pub struct DispatchingResourceHandler { /* private fields */ }Expand description
A resource handler which dispatches reading among a list of inner handlers.
Implementations§
Source§impl DispatchingResourceHandler
impl DispatchingResourceHandler
Sourcepub fn new(handlers: Vec<Box<dyn ResourceUrlHandler>>) -> Self
pub fn new(handlers: Vec<Box<dyn ResourceUrlHandler>>) -> Self
Create a new handler wrapping all given handlers.
Trait Implementations§
Source§impl ResourceUrlHandler for DispatchingResourceHandler
impl ResourceUrlHandler for DispatchingResourceHandler
Source§fn read_resource(&self, url: &Url) -> Result<MimeData>
fn read_resource(&self, url: &Url) -> Result<MimeData>
Read from the given resource url.
Try every inner handler one after another, while handlers return an
ErrorKind::Unsupported IO error. For any other error abort and return the error.
Return the first different result, i.e. either data read or another error.
Auto Trait Implementations§
impl Freeze for DispatchingResourceHandler
impl !RefUnwindSafe for DispatchingResourceHandler
impl !Send for DispatchingResourceHandler
impl !Sync for DispatchingResourceHandler
impl Unpin for DispatchingResourceHandler
impl !UnwindSafe for DispatchingResourceHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more