pub struct ChainResolver { /* private fields */ }Expand description
Tries resolvers in order; the first one not returning Unsupported wins.
Implementations§
Source§impl ChainResolver
impl ChainResolver
pub fn new() -> Self
Sourcepub fn with_data_urls() -> Self
pub fn with_data_urls() -> Self
Chain starting with the DataUrlResolver.
pub fn then(self, resolver: Arc<dyn FileResolver>) -> Self
Trait Implementations§
Source§impl Clone for ChainResolver
impl Clone for ChainResolver
Source§impl Debug for ChainResolver
impl Debug for ChainResolver
Source§impl Default for ChainResolver
impl Default for ChainResolver
Source§impl FileResolver for ChainResolver
impl FileResolver for ChainResolver
Source§fn read<'a>(
&'a self,
file: &'a File,
max_bytes: u64,
) -> BoxFuture<'a, Result<FileBytes, FileError>>
fn read<'a>( &'a self, file: &'a File, max_bytes: u64, ) -> BoxFuture<'a, Result<FileBytes, FileError>>
Read the whole file, failing with
FileError::TooLarge past max_bytes.
Return FileError::Unsupported for files this resolver does not handle,
so a ChainResolver can try the next one.Auto Trait Implementations§
impl !RefUnwindSafe for ChainResolver
impl !UnwindSafe for ChainResolver
impl Forget for ChainResolver
impl Freeze for ChainResolver
impl Move for ChainResolver
impl Send for ChainResolver
impl Sync for ChainResolver
impl Unpin for ChainResolver
impl UnsafeUnpin for ChainResolver
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