pub struct Builder<Ev> { /* private fields */ }Available on crate feature
client and crate feature client-pool and docsrs only.Expand description
A builder to configure a Cache.
§Unnameable
This type is normally unnameable, forbidding naming of the type within code. The type is exposed in the documentation to show which methods can be publicly called.
Implementations§
Source§impl<Ev> Builder<Ev>
impl<Ev> Builder<Ev>
Sourcepub fn executor<E>(self, exec: E) -> Builder<WithExecutor<E>>
pub fn executor<E>(self, exec: E) -> Builder<WithExecutor<E>>
Provide a Future executor to be used by the Cache.
The executor is used handle some optional background tasks that can improve the behavior of the cache, such as reducing connection thrashing when a race is won. If not configured with an executor, the default behavior is to ignore any of these optional background tasks.
The executor should implmenent hyper::rt::Executor.
§Example
let builder = hyper_util::client::pool::cache::builder()
.executor(hyper_util::rt::TokioExecutor::new());Trait Implementations§
Auto Trait Implementations§
impl<Ev> Freeze for Builder<Ev>where
Ev: Freeze,
impl<Ev> RefUnwindSafe for Builder<Ev>where
Ev: RefUnwindSafe,
impl<Ev> Send for Builder<Ev>where
Ev: Send,
impl<Ev> Sync for Builder<Ev>where
Ev: Sync,
impl<Ev> Unpin for Builder<Ev>where
Ev: Unpin,
impl<Ev> UnwindSafe for Builder<Ev>where
Ev: 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