pub(crate) trait ServoImageDecoder<'a>: Sized + Debug {
// Required methods
fn make_decoder(format: ImageFormat, buffer: &'a [u8]) -> ImageResult<Self>;
fn is_animated(&self) -> bool;
fn decoder(self) -> impl ImageDecoder;
fn animated_decoder(self) -> impl AnimationDecoder<'a>;
}Expand description
Main Image decoder trait.
Required Methods§
Sourcefn make_decoder(format: ImageFormat, buffer: &'a [u8]) -> ImageResult<Self>
fn make_decoder(format: ImageFormat, buffer: &'a [u8]) -> ImageResult<Self>
Create a decoder for a format from a buffer.
fn is_animated(&self) -> bool
Sourcefn decoder(self) -> impl ImageDecoder
fn decoder(self) -> impl ImageDecoder
Return the created decoder in impl ImageDecoder
Sourcefn animated_decoder(self) -> impl AnimationDecoder<'a>
fn animated_decoder(self) -> impl AnimationDecoder<'a>
Return the created decoder in impl AnimationDecoder if animated.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".