pub struct Kwargs(pub Vec<(String, KwVal)>);Expand description
The kwargs bag handed to the *_kw trait hooks. Order-preserving —
insertion order never matters to the converters, but it keeps error
messages deterministic.
Tuple Fields§
§0: Vec<(String, KwVal)>Implementations§
Source§impl Kwargs
impl Kwargs
pub fn is_empty(&self) -> bool
pub fn get(&self, key: &str) -> Option<&KwVal>
pub fn str(&self, key: &str) -> Option<&str>
pub fn bool(&self, key: &str) -> Option<bool>
pub fn int(&self, key: &str) -> Option<i64>
pub fn list(&self, key: &str) -> Option<&[String]>
Sourcepub fn only(&self, allowed: &[&str]) -> bool
pub fn only(&self, allowed: &[&str]) -> bool
True when every key is in allowed. A language’s *_kw override
starts with this guard: an unexpected key means the Python signature
would raise TypeError, so the hook returns NotImplemented and the
dispatcher falls back to Python, which raises the original error.
Trait Implementations§
impl StructuralPartialEq for Kwargs
Auto Trait Implementations§
impl Freeze for Kwargs
impl RefUnwindSafe for Kwargs
impl Send for Kwargs
impl Sync for Kwargs
impl Unpin for Kwargs
impl UnsafeUnpin for Kwargs
impl UnwindSafe for Kwargs
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