pub struct MessageDef {
pub name: String,
pub id: u16,
pub block_length: u16,
pub semantic_type: Option<String>,
pub description: Option<String>,
pub since_version: Option<u16>,
pub deprecated: Option<u16>,
pub fields: Vec<FieldDef>,
pub groups: Vec<GroupDef>,
pub data_fields: Vec<DataFieldDef>,
}Expand description
Message definition.
Fields§
§name: StringMessage name.
id: u16Message template ID.
block_length: u16Block length (fixed portion size in bytes).
semantic_type: Option<String>Semantic type.
description: Option<String>Description.
since_version: Option<u16>Since version.
deprecated: Option<u16>Deprecated since version.
fields: Vec<FieldDef>Fixed fields in the root block.
groups: Vec<GroupDef>Repeating groups.
data_fields: Vec<DataFieldDef>Variable-length data fields.
Implementations§
Source§impl MessageDef
impl MessageDef
Sourcepub fn add_data_field(&mut self, data_field: DataFieldDef)
pub fn add_data_field(&mut self, data_field: DataFieldDef)
Adds a data field to the message.
Sourcepub fn has_groups(&self) -> bool
pub fn has_groups(&self) -> bool
Returns true if the message has any repeating groups.
Sourcepub fn has_var_data(&self) -> bool
pub fn has_var_data(&self) -> bool
Returns true if the message has any variable-length data.
Sourcepub fn min_encoded_length(&self) -> usize
pub fn min_encoded_length(&self) -> usize
Calculates the minimum encoded length (header + block).
Trait Implementations§
Source§impl Clone for MessageDef
impl Clone for MessageDef
Source§fn clone(&self) -> MessageDef
fn clone(&self) -> MessageDef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MessageDef
impl RefUnwindSafe for MessageDef
impl Send for MessageDef
impl Sync for MessageDef
impl Unpin for MessageDef
impl UnwindSafe for MessageDef
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