Skip to main content

ImageDecodeError

Enum ImageDecodeError 

Source
pub enum ImageDecodeError {
    InputTooLarge(InputTooLarge),
    Decode(Error),
    Convert(ConvertError),
    EmptyPayload,
    NoImage,
    Corrupt(Corrupt),
    TrustedPayload(TrustedPayload),
}
Expand description

Errors from [FfmpegImageDecoder].

Variants§

§

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

Source

pub const fn is_input_too_large(&self) -> bool

Returns true if this value is of type InputTooLarge. Returns false otherwise

Source

pub const fn is_decode(&self) -> bool

Returns true if this value is of type Decode. Returns false otherwise

Source

pub const fn is_convert(&self) -> bool

Returns true if this value is of type Convert. Returns false otherwise

Source

pub const fn is_empty_payload(&self) -> bool

Returns true if this value is of type EmptyPayload. Returns false otherwise

Source

pub const fn is_no_image(&self) -> bool

Returns true if this value is of type NoImage. Returns false otherwise

Source

pub const fn is_corrupt(&self) -> bool

Returns true if this value is of type Corrupt. Returns false otherwise

Source

pub const fn is_trusted_payload(&self) -> bool

Returns true if this value is of type TrustedPayload. Returns false otherwise

Source§

impl ImageDecodeError

Source

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.

Source

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.

Source

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.

Source

pub fn unwrap_decode(self) -> Error

Unwraps this value to the ImageDecodeError::Decode variant. Panics if this value is of any other type.

Source

pub fn unwrap_decode_ref(&self) -> &Error

Unwraps this reference to the ImageDecodeError::Decode variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_convert(self) -> ConvertError

Unwraps this value to the ImageDecodeError::Convert variant. Panics if this value is of any other type.

Source

pub fn unwrap_convert_ref(&self) -> &ConvertError

Unwraps this reference to the ImageDecodeError::Convert variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_empty_payload(self)

Unwraps this value to the ImageDecodeError::EmptyPayload variant. Panics if this value is of any other type.

Source

pub fn unwrap_empty_payload_ref(&self)

Unwraps this reference to the ImageDecodeError::EmptyPayload variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_no_image(self)

Unwraps this value to the ImageDecodeError::NoImage variant. Panics if this value is of any other type.

Source

pub fn unwrap_no_image_ref(&self)

Unwraps this reference to the ImageDecodeError::NoImage variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_corrupt(self) -> Corrupt

Unwraps this value to the ImageDecodeError::Corrupt variant. Panics if this value is of any other type.

Source

pub fn unwrap_corrupt_ref(&self) -> &Corrupt

Unwraps this reference to the ImageDecodeError::Corrupt variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_trusted_payload(self) -> TrustedPayload

Unwraps this value to the ImageDecodeError::TrustedPayload variant. Panics if this value is of any other type.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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 Clone for ImageDecodeError

Source§

fn clone(&self) -> ImageDecodeError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ImageDecodeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ImageDecodeError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ImageDecodeError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ConvertError> for ImageDecodeError

Source§

fn from(source: ConvertError) -> Self

Converts to this type from the input type.
Source§

impl From<Corrupt> for ImageDecodeError

Source§

fn from(source: Corrupt) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ImageDecodeError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<InputTooLarge> for ImageDecodeError

Source§

fn from(source: InputTooLarge) -> Self

Converts to this type from the input type.
Source§

impl From<TrustedPayload> for ImageDecodeError

Source§

fn from(source: TrustedPayload) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more