Skip to main content

TypeKind

Enum TypeKind 

Source
pub enum TypeKind {
    Integer,
    Float,
    String,
    Binary,
    Boolean {
        zero_label: Option<NameId>,
        one_label: Option<NameId>,
    },
    Enumerated(EnumerationList),
    AbsoluteTime {
        epoch: Option<NameId>,
        offset_from: Option<ParamId>,
    },
    RelativeTime,
    Aggregate {
        members: Vec<AggregateMember>,
    },
    Array {
        element: TypeId,
        dimensions: Vec<ArrayDimension>,
    },
    Unsupported {
        element: NameId,
    },
}
Expand description

The semantic family of a parameter type.

Variants§

§

Integer

IntegerParameterType.

§

Float

FloatParameterType.

§

String

StringParameterType.

§

Binary

BinaryParameterType.

§

Boolean

BooleanParameterType.

XTCE calls this “a restricted form of enumeration”, and the reference implementation derives truthiness from the raw value, ignoring the label attributes. The labels are kept here so callers can render them; see crate::XtceDb::boolean_label.

Fields

§zero_label: Option<NameId>

Label for the false value, from zeroStringValue.

§one_label: Option<NameId>

Label for the true value, from oneStringValue.

§

Enumerated(EnumerationList)

EnumeratedParameterType.

§

AbsoluteTime

AbsoluteTimeParameterType.

Fields

§epoch: Option<NameId>

ReferenceTime/Epoch, verbatim.

§offset_from: Option<ParamId>

ReferenceTime/OffsetFrom/@parameterRef, resolved.

§

RelativeTime

RelativeTimeParameterType.

§

Aggregate

AggregateParameterType: a record, “analogous to a C-struct”.

Like an array, a parameter of this type never reaches a decoder: the container entry naming it is expanded at load time into one synthetic parameter per member. XTCE says the members are “ordered and contiguous … (packed)” and addressed “by the dot syntax similar to C such as P.voltage”, so that is what the expansion produces.

Fields

§members: Vec<AggregateMember>

Members in document order, which is the order they occupy in the packet.

§

Array

ArrayParameterType: a repetition of one element type.

A parameter of this type never reaches a decoder. The container entry that names it is expanded at load time into one synthetic parameter per index, each of the element type, so everything downstream sees ordinary fields — see XtceDb::array_element_of. The type is kept because xtce info reports it and because the expansion needs it.

Fields

§element: TypeId

The type each element has.

§dimensions: Vec<ArrayDimension>

One entry per dimension, outermost first. XTCE writes Array[1st][2nd][last] and says the last dimension varies fastest, so the layout is row-major.

§

Unsupported

A parameter type this crate models structurally but cannot decode.

Loading succeeds; decoding a parameter of this type reports XtceError::Unsupported naming the element below.

Fields

§element: NameId

The element name that put this type out of scope.

Implementations§

Source§

impl TypeKind

Source

pub const fn label(&self) -> &'static str

A short, stable name for reporting, e.g. in xtce info.

Trait Implementations§

Source§

impl Clone for TypeKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TypeKind

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.