pub struct Directory { /* private fields */ }Expand description
A parsed image file directory.
Implementations§
Source§impl Directory
impl Directory
Sourcepub fn parse(data: &[u8], order: ByteOrder, offset: usize) -> Result<Self>
pub fn parse(data: &[u8], order: ByteOrder, offset: usize) -> Result<Self>
Parse the IFD at offset within data.
§Errors
Returns PixelsError::Malformed for a directory that runs past the
end of the data or declares an implausible value count.
Sourcepub fn value_or(&self, tag: u16, default: u32) -> u32
pub fn value_or(&self, tag: u16, default: u32) -> u32
The first value of tag, or default if absent.
Sourcepub fn require(&self, tag: u16, name: &str) -> Result<u32>
pub fn require(&self, tag: u16, name: &str) -> Result<u32>
The first value of tag, or a malformed-input error naming it.
§Errors
Returns PixelsError::Malformed if the tag is absent or empty.
Sourcepub const fn next_offset(&self) -> Option<u32>
pub const fn next_offset(&self) -> Option<u32>
The offset of the next directory, or None if this is the last.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Directory
impl RefUnwindSafe for Directory
impl Send for Directory
impl Sync for Directory
impl Unpin for Directory
impl UnsafeUnpin for Directory
impl UnwindSafe for Directory
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