pub struct VariableRegistry { /* private fields */ }Expand description
A registry to store variables in during macro execution.
Implementations§
Source§impl VariableRegistry
impl VariableRegistry
Sourcepub fn load<'slf, 'name>(&'slf self, name: InternerEntry) -> Option<&'slf [u8]>
pub fn load<'slf, 'name>(&'slf self, name: InternerEntry) -> Option<&'slf [u8]>
Loads a variable of a given name.
Sourcepub fn load_fn<'slf, 'name>(
&'slf self,
name: InternerEntry,
) -> Option<&'slf ExpressionFunction>
pub fn load_fn<'slf, 'name>( &'slf self, name: InternerEntry, ) -> Option<&'slf ExpressionFunction>
Loads a function of a given name.
Sourcepub fn load_mut<'slf, 'name>(
&'slf mut self,
name: InternerEntry,
) -> Option<&'slf mut [u8]>
pub fn load_mut<'slf, 'name>( &'slf mut self, name: InternerEntry, ) -> Option<&'slf mut [u8]>
Loads a variable of a given name, giving a mutable reference to it.
Sourcepub fn store<'val, 'slf, 'name>(
&'slf mut self,
name: InternerEntry,
val: Cow<'val, [u8]>,
)
pub fn store<'val, 'slf, 'name>( &'slf mut self, name: InternerEntry, val: Cow<'val, [u8]>, )
Stores a variable into a given name, dropping the old value if it existed.
Auto Trait Implementations§
impl Freeze for VariableRegistry
impl RefUnwindSafe for VariableRegistry
impl Send for VariableRegistry
impl Sync for VariableRegistry
impl Unpin for VariableRegistry
impl UnsafeUnpin for VariableRegistry
impl UnwindSafe for VariableRegistry
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more