Skip to main content

TurboTasksBackend

Struct TurboTasksBackend 

Source
pub struct TurboTasksBackend { /* private fields */ }

Implementations§

Source§

impl TurboTasksBackend

Source

pub fn invalidate_storage(&self, reason_code: &str) -> Result<()>

Invalidates the persistent storage so that it will be deleted the next time a turbopack instance is created with the filesystem cache enabled.

reason_code should be one of the codes in crate::db_invalidation::invalidation_reasons.

Source

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

Trait Implementations§

Source§

impl Backend for TurboTasksBackend

Source§

type BackendJob = TurboTasksBackendJob

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn get_or_create_task( &self, native_fn: &'static NativeFunction, this: Option<RawVc>, arg: &mut dyn DynTaskInputsStorage, parent_task: Option<TaskId>, persistence: TaskPersistence, turbo_tasks: &TurboTasks<Self>, ) -> TaskId

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn try_start_task_execution( &self, task_id: TaskId, priority: TaskPriority, turbo_tasks: &TurboTasks<Self>, ) -> Option<TaskExecutionSpec<'_>>

Source§

fn task_execution_completed( &self, task_id: TaskId, result: Result<RawVc, TurboTasksExecutionError>, cell_counters: &AutoMap<ValueTypeId, u32, BuildHasherDefault<FxHasher>, 8>, has_invalidator: bool, turbo_tasks: &TurboTasks<Self>, ) -> Option<TaskPriority>

Called when a task’s execution finishes. Read more
Source§

fn run_backend_job<'a>( &'a self, job: Self::BackendJob, turbo_tasks: &'a TurboTasks<Self>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>

Source§

fn try_read_task_output( &self, task_id: TaskId, reader: Option<TaskId>, options: ReadOutputOptions, turbo_tasks: &TurboTasks<Self>, ) -> Result<Result<RawVc, EventListener>>

INVALIDATION: Be careful with this, when reader is None, 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: Option<TaskId>, options: ReadCellOptions, turbo_tasks: &TurboTasks<Self>, ) -> Result<Result<TypedCellContent, EventListener>>

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

fn try_read_own_task_cell( &self, task_id: TaskId, cell: CellId, turbo_tasks: &TurboTasks<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: Option<TaskId>, turbo_tasks: &TurboTasks<Self>, ) -> AutoMap<RawVc, i32, BuildHasherDefault<FxHasher>, 1>

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

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

Source§

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

Source§

fn update_task_cell( &self, task_id: TaskId, cell: CellId, content: CellContent, updated_key_hashes: Option<SmallVec<[u64; 2]>>, content_hash: Option<CellHash>, verification_mode: VerificationMode, turbo_tasks: &TurboTasks<Self>, )

Source§

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

Source§

fn connect_task( &self, task: TaskId, parent_task: Option<TaskId>, turbo_tasks: &TurboTasks<Self>, )

Source§

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

Source§

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

Source§

fn task_statistics(&self) -> &TaskStatisticsApi

Source§

fn is_tracking_dependencies(&self) -> bool

Source§

fn get_task_name(&self, task: TaskId, turbo_tasks: &TurboTasks<Self>) -> String

Returns a human-readable name for the given task. Used by error display formatting to lazily resolve task names instead of storing them eagerly in error objects.

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> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<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