Struct Directory
pub struct Directory { /* private fields */ }
An Image File Directory (IFD).
A directory is a map of Tags to Values. The values are
stored anywhere in the file, with the directory containing the offsets and length of the
associated values for each tag present in the directory.
A directory can be created with with
Decoder::read_directory or as an empty directory
to be extended with entries. A directory may be used with
Decoder::read_directory_tags to read the
values associated with tags from an underlying file.
Implementations
impl Directory
fn empty() -> SelfCreate a directory in an initial state without entries. Note that an empty directory can not be encoded in a file, it must contain at least one entry.
fn get(&self, tag: Tag) -> Option<&Entry>Retrieve the value associated with a tag.
fn contains(&self, tag: Tag) -> boolCheck if the directory contains a specified tag.
fn iter(&self) -> impl Iterator<Item = (Tag, &Entry)> + '_Iterate over all known and unknown tags in this directory.
fn extend(&mut self, iter: impl IntoIterator<Item = (Tag, Entry)>)Insert additional entries into the directory.
Note that a directory can contain at most
u16::MAXvalues. There may be one entry that does not fit into the directory. This entry is silently ignored (please checkSelf::lento detect the condition). Providing a tag multiple times or a tag that already exists within this directory overwrites the entry.fn len(&self) -> usizeGet the number of entries.
fn is_empty(&self) -> boolCheck if there are any entries in this directory. Note that an empty directory can not be encoded in the file, it must contain at least one entry.
fn next(&self) -> Option<IfdPointer>Get the pointer to the next IFD, if it was defined.
fn set_next(&mut self, next: Option<IfdPointer>)
Trait Implementations
impl Debug for Directory
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl FromIterator<(Tag, Entry)> for Directory
fn from_iter<T: IntoIterator<Item = (Tag, Entry)>>(iter: T) -> Self
Auto Trait Implementations
impl Freeze for Directory
impl RefUnwindSafe for Directory
impl Send for Directory
impl Sync for Directory
impl Unpin for Directory
impl UnsafeUnpin for Directory
impl UnwindSafe for Directory
Blanket Implementations
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for Directory
where
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for Directory
where
ST: ?Sized,
DT: ?Sized,
impl<T> Any for Directory
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Directory
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Directory
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Directory
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Read<Exclusive, BecauseExclusive> for Directory
where
T: ?Sized,
impl<T, U> Into<U> for Directory
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Directory
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Directory
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>