pub struct ValueType {
pub name: String,
/* 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§
§name: String
A readable name of the type
Implementations§
Source§impl ValueType
impl ValueType
Sourcepub fn new<T: VcValueType>() -> Self
pub fn new<T: VcValueType>() -> Self
This is internally used by #[turbo_tasks::value]
Sourcepub fn new_with_any_serialization<T: VcValueType + Any + Serialize + for<'de> Deserialize<'de>>() -> Self
pub fn new_with_any_serialization<T: VcValueType + Any + Serialize + for<'de> Deserialize<'de>>() -> Self
This is internally used by #[turbo_tasks::value]
pub fn magic_as_serializable<'a>( &self, arc: &'a Arc<dyn MagicAny>, ) -> Option<&'a dyn Serialize>
pub fn any_as_serializable<'a>( &self, arc: &'a Arc<dyn Any + Sync + Send>, ) -> Option<&'a dyn Serialize>
pub fn is_serializable(&self) -> bool
pub fn get_magic_deserialize_seed(&self) -> Option<MagicAnyDeserializeSeed>
pub fn get_any_deserialize_seed(&self) -> Option<AnyDeserializeSeed>
Sourcepub fn register_trait_method(
&mut self,
trait_type: TraitTypeId,
name: &str,
native_fn: &'static NativeFunction,
)
pub fn register_trait_method( &mut self, trait_type: TraitTypeId, name: &str, native_fn: &'static NativeFunction, )
This is internally used by #[turbo_tasks::value_impl]
pub fn get_trait_method( &self, trait_method: &'static TraitMethod, ) -> Option<&'static NativeFunction>
Sourcepub fn register_trait(&mut self, trait_type: TraitTypeId)
pub fn register_trait(&mut self, trait_type: TraitTypeId)
This is internally used by #[turbo_tasks::value_impl]
pub fn has_trait(&self, trait_type: &TraitTypeId) -> bool
pub fn traits_iter(&self) -> impl Iterator<Item = TraitTypeId> + '_
pub fn register( &'static self, global_name: &'static str, register_traits: impl FnOnce(ValueTypeId), )
Trait Implementations§
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 !UnwindSafe for ValueType
Blanket Implementations§
§impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
§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
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
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.