Trait Resource

Source
pub trait Resource {
    type Output;
    type Error;

    // Required method
    fn try_create(&self) -> Result<Self::Output, Self::Error>;
}
Expand description

A factory which produces a resource for use with ResourcePool.

Required Associated Types§

Source

type Output

The type of the resource to be produced.

Source

type Error

An error type.

Required Methods§

Source

fn try_create(&self) -> Result<Self::Output, Self::Error>

Constructor for the resource.

Implementors§