[][src]Trait lib::Resource

pub trait Resource<T: UniqueID> {
    fn load(&self) -> Result<Arc<HashMap<u64, T>>>;
}

A resouce is an abstraction around some outside resource like a File or Network connection. It may or may not involve levels of caching.

Required methods

fn load(&self) -> Result<Arc<HashMap<u64, T>>>

Load the resource, returning a reference-counted view to it's most recent contents Once loaded, the caller will continue to have a view into the contents at the time load was called; this means it may get out of sync with later callers.

Loading content...

Implementations on Foreign Types

impl<'r, T> Resource<T> for State<'r, FileResource<T>> where
    T: Clone + UniqueID + Send + Sync + FromStr,
    T::Err: ThreadSafeErr
[src]

Loading content...

Implementors

impl<T> Resource<T> for FileResource<T> where
    T: FromStr + Clone + UniqueID + Sync + Send,
    T::Err: ThreadSafeErr
[src]

fn load(&self) -> Result<Arc<HashMap<u64, T>>>[src]

load the resource. this will return a cache of the file at the time it was loaded

impl<T, '_> Resource<T> for &'_ FileResource<T> where
    T: FromStr + Clone + UniqueID + Sync + Send,
    T::Err: ThreadSafeErr
[src]

fn load(&self) -> Result<Arc<HashMap<u64, T>>>[src]

load the resource. this will return a cache of the file at the time it was loaded

Loading content...