Releasable

Trait Releasable 

Source
pub trait Releasable {
    type Context<'a>;

    // Required method
    fn release<'a>(self, c: Self::Context<'a>);
}
Expand description

The base trait for explicit ownership. Any Releasable object must call release before being dropped.

Required Associated Types§

Source

type Context<'a>

Required Methods§

Source

fn release<'a>(self, c: Self::Context<'a>)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Releasable> Releasable for Option<T>

Releasing an option calls release if the option is not empty.

Source§

type Context<'a> = <T as Releasable>::Context<'a>

Source§

fn release<'a>(self, c: Self::Context<'a>)

Source§

impl<T: Releasable> Releasable for Vec<T>
where for<'a> T::Context<'a>: Clone,

Releasing a vec calls release on each element

Source§

type Context<'a> = <T as Releasable>::Context<'a>

Source§

fn release<'a>(self, c: Self::Context<'a>)

Source§

impl<T: Releasable, E> Releasable for Result<T, E>

Releasing a result calls release on the value if the result is ok.

Source§

type Context<'a> = <T as Releasable>::Context<'a>

Source§

fn release<'a>(self, c: Self::Context<'a>)

Implementors§