pub struct SamplerCache<B: Backend> { /* private fields */ }
Expand description
Sampler cache holds handlers to created samplers.
Implementations§
Source§impl<B> SamplerCache<B>where
B: Backend,
impl<B> SamplerCache<B>where
B: Backend,
Sourcepub fn get(
&mut self,
info: SamplerDesc,
create: impl FnOnce() -> Result<Handle<Sampler<B>>, AllocationError>,
) -> Result<Handle<Sampler<B>>, AllocationError>
pub fn get( &mut self, info: SamplerDesc, create: impl FnOnce() -> Result<Handle<Sampler<B>>, AllocationError>, ) -> Result<Handle<Sampler<B>>, AllocationError>
Get sampler with specified paramters. Create new one using closure provided.
Sourcepub fn get_with_upgradable_lock<R, W, U>(
read: R,
upgrade: U,
info: SamplerDesc,
create: impl FnOnce() -> Result<Handle<Sampler<B>>, AllocationError>,
) -> Result<Handle<Sampler<B>>, AllocationError>
pub fn get_with_upgradable_lock<R, W, U>( read: R, upgrade: U, info: SamplerDesc, create: impl FnOnce() -> Result<Handle<Sampler<B>>, AllocationError>, ) -> Result<Handle<Sampler<B>>, AllocationError>
Get sampler with specified paramters. Create new one using closure provided. Does not lock for writing if sampler exists.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for SamplerCache<B>
impl<B> RefUnwindSafe for SamplerCache<B>
impl<B> Send for SamplerCache<B>
impl<B> Sync for SamplerCache<B>
impl<B> Unpin for SamplerCache<B>
impl<B> UnwindSafe for SamplerCache<B>
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