pub struct Directory { /* private fields */ }Expand description
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§
Source§impl Directory
impl Directory
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Create 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.
Sourcepub fn iter(&self) -> impl Iterator<Item = (Tag, &Entry)> + '_
pub fn iter(&self) -> impl Iterator<Item = (Tag, &Entry)> + '_
Iterate over all known and unknown tags in this directory.
Sourcepub fn extend(&mut self, iter: impl IntoIterator<Item = (Tag, Entry)>)
pub 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::MAX values. There may be one entry that
does not fit into the directory. This entry is silently ignored (please check Self::len
to detect the condition). Providing a tag multiple times or a tag that already exists
within this directory overwrites the entry.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Check 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.
Sourcepub fn next(&self) -> Option<IfdPointer>
pub fn next(&self) -> Option<IfdPointer>
Get the pointer to the next IFD, if it was defined.