pub trait Storage {
    type Entry: Entry;
    type State<'a>;

    // Required methods
    fn upload(
        &mut self,
        width: u32,
        height: u32,
        data: &[u8],
        state: &mut Self::State<'_>
    ) -> Option<Self::Entry>;
    fn remove(&mut self, entry: &Self::Entry, state: &mut Self::State<'_>);
}
Expand description

Stores cached image data for use in rendering

Required Associated Types§

source

type Entry: Entry

The type of an Entry in the Storage.

source

type State<'a>

State provided to upload or remove a Self::Entry.

Required Methods§

source

fn upload( &mut self, width: u32, height: u32, data: &[u8], state: &mut Self::State<'_> ) -> Option<Self::Entry>

Upload the image data of a Self::Entry.

source

fn remove(&mut self, entry: &Self::Entry, state: &mut Self::State<'_>)

Remove a Self::Entry from the Storage.

Implementors§