pub struct Dict { /* private fields */ }Expand description
A dictionary: keys mapped to values, sorted by key.
Implementations§
Source§impl Dict
impl Dict
Sourcepub fn from_entries(
entries: impl IntoIterator<Item = (Value, Value)>,
) -> Result<Dict, DataError>
pub fn from_entries( entries: impl IntoIterator<Item = (Value, Value)>, ) -> Result<Dict, DataError>
Returns the dictionary of entries, where a later entry with a key
equal to an earlier one’s wins (the dictionary literal’s rule).
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = (&Value, &Value)>
pub fn iter(&self) -> impl ExactSizeIterator<Item = (&Value, &Value)>
Returns the entries, in key order.
Sourcepub fn keys(&self) -> impl ExactSizeIterator<Item = &Value>
pub fn keys(&self) -> impl ExactSizeIterator<Item = &Value>
Returns the keys, in key order.
Sourcepub fn values(&self) -> impl ExactSizeIterator<Item = &Value>
pub fn values(&self) -> impl ExactSizeIterator<Item = &Value>
Returns the values, in key order.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Dict
impl !UnwindSafe for Dict
impl Freeze for Dict
impl Send for Dict
impl Sync for Dict
impl Unpin for Dict
impl UnsafeUnpin for Dict
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