#[non_exhaustive]pub enum CorruptReason {
Truncated(Truncation),
InvalidUnit {
unit: DataUnit,
message: String,
},
PreviewFallback {
message: String,
},
}Expand description
Structured cause of an Error::CorruptFile (or of a recovered DecodeWarning).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Truncated(Truncation)
Sensor data extends past the end of the file.
InvalidUnit
A compressed unit could not be decoded (reported as a warning when recovered).
PreviewFallback
The sensor data could not be decoded (e.g. an unsupported compression) and the frame holds the embedded full-size preview instead. Only reported as a warning, when the caller opted into the preview fallback.
Implementations§
Source§impl CorruptReason
impl CorruptReason
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
Machine-friendly kind: "truncated", "invalid-unit" or "preview-fallback".
Sourcepub fn truncation(&self) -> Option<&Truncation>
pub fn truncation(&self) -> Option<&Truncation>
The truncation details, for CorruptReason::Truncated.
Trait Implementations§
Source§impl Clone for CorruptReason
impl Clone for CorruptReason
Source§impl Debug for CorruptReason
impl Debug for CorruptReason
Source§impl Display for CorruptReason
impl Display for CorruptReason
impl Eq for CorruptReason
Source§impl PartialEq for CorruptReason
impl PartialEq for CorruptReason
impl StructuralPartialEq for CorruptReason
Auto Trait Implementations§
impl Freeze for CorruptReason
impl RefUnwindSafe for CorruptReason
impl Send for CorruptReason
impl Sync for CorruptReason
impl Unpin for CorruptReason
impl UnsafeUnpin for CorruptReason
impl UnwindSafe for CorruptReason
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