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§
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>
Sourceunsafe fn reuse_persistent_task_id(&self, id: Unused<TaskId>)
unsafe fn reuse_persistent_task_id(&self, id: Unused<TaskId>)
§Safety
The caller must ensure that the task id is not used anymore.
Sourceunsafe fn reuse_transient_task_id(&self, id: Unused<TaskId>)
unsafe fn reuse_transient_task_id(&self, id: Unused<TaskId>)
§Safety
The caller must ensure that the task id is not used anymore.
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>>>
Sourcefn schedule_notify_tasks(&self, tasks: &[TaskId])
fn schedule_notify_tasks(&self, tasks: &[TaskId])
Enqueues tasks for notification of changed dependencies. This will
eventually call invalidate_tasks()
on all tasks.
Sourcefn schedule_notify_tasks_set(&self, tasks: &TaskIdSet)
fn schedule_notify_tasks_set(&self, tasks: &TaskIdSet)
Enqueues tasks for notification of changed dependencies. This will
eventually call invalidate_tasks()
on all tasks.
Sourcefn program_duration_until(&self, instant: Instant) -> Duration
fn program_duration_until(&self, instant: Instant) -> Duration
Returns the duration from the start of the program to the given instant.
Sourcefn read_task_state_dyn(&self, func: &mut dyn FnMut(&B::TaskState))
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.
Sourcefn write_task_state_dyn(&self, func: &mut dyn FnMut(&mut B::TaskState))
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.