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 CompiledExpr>
pub fn load_fn<'slf, 'name>( &'slf self, name: InternerEntry, ) -> Option<&'slf CompiledExpr>
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 load_two_mut<'slf, 'name>(
&'slf mut self,
name1: InternerEntry,
name2: InternerEntry,
) -> Option<[&'slf mut [u8]; 2]>
pub fn load_two_mut<'slf, 'name>( &'slf mut self, name1: InternerEntry, name2: InternerEntry, ) -> Option<[&'slf mut [u8]; 2]>
Loads two variables of given names, giving mutable references to both.
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.
Sourcepub fn store_fn<'val, 'slf, 'name>(
&'slf mut self,
name: InternerEntry,
val: CompiledExpr,
)
pub fn store_fn<'val, 'slf, 'name>( &'slf mut self, name: InternerEntry, val: CompiledExpr, )
Stores a function into a given name, dropping the old function if it existed.
Sourcepub fn drop<'slf, 'name>(&'slf mut self, name: InternerEntry) -> bool
pub fn drop<'slf, 'name>(&'slf mut self, name: InternerEntry) -> bool
Drops a variable of a given name, returning a boolean for whether it existed in the first place.
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