pub struct ConnectionMeta {
pub created_at: Instant,
pub last_used: Instant,
pub is_broken: bool,
}Expand description
Metadata for a pooled connection — used for idle timeout and max lifetime.
Fields§
§created_at: InstantWhen this connection was created.
last_used: InstantWhen this connection was last returned to the pool.
is_broken: boolFlag set when an I/O error occurs — marks connection as broken.
Implementations§
Source§impl ConnectionMeta
impl ConnectionMeta
pub fn new() -> Self
Sourcepub fn is_idle_expired(&self, timeout: Duration) -> bool
pub fn is_idle_expired(&self, timeout: Duration) -> bool
Check if the connection has exceeded the idle timeout.
Sourcepub fn is_lifetime_expired(&self, max_lifetime: Duration) -> bool
pub fn is_lifetime_expired(&self, max_lifetime: Duration) -> bool
Check if the connection has exceeded its max lifetime.
Trait Implementations§
Source§impl Debug for ConnectionMeta
impl Debug for ConnectionMeta
Auto Trait Implementations§
impl Freeze for ConnectionMeta
impl RefUnwindSafe for ConnectionMeta
impl Send for ConnectionMeta
impl Sync for ConnectionMeta
impl Unpin for ConnectionMeta
impl UnsafeUnpin for ConnectionMeta
impl UnwindSafe for ConnectionMeta
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