pub struct Dict<'a>(/* private fields */);Expand description
A dictionary, which is a key-value map, keys being names, and values being any PDF object or objetc reference.
Implementations§
Source§impl<'a> Dict<'a>
impl<'a> Dict<'a>
Sourcepub fn contains_key(&self, key: impl Deref<Target = [u8]>) -> bool
pub fn contains_key(&self, key: impl Deref<Target = [u8]>) -> bool
Checks whether the dictionary contains an entry with a specific key.
Sourcepub fn get<T>(&self, key: impl Deref<Target = [u8]>) -> Option<T>where
T: ObjectLike<'a>,
pub fn get<T>(&self, key: impl Deref<Target = [u8]>) -> Option<T>where
T: ObjectLike<'a>,
Returns the entry of a key as a specific object, or try to resolve it in case it’s an object reference.
Sourcepub fn get_ref(&self, key: impl Deref<Target = [u8]>) -> Option<ObjRef>
pub fn get_ref(&self, key: impl Deref<Target = [u8]>) -> Option<ObjRef>
Get the object reference linked to a key.
Sourcepub fn keys(&self) -> impl Iterator<Item = Name<'a>>
pub fn keys(&self) -> impl Iterator<Item = Name<'a>>
Returns an iterator over all keys in the dictionary.
Sourcepub fn entries(&self) -> impl Iterator<Item = (Name<'a>, MaybeRef<Object<'a>>)>
pub fn entries(&self) -> impl Iterator<Item = (Name<'a>, MaybeRef<Object<'a>>)>
An iterator over all entries in the dictionary, sorted by key.
Sourcepub fn obj_id(&self) -> Option<ObjectIdentifier>
pub fn obj_id(&self) -> Option<ObjectIdentifier>
Return the object identifier of the dict, if it’s an indirect object.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Dict<'a>
impl<'a> !RefUnwindSafe for Dict<'a>
impl<'a> Send for Dict<'a>
impl<'a> Sync for Dict<'a>
impl<'a> Unpin for Dict<'a>
impl<'a> !UnwindSafe for Dict<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> FromBytes<'a> for Twhere
T: Readable<'a>,
impl<'a, T> FromBytes<'a> for Twhere
T: Readable<'a>,
Source§fn from_bytes(b: &'a [u8]) -> Option<T>
fn from_bytes(b: &'a [u8]) -> Option<T>
Try to read the object from the given bytes.