pub struct Arguments<'a> { /* private fields */ }
Expand description
Arguments passed to a varargs function.
This is a wrapper that does things like type-checking and arity-checking.
Implementations
sourceimpl<'a> Arguments<'a>
impl<'a> Arguments<'a>
sourcepub fn new(raw_arguments: &'a [RawValue], env: &'a Environment) -> Self
pub fn new(raw_arguments: &'a [RawValue], env: &'a Environment) -> Self
Creates a new Arguments
from a raw argument list, as is passed into a
raw function.
sourcepub fn expect_exactly(&self, n: usize) -> Result<(), Error>
pub fn expect_exactly(&self, n: usize) -> Result<(), Error>
Raises an error if there weren’t exactly n
arguments passed to the function.
sourcepub fn expect_at_least(&self, n: usize) -> Result<(), Error>
pub fn expect_at_least(&self, n: usize) -> Result<(), Error>
Raises an error if there weren’t at least n
arguments passed to the function.
sourcepub fn nth(&self, n: usize) -> Option<&RawValue>
pub fn nth(&self, n: usize) -> Option<&RawValue>
Returns the n
th argument, or None
if the argument is not present.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Arguments<'a>
impl<'a> !Send for Arguments<'a>
impl<'a> !Sync for Arguments<'a>
impl<'a> Unpin for Arguments<'a>
impl<'a> !UnwindSafe for Arguments<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more