pub struct NullAssetResolver;Expand description
Resolver that returns NotFound for every URI. The default when the
caller hasn’t wired anything else; lets media-bearing documents render
as placeholders without configuration.
Trait Implementations§
Source§impl AssetResolver for NullAssetResolver
impl AssetResolver for NullAssetResolver
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.Source§impl Debug for NullAssetResolver
impl Debug for NullAssetResolver
Auto Trait Implementations§
impl Forget for NullAssetResolver
impl Freeze for NullAssetResolver
impl Move for NullAssetResolver
impl RefUnwindSafe for NullAssetResolver
impl Send for NullAssetResolver
impl Sync for NullAssetResolver
impl Unpin for NullAssetResolver
impl UnsafeUnpin for NullAssetResolver
impl UnwindSafe for NullAssetResolver
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.