[][src]Struct goods::Cache

pub struct Cache<K> { /* fields omitted */ }

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]

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]

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]

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]

Process all SimpleAsset types.

Auto Trait Implementations

impl<K> !RefUnwindSafe for Cache<K>

impl<K> Send for Cache<K> where
    K: Send

impl<K> Sync for Cache<K> where
    K: Send

impl<K> Unpin for Cache<K> where
    K: Unpin

impl<K> !UnwindSafe for Cache<K>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.