Struct rustpython_vm::function::KwArgs
source · pub struct KwArgs<T = PyObjectRef>(_);
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> 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