[][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<S>(registry: Registry<K>, spawn: S) -> Self where
    S: Spawn + MaybeSend + MaybeSync + 'static, 
[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: Key,
    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: Key,
    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.

Trait Implementations

impl<K> Clone for Cache<K>[src]

impl<K> Debug for Cache<K>[src]

Auto Trait Implementations

impl<K> !RefUnwindSafe for Cache<K>

impl<K> !Send for Cache<K>

impl<K> !Sync for Cache<K>

impl<K> Unpin for Cache<K>

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> MaybeSend for T where
    T: ?Sized
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.