pub struct PoolEntry {
pub version: HttpVersion,
pub established_at: Instant,
pub last_used: Instant,
pub active_streams: u32,
pub max_streams: u32,
pub is_valid: bool,
}Expand description
Pool entry tracking connection state and stream usage
Fields§
§version: HttpVersion§established_at: Instant§last_used: Instant§active_streams: u32Number of active streams (for HTTP/2 and HTTP/3)
max_streams: u32Maximum concurrent streams (from SETTINGS for HTTP/2)
is_valid: boolConnection is still valid
Implementations§
Source§impl PoolEntry
impl PoolEntry
Sourcepub fn new(version: HttpVersion, max_streams: u32) -> Self
pub fn new(version: HttpVersion, max_streams: u32) -> Self
Create a new pool entry
Sourcepub fn can_multiplex(&self) -> bool
pub fn can_multiplex(&self) -> bool
Check if this connection can handle another multiplexed stream
Sourcepub fn acquire_stream(&mut self) -> bool
pub fn acquire_stream(&mut self) -> bool
Attempt to acquire a stream slot
Sourcepub fn release_stream(&mut self)
pub fn release_stream(&mut self)
Release a stream slot
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Mark connection as invalid (connection error, GOAWAY frame, etc.)
Sourcepub fn is_expired(&self, max_idle: Duration) -> bool
pub fn is_expired(&self, max_idle: Duration) -> bool
Check if connection is expired based on idle time
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PoolEntry
impl RefUnwindSafe for PoolEntry
impl Send for PoolEntry
impl Sync for PoolEntry
impl Unpin for PoolEntry
impl UnsafeUnpin for PoolEntry
impl UnwindSafe for PoolEntry
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§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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more