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§
Required Methods§
Sourcefn data_values_are_copy() -> bool
fn data_values_are_copy() -> bool
Returns whether all values represented by this type are Copy
.
Sourcefn data_value_is_copy(&self) -> bool
fn data_value_is_copy(&self) -> bool
Returns whether the specific value for this type is Copy
.
Sourcefn data_value_default(&self) -> Option<Self::Value> ⓘ
fn data_value_default(&self) -> Option<Self::Value> ⓘ
Returns the default value for this type, or None
if not available.
Sourcefn data_value_align(&self) -> usize
fn data_value_align(&self) -> usize
Returns the alignment of the value represented by this type.
Sourcefn data_value_size(&self) -> usize
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.