Struct goods::Registry[][src]

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

Collection of registered sources. Used by Cache to load new assets.

Implementations

impl<K> Registry<K> where
    K: 'static, 
[src]

pub fn builder() -> RegistryBuilder<K>[src]

Create registry builder.

pub async fn read(&self, key: &K) -> Result<Box<[u8]>>[src]

Try to read data for asset with specified key. This method will try to read asset from all registered sources one-by-one. Returns as soon as first source returns anything except SourceError::NotFound.

This method ignores sources that return non-send futures.

Trait Implementations

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

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

Auto Trait Implementations

impl<K> !RefUnwindSafe for Registry<K>[src]

impl<K> Send for Registry<K>[src]

impl<K> Sync for Registry<K>[src]

impl<K> Unpin for Registry<K>[src]

impl<K> !UnwindSafe for Registry<K>[src]

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> 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.