Skip to main content

ClosableKvBackend

Trait ClosableKvBackend 

Source
pub trait ClosableKvBackend: KvBackend<Error = Error> {
    // Required method
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A KvBackend holding resources that must be released explicitly on shutdown, because components sharing it may keep it alive until the process exits.

Wrappers of a closable backend must forward ClosableKvBackend::close to it.

Required Methods§

Source

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Releases the backend’s resources; any later use fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§