Struct dlt_core::dlt::TypeInfo

source ·
pub struct TypeInfo {
    pub kind: TypeInfoKind,
    pub coding: StringCoding,
    pub has_variable_info: bool,
    pub has_trace_info: bool,
}
Expand description

The Type Info contains meta data about the data payload.

TypeInfo is a 32 bit field. It is encoded the following way:

    * Bit 0-3   Type Length (TYLE)
    * Bit 4     Type Bool (BOOL)
    * Bit 5     Type Signed (SINT)
    * Bit 6     Type Unsigned (UINT)
    * Bit 7     Type Float (FLOA)
    * Bit 8     Type Array (ARAY)
    * Bit 9     Type String (STRG)
    * Bit 10    Type Raw (RAWD)
    * Bit 11    Variable Info (VARI)
    * Bit 12    Fixed Point (FIXP)
    * Bit 13    Trace Info (TRAI)
    * Bit 14    Type Struct (STRU)
    * Bit 15–17 String Coding (SCOD)
    * Bit 18–31 reserved for future use

Bit Variable Info (VARI)

If Variable Info (VARI) is set, the name and the unit of a variable can be added. Both always contain a length information field and a field with the text (of name or unit). The length field contains the number of characters of the associated name or unit filed. The unit information is to add only in some data types.

Fields§

§kind: TypeInfoKind§coding: StringCoding§has_variable_info: bool§has_trace_info: bool

Implementations§

Trait Implementations§

source§

impl Clone for TypeInfo

source§

fn clone(&self) -> TypeInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TypeInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<TypeInfo> for TypeInfo

source§

fn eq(&self, other: &TypeInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for TypeInfo

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<u32> for TypeInfo

Bit Representation 0b0011_1111_1111_1111_1111 string coding …………………..^^_^||| |||| |||| |||| type struct ………………………..^|| |||| |||| |||| trace info ………………………….^| |||| |||| |||| fixed point ………………………….^ |||| |||| |||| variable info…………………………..^||| |||| |||| type raw ……………………………….^|| |||| |||| type string ……………………………..^| |||| |||| type array ……………………………….^ |||| |||| type float …………………………………^||| |||| type unsigned ……………………………….^|| |||| type signed ………………………………….^| |||| type bool …………………………………….^ |||| type length …………………………………….^^^^

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(info: u32) -> Result<TypeInfo, Error>

Performs the conversion.
source§

impl StructuralPartialEq for TypeInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.