pub struct FunctionSet<S> { /* private fields */ }Expand description
Collection of functions.
Implementations§
Source§impl<S> FunctionSet<S>
impl<S> FunctionSet<S>
Sourcepub fn get(&self, name: &str) -> Option<&Rc<Function<S>>>
pub fn get(&self, name: &str) -> Option<&Rc<Function<S>>>
Returns the function with the given name.
Sourcepub fn define<F: Into<Rc<Function<S>>>>(
&mut self,
function: F,
) -> Result<Option<Rc<Function<S>>>, DefineError<S>>
pub fn define<F: Into<Rc<Function<S>>>>( &mut self, function: F, ) -> Result<Option<Rc<Function<S>>>, DefineError<S>>
Inserts a function into the set.
If a function with the same name already exists, it is replaced and
returned unless it is read-only, in which case DefineError is
returned.
Trait Implementations§
Source§impl<S> Clone for FunctionSet<S>
impl<S> Clone for FunctionSet<S>
Source§impl<S> Debug for FunctionSet<S>
impl<S> Debug for FunctionSet<S>
Source§impl<S> Default for FunctionSet<S>
impl<S> Default for FunctionSet<S>
Source§impl<'a, S> IntoIterator for &'a FunctionSet<S>
impl<'a, S> IntoIterator for &'a FunctionSet<S>
Auto Trait Implementations§
impl<S> Freeze for FunctionSet<S>
impl<S> !RefUnwindSafe for FunctionSet<S>
impl<S> !Send for FunctionSet<S>
impl<S> !Sync for FunctionSet<S>
impl<S> Unpin for FunctionSet<S>
impl<S> !UnwindSafe for FunctionSet<S>
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> 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