pub enum DataType {
Show 18 variants
UnsignedIntegerLE,
UnsignedIntegerBE,
SignedIntegerLE,
SignedIntegerBE,
FloatLE,
FloatBE,
StringLatin1,
StringUtf8,
StringUtf16LE,
StringUtf16BE,
ByteArray,
MimeSample,
MimeStream,
CanOpenDate,
CanOpenTime,
ComplexLE,
ComplexBE,
Unknown(()),
}Variants§
UnsignedIntegerLE
UnsignedIntegerBE
SignedIntegerLE
SignedIntegerBE
FloatLE
FloatBE
StringLatin1
StringUtf8
StringUtf16LE
StringUtf16BE
ByteArray
MimeSample
MimeStream
CanOpenDate
CanOpenTime
ComplexLE
ComplexBE
Unknown(())
Implementations§
Source§impl DataType
impl DataType
Sourcepub fn to_u8(&self) -> u8
pub fn to_u8(&self) -> u8
Converts the DataType enum value to its corresponding u8 representation according to the MDF 4.1 specification.
§Returns
The u8 value corresponding to this DataType
§Note
For ComplexLE, ComplexBE, and Unknown variants, we use values that match the MDF 4.1 specification (15, 16) or a default (0) for Unknown.
Sourcepub fn from_u8(value: u8) -> Self
pub fn from_u8(value: u8) -> Self
Convert a numeric representation to the corresponding DataType.
Values outside the known range yield DataType::Unknown.
Sourcepub fn default_bits(&self) -> u32
pub fn default_bits(&self) -> u32
Returns a typical bit width for this data type. This is used when creating channels without an explicit bit count.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataType
impl<'de> Deserialize<'de> for DataType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for DataType
impl Eq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more