pub struct ParsedExifEntry { /* private fields */ }
Expand description
Represents a parsed IFD entry. Used as iterator items in ExifIter
.
Implementations§
Source§impl ParsedExifEntry
impl ParsedExifEntry
Sourcepub fn ifd_index(&self) -> usize
pub fn ifd_index(&self) -> usize
Get the IFD index value where this entry is located.
- 0: ifd0 (main image)
- 1: ifd1 (thumbnail)
Sourcepub fn tag(&self) -> Option<ExifTag>
pub fn tag(&self) -> Option<ExifTag>
Get recognized Exif tag of this entry, maybe return None
if the tag
is unrecognized.
If you have any custom defined tag which does not exist in ExifTag
,
then you should use Self::tag_code
to get the raw tag code.
Note: You can always get the raw tag code via Self::tag_code
,
no matter if it’s recognized.
Sourcepub fn tag_code(&self) -> u16
pub fn tag_code(&self) -> u16
Get the raw tag code of this entry.
In case you have some custom defined tags which doesn’t exist in
ExifTag
, you can use this method to get the raw tag code of this
entry.
Sourcepub fn has_value(&self) -> bool
pub fn has_value(&self) -> bool
Returns true if there is an EntryValue
in self.
Both of the following situations may cause this method to return false:
- An error occurred while parsing this entry
- The value has been taken by calling
Self::take_value
orSelf::take_result
methods.
Sourcepub fn get_value(&self) -> Option<&EntryValue>
pub fn get_value(&self) -> Option<&EntryValue>
Get the parsed entry value of this entry.
Sourcepub fn take_value(&mut self) -> Option<EntryValue>
pub fn take_value(&mut self) -> Option<EntryValue>
Takes out the parsed entry value of this entry.
If you need to convert this ExifIter
to an crate::Exif
, please
don’t call this method! Otherwise the converted Exif
is incomplete.
Note: This method can only be called once! Once it has been called,
calling it again always returns None
. You may want to check it by
calling Self::has_value
before calling this method.
Sourcepub fn get_result(&self) -> Result<&EntryValue, &EntryError>
pub fn get_result(&self) -> Result<&EntryValue, &EntryError>
Get the parsed result of this entry.
Returns:
-
If any error occurred while parsing this entry, an Err(&[
EntryError
]) is returned. -
Otherwise, an Ok(&
EntryValue
) is returned.
Sourcepub fn take_result(&mut self) -> Result<EntryValue, EntryError>
pub fn take_result(&mut self) -> Result<EntryValue, EntryError>
Takes out the parsed result of this entry.
If you need to convert this ExifIter
to an crate::Exif
, please
don’t call this method! Otherwise the converted Exif
is incomplete.
Returns:
-
If any error occurred while parsing this entry, an Err(
InvalidEntry
) is returned. -
Otherwise, an Ok(
EntryValue
) is returned.
Note: This method can ONLY be called once! If you call it twice, it will panic directly!
Trait Implementations§
Source§impl Clone for ParsedExifEntry
impl Clone for ParsedExifEntry
Source§fn clone(&self) -> ParsedExifEntry
fn clone(&self) -> ParsedExifEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more