Struct nom_exif::ParsedExifEntry
source · 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_valueorSelf::take_resultmethods.
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 moreAuto Trait Implementations§
impl Freeze for ParsedExifEntry
impl RefUnwindSafe for ParsedExifEntry
impl Send for ParsedExifEntry
impl Sync for ParsedExifEntry
impl Unpin for ParsedExifEntry
impl UnwindSafe for ParsedExifEntry
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)