pub unsafe trait VcValueType:
ShrinkToFit
+ Sized
+ Send
+ Sync
+ 'static {
type Read: VcRead<Self>;
type CellMode: VcCellMode<Self>;
// Required methods
fn get_value_type_id() -> ValueTypeId;
fn has_serialization() -> bool;
}Expand description
A trait implemented on all values types that can be put into a value cell (Vc).
Custom traits for VcValueTypes should be subtraits of VcValueTrait.
You should not implement this trait directly, but instead use the
#[turbo_tasks::value] macro instead.
§Safety
The implementor of this trait must ensure that the read and cell mode implementations are
correct for the value type. Otherwise, it is possible to generate invalid reads, for instance by
using VcTransparentRead for a value type that is not
#[repr(transparent)].
Required Associated Types§
Required Methods§
Sourcefn get_value_type_id() -> ValueTypeId
fn get_value_type_id() -> ValueTypeId
Returns the type id of the value type.
fn has_serialization() -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.