#[non_exhaustive]pub enum ImageDecodeError {
InputTooLarge(InputTooLarge),
Decode(Error),
Convert(ConvertError),
EmptyPayload,
NoImage,
Corrupt(Corrupt),
TrustedPayload(TrustedPayload),
}Expand description
Errors from [FfmpegImageDecoder].
Open fault taxonomy, so it is #[non_exhaustive]. New ways to
fail are discovered — a backend, a ceiling, a corruption a codec
learns to report — and a consumer that meets one it has never heard
of should take its generic-fault path. That is exactly what the
wildcard arm this attribute forces is for. The two status
vocabularies opposite it,
Sent and Received,
are exhaustive for the mirror-image reason: their arms are the
substrate’s fixed state set, and there the wildcard would be dead
weight hiding a state a consumer forgot.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InputTooLarge(InputTooLarge)
The compressed payload is larger than the ceiling allows. Refused
before it is copied into an AVPacket.
Decode(Error)
The wrapped ffmpeg::decoder::Video reported an error, or the
codec context could not be built.
Convert(ConvertError)
Conversion from FFmpeg’s AVFrame to mediadecode’s ImageFrame
failed — an undeliverable pixel format, or a plane layout the
safe accessors refuse.
EmptyPayload
The attachment carried no bytes, so there is nothing to decode.
Distinct from Self::NoImage: this is an empty payload, which
the demuxer synthesizes for an attachment track whose picture the
container never stored.
NoImage
The payload was accepted and produced no picture — it is not an image this codec reads.
Corrupt(Corrupt)
Something on this road is marked corrupt, and an ImageFrame
has nowhere to say so.
TrustedPayload(TrustedPayload)
The attachment is marked AV_PKT_FLAG_TRUSTED, so its body may
hold pointers rather than bytes. See
crate::buffer::TrustedPayload.
Implementations§
Source§impl ImageDecodeError
impl ImageDecodeError
Sourcepub const fn is_input_too_large(&self) -> bool
pub const fn is_input_too_large(&self) -> bool
Returns true if this value is of type InputTooLarge. Returns false otherwise
Sourcepub const fn is_decode(&self) -> bool
pub const fn is_decode(&self) -> bool
Returns true if this value is of type Decode. Returns false otherwise
Sourcepub const fn is_convert(&self) -> bool
pub const fn is_convert(&self) -> bool
Returns true if this value is of type Convert. Returns false otherwise
Sourcepub const fn is_empty_payload(&self) -> bool
pub const fn is_empty_payload(&self) -> bool
Returns true if this value is of type EmptyPayload. Returns false otherwise
Sourcepub const fn is_no_image(&self) -> bool
pub const fn is_no_image(&self) -> bool
Returns true if this value is of type NoImage. Returns false otherwise
Sourcepub const fn is_corrupt(&self) -> bool
pub const fn is_corrupt(&self) -> bool
Returns true if this value is of type Corrupt. Returns false otherwise
Sourcepub const fn is_trusted_payload(&self) -> bool
pub const fn is_trusted_payload(&self) -> bool
Returns true if this value is of type TrustedPayload. Returns false otherwise
Source§impl ImageDecodeError
impl ImageDecodeError
Sourcepub fn unwrap_input_too_large(self) -> InputTooLarge
pub fn unwrap_input_too_large(self) -> InputTooLarge
Unwraps this value to the ImageDecodeError::InputTooLarge variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_input_too_large_ref(&self) -> &InputTooLarge
pub fn unwrap_input_too_large_ref(&self) -> &InputTooLarge
Unwraps this reference to the ImageDecodeError::InputTooLarge variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_input_too_large_mut(&mut self) -> &mut InputTooLarge
pub fn unwrap_input_too_large_mut(&mut self) -> &mut InputTooLarge
Unwraps this mutable reference to the ImageDecodeError::InputTooLarge variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_decode(self) -> Error
pub fn unwrap_decode(self) -> Error
Unwraps this value to the ImageDecodeError::Decode variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_decode_ref(&self) -> &Error
pub fn unwrap_decode_ref(&self) -> &Error
Unwraps this reference to the ImageDecodeError::Decode variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_decode_mut(&mut self) -> &mut Error
pub fn unwrap_decode_mut(&mut self) -> &mut Error
Unwraps this mutable reference to the ImageDecodeError::Decode variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_convert(self) -> ConvertError
pub fn unwrap_convert(self) -> ConvertError
Unwraps this value to the ImageDecodeError::Convert variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_convert_ref(&self) -> &ConvertError
pub fn unwrap_convert_ref(&self) -> &ConvertError
Unwraps this reference to the ImageDecodeError::Convert variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_convert_mut(&mut self) -> &mut ConvertError
pub fn unwrap_convert_mut(&mut self) -> &mut ConvertError
Unwraps this mutable reference to the ImageDecodeError::Convert variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_empty_payload(self)
pub fn unwrap_empty_payload(self)
Unwraps this value to the ImageDecodeError::EmptyPayload variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_empty_payload_ref(&self)
pub fn unwrap_empty_payload_ref(&self)
Unwraps this reference to the ImageDecodeError::EmptyPayload variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_empty_payload_mut(&mut self)
pub fn unwrap_empty_payload_mut(&mut self)
Unwraps this mutable reference to the ImageDecodeError::EmptyPayload variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_no_image(self)
pub fn unwrap_no_image(self)
Unwraps this value to the ImageDecodeError::NoImage variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_no_image_ref(&self)
pub fn unwrap_no_image_ref(&self)
Unwraps this reference to the ImageDecodeError::NoImage variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_no_image_mut(&mut self)
pub fn unwrap_no_image_mut(&mut self)
Unwraps this mutable reference to the ImageDecodeError::NoImage variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_corrupt(self) -> Corrupt
pub fn unwrap_corrupt(self) -> Corrupt
Unwraps this value to the ImageDecodeError::Corrupt variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_corrupt_ref(&self) -> &Corrupt
pub fn unwrap_corrupt_ref(&self) -> &Corrupt
Unwraps this reference to the ImageDecodeError::Corrupt variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_corrupt_mut(&mut self) -> &mut Corrupt
pub fn unwrap_corrupt_mut(&mut self) -> &mut Corrupt
Unwraps this mutable reference to the ImageDecodeError::Corrupt variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_trusted_payload(self) -> TrustedPayload
pub fn unwrap_trusted_payload(self) -> TrustedPayload
Unwraps this value to the ImageDecodeError::TrustedPayload variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_trusted_payload_ref(&self) -> &TrustedPayload
pub fn unwrap_trusted_payload_ref(&self) -> &TrustedPayload
Unwraps this reference to the ImageDecodeError::TrustedPayload variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_trusted_payload_mut(&mut self) -> &mut TrustedPayload
pub fn unwrap_trusted_payload_mut(&mut self) -> &mut TrustedPayload
Unwraps this mutable reference to the ImageDecodeError::TrustedPayload variant.
Panics if this value is of any other type.
Source§impl ImageDecodeError
impl ImageDecodeError
Sourcepub fn try_unwrap_input_too_large(
self,
) -> Result<InputTooLarge, TryUnwrapError<Self>>
pub fn try_unwrap_input_too_large( self, ) -> Result<InputTooLarge, TryUnwrapError<Self>>
Attempts to unwrap this value to the ImageDecodeError::InputTooLarge variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_input_too_large_ref(
&self,
) -> Result<&InputTooLarge, TryUnwrapError<&Self>>
pub fn try_unwrap_input_too_large_ref( &self, ) -> Result<&InputTooLarge, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ImageDecodeError::InputTooLarge variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_input_too_large_mut(
&mut self,
) -> Result<&mut InputTooLarge, TryUnwrapError<&mut Self>>
pub fn try_unwrap_input_too_large_mut( &mut self, ) -> Result<&mut InputTooLarge, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ImageDecodeError::InputTooLarge variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_decode(self) -> Result<Error, TryUnwrapError<Self>>
pub fn try_unwrap_decode(self) -> Result<Error, TryUnwrapError<Self>>
Attempts to unwrap this value to the ImageDecodeError::Decode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_decode_ref(&self) -> Result<&Error, TryUnwrapError<&Self>>
pub fn try_unwrap_decode_ref(&self) -> Result<&Error, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ImageDecodeError::Decode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_decode_mut(
&mut self,
) -> Result<&mut Error, TryUnwrapError<&mut Self>>
pub fn try_unwrap_decode_mut( &mut self, ) -> Result<&mut Error, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ImageDecodeError::Decode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_convert(self) -> Result<ConvertError, TryUnwrapError<Self>>
pub fn try_unwrap_convert(self) -> Result<ConvertError, TryUnwrapError<Self>>
Attempts to unwrap this value to the ImageDecodeError::Convert variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_convert_ref(
&self,
) -> Result<&ConvertError, TryUnwrapError<&Self>>
pub fn try_unwrap_convert_ref( &self, ) -> Result<&ConvertError, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ImageDecodeError::Convert variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_convert_mut(
&mut self,
) -> Result<&mut ConvertError, TryUnwrapError<&mut Self>>
pub fn try_unwrap_convert_mut( &mut self, ) -> Result<&mut ConvertError, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ImageDecodeError::Convert variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_empty_payload(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_empty_payload(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ImageDecodeError::EmptyPayload variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_empty_payload_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_empty_payload_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ImageDecodeError::EmptyPayload variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_empty_payload_mut(
&mut self,
) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_empty_payload_mut( &mut self, ) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ImageDecodeError::EmptyPayload variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_no_image(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_no_image(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ImageDecodeError::NoImage variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_no_image_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_no_image_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ImageDecodeError::NoImage variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_no_image_mut(
&mut self,
) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_no_image_mut( &mut self, ) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ImageDecodeError::NoImage variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_corrupt(self) -> Result<Corrupt, TryUnwrapError<Self>>
pub fn try_unwrap_corrupt(self) -> Result<Corrupt, TryUnwrapError<Self>>
Attempts to unwrap this value to the ImageDecodeError::Corrupt variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_corrupt_ref(&self) -> Result<&Corrupt, TryUnwrapError<&Self>>
pub fn try_unwrap_corrupt_ref(&self) -> Result<&Corrupt, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ImageDecodeError::Corrupt variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_corrupt_mut(
&mut self,
) -> Result<&mut Corrupt, TryUnwrapError<&mut Self>>
pub fn try_unwrap_corrupt_mut( &mut self, ) -> Result<&mut Corrupt, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ImageDecodeError::Corrupt variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_trusted_payload(
self,
) -> Result<TrustedPayload, TryUnwrapError<Self>>
pub fn try_unwrap_trusted_payload( self, ) -> Result<TrustedPayload, TryUnwrapError<Self>>
Attempts to unwrap this value to the ImageDecodeError::TrustedPayload variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_trusted_payload_ref(
&self,
) -> Result<&TrustedPayload, TryUnwrapError<&Self>>
pub fn try_unwrap_trusted_payload_ref( &self, ) -> Result<&TrustedPayload, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ImageDecodeError::TrustedPayload variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_trusted_payload_mut(
&mut self,
) -> Result<&mut TrustedPayload, TryUnwrapError<&mut Self>>
pub fn try_unwrap_trusted_payload_mut( &mut self, ) -> Result<&mut TrustedPayload, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ImageDecodeError::TrustedPayload variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Trait Implementations§
Source§impl Debug for ImageDecodeError
impl Debug for ImageDecodeError
Source§impl Display for ImageDecodeError
impl Display for ImageDecodeError
Source§impl Error for ImageDecodeError
impl Error for ImageDecodeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()