Skip to main content

ParameterList

Struct ParameterList 

Source
pub struct ParameterList {
    pub parameters: Vec<Parameter>,
}
Expand description

ParameterList = Sequenz von Parametern + Sentinel-Terminator.

Fields§

§parameters: Vec<Parameter>

Liste der Parameter (ohne Sentinel — der wird automatisch beim Encode angefuegt).

Implementations§

Source§

impl ParameterList

Source

pub fn new() -> Self

Leere Liste.

Source

pub fn push(&mut self, param: Parameter)

Parameter anhaengen.

Source

pub fn find(&self, id: u16) -> Option<&Parameter>

Erste Parameter mit id finden.

Source

pub fn validate_must_understand<F>(&self, is_known: F) -> Result<(), WireError>
where F: Fn(u16) -> bool,

Validiert die ParameterList gegen die Must-Understand-Regel (DDSI-RTPS 2.5 §9.4.2.11.2).

Spec-Verhalten:

“If the receiver does not understand a parameter and the must_understand bit (0x4000) is set, the entire RTPS message carrying this ParameterList MUST be discarded.”

is_known ist ein Klassifikator: liefert true fuer alle PIDs, die der Receiver versteht (ohne Must-Understand- und Vendor- Bits, also masked PID).

§Errors

ValueOutOfRange mit Marker-Message bei Verletzung — der Caller MUSS die Ganz-Message verwerfen.

Source

pub fn validate_must_understand_in_data_pipeline(&self) -> Result<(), WireError>

Convenience-Wrapper um Self::validate_must_understand mit dem standard-konformen is_standard_pid-Klassifikator. Wird im Receiver-Pipeline-Hot-Path gerufen (crates/rtps/src/datagram.rs::decode_datagram), sodass die Spec-§9.4.2.11.2-Reject-Regel automatisch greift.

Vendor-Specific-PIDs (oberstes Bit gesetzt) sind explizit erlaubt — der Vendor-Bit-Pfad ueberlebt die Pruefung in validate_must_understand, weil das masked den Vendor-Bit strippt aber is_standard_pid ihn nicht zurueckaddiert; der Caller behandelt Vendor-PIDs als “kann ignoriert werden”.

§Errors

ValueOutOfRange bei Verletzung — Caller verwirft die Message.

Source

pub fn to_bytes(&self, little_endian: bool) -> Vec<u8>

Encoded zu Bytes mit der gegebenen Endianness. Padding zu 4-Byte-Boundary wird pro Value automatisch eingefuegt; der Sentinel wird angefuegt.

Source

pub fn from_bytes(bytes: &[u8], little_endian: bool) -> Result<Self, WireError>

Decoded eine ParameterList aus Bytes. Stoppt am Sentinel.

§Errors

UnexpectedEof bei truncated Eingabe; ValueOutOfRange wenn Length nicht 4-Byte-aligned ist; ValueOutOfRange wenn die Parameter-Zahl MAX_PARAMETERS uebersteigt (DoS-Cap).

Trait Implementations§

Source§

impl Clone for ParameterList

Source§

fn clone(&self) -> ParameterList

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 Debug for ParameterList

Source§

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

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

impl Default for ParameterList

Source§

fn default() -> Self

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

impl PartialEq for ParameterList

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ParameterList

Source§

impl StructuralPartialEq for ParameterList

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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.