[][src]Trait tokio_resource_pool::Manage

pub trait Manage: Sized {
    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>;
    fn create(&self) -> Self::CreateFuture;
fn status(&self, resource: &Self::Resource) -> Status;
fn recycle(&self, resource: Self::Resource) -> Self::RecycleFuture; }

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>

Loading content...

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.

Loading content...

Implementors

Loading content...