pub struct CachedTaskType {
pub native_fn: &'static NativeFunction,
pub this: Option<RawVc>,
pub arg: Box<dyn DynTaskInputs>,
}Expand description
A normal task execution containing a native (rust) function. This type is passed into the backend either to execute a function or to look up a cached result.
Fields§
§native_fn: &'static NativeFunction§this: Option<RawVc>§arg: Box<dyn DynTaskInputs>Implementations§
Source§impl CachedTaskType
impl CachedTaskType
Sourcepub fn get_name(&self) -> &'static str
pub fn get_name(&self) -> &'static str
Get the name of the function. Equivalent to the
Display/ToString::to_string implementation, but does not allocate a String.
Sourcepub fn hash_encode<H: DeterministicHasher>(&self, hasher: &mut H)
pub fn hash_encode<H: DeterministicHasher>(&self, hasher: &mut H)
Encodes this task type directly to a hasher, avoiding buffer allocation.
This uses the same encoding logic as TurboBincodeEncode but writes
directly to a DeterministicHasher instead of a buffer.
Source§impl CachedTaskType
impl CachedTaskType
Sourcepub fn hash_from_components(
hasher: &impl BuildHasher,
native_fn: &'static NativeFunction,
this: Option<RawVc>,
arg: &dyn DynTaskInputs,
) -> u64
pub fn hash_from_components( hasher: &impl BuildHasher, native_fn: &'static NativeFunction, this: Option<RawVc>, arg: &dyn DynTaskInputs, ) -> u64
Compute the hash of a task type from its individual components, matching the Hash impl. This avoids constructing a full CachedTaskType just to compute the hash.
Sourcepub fn hash_encode_components<H: DeterministicHasher>(
native_fn: &'static NativeFunction,
this: Option<RawVc>,
arg: &dyn DynTaskInputs,
hasher: &mut H,
)
pub fn hash_encode_components<H: DeterministicHasher>( native_fn: &'static NativeFunction, this: Option<RawVc>, arg: &dyn DynTaskInputs, hasher: &mut H, )
Compute the deterministic hash for backing storage from components.
This mirrors the logic in CachedTaskType::hash_encode but works with
borrowed components, avoiding the need to construct a full CachedTaskType.
Sourcepub fn eq_components(
&self,
native_fn: &'static NativeFunction,
this: Option<RawVc>,
arg: &dyn DynTaskInputs,
) -> bool
pub fn eq_components( &self, native_fn: &'static NativeFunction, this: Option<RawVc>, arg: &dyn DynTaskInputs, ) -> bool
Check equality of components against this CachedTaskType.
Trait Implementations§
Source§impl AsRef<CachedTaskType> for CachedTaskTypeArc
impl AsRef<CachedTaskType> for CachedTaskTypeArc
Source§fn as_ref(&self) -> &CachedTaskType
fn as_ref(&self) -> &CachedTaskType
Source§impl Borrow<CachedTaskType> for CachedTaskTypeArc
impl Borrow<CachedTaskType> for CachedTaskTypeArc
Source§fn borrow(&self) -> &CachedTaskType
fn borrow(&self) -> &CachedTaskType
Source§impl<'de, __Context> BorrowDecode<'de, __Context> for CachedTaskType
impl<'de, __Context> BorrowDecode<'de, __Context> for CachedTaskType
Source§fn borrow_decode<D: BorrowDecoder<'de, Context = __Context>>(
decoder: &mut D,
) -> Result<Self, DecodeError>
fn borrow_decode<D: BorrowDecoder<'de, Context = __Context>>( decoder: &mut D, ) -> Result<Self, DecodeError>
Source§impl Debug for CachedTaskType
impl Debug for CachedTaskType
Source§impl<Context> Decode<Context> for CachedTaskType
impl<Context> Decode<Context> for CachedTaskType
Source§impl Display for CachedTaskType
impl Display for CachedTaskType
Source§impl Encode for CachedTaskType
impl Encode for CachedTaskType
Source§impl Hash for CachedTaskType
impl Hash for CachedTaskType
Source§impl PartialEq for CachedTaskType
impl PartialEq for CachedTaskType
Source§impl<Context> TurboBincodeDecode<Context> for CachedTaskType
impl<Context> TurboBincodeDecode<Context> for CachedTaskType
fn decode(decoder: &mut TurboBincodeDecoder<'_>) -> Result<Self, DecodeError>
Source§impl TurboBincodeEncode for CachedTaskType
impl TurboBincodeEncode for CachedTaskType
fn encode( &self, encoder: &mut TurboBincodeEncoder<'_>, ) -> Result<(), EncodeError>
impl Eq for CachedTaskType
Auto Trait Implementations§
impl Freeze for CachedTaskType
impl !RefUnwindSafe for CachedTaskType
impl Send for CachedTaskType
impl Sync for CachedTaskType
impl Unpin for CachedTaskType
impl UnsafeUnpin for CachedTaskType
impl !UnwindSafe for CachedTaskType
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> DynPartialEq for T
impl<T> DynPartialEq for T
fn dyn_partial_eq(&self, other: &(dyn Any + 'static)) -> 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
§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<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<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