Struct rustc_span::symbol::SymbolStr [−][src]
pub struct SymbolStr {
string: &'static str,
}Expand description
An alternative to Symbol, useful when the chars within the symbol need to
be accessed. It deliberately has limited functionality and should only be
used for temporary values.
Because the interner outlives any thread which uses this type, we can
safely treat string which points to interner data, as an immortal string,
as long as this type never crosses between threads.
Fields
string: &'static strTrait Implementations
This impl means that if ss is a SymbolStr:
*ssis astr;&*ssis a&str(andmatch &*ss { ... }is a common pattern).&ss as &stris a&str, which means that&sscan be passed to a function expecting a&str.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes