pub struct CompositeAssetResolver { /* private fields */ }Expand description
Composes multiple resolvers; the first one whose fetch doesn’t
return UnsupportedScheme wins.
Implementations§
Trait Implementations§
Source§impl AssetResolver for CompositeAssetResolver
impl AssetResolver for CompositeAssetResolver
Source§fn fetch(&self, uri: &str) -> Result<Vec<u8>, AssetError>
fn fetch(&self, uri: &str) -> Result<Vec<u8>, AssetError>
Fetch the bytes referenced by
uri. The URI can be a relative or
absolute path, an http:// / https:// URL, an asset-service
reference, or anything else a caller-supplied resolver knows how to handle.Source§fn 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.Auto Trait Implementations§
impl !RefUnwindSafe for CompositeAssetResolver
impl !UnwindSafe for CompositeAssetResolver
impl Forget for CompositeAssetResolver
impl Freeze for CompositeAssetResolver
impl Move for CompositeAssetResolver
impl Send for CompositeAssetResolver
impl Sync for CompositeAssetResolver
impl Unpin for CompositeAssetResolver
impl UnsafeUnpin for CompositeAssetResolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.