pub struct TurboTasksBackend { /* private fields */ }Implementations§
Source§impl TurboTasksBackend
impl TurboTasksBackend
Sourcepub fn invalidate_storage(&self, reason_code: &str) -> Result<()>
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.
pub fn new( options: BackendOptions, backing_storage: TurboBackingStorage, ) -> Self
Trait Implementations§
Source§impl Backend for TurboTasksBackend
impl Backend for TurboTasksBackend
type BackendJob = TurboTasksBackendJob
fn startup(&self, turbo_tasks: &TurboTasks<Self>)
fn stopping(&self, _turbo_tasks: &TurboTasks<Self>)
fn stop(&self, turbo_tasks: &TurboTasks<Self>)
fn idle_start(&self, turbo_tasks: &TurboTasks<Self>)
fn idle_end(&self, _turbo_tasks: &TurboTasks<Self>)
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
fn invalidate_task(&self, task_id: TaskId, turbo_tasks: &TurboTasks<Self>)
fn invalidate_tasks(&self, tasks: &[TaskId], turbo_tasks: &TurboTasks<Self>)
fn invalidate_tasks_set( &self, tasks: &AutoSet<TaskId, BuildHasherDefault<FxHasher>, 2>, turbo_tasks: &TurboTasks<Self>, )
fn invalidate_serialization( &self, task_id: TaskId, turbo_tasks: &TurboTasks<Self>, )
fn task_execution_canceled(&self, task: TaskId, turbo_tasks: &TurboTasks<Self>)
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>
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
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>>
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>>
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>
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>
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.
fn emit_collectible( &self, collectible_type: TraitTypeId, collectible: RawVc, task_id: TaskId, turbo_tasks: &TurboTasks<Self>, )
fn unemit_collectible( &self, collectible_type: TraitTypeId, collectible: RawVc, count: u32, task_id: TaskId, turbo_tasks: &TurboTasks<Self>, )
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>, )
fn mark_own_task_as_finished( &self, task_id: TaskId, turbo_tasks: &TurboTasks<Self>, )
fn connect_task( &self, task: TaskId, parent_task: Option<TaskId>, turbo_tasks: &TurboTasks<Self>, )
fn create_transient_task( &self, task_type: TransientTaskType, _turbo_tasks: &TurboTasks<Self>, ) -> TaskId
fn dispose_root_task(&self, task_id: TaskId, turbo_tasks: &TurboTasks<Self>)
fn task_statistics(&self) -> &TaskStatisticsApi
fn is_tracking_dependencies(&self) -> bool
Source§fn get_task_name(&self, task: TaskId, turbo_tasks: &TurboTasks<Self>) -> String
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§
impl !Freeze for TurboTasksBackend
impl !RefUnwindSafe for TurboTasksBackend
impl Send for TurboTasksBackend
impl Sync for TurboTasksBackend
impl Unpin for TurboTasksBackend
impl UnsafeUnpin for TurboTasksBackend
impl !UnwindSafe for TurboTasksBackend
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.