devela::all

Trait DataType

Source
pub trait DataType: Copy + Debug {
    type Value: DataValue;

    // Required methods
    fn data_value_default(&self) -> Option<Self::Value> ;
    fn data_value_is_copy(&self) -> bool;
    fn data_value_align(&self) -> usize;
    fn data_value_size(&self) -> usize;
}
Expand description

Common trait for data types.

Allows extending DataType*With versions with custom types.

§See also

Required Associated Types§

Source

type Value: DataValue

The DataValue type that pairs with this DataType.

Required Methods§

Source

fn data_value_default(&self) -> Option<Self::Value>

Returns some default value corresponding to the current type.

Or returns None if the actual type doesn’t implement Default.

Source

fn data_value_is_copy(&self) -> bool

Returns true if the data represented by this type is Copy.

Source

fn data_value_align(&self) -> usize

Returns the alignment of the data represented by the current type.

Source

fn data_value_size(&self) -> usize

Returns the size of the data represented by this 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.

Implementors§