#[non_exhaustive]pub struct MessageDef {
pub name: String,
pub endian: Endian,
pub bits: Option<BitOrder>,
pub needs: Vec<Param>,
pub segments: Vec<Segment>,
pub doc: Option<String>,
pub derives: Vec<Derive>,
}Expand description
A variable-length message.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe type name.
endian: EndianThe byte order.
bits: Option<BitOrder>The bit order, or None for a byte-addressed message.
A bit-addressed message holds bit fields and inline presence bits, padded with zeros to a whole byte.
needs: Vec<Param>The parameters, which generate a <Name>Ctx struct used as Message::Ctx.
segments: Vec<Segment>The segments, in wire order.
doc: Option<String>Documentation.
derives: Vec<Derive>Derives for this message, written after the module’s.
Implementations§
Source§impl MessageDef
impl MessageDef
Sourcepub fn new(name: &str, segments: Vec<Segment>) -> Self
pub fn new(name: &str, segments: Vec<Segment>) -> Self
A little-endian, byte-addressed message.
Sourcepub fn with_derives(self, derives: Vec<Derive>) -> Self
pub fn with_derives(self, derives: Vec<Derive>) -> Self
Sets the derives written on this message, after the module’s.
Sourcepub fn with_needs(self, needs: Vec<Param>) -> Self
pub fn with_needs(self, needs: Vec<Param>) -> Self
Sets the parameters.
Sourcepub fn with_endian(self, endian: Endian) -> Self
pub fn with_endian(self, endian: Endian) -> Self
Sets the byte order.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MessageDef
impl Debug for MessageDef
impl Eq for MessageDef
Source§impl PartialEq for MessageDef
impl PartialEq for MessageDef
impl StructuralPartialEq for MessageDef
Auto Trait Implementations§
impl Freeze for MessageDef
impl RefUnwindSafe for MessageDef
impl Send for MessageDef
impl Sync for MessageDef
impl Unpin for MessageDef
impl UnsafeUnpin 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