Trait BackingStorage

Source
pub trait BackingStorage: BackingStorageSealed {
    // Required method
    fn invalidate(&self, reason_code: &str) -> Result<()>;
}
Expand description

Represents types accepted by TurboTasksBackend::new. Typically this is the value returned by default_backing_storage or noop_backing_storage.

This trait is sealed. External crates are not allowed to implement it.

Required Methods§

Source

fn invalidate(&self, reason_code: &str) -> Result<()>

Called when the database should be invalidated upon re-initialization.

This typically means that we’ll restart the process or turbo-tasks soon with a fresh database. If this happens, there’s no point in writing anything else to disk, or flushing during KeyValueDatabase::shutdown.

This can be implemented by calling invalidate_db with the database’s non-versioned base path.

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<L, R> BackingStorage for Either<L, R>

Source§

fn invalidate(&self, reason_code: &str) -> Result<()>

Implementors§

Source§

impl<T: KeyValueDatabase + Send + Sync + 'static> BackingStorage for KeyValueDatabaseBackingStorage<T>