Trait VcValueType

Source
pub unsafe trait VcValueType:
    ShrinkToFit
    + Sized
    + Send
    + Sync
    + 'static {
    type Read: VcRead<Self>;
    type CellMode: VcCellMode<Self>;

    // Required method
    fn get_value_type_id() -> ValueTypeId;
}
Expand description

A trait implemented on all values types that can be put into a Value Cell (Vc<T>).

§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§

Source

type Read: VcRead<Self>

How to read the value.

Source

type CellMode: VcCellMode<Self>

How to update cells of this value type.

Required Methods§

Source

fn get_value_type_id() -> ValueTypeId

Returns the type id of the value type.

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.

Implementations on Foreign Types§

Source§

impl VcValueType for Option<u16>

Source§

impl VcValueType for Option<u64>

Source§

impl VcValueType for Option<RcStr>

Source§

impl VcValueType for Option<String>

Source§

impl VcValueType for Value

Source§

impl VcValueType for bool

Source§

impl VcValueType for i8

Source§

impl VcValueType for i16

Source§

impl VcValueType for i32

Source§

impl VcValueType for i64

Source§

impl VcValueType for i128

Source§

impl VcValueType for isize

Source§

impl VcValueType for u8

Source§

impl VcValueType for u16

Source§

impl VcValueType for u32

Source§

impl VcValueType for u64

Source§

impl VcValueType for u128

Source§

impl VcValueType for ()

Source§

impl VcValueType for usize

Source§

impl VcValueType for RcStr

Source§

impl VcValueType for String

Source§

impl VcValueType for Vec<bool>

Source§

impl VcValueType for Vec<u8>

Source§

impl VcValueType for Vec<RcStr>

Source§

impl VcValueType for Duration

Implementors§