[−][src]Trait lib::Resource
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.
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...
T: Clone + UniqueID + Send + Sync + FromStr,
T::Err: ThreadSafeErr,
Implementors
impl<T> Resource<T> for FileResource<T> where
T: FromStr + Clone + UniqueID + Sync + Send,
T::Err: ThreadSafeErr,
[src]
T: FromStr + Clone + UniqueID + Sync + Send,
T::Err: ThreadSafeErr,
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]
T: FromStr + Clone + UniqueID + Sync + Send,
T::Err: ThreadSafeErr,