TurboTasksBackendApi

Trait TurboTasksBackendApi 

Source
pub trait TurboTasksBackendApi<B: Backend + 'static>:
    TurboTasksCallApi
    + Sync
    + Send {
    // 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_foreground_job(&self, job: B::BackendJob);
    fn schedule_backend_background_job(&self, job: B::BackendJob);
    fn program_duration_until(&self, instant: Instant) -> Duration;
    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)

Schedule a task for execution.

Source

fn schedule_backend_foreground_job(&self, job: B::BackendJob)

Schedule a foreground backend job for execution.

Source

fn schedule_backend_background_job(&self, job: B::BackendJob)

Schedule a background backend job for execution.

Background jobs are not counted towards activeness of the system. The system is considered idle even with active background jobs.

Source

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

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

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>