pub struct StatelessMessageReader { /* private fields */ }Expand description
Stateless message reader (Spec §7.4.4 + §10.3.4).
Decodes incoming DATA submessages addressed to the
BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER.
Stateless: no history cache, no ACKNACK, no heartbeat state.
A known writer proxy is optional for source-authenticity checks —
the reader always delivers the message, the auth plugin hook decides
based on the source_guid field.
Implementations§
Source§impl StatelessMessageReader
impl StatelessMessageReader
Sourcepub fn new(participant_prefix: GuidPrefix, vendor_id: VendorId) -> Self
pub fn new(participant_prefix: GuidPrefix, vendor_id: VendorId) -> Self
Creates a reader for the local participant.
Sourcepub fn writer_proxy_count(&self) -> usize
pub fn writer_proxy_count(&self) -> usize
Number of registered writer proxies.
Sourcepub fn writer_proxies(&self) -> &[WriterProxy]
pub fn writer_proxies(&self) -> &[WriterProxy]
Read-only slice of the registered writer proxies.
Sourcepub fn add_writer_proxy(&mut self, proxy: WriterProxy)
pub fn add_writer_proxy(&mut self, proxy: WriterProxy)
Adds a writer proxy (idempotent).
Sourcepub fn remove_writer_proxy(&mut self, guid: Guid) -> Option<WriterProxy>
pub fn remove_writer_proxy(&mut self, guid: Guid) -> Option<WriterProxy>
Removes a writer proxy.
Sourcepub fn handle_data(
&mut self,
data: &DataSubmessage,
) -> SecurityResult<ParticipantGenericMessage>
pub fn handle_data( &mut self, data: &DataSubmessage, ) -> SecurityResult<ParticipantGenericMessage>
Processes an incoming DATA submessage and decodes it into a
ParticipantGenericMessage.
§Errors
BadArgument if the encapsulation/CDR decode fails.
Sourcepub fn handle_data_frag(
&mut self,
df: &DataFragSubmessage,
) -> SecurityResult<Vec<ParticipantGenericMessage>>
pub fn handle_data_frag( &mut self, df: &DataFragSubmessage, ) -> SecurityResult<Vec<ParticipantGenericMessage>>
Processes an incoming DATA_FRAG submessage. Large stateless
messages (HandshakeReply/Final with cert/permissions) are
RTPS-fragmented cross-vendor. Returns the decoded
ParticipantGenericMessage once all fragments are present
(otherwise empty — best-effort, no NACK).
§Errors
BadArgument if the reassembled generic-message body does not parse.
Sourcepub fn handle_datagram(
&mut self,
datagram: &[u8],
) -> SecurityResult<Vec<ParticipantGenericMessage>>
pub fn handle_datagram( &mut self, datagram: &[u8], ) -> SecurityResult<Vec<ParticipantGenericMessage>>
Processes a complete RTPS datagram. Returns all decoded stateless messages from this datagram.
§Errors
BadArgumentif the datagram does not parse (wire decoder error) or a relevant DATA submessage has a corrupt generic-message body.