Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks-backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ turbo-bincode = { workspace = true }
turbo-persistence = { workspace = true }
turbo-rcstr = { workspace = true }
turbo-tasks = { workspace = true }
turbo-tasks-macros = { workspace = true }

[dev-dependencies]
criterion = { workspace = true, features = ["async_tokio"] }
Expand Down
1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod dynamic_storage;
mod operation;
mod storage;
mod storage_schema;

use std::{
borrow::Cow,
Expand Down
1,016 changes: 1,016 additions & 0 deletions turbopack/crates/turbo-tasks-backend/src/backend/storage_schema.rs

Large diffs are not rendered by default.

27 changes: 26 additions & 1 deletion turbopack/crates/turbo-tasks-backend/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,51 @@ pub struct CellRef {
pub cell: CellId,
}

impl CellRef {
/// Returns true if this cell reference points to a transient task.
pub fn is_transient(&self) -> bool {
self.task.is_transient()
}
}

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Encode, Decode)]
pub struct CollectibleRef {
pub collectible_type: TraitTypeId,
pub cell: CellRef,
}

impl CollectibleRef {
/// Returns true if this collectible reference points to a transient task.
pub fn is_transient(&self) -> bool {
self.cell.is_transient()
}
}

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Encode, Decode)]
pub struct CollectiblesRef {
pub task: TaskId,
pub collectible_type: TraitTypeId,
}

impl CollectiblesRef {
/// Returns true if this collectibles reference points to a transient task.
pub fn is_transient(&self) -> bool {
self.task.is_transient()
}
}

#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)]
pub enum OutputValue {
Cell(CellRef),
Output(TaskId),
Error(TurboTasksExecutionError),
}
impl OutputValue {
fn is_transient(&self) -> bool {
/// Returns true if this output value references a transient task.
///
/// Transient values should not be persisted to disk since they reference
/// tasks that will not exist after restart.
pub fn is_transient(&self) -> bool {
match self {
OutputValue::Cell(cell) => cell.task.is_transient(),
OutputValue::Output(task) => task.is_transient(),
Expand Down
2 changes: 2 additions & 0 deletions turbopack/crates/turbo-tasks-macros/src/derive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mod key_value_pair_macro;
mod non_local_value_macro;
mod operation_value_macro;
mod task_input_macro;
mod task_storage_macro;
mod trace_raw_vcs_macro;
mod value_debug_format_macro;
mod value_debug_macro;
Expand All @@ -13,6 +14,7 @@ pub use non_local_value_macro::derive_non_local_value;
pub use operation_value_macro::derive_operation_value;
use syn::{Attribute, Meta, Token, punctuated::Punctuated, spanned::Spanned};
pub use task_input_macro::derive_task_input;
pub use task_storage_macro::derive_task_storage;
pub use trace_raw_vcs_macro::derive_trace_raw_vcs;
pub use value_debug_format_macro::derive_value_debug_format;
pub use value_debug_macro::derive_value_debug;
Expand Down
Loading
Loading