pub struct EffectTextureCache<T> { /* private fields */ }Expand description
A renderer’s uploaded effect textures, keyed by image and colour handling.
Implementations§
Source§impl<T> EffectTextureCache<T>
impl<T> EffectTextureCache<T>
Sourcepub fn begin_frame(&mut self)
pub fn begin_frame(&mut self)
Call once per drawn frame, before Self::get: frees what has gone
unused for a while or whose image is gone.
Sourcepub fn get(
&mut self,
texture: &EffectTexture,
upload: impl FnOnce(u32, u32, &[u8]) -> Result<T>,
) -> Option<&T>
pub fn get( &mut self, texture: &EffectTexture, upload: impl FnOnce(u32, u32, &[u8]) -> Result<T>, ) -> Option<&T>
The texture for texture, uploading it through upload (width,
height, BGRA8 texels) when this image has none yet. An upload that
fails is not retried while the image lives; its quads read black.
Trait Implementations§
Auto Trait Implementations§
impl<T> Forget for EffectTextureCache<T>
impl<T> Freeze for EffectTextureCache<T>
impl<T> Move for EffectTextureCache<T>
impl<T> RefUnwindSafe for EffectTextureCache<T>
impl<T> Send for EffectTextureCache<T>
impl<T> Sync for EffectTextureCache<T>
impl<T> Unpin for EffectTextureCache<T>
impl<T> UnsafeUnpin for EffectTextureCache<T>
impl<T> UnwindSafe for EffectTextureCache<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more