pub struct PooledConnectionMeta {
pub id: u64,
pub state: PooledConnectionState,
pub created_at: Time,
pub last_used: Time,
pub requests_served: u64,
pub http_version: u8,
}Expand description
Metadata for a pooled connection.
Fields§
§id: u64Unique identifier for this connection.
state: PooledConnectionStateConnection state.
created_at: TimeWhen the connection was created.
last_used: TimeWhen the connection was last used.
requests_served: u64Number of requests served by this connection.
http_version: u8HTTP version (1 for HTTP/1.x, 2 for HTTP/2).
Implementations§
Source§impl PooledConnectionMeta
impl PooledConnectionMeta
Sourcepub fn mark_connected(&mut self, now: Time) -> bool
pub fn mark_connected(&mut self, now: Time) -> bool
Marks the connection as connected only if it is still connecting.
Returns true when the transition was applied.
Sourcepub fn mark_in_use(&mut self)
pub fn mark_in_use(&mut self)
Marks the connection as in use.
Sourcepub fn release(&mut self, now: Time) -> bool
pub fn release(&mut self, now: Time) -> bool
Returns the connection to idle only if it is currently checked out.
Returns true when the transition was applied.
Sourcepub fn mark_unhealthy(&mut self)
pub fn mark_unhealthy(&mut self)
Marks the connection as unhealthy.
Sourcepub fn is_expired(&self, now: Time, idle_timeout: Duration) -> bool
pub fn is_expired(&self, now: Time, idle_timeout: Duration) -> bool
Returns true if this connection has been idle longer than the timeout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PooledConnectionMeta
impl RefUnwindSafe for PooledConnectionMeta
impl Send for PooledConnectionMeta
impl Sync for PooledConnectionMeta
impl Unpin for PooledConnectionMeta
impl UnsafeUnpin for PooledConnectionMeta
impl UnwindSafe for PooledConnectionMeta
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).