pub struct HLAfixedRecord { /* private fields */ }Expand description
HLAfixedRecord (IEEE 1516.2 4.14.10.1): fields of any datatypes, encoded in order, each at its own
octet boundary. Nothing follows the last field. The octet boundary of the record is the largest
boundary of its fields.
Implementations§
Source§impl HLAfixedRecord
impl HLAfixedRecord
Sourcepub fn with(self, element: impl DataElement) -> Self
pub fn with(self, element: impl DataElement) -> Self
Appends a field, builder style.
Sourcepub fn push(&mut self, element: impl DataElement) -> &mut Self
pub fn push(&mut self, element: impl DataElement) -> &mut Self
Appends a field.
Sourcepub fn push_boxed(&mut self, element: Box<DynElement>) -> &mut Self
pub fn push_boxed(&mut self, element: Box<DynElement>) -> &mut Self
Appends an already boxed field.
Sourcepub fn get(&self, index: usize) -> Option<&DynElement>
pub fn get(&self, index: usize) -> Option<&DynElement>
The field at index.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut DynElement>
pub fn get_mut(&mut self, index: usize) -> Option<&mut DynElement>
The field at index, mutable. Its value may change, its datatype stays.
Sourcepub fn get_as<T: DataElement>(&self, index: usize) -> Option<&T>
pub fn get_as<T: DataElement>(&self, index: usize) -> Option<&T>
The field at index as a T, if it is one.
Sourcepub fn set(
&mut self,
index: usize,
element: impl DataElement,
) -> Result<(), EncoderError>
pub fn set( &mut self, index: usize, element: impl DataElement, ) -> Result<(), EncoderError>
Replaces the field at index by an element of the same datatype.
Sourcepub fn iter(&self) -> impl Iterator<Item = &DynElement>
pub fn iter(&self) -> impl Iterator<Item = &DynElement>
The fields in order.
Trait Implementations§
Source§impl Clone for HLAfixedRecord
impl Clone for HLAfixedRecord
Source§impl DataElement for HLAfixedRecord
impl DataElement for HLAfixedRecord
Source§fn octet_boundary(&self) -> usize
fn octet_boundary(&self) -> usize
Octet boundary of this element.
Source§fn encode_into(&self, writer: &mut ByteWriter<'_>) -> Result<(), EncoderError>
fn encode_into(&self, writer: &mut ByteWriter<'_>) -> Result<(), EncoderError>
Appends the padding this element needs and its encoding.
Source§fn decode_from(
&mut self,
reader: &mut ByteReader<'_>,
) -> Result<(), DecoderError>
fn decode_from( &mut self, reader: &mut ByteReader<'_>, ) -> Result<(), DecoderError>
Skips the padding this element needs and replaces its value by the decoded one. Read more
Source§fn clone_element(&self) -> Box<DynElement>
fn clone_element(&self) -> Box<DynElement>
A boxed copy of this element.
Source§fn is_same_type_as(&self, other: &DynElement) -> bool
fn is_same_type_as(&self, other: &DynElement) -> bool
True if
other has the same datatype: the same Rust type and, for dynamic containers, the same
structure.Source§fn encoded_length(&self) -> Result<usize, EncoderError>
fn encoded_length(&self) -> Result<usize, EncoderError>
Length in octets of the encoding when it starts at an aligned offset.
Source§fn to_bytes(&self) -> Result<Vec<u8>, EncoderError>
fn to_bytes(&self) -> Result<Vec<u8>, EncoderError>
Encodes this element as an outermost value.
Source§fn append_to(&self, buffer: &mut Vec<u8>) -> Result<(), EncoderError>
fn append_to(&self, buffer: &mut Vec<u8>) -> Result<(), EncoderError>
Appends the encoding to
buffer as a new outermost value: padding is computed from the first
appended octet. On error buffer is left unchanged.Source§fn decode_slice(&mut self, bytes: &[u8]) -> Result<(), DecoderError>
fn decode_slice(&mut self, bytes: &[u8]) -> Result<(), DecoderError>
Decodes this element from the start of
bytes; octets after the value are ignored.Source§fn decode_slice_strict(&mut self, bytes: &[u8]) -> Result<(), DecoderError>
fn decode_slice_strict(&mut self, bytes: &[u8]) -> Result<(), DecoderError>
Decodes this element from
bytes, which must hold exactly one value.Source§impl Debug for HLAfixedRecord
impl Debug for HLAfixedRecord
Source§impl Default for HLAfixedRecord
impl Default for HLAfixedRecord
Auto Trait Implementations§
impl !RefUnwindSafe for HLAfixedRecord
impl !UnwindSafe for HLAfixedRecord
impl Forget for HLAfixedRecord
impl Freeze for HLAfixedRecord
impl Move for HLAfixedRecord
impl Send for HLAfixedRecord
impl Sync for HLAfixedRecord
impl Unpin for HLAfixedRecord
impl UnsafeUnpin for HLAfixedRecord
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