pub struct ValueType {
pub ty: RegistryType,
pub bincode: Option<(AnyEncodeFn, AnyDecodeFn<SharedReference>)>,
/* private fields */
}Expand description
A definition of a type of data.
Contains a list of traits and trait methods that are available on that type.
Fields§
§ty: RegistryType§bincode: Option<(AnyEncodeFn, AnyDecodeFn<SharedReference>)>Functions to convert to write the type to a buffer or read it from a buffer.
Implementations§
Source§impl ValueType
impl ValueType
Sourcepub const fn new<T: VcValueType>(global_name: &'static str) -> Self
pub const fn new<T: VcValueType>(global_name: &'static str) -> Self
This is internally used by #[turbo_tasks::value].
Sourcepub const fn new_with_bincode<T: VcValueType + Encode + Decode<()>>(
global_name: &'static str,
) -> Self
pub const fn new_with_bincode<T: VcValueType + Encode + Decode<()>>( global_name: &'static str, ) -> Self
This is internally used by #[turbo_tasks::value].
Sourcepub const fn new_with_bincode_wrappers<T: VcValueType, E: ManualEncodeWrapper<Value = T>, D: ManualDecodeWrapper<Value = T>>(
global_name: &'static str,
) -> Self
pub const fn new_with_bincode_wrappers<T: VcValueType, E: ManualEncodeWrapper<Value = T>, D: ManualDecodeWrapper<Value = T>>( global_name: &'static str, ) -> Self
This is used internally by turbo_tasks_macros::primitive to encode/decode foreign types
that cannot implement the bincode traits due to the orphan rules.
This is done by constructing wrapper types that implement the bincode traits on behalf of the wrapped type.
Sourcepub fn type_id(&self) -> TypeId
pub fn type_id(&self) -> TypeId
Returns the TypeId of the concrete type this ValueType represents.
pub fn get_trait_method( &self, trait_method: &'static TraitMethod, ) -> Option<&'static NativeFunction>
pub fn has_trait(&self, trait_type: &TraitTypeId) -> bool
Trait Implementations§
Source§impl Ord for ValueType
impl Ord for ValueType
Source§impl PartialOrd for ValueType
impl PartialOrd for ValueType
impl Collect for &'static ValueType
impl Eq for ValueType
Auto Trait Implementations§
impl !Freeze for ValueType
impl !RefUnwindSafe for ValueType
impl Send for ValueType
impl Sync for ValueType
impl Unpin for ValueType
impl UnsafeUnpin for ValueType
impl !UnwindSafe for ValueType
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
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> ⓘ
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.