#[non_exhaustive]pub struct Truncation {
pub unit: DataUnit,
pub offset: u64,
pub expected: u64,
pub available: u64,
pub file_len: u64,
}Expand description
A sensor-data range that the file does not fully contain.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.unit: DataUnitThe strip, tile or plane affected.
offset: u64File offset where the unit starts.
expected: u64Bytes the unit needs from offset (its geometry, or its declared length).
available: u64Bytes present from offset to the end of the file (0 when offset is past it).
file_len: u64Length of the input.
Implementations§
Source§impl Truncation
impl Truncation
Sourcepub fn new(unit: DataUnit, offset: u64, expected: u64, file_len: u64) -> Self
pub fn new(unit: DataUnit, offset: u64, expected: u64, file_len: u64) -> Self
A report for expected bytes at offset of a file_len-byte input.
Sourcepub fn starts_beyond_eof(&self) -> bool
pub fn starts_beyond_eof(&self) -> bool
True when the unit starts at or past the end of the file.
Sourcepub fn range_overflows(&self) -> bool
pub fn range_overflows(&self) -> bool
True when offset + expected does not fit in the address space.
Trait Implementations§
Source§impl Clone for Truncation
impl Clone for Truncation
Source§impl Debug for Truncation
impl Debug for Truncation
Source§impl Display for Truncation
impl Display for Truncation
impl Eq for Truncation
Source§impl PartialEq for Truncation
impl PartialEq for Truncation
impl StructuralPartialEq for Truncation
Auto Trait Implementations§
impl Freeze for Truncation
impl RefUnwindSafe for Truncation
impl Send for Truncation
impl Sync for Truncation
impl Unpin for Truncation
impl UnsafeUnpin for Truncation
impl UnwindSafe for Truncation
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more