Struct gluon_base::symbol::Symbols

source ·
pub struct Symbols { /* private fields */ }
Expand description

Symbols is a bidirectional mapping between Symbols and their name as represented in a source file. Used to make identifiers within a single module point to the same symbol

Implementations§

source§

impl Symbols

source

pub fn new() -> Symbols

source

pub fn simple_symbol<N>(&mut self, name: N) -> Symbol
where N: Into<NameBuf> + AsRef<Name>,

source

pub fn symbol<N>(&mut self, name: SymbolData<N>) -> Symbol
where N: Into<NameBuf> + AsRef<Name>,

Looks up the symbol for name or creates a new symbol if it does not exist

source

pub fn contains_name<N>(&mut self, name: N) -> bool
where N: AsRef<Name>,

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

Trait Implementations§

source§

impl Debug for Symbols

source§

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

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

impl Default for Symbols

source§

fn default() -> Symbols

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

impl DisplayEnv for Symbols

§

type Ident = Symbol

source§

fn string<'a>(&'a self, ident: &'a Self::Ident) -> &'a str

source§

impl IdentEnv for Symbols

source§

fn from_str(&mut self, s: &str) -> 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
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, 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,