[−][src]Struct goods::Cache
Asset cache. This type is main entry point for asset loading. Caches loaded assets and provokes loading work for new assets.
Implementations
impl<K> Cache<K>
[src]
pub fn new(registry: Registry<K>, loader: &Loader<K>) -> Self
[src]
Creates new asset cache.
Assets will be loaded from provided registry
.
Loading tasks will be sent to Loader
.
pub fn load<A>(&self, key: K) -> Handle<A> where
K: Eq + Hash + Clone + Send + Sync + 'static,
A: AssetDefaultFormat<K>,
[src]
K: Eq + Hash + Clone + Send + Sync + 'static,
A: AssetDefaultFormat<K>,
Requests an asset by the key
.
Returns cached asset handle if same asset type was loaded from same key
(even if loading is incomplete).
Uses default asset format for decoding.
pub fn load_with_format<A, F>(&self, key: K, format: F) -> Handle<A> where
K: Eq + Hash + Clone + Send + Sync + 'static,
A: Asset,
F: Format<A, K>,
[src]
K: Eq + Hash + Clone + Send + Sync + 'static,
A: Asset,
F: Format<A, K>,
Requests an asset by the key
.
Returns cached asset handle if same asset type was loaded from same key
(even if loading is incomplete).
Uses provided asset format for decoding.
pub fn process<C: 'static>(&self, ctx: &mut C) where
K: 'static,
[src]
K: 'static,
Process intermediate asset represnetations into assets.
Calling this function will build all loaded assets whose context type is C
.
pub fn process_simple(&self) where
K: 'static,
[src]
K: 'static,
Process all SimpleAsset
types.
Auto Trait Implementations
impl<K> !RefUnwindSafe for Cache<K>
impl<K> Send for Cache<K> where
K: Send,
K: Send,
impl<K> Sync for Cache<K> where
K: Send,
K: Send,
impl<K> Unpin for Cache<K> where
K: Unpin,
K: Unpin,
impl<K> !UnwindSafe for Cache<K>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,