pub struct StringCache { /* private fields */ }Expand description
Stores the mappings between a set of Atoms and the primitives that they reference.
Implementations§
Source§impl StringCache
impl StringCache
Sourcepub fn str_to_atom(&mut self, string: &str) -> Atom
pub fn str_to_atom(&mut self, string: &str) -> Atom
Sourcepub fn str_to_existing_atom(&self, string: &str) -> Option<Atom>
pub fn str_to_existing_atom(&self, string: &str) -> Option<Atom>
Sourcepub fn integer_to_atom(integer: i32) -> Atom
pub fn integer_to_atom(integer: i32) -> Atom
Returns an Atom referencing the provided integer.
Sourcepub fn atom_to_str(&self, atom: Atom) -> Option<&str>
pub fn atom_to_str(&self, atom: Atom) -> Option<&str>
Returns the string referenced by the provided atom.
Sourcepub fn atom_to_integer(atom: Atom) -> Option<i32>
pub fn atom_to_integer(atom: Atom) -> Option<i32>
Returns the integer referenced by the provided atom.
Trait Implementations§
Source§impl Clone for StringCache
impl Clone for StringCache
Source§fn clone(&self) -> StringCache
fn clone(&self) -> StringCache
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 moreAuto Trait Implementations§
impl Freeze for StringCache
impl RefUnwindSafe for StringCache
impl Send for StringCache
impl Sync for StringCache
impl Unpin for StringCache
impl UnwindSafe for StringCache
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