Expand description
§Lease
This crate provides a Pool struct that allows taking Leasees and using them.
When a Lease is dropped it is automatically returned to the pool.
One nice thing about this api is that the lifetime of a Lease is not connected to the lifetime
of a Pool so they can be sent across threads.
There is also an InitPool that ensures that all new leases are created the same way
A LockedPool only allows calling functions that do not add or remove any Leases
§Features
async- Enables the
Pool::get()function. Async brings a little bit of overhead to getting leases so it is behind a feature. - Enables the
Pool::stream()function that allows getting a stream of leases as they become available
- Enables the
Re-exports§
pub use init::InitPool;
Modules§
- init
- This module contains an initializing pool
Structs§
- Async
Lease - Implements the
core::future::Futuretrait. - Lease
- Represents a lease from a
Pool - Locked
Pool - A pool of objects of type
Tthat can be leased out. - Pool
- A pool of objects of type
Tthat can be leased out. - Pool
Stream - Implements the
futures_core::Streamtrait to returnLeasees as they become available.
Enums§
- Pool
Conversion Error - A set of errors giving more context into why a
LockedPoolcouldn’t be created