[−][src]Trait tokio_resource_pool::Manage
A trait for managing the lifecycle of a resource.
Associated Types
type Resource: Send
type Dependencies: Dependencies
type CheckOut: From<CheckOut<Self>>
type Error
type CreateFuture: Future<Item = Self::Resource, Error = Self::Error>
type RecycleFuture: Future<Item = Option<Self::Resource>, Error = Self::Error>
Required methods
fn create(&self) -> Self::CreateFuture
Creates a new instance of the managed resource.
fn status(&self, resource: &Self::Resource) -> Status
fn recycle(&self, resource: Self::Resource) -> Self::RecycleFuture
Recycling a resource is done periodically to determine whether it is still valid and can be reused or if it is broken and must be discarded.