Trait TurboTasksBackendApi

Source
pub trait TurboTasksBackendApi<B: Backend + 'static>:
    TurboTasksCallApi
    + Sync
    + Send {
Show 17 methods // Required methods fn pin(&self) -> Arc<dyn TurboTasksBackendApi<B>>; fn get_fresh_persistent_task_id(&self) -> Unused<TaskId>; fn get_fresh_transient_task_id(&self) -> Unused<TaskId>; unsafe fn reuse_persistent_task_id(&self, id: Unused<TaskId>); unsafe fn reuse_transient_task_id(&self, id: Unused<TaskId>); fn schedule(&self, task: TaskId); fn schedule_backend_background_job(&self, id: BackendJobId); fn schedule_backend_foreground_job(&self, id: BackendJobId); fn try_foreground_done(&self) -> Result<(), EventListener>; fn wait_foreground_done_excluding_own<'a>( &'a self, ) -> Option<Pin<Box<dyn Future<Output = ()> + Send + 'a>>>; fn schedule_notify_tasks(&self, tasks: &[TaskId]); fn schedule_notify_tasks_set(&self, tasks: &TaskIdSet); fn program_duration_until(&self, instant: Instant) -> Duration; fn read_task_state_dyn(&self, func: &mut dyn FnMut(&B::TaskState)); fn write_task_state_dyn(&self, func: &mut dyn FnMut(&mut B::TaskState)); fn is_idle(&self) -> bool; fn backend(&self) -> &B;
}
Expand description

A subset of the TurboTasks API that’s exposed to Backend implementations.

Required Methods§

Source

fn pin(&self) -> Arc<dyn TurboTasksBackendApi<B>>

Source

fn get_fresh_persistent_task_id(&self) -> Unused<TaskId>

Source

fn get_fresh_transient_task_id(&self) -> Unused<TaskId>

Source

unsafe fn reuse_persistent_task_id(&self, id: Unused<TaskId>)

§Safety

The caller must ensure that the task id is not used anymore.

Source

unsafe fn reuse_transient_task_id(&self, id: Unused<TaskId>)

§Safety

The caller must ensure that the task id is not used anymore.

Source

fn schedule(&self, task: TaskId)

Source

fn schedule_backend_background_job(&self, id: BackendJobId)

Source

fn schedule_backend_foreground_job(&self, id: BackendJobId)

Source

fn try_foreground_done(&self) -> Result<(), EventListener>

Source

fn wait_foreground_done_excluding_own<'a>( &'a self, ) -> Option<Pin<Box<dyn Future<Output = ()> + Send + 'a>>>

Source

fn schedule_notify_tasks(&self, tasks: &[TaskId])

Enqueues tasks for notification of changed dependencies. This will eventually call invalidate_tasks() on all tasks.

Source

fn schedule_notify_tasks_set(&self, tasks: &TaskIdSet)

Enqueues tasks for notification of changed dependencies. This will eventually call invalidate_tasks() on all tasks.

Source

fn program_duration_until(&self, instant: Instant) -> Duration

Returns the duration from the start of the program to the given instant.

Source

fn read_task_state_dyn(&self, func: &mut dyn FnMut(&B::TaskState))

An untyped object-safe version of TurboTasksBackendApiExt::read_task_state. Callers should prefer the extension trait’s version of this method.

Source

fn write_task_state_dyn(&self, func: &mut dyn FnMut(&mut B::TaskState))

An untyped object-safe version of TurboTasksBackendApiExt::write_task_state. Callers should prefer the extension trait’s version of this method.

Source

fn is_idle(&self) -> bool

Returns true if the system is idle.

Source

fn backend(&self) -> &B

Returns a reference to the backend.

Implementors§

Source§

impl<B: Backend + 'static> TurboTasksBackendApi<B> for TurboTasks<B>