pub struct In(pub u16);
Expand description
An IFD number.
The IFDs are indexed from 0. The 0th IFD is for the primary image
and the 1st one is for the thumbnail. Two associated constants,
In::PRIMARY
and In::THUMBNAIL
, are defined for them respectively.
§Examples
use exif::In;
assert_eq!(In::PRIMARY.index(), 0);
assert_eq!(In::THUMBNAIL.index(), 1);
Tuple Fields§
§0: u16
Implementations§
Source§impl In
impl In
pub const PRIMARY: In = _
pub const THUMBNAIL: In = _
Sourcepub fn index(self) -> u16
pub fn index(self) -> u16
Returns the IFD number.
Examples found in repository?
examples/dumpexif.rs (line 61)
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
fn dump_file(path: &Path) -> Result<(), exif::Error> {
let file = File::open(path)?;
// To parse strictly:
// let exif = exif::Reader::new()
// .read_from_container(&mut BufReader::new(&file))?;
// To parse with continue-on-error mode:
let exif = exif::Reader::new()
.continue_on_error(true)
.read_from_container(&mut BufReader::new(&file))
.or_else(|e| e.distill_partial_result(|errors| {
eprintln!("{}: {} warning(s)", path.display(), errors.len());
errors.iter().for_each(|e| eprintln!(" {}", e));
}))?;
println!("{}", path.display());
for f in exif.fields() {
println!(" {}/{}: {}",
f.ifd_num.index(), f.tag,
f.display_value().with_unit(&exif));
println!(" {:?}", f.value);
}
Ok(())
}
Trait Implementations§
Source§impl Ord for In
impl Ord for In
Source§impl PartialOrd for In
impl PartialOrd for In
impl Copy for In
impl Eq for In
impl StructuralPartialEq for In
Auto Trait Implementations§
impl Freeze for In
impl RefUnwindSafe for In
impl Send for In
impl Sync for In
impl Unpin for In
impl UnwindSafe for In
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
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)