pub struct Layout {
pub container: String,
pub total_len: u64,
pub orientation: u16,
pub segments: Vec<Segment>,
}Fields§
§container: String§total_len: u64§orientation: u16TIFF/Exif orientation (tag 274). 1 means “already upright”.
Stored pixels are frequently not upright: cameras record the sensor readout as captured and note the rotation separately. Anything that displays the pixels without consulting this — a thumbnailer, say — shows the photo on its side.
segments: Vec<Segment>Implementations§
Source§impl Layout
impl Layout
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Verify the invariant the whole design rests on: segments must tile the file
exactly — sorted, contiguous, starting at 0, ending at total_len.
Called on every archive and every restore. A layout that fails this can never reproduce the original, so we refuse it rather than write an archive we cannot honour.
pub fn image_segments( &self, ) -> impl Iterator<Item = (usize, &Segment, &ImageSpec)>
Sourcepub fn payload_len(&self) -> u64
pub fn payload_len(&self) -> u64
Total bytes held in image segments — the part a codec can act on.
Sourcepub fn skeleton_len(&self) -> u64
pub fn skeleton_len(&self) -> u64
Total bytes stored verbatim — the skeleton.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Layout
impl<'de> Deserialize<'de> for Layout
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 Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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