Skip to main content

TdmsStorageType

Trait TdmsStorageType 

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

Source

const SUPPORTED_TYPES: &'static [DataType]

The DataType that can be read as this storage type.

Source

const NATURAL_TYPE: DataType

The DataType that this storage type is naturally written as.

Provided Associated Constants§

Source

const SIZE_BYTES: usize = _

Size in bytes of the type.

Required Methods§

Source

fn read_le(reader: &mut impl Read) -> Result<Self, TdmsError>

Source

fn read_be(reader: &mut impl Read) -> Result<Self, TdmsError>

Source

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Write the value as little endian.

Source

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Write the value as big endian.

Source

fn size(&self) -> usize

Report the size of the type to allow for planning of writes.

Provided Methods§

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 TdmsStorageType for bool

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

const NATURAL_TYPE: DataType = DataType::Boolean

Source§

fn read_le(reader: &mut impl Read) -> Result<Self, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<Self, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for f32

Source§

const NATURAL_TYPE: DataType = DataType::SingleFloat

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<f32, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<f32, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for f64

Source§

const NATURAL_TYPE: DataType = DataType::DoubleFloat

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<f64, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<f64, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for i8

Source§

const NATURAL_TYPE: DataType = DataType::I8

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<i8, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<i8, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for i16

Source§

const NATURAL_TYPE: DataType = DataType::I16

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<i16, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<i16, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for i32

Source§

const NATURAL_TYPE: DataType = DataType::I32

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<i32, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<i32, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for i64

Source§

const NATURAL_TYPE: DataType = DataType::I64

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<i64, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<i64, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for u8

Source§

const NATURAL_TYPE: DataType = DataType::U8

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<u8, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<u8, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for u16

Source§

const NATURAL_TYPE: DataType = DataType::U16

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<u16, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<u16, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for u32

Source§

const NATURAL_TYPE: DataType = DataType::U32

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<u32, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<u32, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for u64

Source§

const NATURAL_TYPE: DataType = DataType::U64

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

fn read_le(reader: &mut impl Read) -> Result<u64, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<u64, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for String

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

const NATURAL_TYPE: DataType = DataType::TdmsString

Source§

fn read_le(reader: &mut impl Read) -> Result<Self, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<Self, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Source§

impl TdmsStorageType for LVTime

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

const NATURAL_TYPE: DataType = DataType::Timestamp

Source§

fn read_le(reader: &mut impl Read) -> Result<Self, TdmsError>

Source§

fn read_be(reader: &mut impl Read) -> Result<Self, TdmsError>

Source§

fn write_le(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn write_be(&self, writer: &mut impl Write) -> Result<(), TdmsError>

Source§

fn size(&self) -> usize

Implementors§

Source§

impl TdmsStorageType for Complex<f32>

Source§

const NATURAL_TYPE: DataType = DataType::ComplexSingleFloat

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

impl TdmsStorageType for Complex<f64>

Source§

const NATURAL_TYPE: DataType = DataType::ComplexDoubleFloat

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

impl TdmsStorageType for ExtendedRaw

Source§

const SUPPORTED_TYPES: &'static [DataType]

Source§

const NATURAL_TYPE: DataType = DataType::ExtendedFloat