Skip to main content

ImageCache

Struct ImageCache 

Source
pub struct ImageCache<T> { /* private fields */ }
Expand description

O que um renderizador fez de cada imagem, pelo Image::id, com a imagem fraca ao lado.

Implementations§

Source§

impl<T> ImageCache<T>

Source

pub fn named(name: &'static str) -> Self

Um cache que aparece no painel de memória (stats) com este nome (“Direct2D · pixels na placa”).

Source

pub fn get(&mut self, image: &Image) -> Option<&T>

O valor guardado da imagem, marcado como usado agora.

Source

pub fn get_by_id_mut(&mut self, id: u64) -> Option<&mut T>

O valor pelo id, sem marcar uso (quem termina de carregar depois, como o navegador).

Source

pub fn insert( &mut self, image: &Image, value: T, bytes: usize, max_count: usize, max_bytes: usize, )

Guarda o valor da imagem (bytes: quanto ocupa, para o limite em bytes). Antes, solta o das imagens mortas; depois, enquanto passar de max_count entradas ou max_bytes, tira a usada há mais tempo (nunca a que acabou de entrar).

Source

pub fn drain_dropped(&mut self) -> Vec<T>

Como forget_dropped, devolvendo os valores das imagens soltas: o renderizador reaproveita o bitmap de um quadro de câmera no quadro seguinte.

Source

pub fn forget_dropped(&mut self)

Solta o que é de imagens que o app já soltou.

Source

pub fn clear(&mut self)

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn bytes(&self) -> usize

A soma dos bytes guardados.

Trait Implementations§

Source§

impl<T> Default for ImageCache<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Forget for ImageCache<T>

§

impl<T> Freeze for ImageCache<T>
where HashMap<u64, Entry<T>>: Freeze,

§

impl<T> Move for ImageCache<T>

§

impl<T> RefUnwindSafe for ImageCache<T>
where HashMap<u64, Entry<T>>: RefUnwindSafe,

§

impl<T> Send for ImageCache<T>
where HashMap<u64, Entry<T>>: Send,

§

impl<T> Sync for ImageCache<T>
where HashMap<u64, Entry<T>>: Sync,

§

impl<T> Unpin for ImageCache<T>
where HashMap<u64, Entry<T>>: Unpin,

§

impl<T> UnsafeUnpin for ImageCache<T>
where HashMap<u64, Entry<T>>: UnsafeUnpin,

§

impl<T> UnwindSafe for ImageCache<T>
where HashMap<u64, Entry<T>>: UnwindSafe,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.