pub struct Args<'d>(pub Vec<Value<'d>>);Expand description
Provides common utility functions for dealing with function argument lists.
Tuple Fields§
§0: Vec<Value<'d>>Implementations§
Source§impl<'d> Args<'d>
impl<'d> Args<'d>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn at_least(&self, minimum: usize) -> Result<(), Error>
pub fn at_least(&self, minimum: usize) -> Result<(), Error>
Ensures that there are at least the requested number of arguments.
Sourcepub fn at_most(&self, maximum: usize) -> Result<(), Error>
pub fn at_most(&self, maximum: usize) -> Result<(), Error>
Ensures that there are no more than the requested number of arguments.
Sourcepub fn exactly(&self, expected: usize) -> Result<(), Error>
pub fn exactly(&self, expected: usize) -> Result<(), Error>
Ensures that there are exactly the requested number of arguments.
Sourcepub fn pop_boolean(&mut self) -> Result<bool, Error>
pub fn pop_boolean(&mut self) -> Result<bool, Error>
Removes the last argument and ensures it is a boolean. If the argument is not a boolean, it is converted to one.
Sourcepub fn pop_number(&mut self) -> Result<f64, Error>
pub fn pop_number(&mut self) -> Result<f64, Error>
Removes the last argument and ensures it is a number. If the argument is not a number, it is converted to one.
Sourcepub fn pop_string(&mut self) -> Result<String, Error>
pub fn pop_string(&mut self) -> Result<String, Error>
Removes the last argument and ensures it is a string. If the argument is not a string, it is converted to one.
Sourcepub fn pop_nodeset(&mut self) -> Result<Nodeset<'d>, Error>
pub fn pop_nodeset(&mut self) -> Result<Nodeset<'d>, Error>
Removes the last argument and ensures it is a nodeset. If the argument is not a nodeset, a type mismatch error is returned.
Trait Implementations§
Auto Trait Implementations§
impl<'d> Freeze for Args<'d>
impl<'d> !RefUnwindSafe for Args<'d>
impl<'d> !Send for Args<'d>
impl<'d> !Sync for Args<'d>
impl<'d> Unpin for Args<'d>
impl<'d> !UnwindSafe for Args<'d>
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