pub enum NamespacedIdentifier {
Function(Identifier),
Binding(Identifier),
}Expand description
Represents an identifier qualified with its namespace.
Identifiers in AirScript are separated into two namespaces: one for functions, and one for buses and bindings. This is because functions cannot be bound, added to or remove from, while buses and bindings cannot be called. So we can always disambiguate identifiers based on its usage.
It is still probably best practice to avoid having name conflicts between functions, buses and bindings, but that is a matter of style rather than one of necessity.
Variants§
Function(Identifier)
Binding(Identifier)
Implementations§
Source§impl NamespacedIdentifier
impl NamespacedIdentifier
pub fn id(&self) -> Identifier
Trait Implementations§
Source§impl AsRef<Identifier> for NamespacedIdentifier
impl AsRef<Identifier> for NamespacedIdentifier
Source§fn as_ref(&self) -> &Identifier
fn as_ref(&self) -> &Identifier
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for NamespacedIdentifier
impl Clone for NamespacedIdentifier
Source§fn clone(&self) -> NamespacedIdentifier
fn clone(&self) -> NamespacedIdentifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NamespacedIdentifier
impl Debug for NamespacedIdentifier
Source§impl Display for NamespacedIdentifier
impl Display for NamespacedIdentifier
Source§impl From<ResolvableIdentifier> for NamespacedIdentifier
impl From<ResolvableIdentifier> for NamespacedIdentifier
Source§fn from(id: ResolvableIdentifier) -> Self
fn from(id: ResolvableIdentifier) -> Self
Converts to this type from the input type.
Source§impl Hash for NamespacedIdentifier
impl Hash for NamespacedIdentifier
Source§impl Ord for NamespacedIdentifier
impl Ord for NamespacedIdentifier
Source§fn cmp(&self, other: &NamespacedIdentifier) -> Ordering
fn cmp(&self, other: &NamespacedIdentifier) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NamespacedIdentifier
impl PartialEq for NamespacedIdentifier
Source§impl PartialOrd for NamespacedIdentifier
impl PartialOrd for NamespacedIdentifier
Source§impl Spanned for NamespacedIdentifier
impl Spanned for NamespacedIdentifier
fn span(&self) -> SourceSpan
impl Copy for NamespacedIdentifier
impl Eq for NamespacedIdentifier
impl StructuralPartialEq for NamespacedIdentifier
Auto Trait Implementations§
impl Freeze for NamespacedIdentifier
impl RefUnwindSafe for NamespacedIdentifier
impl Send for NamespacedIdentifier
impl Sync for NamespacedIdentifier
impl Unpin for NamespacedIdentifier
impl UnwindSafe for NamespacedIdentifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more