pub struct FunctionEnv { /* private fields */ }
Expand description
An environment for defined, named functions.
Implementations§
Source§impl FunctionEnv
impl FunctionEnv
Sourcepub fn get(&self, name: &str) -> Option<&FunctionRegistration>
pub fn get(&self, name: &str) -> Option<&FunctionRegistration>
Tries to retrieve the registration for a function by name.
§Arguments
name
- The name of the function to retrieve.
Sourcepub fn get_mut(&mut self, name: &str) -> Option<&mut FunctionRegistration>
pub fn get_mut(&mut self, name: &str) -> Option<&mut FunctionRegistration>
Tries to retrieve a mutable reference to the registration for a function by name.
§Arguments
name
- The name of the function to retrieve.
Sourcepub fn remove(&mut self, name: &str) -> Option<FunctionRegistration>
pub fn remove(&mut self, name: &str) -> Option<FunctionRegistration>
Sourcepub fn update(&mut self, name: String, registration: FunctionRegistration)
pub fn update(&mut self, name: String, registration: FunctionRegistration)
Updates a function registration in this environment.
§Arguments
name
- The name of the function to update.registration
- The new registration for the function.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &FunctionRegistration)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &FunctionRegistration)>
Returns an iterator over the functions registered in this environment.
Trait Implementations§
Source§impl Clone for FunctionEnv
impl Clone for FunctionEnv
Source§fn clone(&self) -> FunctionEnv
fn clone(&self) -> FunctionEnv
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for FunctionEnv
impl Default for FunctionEnv
Source§fn default() -> FunctionEnv
fn default() -> FunctionEnv
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FunctionEnv
impl RefUnwindSafe for FunctionEnv
impl Send for FunctionEnv
impl Sync for FunctionEnv
impl Unpin for FunctionEnv
impl UnwindSafe for FunctionEnv
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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