pub struct EffectCache { /* private fields */ }Expand description
Loads each effect once.
Implementations§
Source§impl EffectCache
impl EffectCache
Sourcepub fn get(&mut self, archive: &Archive, reference: &str) -> Option<Rc<Effect>>
pub fn get(&mut self, archive: &Archive, reference: &str) -> Option<Rc<Effect>>
An effect by its reference, loaded and decoded the first time it is asked for.
Sourcepub fn preload(&mut self, archive: &Archive, references: &[&str])
pub fn preload(&mut self, archive: &Archive, references: &[&str])
Load every effect of references that is not loaded yet, as EffectCache::get would
one by one.
Sourcepub fn missing<'a>(&self, references: &[&'a str]) -> Vec<&'a str>
pub fn missing<'a>(&self, references: &[&'a str]) -> Vec<&'a str>
The effects of references that are not loaded yet.
Sourcepub fn prepare(archive: &Archive, references: &[&str]) -> Prepared
pub fn prepare(archive: &Archive, references: &[&str]) -> Prepared
Read and decode effects without the cache, so that it can run on another thread while the caller loads something else. Each sound buffer decodes on its own (a pure function of its data), so all the buffers of all the effects decode in parallel (native).
Trait Implementations§
Source§impl Default for EffectCache
impl Default for EffectCache
Source§fn default() -> EffectCache
fn default() -> EffectCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Send for EffectCache
impl !Sync for EffectCache
impl Freeze for EffectCache
impl RefUnwindSafe for EffectCache
impl Unpin for EffectCache
impl UnsafeUnpin for EffectCache
impl UnwindSafe for EffectCache
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