pub enum RawVc {
TaskOutput(TaskId),
TaskCell(TaskId, CellId),
LocalOutput(ExecutionId, LocalTaskId, TaskPersistence),
}
Expand description
A type-erased representation of Vc
.
Type erasure reduces the monomorphization (and therefore binary size and compilation time)
required to support Vc
.
This type is heavily used within the Backend
trait, but should
otherwise be treated as an internal implementation detail of turbo-tasks
.
Variants§
TaskOutput(TaskId)
The synchronous return value of a task (after argument resolution). This is the
representation used by OperationVc
.
TaskCell(TaskId, CellId)
A pointer to a specific Vc::cell
or .cell()
call within a task. This
is the representation used by ResolvedVc
.
CellId
contains the ValueTypeId
, which can be useful for efficient downcasting.
LocalOutput(ExecutionId, LocalTaskId, TaskPersistence)
The synchronous return value of a local task. This is created when a function is called
with unresolved arguments or more explicitly with
#[turbo_tasks::function(local)]
.
Local outputs are only valid within the context of their parent “non-local” task. Turbo
Task’s APIs are designed to prevent escapes of local [Vc
]s, but ExecutionId
is used
for a fallback runtime assertion.
Implementations§
Source§impl RawVc
impl RawVc
pub fn is_resolved(&self) -> bool
pub fn is_local(&self) -> bool
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns true
if the task this RawVc
reads from cannot be serialized and will not be
stored in the persistent cache.
See TaskPersistence
for more details.
pub fn try_get_task_id(&self) -> Option<TaskId>
pub fn try_get_type_id(&self) -> Option<ValueTypeId>
Trait Implementations§
Source§impl CollectiblesSource for RawVc
This implementation of CollectiblesSource
assumes that self
is a RawVc::TaskOutput
.
impl CollectiblesSource for RawVc
This implementation of CollectiblesSource
assumes that self
is a RawVc::TaskOutput
.
fn peek_collectibles<T: VcValueTrait + ?Sized>(self) -> AutoSet<ResolvedVc<T>>
fn take_collectibles<T: VcValueTrait + ?Sized>(self) -> AutoSet<ResolvedVc<T>>
Source§impl<'de> Deserialize<'de> for RawVc
impl<'de> Deserialize<'de> for RawVc
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<CurrentCellRef> for RawVc
impl From<CurrentCellRef> for RawVc
Source§fn from(cell: CurrentCellRef) -> Self
fn from(cell: CurrentCellRef) -> Self
Source§impl TraceRawVcs for RawVc
impl TraceRawVcs for RawVc
fn trace_raw_vcs(&self, trace_context: &mut TraceRawVcsContext)
fn get_raw_vcs(&self) -> Vec<RawVc>
impl Copy for RawVc
impl Eq for RawVc
impl StructuralPartialEq for RawVc
Auto Trait Implementations§
impl Freeze for RawVc
impl RefUnwindSafe for RawVc
impl Send for RawVc
impl Sync for RawVc
impl Unpin for RawVc
impl UnwindSafe for RawVc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynamicEqHash for T
impl<T> DynamicEqHash for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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>
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>
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