pub struct Dict { /* private fields */ }Expand description
An insertion-ordered dictionary. Lookups are linear, which is faster than hashing for the handful of keys real PDF dictionaries carry.
Added in 0.2.0.
Implementations§
Source§impl Dict
impl Dict
Sourcepub fn get(&self, key: &str) -> Option<&Object>
pub fn get(&self, key: &str) -> Option<&Object>
Looks up key (without the leading /).
Added in 0.2.0.
Sourcepub fn get_mut(&mut self, key: &str) -> Option<&mut Object>
pub fn get_mut(&mut self, key: &str) -> Option<&mut Object>
Mutable lookup of key.
Added in 0.2.0.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
True when key is present.
Added in 0.2.0.
Sourcepub fn insert(&mut self, key: impl Into<Name>, value: impl Into<Object>)
pub fn insert(&mut self, key: impl Into<Name>, value: impl Into<Object>)
Sets key to value. An existing key keeps its position; a new key is appended.
Added in 0.2.0.
Sourcepub fn remove(&mut self, key: &str) -> Option<Object>
pub fn remove(&mut self, key: &str) -> Option<Object>
Removes key, returning its value.
Added in 0.2.0.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&Name, &Object)>
pub fn iter(&self) -> impl Iterator<Item = (&Name, &Object)>
Entries in insertion order.
Added in 0.2.0.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = (&Name, &mut Object)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&Name, &mut Object)>
Entries in insertion order, with mutable values.
Added in 0.2.0.
Trait Implementations§
impl StructuralPartialEq for Dict
Auto Trait Implementations§
impl Forget for Dict
impl Freeze for Dict
impl Move for Dict
impl RefUnwindSafe for Dict
impl Send for Dict
impl Sync for Dict
impl Unpin for Dict
impl UnsafeUnpin for Dict
impl UnwindSafe 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