Trait amethyst_assets::Store
[−]
[src]
pub trait Store { type Error: Error + Send + Sync + 'static; type Result: IntoFuture<Item = Vec<u8>, Error = Self::Error> + 'static; fn modified(
&self,
category: &str,
id: &str,
ext: &str
) -> Result<u64, Self::Error>; fn load(&self, category: &str, id: &str, ext: &str) -> Self::Result; }
A trait for asset stores, which provides methods for loading
Associated Types
type Error: Error + Send + Sync + 'static
The error that may occur when calling modified
or load
.
type Result: IntoFuture<Item = Vec<u8>, Error = Self::Error> + 'static
The result type of load
.
Required Methods
fn modified(
&self,
category: &str,
id: &str,
ext: &str
) -> Result<u64, Self::Error>
&self,
category: &str,
id: &str,
ext: &str
) -> Result<u64, Self::Error>
This is called to check if an asset has been modified.
Returns the modification time as seconds since UNIX_EPOCH
.
fn load(&self, category: &str, id: &str, ext: &str) -> Self::Result
Loads the bytes given a category, id and extension of the asset.
The id should always use /
as separator in paths.