pub struct Resolver<C: Cache> { /* private fields */ }Expand description
The resolver — composes a Cache with the host-side fetcher.
Implementations§
Source§impl<C: Cache> Resolver<C>
impl<C: Cache> Resolver<C>
pub fn new(cache: C) -> Self
pub fn timeout(self, t: Duration) -> Self
pub fn user_agent<S: Into<String>>(self, ua: S) -> Self
Sourcepub fn resolve(&mut self, url: &str) -> Result<Resolved, ResolveError>
pub fn resolve(&mut self, url: &str) -> Result<Resolved, ResolveError>
Parse a URL string + fetch (with cache hit if possible).
pub fn resolve_source( &mut self, source: &Source, ) -> Result<Resolved, ResolveError>
Auto Trait Implementations§
impl<C> Freeze for Resolver<C>where
C: Freeze,
impl<C> RefUnwindSafe for Resolver<C>where
C: RefUnwindSafe,
impl<C> Send for Resolver<C>where
C: Send,
impl<C> Sync for Resolver<C>where
C: Sync,
impl<C> Unpin for Resolver<C>where
C: Unpin,
impl<C> UnsafeUnpin for Resolver<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Resolver<C>where
C: UnwindSafe,
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