pub trait AssetResolver: Send + Sync {
// Required method
fn fetch(&self, uri: &str) -> Result<Vec<u8>, AssetError>;
// Provided method
fn resolve_id(&self, _id: &str) -> Option<String> { ... }
}Required Methods§
Provided Methods§
Sourcefn resolve_id(&self, _id: &str) -> Option<String>
fn resolve_id(&self, _id: &str) -> Option<String>
Resolve a bare asset id (no path, no extension — e.g. an asset
service’s UUID) to a URI that fetch can load. A filesystem
resolver searches its root recursively for a file whose stem matches;
resolvers that can’t map an id return None (the default). Used as a
fallback for {% media id="…" /%} when the id isn’t a file sitting
directly in the asset root.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".