pub struct PyDictionary<K, V>{ /* private fields */ }Expand description
Python-style dictionary type with all dict methods
Implementations§
Source§impl<K, V> PyDictionary<K, V>
impl<K, V> PyDictionary<K, V>
pub fn new() -> Self
Sourcepub fn get_or_default(&self, key: &K, default: V) -> Vwhere
V: Clone,
pub fn get_or_default(&self, key: &K, default: V) -> Vwhere
V: Clone,
Python dict.get() method with default
Sourcepub fn update(&mut self, other: PyDictionary<K, V>)
pub fn update(&mut self, other: PyDictionary<K, V>)
Python dict.update() method
Sourcepub fn contains_key(&self, key: &K) -> bool
pub fn contains_key(&self, key: &K) -> bool
Check if key exists
Trait Implementations§
Source§impl<K, V: Clone> Clone for PyDictionary<K, V>
impl<K, V: Clone> Clone for PyDictionary<K, V>
Source§fn clone(&self) -> PyDictionary<K, V>
fn clone(&self) -> PyDictionary<K, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K, V: Debug> Debug for PyDictionary<K, V>
impl<K, V: Debug> Debug for PyDictionary<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for PyDictionary<K, V>
impl<K, V> RefUnwindSafe for PyDictionary<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for PyDictionary<K, V>
impl<K, V> Sync for PyDictionary<K, V>
impl<K, V> Unpin for PyDictionary<K, V>
impl<K, V> UnwindSafe for PyDictionary<K, V>where
K: UnwindSafe,
V: 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