Trait TurboTasksBackendApiExt

Source
pub trait TurboTasksBackendApiExt<B: Backend + 'static>: TurboTasksBackendApi<B> {
    // Provided methods
    fn read_task_state<T>(&self, func: impl FnOnce(&B::TaskState) -> T) -> T { ... }
    fn write_task_state<T>(
        &self,
        func: impl FnOnce(&mut B::TaskState) -> T,
    ) -> T { ... }
}
Expand description

An extension trait for methods of TurboTasksBackendApi that are not object-safe. This is automatically implemented for all TurboTasksBackendApis using a blanket impl.

Provided Methods§

Source

fn read_task_state<T>(&self, func: impl FnOnce(&B::TaskState) -> T) -> T

Allows modification of the Backend::TaskState.

This function holds open a non-exclusive read lock that blocks writes, so func is expected to execute quickly in order to release the lock.

Source

fn write_task_state<T>(&self, func: impl FnOnce(&mut B::TaskState) -> T) -> T

Allows modification of the Backend::TaskState.

This function holds open a write lock, so func is expected to execute quickly in order to release the lock.

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.

Implementors§

Source§

impl<TT, B> TurboTasksBackendApiExt<B> for TT
where TT: TurboTasksBackendApi<B> + ?Sized, B: Backend + 'static,