pub struct Arguments<'v, 'a>(/* private fields */);Expand description
Arguments object is passed from the starlark interpreter to function implementation when evaluation function or method calls.
Implementations§
Source§impl<'v, 'a> Arguments<'v, 'a>
impl<'v, 'a> Arguments<'v, 'a>
Sourcepub fn names_map(&self) -> Result<SmallMap<StringValue<'v>, Value<'v>>>
pub fn names_map(&self) -> Result<SmallMap<StringValue<'v>, Value<'v>>>
Unwrap all named arguments (both explicit and in **kwargs) into a map.
This operation fails if named argument names are not unique.
Sourcepub fn len(&self) -> Result<usize>
pub fn len(&self) -> Result<usize>
The number of arguments, where those inside a args/kwargs are counted as multiple arguments.
This operation fails if the kwargs is not a dictionary, or args does not support len.
Sourcepub fn no_positional_args(&self, heap: &'v Heap) -> Result<()>
pub fn no_positional_args(&self, heap: &'v Heap) -> Result<()>
Produce Err if there are any positional arguments.
Sourcepub fn no_named_args(&self) -> Result<()>
pub fn no_named_args(&self) -> Result<()>
Produce Err if there are any named (i.e. non-positional) arguments.
Trait Implementations§
Auto Trait Implementations§
impl<'v, 'a> Freeze for Arguments<'v, 'a>
impl<'v, 'a> !RefUnwindSafe for Arguments<'v, 'a>
impl<'v, 'a> !Send for Arguments<'v, 'a>
impl<'v, 'a> !Sync for Arguments<'v, 'a>
impl<'v, 'a> Unpin for Arguments<'v, 'a>
impl<'v, 'a> !UnwindSafe for Arguments<'v, 'a>
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