Trait Backend

Source
pub trait Backend: Send + Sync {
    // Required methods
    fn lock_exclusive(&self) -> Result<Box<dyn Lock>>;
    fn lock_shared(&self) -> Result<Box<dyn Lock>>;
    fn new_thread(&self) -> Result<Box<dyn BackendThread>>;
}
Expand description

Backend API

Backend is thread-safe, and the actual work is implemented by per-thread instances of it.

Required Methods§

Source

fn lock_exclusive(&self) -> Result<Box<dyn Lock>>

Lock the repository exclusively

Use to protect operations that are potentially destructive, like GC.

Source

fn lock_shared(&self) -> Result<Box<dyn Lock>>

Lock the repository in shared mode

This will only prevent anyone from grabing exclusive lock. Use to protect operations that only add new data, like write.

Source

fn new_thread(&self) -> Result<Box<dyn BackendThread>>

Spawn a new thread object of the backend.

Implementors§