pub enum TagOrCode {
Tag(ExifTag),
Unknown(u16),
}Expand description
Either a recognized ExifTag or a raw u16 tag code that the parser did
not recognize. Yielded by crate::ExifIterEntry::tag and by
crate::ExifEntry::tag.
Variants§
Tag(ExifTag)
Tag is in the recognized ExifTag enum.
Unknown(u16)
Tag is not in ExifTag; raw u16 code is preserved.
Implementations§
Source§impl TagOrCode
impl TagOrCode
Sourcepub fn from_code_in(kind: IfdKind, code: u16) -> Self
pub fn from_code_in(kind: IfdKind, code: u16) -> Self
Resolve a raw code within a known IFD namespace.
Prefer this over From<u16> whenever the namespace is known: the same
code means different things in different IFDs, so the namespace-free
lookup has to guess.
use nom_exif::{ExifTag, IfdKind, TagOrCode};
assert_eq!(TagOrCode::from_code_in(IfdKind::Gps, 0x000b),
TagOrCode::Tag(ExifTag::GPSDOP));
assert_eq!(TagOrCode::from_code_in(IfdKind::Tiff, 0x000b),
TagOrCode::Tag(ExifTag::ProcessingSoftware));Trait Implementations§
impl Copy for TagOrCode
Source§impl<'de> Deserialize<'de> for TagOrCode
impl<'de> Deserialize<'de> for TagOrCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TagOrCode
Source§impl From<u16> for TagOrCode
Namespace-free lookup. Ambiguous for codes that several IFDs define — it
resolves those the way it always has (GPS wins), which is why
TagOrCode::from_code_in exists.
impl From<u16> for TagOrCode
Namespace-free lookup. Ambiguous for codes that several IFDs define — it
resolves those the way it always has (GPS wins), which is why
TagOrCode::from_code_in exists.
impl StructuralPartialEq for TagOrCode
Auto Trait Implementations§
impl Freeze for TagOrCode
impl RefUnwindSafe for TagOrCode
impl Send for TagOrCode
impl Sync for TagOrCode
impl Unpin for TagOrCode
impl UnsafeUnpin for TagOrCode
impl UnwindSafe for TagOrCode
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