pub struct Connection<Upstream> { /* private fields */ }
Expand description
A connection that caches responses from an upstream connection.
Implementations§
source§impl<Upstream> Connection<Upstream>
impl<Upstream> Connection<Upstream>
sourcepub fn new(upstream: Upstream) -> Self
pub fn new(upstream: Upstream) -> Self
Create a new connection with default configuration parameters.
Note that Upstream needs to implement SendRequest (and Clone/Send/Sync) to be useful.
sourcepub fn with_config(upstream: Upstream, config: Config) -> Self
pub fn with_config(upstream: Upstream, config: Config) -> Self
Create a new connection with specified configuration parameters.
Note that Upstream needs to implement SendRequest (and Clone/Send/Sync) to be useful.
Trait Implementations§
source§impl<Upstream: Clone> Clone for Connection<Upstream>
impl<Upstream: Clone> Clone for Connection<Upstream>
source§fn clone(&self) -> Connection<Upstream>
fn clone(&self) -> Connection<Upstream>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<CR, Upstream> SendRequest<CR> for Connection<Upstream>where
CR: Clone + ComposeRequest + 'static,
Upstream: Clone + SendRequest<CR> + Send + Sync + 'static,
impl<CR, Upstream> SendRequest<CR> for Connection<Upstream>where
CR: Clone + ComposeRequest + 'static,
Upstream: Clone + SendRequest<CR> + Send + Sync + 'static,
source§fn send_request(&self, request_msg: CR) -> Box<dyn GetResponse + Send + Sync>
fn send_request(&self, request_msg: CR) -> Box<dyn GetResponse + Send + Sync>
Request function that takes a ComposeRequest type.
Auto Trait Implementations§
impl<Upstream> Freeze for Connection<Upstream>where
Upstream: Freeze,
impl<Upstream> !RefUnwindSafe for Connection<Upstream>
impl<Upstream> Send for Connection<Upstream>where
Upstream: Send,
impl<Upstream> Sync for Connection<Upstream>where
Upstream: Sync,
impl<Upstream> Unpin for Connection<Upstream>where
Upstream: Unpin,
impl<Upstream> !UnwindSafe for Connection<Upstream>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.