pub struct Args<C: 'static + Context> {
pub required: Vec<Symbol>,
pub optional: Vec<(Symbol, Gc<Value<C>>)>,
pub rest: Option<Symbol>,
}
Expand description
A type that represents the arguments specified for a function.
Fields§
§required: Vec<Symbol>
The required arguments.
optional: Vec<(Symbol, Gc<Value<C>>)>
The optional arguments, and their default values.
rest: Option<Symbol>
The rest argument, if any.
Implementations§
Source§impl<C: 'static + Context> Args<C>
impl<C: 'static + Context> Args<C>
Sourcepub fn bind(
&self,
name: Option<Symbol>,
args: Vec<Gc<Value<C>>>,
) -> Result<GcLinkedList<(Symbol, Gc<Value<C>>)>, ArgsBindingError<C>>
pub fn bind( &self, name: Option<Symbol>, args: Vec<Gc<Value<C>>>, ) -> Result<GcLinkedList<(Symbol, Gc<Value<C>>)>, ArgsBindingError<C>>
Attempts to bind a list of arguments to the names specified in the Args object.
Sourcepub fn from_value(value: Gc<Value<C>>) -> Result<Args<C>, ArgsConvertError<C>>
pub fn from_value(value: Gc<Value<C>>) -> Result<Args<C>, ArgsConvertError<C>>
Converts a Value to an Args.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Args<C>
impl<C> !RefUnwindSafe for Args<C>
impl<C> !Send for Args<C>
impl<C> !Sync for Args<C>
impl<C> Unpin for Args<C>
impl<C> !UnwindSafe for Args<C>
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