pub trait TdmsStorageType: Sized + 'static {
const SUPPORTED_TYPES: &'static [DataType];
const NATURAL_TYPE: DataType;
const SIZE_BYTES: usize = _;
// Required methods
fn read_le(reader: &mut impl Read) -> Result<Self, TdmsError>;
fn read_be(reader: &mut impl Read) -> Result<Self, TdmsError>;
fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>;
fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>;
fn size(&self) -> usize;
// Provided method
fn supports_data_type(data_type: &DataType) -> bool { ... }
}Required Associated Constants§
Sourceconst SUPPORTED_TYPES: &'static [DataType]
const SUPPORTED_TYPES: &'static [DataType]
The DataType that can be read as this storage type.
Sourceconst NATURAL_TYPE: DataType
const NATURAL_TYPE: DataType
The DataType that this storage type is naturally written as.
Provided Associated Constants§
Sourceconst SIZE_BYTES: usize = _
const SIZE_BYTES: usize = _
Size in bytes of the type.
Required Methods§
fn read_le(reader: &mut impl Read) -> Result<Self, TdmsError>
fn read_be(reader: &mut impl Read) -> Result<Self, TdmsError>
Sourcefn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>
fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>
Write the value as little endian.
Provided Methods§
fn supports_data_type(data_type: &DataType) -> 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.