Struct amethyst_assets::AssetStorage [−][src]
pub struct AssetStorage<A: Asset> { /* fields omitted */ }
An asset storage, storing the actual assets and allocating handles to them.
Methods
impl<A: Asset> AssetStorage<A>[src]
impl<A: Asset> AssetStorage<A>pub fn new() -> Self[src]
pub fn new() -> SelfCreates a new asset storage.
pub fn clone_asset(&mut self, handle: &Handle<A>) -> Option<Handle<A>> where
A: Clone, [src]
pub fn clone_asset(&mut self, handle: &Handle<A>) -> Option<Handle<A>> where
A: Clone, When cloning an asset handle, you'll get another handle,
but pointing to the same asset. If you instead want to
indeed create a new asset, you can use this method.
Note however, that it needs a mutable borrow of self,
so it can't be used in parallel.
pub fn get(&self, handle: &Handle<A>) -> Option<&A>[src]
pub fn get(&self, handle: &Handle<A>) -> Option<&A>Get an asset from a given asset handle.
pub fn get_mut(&mut self, handle: &Handle<A>) -> Option<&mut A>[src]
pub fn get_mut(&mut self, handle: &Handle<A>) -> Option<&mut A>Get an asset mutably from a given asset handle.
pub fn process<F>(
&mut self,
f: F,
frame_number: u64,
pool: &ThreadPool,
strategy: Option<&HotReloadStrategy>
) where
F: FnMut(A::Data) -> Result<A>, [src]
pub fn process<F>(
&mut self,
f: F,
frame_number: u64,
pool: &ThreadPool,
strategy: Option<&HotReloadStrategy>
) where
F: FnMut(A::Data) -> Result<A>, Process finished asset data and maintain the storage.
pub fn process_custom_drop<F, D>(
&mut self,
f: F,
drop_fn: D,
frame_number: u64,
pool: &ThreadPool,
strategy: Option<&HotReloadStrategy>
) where
D: FnMut(A),
F: FnMut(A::Data) -> Result<A>, [src]
pub fn process_custom_drop<F, D>(
&mut self,
f: F,
drop_fn: D,
frame_number: u64,
pool: &ThreadPool,
strategy: Option<&HotReloadStrategy>
) where
D: FnMut(A),
F: FnMut(A::Data) -> Result<A>, Process finished asset data and maintain the storage.
This calls the drop_fn closure for assets that were removed from the storage.
Trait Implementations
impl<A: Asset> Default for AssetStorage<A>[src]
impl<A: Asset> Default for AssetStorage<A>impl<A: Asset> Drop for AssetStorage<A>[src]
impl<A: Asset> Drop for AssetStorage<A>Auto Trait Implementations
impl<A> Send for AssetStorage<A> where
<A as Asset>::Data: Send,
impl<A> Send for AssetStorage<A> where
<A as Asset>::Data: Send, impl<A> Sync for AssetStorage<A> where
<A as Asset>::Data: Send,
impl<A> Sync for AssetStorage<A> where
<A as Asset>::Data: Send,