pub trait Source: Send + Sync + 'static {
type Error: Error + Send + Sync;
fn find(&self, path: &str, asset: &str) -> BoxFuture<'_, Option<AssetId>>;
fn load(
&self,
id: AssetId
) -> BoxFuture<'_, Result<Option<AssetData>, Self::Error>>;
fn update(
&self,
id: AssetId,
version: u64
) -> BoxFuture<'_, Result<Option<AssetData>, Self::Error>>;
}
Expand description
Abstract source for asset raw data.
Associated Types
Required methods
Searches for the asset by given path.
Returns Ok(Some(asset_data))
if asset is found and loaded successfully.
Returns Ok(None)
if asset is not found.
Load asset data from this source.
Returns Ok(Some(asset_data))
if asset is loaded successfully.
Returns Ok(None)
if asset is not found, allowing checking other sources.