Struct TurboTasksBackend

Source
pub struct TurboTasksBackend<B: BackingStorage>(/* private fields */);

Implementations§

Source§

impl<B: BackingStorage> TurboTasksBackend<B>

Source

pub fn new(options: BackendOptions, backing_storage: B) -> Self

Trait Implementations§

Source§

impl<B: BackingStorage> Backend for TurboTasksBackend<B>

Source§

type TaskState = ()

Task-local state that stored inside of TurboTasksBackendApi. Constructed with Self::new_task_state. Read more
Source§

fn startup(&self, turbo_tasks: &dyn TurboTasksBackendApi<Self>)

Source§

fn stopping(&self, _turbo_tasks: &dyn TurboTasksBackendApi<Self>)

Source§

fn stop(&self, turbo_tasks: &dyn TurboTasksBackendApi<Self>)

Source§

fn idle_start(&self, turbo_tasks: &dyn TurboTasksBackendApi<Self>)

Source§

fn idle_end(&self, _turbo_tasks: &dyn TurboTasksBackendApi<Self>)

Source§

fn get_or_create_persistent_task( &self, task_type: CachedTaskType, parent_task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> TaskId

Source§

fn get_or_create_transient_task( &self, task_type: CachedTaskType, parent_task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> TaskId

Source§

fn invalidate_task( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn invalidate_tasks( &self, tasks: &[TaskId], turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn invalidate_tasks_set( &self, tasks: &AutoSet<TaskId, BuildHasherDefault<FxHasher>, 2>, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn invalidate_serialization( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn get_task_description(&self, task: TaskId) -> String

Source§

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

Constructs a new task-local Self::TaskState for the given task_id. Read more
Source§

fn task_execution_canceled( &self, task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn try_start_task_execution( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> Option<TaskExecutionSpec<'_>>

Source§

fn task_execution_result( &self, task_id: TaskId, result: Result<RawVc, Arc<TurboTasksExecutionError>>, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

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

Source§

fn run_backend_job<'a>( &'a self, id: BackendJobId, turbo_tasks: &'a dyn TurboTasksBackendApi<Self>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>

Source§

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>>

INVALIDATION: Be careful with this, it will not track dependencies, so using it could break cache invalidation.
Source§

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>>

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>

INVALIDATION: Be careful with this, it will not track dependencies, so using it could break cache invalidation.
Source§

fn read_task_collectibles( &self, task_id: TaskId, collectible_type: TraitTypeId, reader: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> AutoMap<RawVc, i32, BuildHasherDefault<FxHasher>, 1>

Source§

fn emit_collectible( &self, collectible_type: TraitTypeId, collectible: RawVc, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn unemit_collectible( &self, collectible_type: TraitTypeId, collectible: RawVc, count: u32, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn update_task_cell( &self, task_id: TaskId, cell: CellId, content: CellContent, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn mark_own_task_as_finished( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn set_own_task_aggregation_number( &self, task: TaskId, aggregation_number: u32, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn mark_own_task_as_session_dependent( &self, task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn connect_task( &self, task: TaskId, parent_task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn create_transient_task( &self, task_type: TransientTaskType, _turbo_tasks: &dyn TurboTasksBackendApi<Self>, ) -> TaskId

Source§

fn dispose_root_task( &self, task_id: TaskId, turbo_tasks: &dyn TurboTasksBackendApi<Self>, )

Source§

fn task_statistics(&self) -> &TaskStatisticsApi

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn get_type_id(&self) -> TypeId

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more