Skip to main content

HLAfixedRecord

Struct HLAfixedRecord 

Source
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

Source

pub fn new() -> Self

A record without fields.

Source

pub fn with(self, element: impl DataElement) -> Self

Appends a field, builder style.

Source

pub fn push(&mut self, element: impl DataElement) -> &mut Self

Appends a field.

Source

pub fn push_boxed(&mut self, element: Box<DynElement>) -> &mut Self

Appends an already boxed field.

Source

pub fn len(&self) -> usize

Number of fields.

Source

pub fn is_empty(&self) -> bool

True for a record without fields.

Source

pub fn get(&self, index: usize) -> Option<&DynElement>

The field at index.

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut DynElement>

The field at index, mutable. Its value may change, its datatype stays.

Source

pub fn get_as<T: DataElement>(&self, index: usize) -> Option<&T>

The field at index as a T, if it is one.

Source

pub fn set( &mut self, index: usize, element: impl DataElement, ) -> Result<(), EncoderError>

Replaces the field at index by an element of the same datatype.

Source

pub fn iter(&self) -> impl Iterator<Item = &DynElement>

The fields in order.

Trait Implementations§

Source§

impl Clone for HLAfixedRecord

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 DataElement for HLAfixedRecord

Source§

fn octet_boundary(&self) -> usize

Octet boundary of this element.
Source§

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>

Skips the padding this element needs and replaces its value by the decoded one. Read more
Source§

fn clone_element(&self) -> Box<DynElement>

A boxed copy of this element.
Source§

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>

Length in octets of the encoding when it starts at an aligned offset.
Source§

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>

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>

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>

Decodes this element from bytes, which must hold exactly one value.
Source§

impl Debug for HLAfixedRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HLAfixedRecord

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for HLAfixedRecord

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. 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.