pub struct KwArgs<T = PyObjectRef>(/* private fields */);
Expand description
A map of keyword arguments to their values.
A built-in function with a KwArgs
parameter is analogous to a Python
function with **kwargs
. All remaining keyword arguments are extracted
(and hence the function will permit an arbitrary number of them).
KwArgs
optionally accepts a generic type parameter to allow type checks
or conversions of each argument.
Note:
KwArgs is only for functions that accept arbitrary keyword arguments. For functions that accept only specific named arguments, a rust struct with an appropriate FromArgs implementation must be created.
Implementations§
Trait Implementations§
Source§impl<T> FromArgs for KwArgs<T>where
T: TryFromObject,
impl<T> FromArgs for KwArgs<T>where
T: TryFromObject,
Source§fn from_args(
vm: &VirtualMachine,
args: &mut FuncArgs,
) -> Result<Self, ArgumentError>
fn from_args( vm: &VirtualMachine, args: &mut FuncArgs, ) -> Result<Self, ArgumentError>
Extracts this item from the next argument(s).
Source§impl<T> FromIterator<(String, T)> for KwArgs<T>
impl<T> FromIterator<(String, T)> for KwArgs<T>
Source§impl<T> IntoIterator for KwArgs<T>
impl<T> IntoIterator for KwArgs<T>
Auto Trait Implementations§
impl<T> Freeze for KwArgs<T>
impl<T> RefUnwindSafe for KwArgs<T>where
T: RefUnwindSafe,
impl<T> Send for KwArgs<T>where
T: Send,
impl<T> Sync for KwArgs<T>where
T: Sync,
impl<T> Unpin for KwArgs<T>where
T: Unpin,
impl<T> UnwindSafe for KwArgs<T>where
T: UnwindSafe,
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