pub struct Corrupt { /* private fields */ }Expand description
Payload for ImageDecodeError::Corrupt.
§Why this is a refusal and not a forwarded flag
Measured, on this build, with a real cover-art payload:
AV_PKT_FLAG_CORRUPTreaches libavcodec and libavcodec does nothing with it — the mjpeg decoder returns a full picture and leavesAV_FRAME_FLAG_CORRUPTclear. So forwarding the flag does not preserve the fact; it only moves where it is dropped.AV_PKT_FLAG_DISCARD, by contrast, is honoured: the decoder produces no frame at all. That flag is therefore forwarded and nothing is decided here.
ImageFrame has no flag seat — deliberately, it is a picture and
not a packet — so a corruption signal that survives the decode has
nowhere left to go. Returning the picture anyway would hand a caller
a possibly-garbage image with the one warning about it deleted en
route. Named refusal, both roads. A caller who wants the bytes
decoded regardless can clear the flag it set.
Implementations§
Source§impl Corrupt
impl Corrupt
Sourcepub const fn new(declared_by: CorruptSource) -> Self
pub const fn new(declared_by: CorruptSource) -> Self
Constructs a Corrupt payload.
Sourcepub const fn declared_by(&self) -> CorruptSource
pub const fn declared_by(&self) -> CorruptSource
Which side declared the corruption.
Trait Implementations§
impl Copy for Corrupt
impl Eq for Corrupt
Source§impl Error for Corrupt
impl Error for Corrupt
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Corrupt> for ImageDecodeError
impl From<Corrupt> for ImageDecodeError
impl StructuralPartialEq for Corrupt
Auto Trait Implementations§
impl Freeze for Corrupt
impl RefUnwindSafe for Corrupt
impl Send for Corrupt
impl Sync for Corrupt
impl Unpin for Corrupt
impl UnsafeUnpin for Corrupt
impl UnwindSafe for Corrupt
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