Expand description
An enum wrapping the common functions shared by the different image formats
Variants
Jpeg(Jpeg)
Png(Png)
WebP(WebP)
Implementations
sourceimpl DynImage
impl DynImage
sourcepub fn from_bytes(b: Bytes) -> Result<Option<DynImage>>
pub fn from_bytes(b: Bytes) -> Result<Option<DynImage>>
Tries to infer the file type from the file signature and calls
the from_bytes
method for the inferred format
Returns Ok(None)
if the format isn’t supported.
Errors
This method fails if the file is corrupted or truncated.
sourcepub fn encoder(self) -> ImageEncoder<Self>ⓘNotable traits for ImageEncoder<I>impl<I: EncodeAt> Iterator for ImageEncoder<I> type Item = Bytes;
pub fn encoder(self) -> ImageEncoder<Self>ⓘNotable traits for ImageEncoder<I>impl<I: EncodeAt> Iterator for ImageEncoder<I> type Item = Bytes;
Create an encoder for the inner image
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DynImage
impl Send for DynImage
impl Sync for DynImage
impl Unpin for DynImage
impl UnwindSafe for DynImage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more