pub struct FieldDefinition {
pub field_def_num: u8,
pub size: u8,
pub base_type: BaseType,
pub base_type_byte: u8,
}Expand description
One field’s wire-level shape inside a Definition message.
Fields§
§field_def_num: u8The Profile-level field identifier.
size: u8Total byte width on the wire. May exceed the BaseType element size
when the field is an array (e.g. size = 4 with BaseType::UInt16
means a length-2 array of u16).
base_type: BaseTypeDecoded base type (after masking off the endian flag).
base_type_byte: u8Raw base-type byte preserved verbatim — useful when round-tripping in the encoder (M8) and for diagnostics.
Implementations§
Source§impl FieldDefinition
impl FieldDefinition
Sourcepub fn element_count(&self) -> usize
pub fn element_count(&self) -> usize
Number of array elements implied by size and the base-type stride.
Returns 0 when size is not a multiple of the element size (malformed
definition); callers may treat this as an error or skip the field.
Trait Implementations§
Source§impl Clone for FieldDefinition
impl Clone for FieldDefinition
Source§fn clone(&self) -> FieldDefinition
fn clone(&self) -> FieldDefinition
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 FieldDefinition
impl Debug for FieldDefinition
Source§impl PartialEq for FieldDefinition
impl PartialEq for FieldDefinition
Source§fn eq(&self, other: &FieldDefinition) -> bool
fn eq(&self, other: &FieldDefinition) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for FieldDefinition
impl Eq for FieldDefinition
impl StructuralPartialEq for FieldDefinition
Auto Trait Implementations§
impl Freeze for FieldDefinition
impl RefUnwindSafe for FieldDefinition
impl Send for FieldDefinition
impl Sync for FieldDefinition
impl Unpin for FieldDefinition
impl UnsafeUnpin for FieldDefinition
impl UnwindSafe for FieldDefinition
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