Struct gluon_base::symbol::Symbol

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

A symbol uniquely identifies something regardless of its name and which module it originated from

Implementations§

source§

impl Symbol

source

pub fn strong_count(sym: &Symbol) -> usize

source

pub fn is_global(&self) -> bool

source

pub fn is_primitive(&self) -> bool

source

pub fn name_eq(&self, other: &Symbol) -> bool

source

pub fn name(&self) -> &Name

source

pub fn as_pretty_str(&self) -> &str

source

pub fn as_data(&self) -> SymbolData<&Name>

Methods from Deref<Target = SymbolRef>§

source

pub fn name_eq(&self, other: &SymbolRef) -> bool

Checks whether the names of two symbols are equal

source

pub fn is_global(&self) -> bool

source

pub fn as_pretty_str(&self) -> &str

source

pub fn as_str(&self) -> &str

source

pub fn name(&self) -> &Name

source

pub fn raw_name(&self) -> &Name

source

pub fn declared_name(&self) -> &str

Returns the name of this symbol as it was originally declared (strips location information and module information)

source

pub fn definition_name(&self) -> &str

Trait Implementations§

source§

impl AsRef<str> for Symbol

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'ast, Id> AstClone<'ast, Id> for Symbol

source§

fn ast_clone(&self, _arena: ArenaRef<'_, 'ast, Id>) -> Self

source§

impl Borrow<SymbolRef> for Symbol

source§

fn borrow(&self) -> &SymbolRef

Immutably borrows from an owned value. Read more
source§

impl Clone for Symbol

source§

fn clone(&self) -> Symbol

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 Symbol

source§

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

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

impl Default for Symbol

source§

fn default() -> Symbol

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

impl Deref for Symbol

§

type Target = SymbolRef

The resulting type after dereferencing.
source§

fn deref(&self) -> &SymbolRef

Dereferences the value.
source§

impl<'de> Deserialize<'de> for Symbol

source§

fn deserialize<D>(deserializer: D) -> Result<Symbol, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'de, Id, T> DeserializeState<'de, Seed<Id, T>> for Symbol

source§

fn deserialize_state<D>( seed: &mut Seed<Id, T>, deserializer: D ) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserializes Self using seed and the deserializer
source§

impl Display for Symbol

source§

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

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

impl From<&str> for Symbol

source§

fn from(name: &str) -> Symbol

Converts to this type from the input type.
source§

impl From<(Symbol, Span<ByteIndex>)> for Symbol

source§

fn from((name, _): (Symbol, Span<BytePos>)) -> Symbol

Converts to this type from the input type.
source§

impl<P> From<Spanned<Symbol, P>> for Symbol

source§

fn from(s: Spanned<Symbol, P>) -> Self

Converts to this type from the input type.
source§

impl From<String> for Symbol

source§

fn from(name: String) -> Symbol

Converts to this type from the input type.
source§

impl<N> From<SymbolData<N>> for Symbol
where N: Into<NameBuf>,

source§

fn from(name: SymbolData<N>) -> Symbol

Converts to this type from the input type.
source§

impl Hash for Symbol

source§

fn hash<H: Hasher>(&self, h: &mut H)

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

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Symbol

source§

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

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

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Symbol> for SymbolRef

source§

fn eq(&self, other: &Symbol) -> 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 PartialEq<SymbolRef> for Symbol

source§

fn eq(&self, other: &SymbolRef) -> 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 PartialEq for Symbol

source§

fn eq(&self, other: &Symbol) -> 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 for Symbol

source§

fn partial_cmp(&self, other: &Symbol) -> 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 Serialize for Symbol

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SerializeState<SeSeed> for Symbol

source§

fn serialize_state<S>( &self, serializer: S, seed: &SeSeed ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serializes self
source§

impl Shared for Symbol

source§

fn unique(&self) -> bool

source§

fn as_ptr(&self) -> *const ()

source§

impl Eq for Symbol

source§

impl StructuralEq for Symbol

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<Id> AsId<Id> for Id
where Id: ?Sized,

source§

fn as_id(&self) -> &Id

source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for T
where T: Hash + ?Sized,

§

fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Any for T
where T: Any,

§

impl<T> CloneAny for T
where T: Any + Clone,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,