Struct rustre_core::id::Id

source ·
pub struct Id(/* private fields */);
Expand description

Name of a node, param, variable, type, package, model, etc., as it appears in the declaration

This is simply a cheap newtype around String.

Example values

  • Nodes: sin, adder, map
  • Variables: a, b, cin
  • Types: state
  • Packages: Lustre

Usage

Ids do not remember their source span. Therefore, queries that rely on it may want to require both to be given, or to compute the Id inside them. Ids without an accompanying span should only be used as inputs to query that don’t report the errors themselves.

Implementations§

source§

impl Id

source

pub const LUSTRE_PACKAGE: &'static Self = _

source

pub const fn from_str(str: &str) -> &Self

Trait Implementations§

source§

impl Clone for Box<Id>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Id

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for &'a Id

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Box<Id>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for Id

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a Id> for Cow<'a, Id>

source§

fn from(value: &'a Id) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a IdNode> for Box<Id>

source§

fn from(value: &'a IdNode) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a Ident> for &'a Id

source§

fn from(value: &'a Ident) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a Ident> for Box<Id>

source§

fn from(value: &'a Ident) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a str> for &'a Id

source§

fn from(value: &'a str) -> Self

Converts to this type from the input type.
source§

impl<'p, 'm> From<&'m Id> for IdRef<'p, 'm>

Converts the Id to an IdRef using IdRef::new_implicit

source§

fn from(value: &'m Id) -> Self

Converts to this type from the input type.
source§

impl From<Box<str, Global>> for Box<Id>

source§

fn from(value: Box<str>) -> Self

Converts to this type from the input type.
source§

impl From<IdNode> for Box<Id>

source§

fn from(value: IdNode) -> Self

Converts to this type from the input type.
source§

impl From<Ident> for Box<Id>

source§

fn from(value: Ident) -> Self

Converts to this type from the input type.
source§

impl From<String> for Box<Id>

source§

fn from(value: String) -> Self

Converts to this type from the input type.
source§

impl Hash for Id

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
source§

impl Ord for Id

source§

fn cmp(&self, other: &Id) -> Ordering

This method returns an Ordering between self and other. Read more
source§

impl PartialEq<Id> for Id

source§

fn eq(&self, other: &Id) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Id> for Id

source§

fn partial_cmp(&self, other: &Id) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl ToOwned for Id

§

type Owned = Box<Id, Global>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl Eq for Id

source§

impl StructuralEq for Id

source§

impl StructuralPartialEq for Id

Auto Trait Implementations§

§

impl RefUnwindSafe for Id

§

impl Send for Id

§

impl !Sized for Id

§

impl Sync for Id

§

impl Unpin for Id

§

impl UnwindSafe for Id

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more