pub struct Pool { /* private fields */ }Implementations§
Source§impl Pool
impl Pool
pub fn new(config: Config) -> Result<Self, Error>
pub fn next_event(&mut self) -> Option<Event>
pub fn total_count(&self) -> usize
pub fn idle_count(&self) -> usize
pub fn waiting_count(&self) -> usize
Sourcepub fn checkout(
&mut self,
token: u64,
now: Instant,
deadline: Option<Instant>,
) -> Result<(), Error>
pub fn checkout( &mut self, token: u64, now: Instant, deadline: Option<Instant>, ) -> Result<(), Error>
Accepted checkouts yield exactly one Acquired or CheckoutFailed event.
pub fn connected(&mut self, id: ConnectionId, now: Instant) -> Result<(), Error>
pub fn connect_failed( &mut self, id: ConnectionId, now: Instant, ) -> Result<(), Error>
pub fn checkin( &mut self, lease: Lease, now: Instant, destroy: bool, ) -> Result<(), Error>
pub fn closed(&mut self, id: ConnectionId, now: Instant) -> Result<(), Error>
Sourcepub fn connection_error(&mut self, id: ConnectionId) -> Result<(), Error>
pub fn connection_error(&mut self, id: ConnectionId) -> Result<(), Error>
Report a broken pooled connection. Any connecting request fails once.
pub fn next_timeout(&self) -> Option<Instant>
pub fn handle_timeout(&mut self, now: Instant)
Auto Trait Implementations§
impl Freeze for Pool
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
impl UnwindSafe for Pool
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