pub struct Symbol { /* private fields */ }Expand description
A lightweight handle to an interned string.
Symbol is a clonable, comparable, and hashable reference
to a string stored inside the interner.
This struct is not copyable sice it has to update reference count atomically but it’s (relatively) cheap to clone.
You can efficiently compare Symbols by value, and resolve them
back to string slices when needed.
§Example
use asylum;
let sym = asylum::intern("hello");
let string: &str = sym.as_str();Implementations§
Trait Implementations§
Source§impl Ord for Symbol
impl Ord for Symbol
Source§impl PartialOrd for Symbol
impl PartialOrd for Symbol
impl Eq for Symbol
impl Send for Symbol
impl StructuralPartialEq for Symbol
impl Sync for Symbol
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Unpin for Symbol
impl UnwindSafe for Symbol
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