Trait ImageContainer

Source
pub trait ImageContainer: KnownSize + Sized {
    // Required methods
    fn get_data(&self) -> &Vec<u8> ;
    fn get_data_mut(&mut self) -> &mut Vec<u8> ;
    fn into_data(self) -> Vec<u8> ;

    // Provided method
    fn as_knownsize(&self) -> &dyn KnownSize { ... }
}
Expand description

Something that can act as, or contains, an image.

Required Methods§

Source

fn get_data(&self) -> &Vec<u8>

Retrieve the data in the image

Source

fn get_data_mut(&mut self) -> &mut Vec<u8>

Retrieve the data in the image, mutably

Source

fn into_data(self) -> Vec<u8>

Retrieve the data in the image, consuming the object

Provided Methods§

Source

fn as_knownsize(&self) -> &dyn KnownSize

Convert the object to a dynamic KnownSize object, as rust doesn’t support calling KnownSize -methods directly on this object

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§