Skip to main content

Unsupported

Struct Unsupported 

Source
pub struct Unsupported<E>(/* private fields */);
Expand description

Stub type for codecs that don’t support an operation.

Use as the associated type for unsupported decode modes:

impl<'a> DecodeJob<'a> for MyDecodeJob<'a> {
    type Error = At<MyError>;  // or just MyError
    type Dec = MyDecoder<'a>;
    type StreamDec = Unsupported<At<MyError>>;
    type AnimationFrameDec = Unsupported<At<MyError>>;
    // ...

    fn streaming_decoder(self, ..) -> Result<Unsupported<At<MyError>>, At<MyError>> {
        Err(MyError::from(UnsupportedOperation::RowLevelDecode).start_at())
    }

    fn animation_frame_decoder(self, ..) -> Result<Unsupported<At<MyError>>, At<MyError>> {
        Err(MyError::from(UnsupportedOperation::AnimationDecode).start_at())
    }
}

The job’s method returns Err(...) before an Unsupported instance is ever created, so the trait methods below are unreachable in practice.

Trait Implementations§

Source§

impl<E: Error + Send + Sync + 'static> AnimationFrameDecoder for Unsupported<E>

Source§

type Error = E

The codec-specific error type.
Source§

fn wrap_sink_error(_err: SinkError) -> E

Wrap a SinkError into this decoder’s error type. Read more
Source§

fn info(&self) -> &ImageInfo

Image metadata, available after construction.
Source§

fn render_next_frame( &mut self, _stop: Option<&dyn Stop>, ) -> Result<Option<AnimationFrame<'_>>, E>

Render the next composited full-canvas frame. Read more
Source§

fn render_next_frame_owned( &mut self, _stop: Option<&dyn Stop>, ) -> Result<Option<OwnedAnimationFrame>, E>

Render the next frame as an owned copy. Read more
Source§

fn render_next_frame_to_sink( &mut self, _stop: Option<&dyn Stop>, _sink: &mut dyn DecodeRowSink, ) -> Result<Option<OutputInfo>, E>

Render the next frame directly into a caller-owned sink (push model). Read more
Source§

fn frame_count(&self) -> Option<u32>

Number of frames, if known without decoding.
Source§

fn loop_count(&self) -> Option<u32>

Animation loop count from the container. Read more
Source§

impl<E: Error + Send + Sync + 'static> StreamingDecode for Unsupported<E>

Source§

type Error = E

The codec-specific error type.
Source§

fn next_batch(&mut self) -> Result<Option<(u32, PixelSlice<'_>)>, E>

Pull the next batch of scanlines. Read more
Source§

fn info(&self) -> &ImageInfo

Image metadata, available after construction.

Auto Trait Implementations§

§

impl<E> Freeze for Unsupported<E>

§

impl<E> RefUnwindSafe for Unsupported<E>

§

impl<E> Send for Unsupported<E>

§

impl<E> Sync for Unsupported<E>

§

impl<E> Unpin for Unsupported<E>

§

impl<E> UnsafeUnpin for Unsupported<E>

§

impl<E> UnwindSafe for Unsupported<E>

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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.