pub struct TurboTasksBackend<B: BackingStorage>(/* private fields */);
Implementations§
Source§impl<B: BackingStorage> TurboTasksBackend<B>
impl<B: BackingStorage> TurboTasksBackend<B>
pub fn new(options: BackendOptions, backing_storage: B) -> Self
Trait Implementations§
Source§impl<B: BackingStorage> Backend for TurboTasksBackend<B>
impl<B: BackingStorage> Backend for TurboTasksBackend<B>
Source§type TaskState = ()
type TaskState = ()
Task-local state that stored inside of
TurboTasksBackendApi
. Constructed with
Self::new_task_state
. Read morefn startup(&self, turbo_tasks: &dyn TurboTasksBackendApi<Self>)
fn stopping(&self, _turbo_tasks: &dyn TurboTasksBackendApi<Self>)
fn stop(&self, turbo_tasks: &dyn TurboTasksBackendApi<Self>)
fn idle_start(&self, turbo_tasks: &dyn TurboTasksBackendApi<Self>)
fn idle_end(&self, _turbo_tasks: &dyn TurboTasksBackendApi<Self>)
fn get_or_create_persistent_task( &self, task_type: CachedTaskType, parent_task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> TaskId
fn get_or_create_transient_task( &self, task_type: CachedTaskType, parent_task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> TaskId
fn invalidate_task( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn invalidate_tasks( &self, tasks: &[TaskId], turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn invalidate_tasks_set( &self, tasks: &AutoSet<TaskId, BuildHasherDefault<FxHasher>, 2>, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn invalidate_serialization( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn get_task_description(&self, task: TaskId) -> String
Source§fn try_get_function_id(&self, task_id: TaskId) -> Option<FunctionId>
fn try_get_function_id(&self, task_id: TaskId) -> Option<FunctionId>
For persistent tasks with associated
[
NativeFunction
][crate::native_function::NativeFunction]s, return the FunctionId
.Source§fn new_task_state(&self, _task: TaskId) -> Self::TaskState
fn new_task_state(&self, _task: TaskId) -> Self::TaskState
fn task_execution_canceled( &self, task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn try_start_task_execution( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> Option<TaskExecutionSpec<'_>>
fn task_execution_result( &self, task_id: TaskId, result: Result<RawVc, Arc<TurboTasksExecutionError>>, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn task_execution_completed( &self, task_id: TaskId, _duration: Duration, _memory_usage: usize, cell_counters: &AutoMap<ValueTypeId, u32, BuildHasherDefault<FxHasher>, 8>, stateful: bool, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> bool
fn run_backend_job<'a>( &'a self, id: BackendJobId, turbo_tasks: &'a dyn TurboTasksBackendApi<Self>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
fn try_read_task_output( &self, task_id: TaskId, reader: TaskId, consistency: ReadConsistency, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> Result<Result<RawVc, EventListener>>
Source§fn try_read_task_output_untracked(
&self,
task_id: TaskId,
consistency: ReadConsistency,
turbo_tasks: &dyn TurboTasksBackendApi<Self>,
) -> Result<Result<RawVc, EventListener>>
fn try_read_task_output_untracked( &self, task_id: TaskId, consistency: ReadConsistency, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> Result<Result<RawVc, EventListener>>
INVALIDATION: Be careful with this, it will not track dependencies, so
using it could break cache invalidation.
fn try_read_task_cell( &self, task_id: TaskId, cell: CellId, reader: TaskId, options: ReadCellOptions, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> Result<Result<TypedCellContent, EventListener>>
Source§fn try_read_task_cell_untracked(
&self,
task_id: TaskId,
cell: CellId,
options: ReadCellOptions,
turbo_tasks: &dyn TurboTasksBackendApi<Self>,
) -> Result<Result<TypedCellContent, EventListener>>
fn try_read_task_cell_untracked( &self, task_id: TaskId, cell: CellId, options: ReadCellOptions, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> Result<Result<TypedCellContent, EventListener>>
INVALIDATION: Be careful with this, it will not track dependencies, so
using it could break cache invalidation.
Source§fn try_read_own_task_cell_untracked(
&self,
task_id: TaskId,
cell: CellId,
options: ReadCellOptions,
turbo_tasks: &dyn TurboTasksBackendApi<Self>,
) -> Result<TypedCellContent>
fn try_read_own_task_cell_untracked( &self, task_id: TaskId, cell: CellId, options: ReadCellOptions, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> Result<TypedCellContent>
INVALIDATION: Be careful with this, it will not track dependencies, so
using it could break cache invalidation.
fn read_task_collectibles( &self, task_id: TaskId, collectible_type: TraitTypeId, reader: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> AutoMap<RawVc, i32, BuildHasherDefault<FxHasher>, 1>
fn emit_collectible( &self, collectible_type: TraitTypeId, collectible: RawVc, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn unemit_collectible( &self, collectible_type: TraitTypeId, collectible: RawVc, count: u32, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn update_task_cell( &self, task_id: TaskId, cell: CellId, content: CellContent, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn mark_own_task_as_finished( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn set_own_task_aggregation_number( &self, task: TaskId, aggregation_number: u32, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn mark_own_task_as_session_dependent( &self, task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn connect_task( &self, task: TaskId, parent_task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn create_transient_task( &self, task_type: TransientTaskType, _turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> TaskId
fn dispose_root_task( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )
fn task_statistics(&self) -> &TaskStatisticsApi
Auto Trait Implementations§
impl<B> Freeze for TurboTasksBackend<B>
impl<B> !RefUnwindSafe for TurboTasksBackend<B>
impl<B> Send for TurboTasksBackend<B>
impl<B> Sync for TurboTasksBackend<B>
impl<B> Unpin for TurboTasksBackend<B>
impl<B> !UnwindSafe for TurboTasksBackend<B>
Blanket Implementations§
§impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more