Trait DataType

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

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

Common trait for enumerating 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_values_are_copy() -> bool

Returns whether all values represented by this type are Copy.

Source

fn data_value_is_copy(&self) -> bool

Returns whether the specific value for this type is Copy.

Source

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

Returns the default value for this type, or None if not available.

Source

fn data_value_align(&self) -> usize

Returns the alignment of the value represented by this type.

Source

fn data_value_size(&self) -> usize

Returns the size of the value 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§