pub struct ParameterList {
pub parameters: Vec<Parameter>,
}Expand description
ParameterList = a sequence of parameters + a sentinel terminator.
Fields§
§parameters: Vec<Parameter>List of parameters (without the sentinel — it is appended automatically on encode).
Implementations§
Source§impl ParameterList
impl ParameterList
Sourcepub fn find_all(&self, id: u16) -> impl Iterator<Item = &Parameter>
pub fn find_all(&self, id: u16) -> impl Iterator<Item = &Parameter>
ALL parameters with id (DDSI-RTPS 2.5 §9.4.2.11: a PID may
appear multiple times, e.g. several *_UNICAST_LOCATOR of a
multi-homed peer).
Sourcepub fn validate_must_understand<F>(&self, is_known: F) -> Result<(), WireError>
pub fn validate_must_understand<F>(&self, is_known: F) -> Result<(), WireError>
Validates the ParameterList against the must-understand rule (DDSI-RTPS 2.5 §9.4.2.11.2).
Spec behavior:
“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 is a classifier: returns true for all PIDs the
receiver understands (without the must-understand and vendor
bits, i.e. the masked PID).
§Errors
ValueOutOfRange with a marker message on violation — the caller
MUST discard the whole message.
Sourcepub fn validate_must_understand_in_data_pipeline(&self) -> Result<(), WireError>
pub fn validate_must_understand_in_data_pipeline(&self) -> Result<(), WireError>
Convenience wrapper around Self::validate_must_understand
with the standard-conformant is_standard_pid classifier.
Called in the receiver pipeline hot path
(crates/rtps/src/datagram.rs::decode_datagram), so the
spec §9.4.2.11.2 reject rule applies automatically.
Vendor-specific PIDs (top bit set) are explicitly allowed — the
vendor-bit path survives the check in
validate_must_understand, because masked strips the vendor
bit but is_standard_pid does not add it back; the caller treats
vendor PIDs as “can be ignored”.
§Errors
ValueOutOfRange on violation — the caller discards the message.
Sourcepub fn to_bytes(&self, little_endian: bool) -> Vec<u8> ⓘ
pub fn to_bytes(&self, little_endian: bool) -> Vec<u8> ⓘ
Encodes to bytes with the given endianness. Padding to the 4-byte boundary is inserted automatically per value; the sentinel is appended.
Sourcepub fn from_bytes(bytes: &[u8], little_endian: bool) -> Result<Self, WireError>
pub fn from_bytes(bytes: &[u8], little_endian: bool) -> Result<Self, WireError>
Decodes a ParameterList from bytes. Stops at the sentinel.
§Errors
UnexpectedEof on truncated input; ValueOutOfRange if the
length is not 4-byte aligned; ValueOutOfRange if the parameter
count exceeds MAX_PARAMETERS (DoS cap).
Trait Implementations§
Source§impl Clone for ParameterList
impl Clone for ParameterList
Source§fn clone(&self) -> ParameterList
fn clone(&self) -> ParameterList
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more