Skip to main content

FieldInfo

Struct FieldInfo 

Source
pub struct FieldInfo {
    pub field_def_num: u8,
    pub name: &'static str,
    pub type_name: &'static str,
    pub array: Option<&'static str>,
    pub scale: Option<f64>,
    pub offset: Option<f64>,
    pub units: Option<&'static str>,
    pub components: &'static [Component],
    pub sub_fields: &'static [SubField],
    pub accumulate: bool,
}
Expand description

Static metadata for a single field of a single message.

Fields§

§field_def_num: u8

Field definition number used on the wire (0..=255).

§name: &'static str

Snake-case canonical name from Profile.xlsx.

§type_name: &'static str

Type reference: either a base type (“uint16”) or a Types-sheet name (“sport”). Resolution to a runtime base type happens in M3.

§array: Option<&'static str>

Raw array spec (e.g. "[5]", "[N]", "[5x10]") or None for scalars.

§scale: Option<f64>

Scale factor (physical = raw / scale - offset). First element only when scale is per-component; component-specific scales live on Component.

§offset: Option<f64>

Offset.

§units: Option<&'static str>

Display unit (e.g. "m/s", "bpm").

§components: &'static [Component]

Components — non-empty when the wire field unpacks LSB-first into multiple sub-values (see protocol §“Components”).

§sub_fields: &'static [SubField]

SubFields — alternative semantic interpretations selected at runtime based on the value of another field in the same message.

§accumulate: bool

Whether this field accumulates across messages (for rollover compensation).

Trait Implementations§

Source§

impl Debug for FieldInfo

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.