pub struct SendRequestWrapper {
inner: Option<SendRequest>,
instant: Instant,
}Expand description
A wrapper around SendRequest, with idle keep-alive timeout support.
Fields§
§inner: Option<SendRequest>§instant: InstantImplementations§
Source§impl SendRequestWrapper
impl SendRequestWrapper
Sourcepub fn new(inner: SendRequest) -> Self
pub fn new(inner: SendRequest) -> Self
Creates a new SendRequestWrapper
Sourcepub fn get(&mut self, timeout: Option<Duration>) -> (Option<SendRequest>, bool)
pub fn get(&mut self, timeout: Option<Duration>) -> (Option<SendRequest>, bool)
Gets the inner SendRequest, along with information on whether to put back the connection to the pool.
Sourcepub async fn wait_ready(&mut self, timeout: Option<Duration>) -> bool
pub async fn wait_ready(&mut self, timeout: Option<Duration>) -> bool
Waits until the inner SendRequest is ready. Return information on whether to put back the connection to the pool.
Auto Trait Implementations§
impl Freeze for SendRequestWrapper
impl !RefUnwindSafe for SendRequestWrapper
impl Send for SendRequestWrapper
impl Sync for SendRequestWrapper
impl Unpin for SendRequestWrapper
impl !UnwindSafe for SendRequestWrapper
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