pub struct StatelessMessageWriter { /* private fields */ }Expand description
Stateless message writer (Spec §7.4.4 + §10.3.4).
Maintains multi-reader fan-out for the
BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER endpoint. Each
write() produces one OutboundDatagram per registered
ReaderProxy — no cache, no resend, no HEARTBEAT
(stateless = no receive status).
Implementations§
Source§impl StatelessMessageWriter
impl StatelessMessageWriter
Sourcepub fn new(participant_prefix: GuidPrefix, vendor_id: VendorId) -> Self
pub fn new(participant_prefix: GuidPrefix, vendor_id: VendorId) -> Self
Creates a writer for the local participant.
Sourcepub fn reader_proxies(&self) -> &[ReaderProxy]
pub fn reader_proxies(&self) -> &[ReaderProxy]
Read-only slice of the registered reader proxies.
Sourcepub fn reader_proxy_count(&self) -> usize
pub fn reader_proxy_count(&self) -> usize
Number of registered reader proxies.
Sourcepub fn add_reader_proxy(&mut self, proxy: ReaderProxy)
pub fn add_reader_proxy(&mut self, proxy: ReaderProxy)
Adds a reader proxy (idempotent: same GUID overwrites).
Sourcepub fn remove_reader_proxy(&mut self, guid: Guid) -> Option<ReaderProxy>
pub fn remove_reader_proxy(&mut self, guid: Guid) -> Option<ReaderProxy>
Removes a reader proxy. Returns it if present.
Sourcepub fn write(
&mut self,
msg: &ParticipantGenericMessage,
) -> Result<Vec<OutboundDatagram>, WireError>
pub fn write( &mut self, msg: &ParticipantGenericMessage, ) -> Result<Vec<OutboundDatagram>, WireError>
Sends a ParticipantGenericMessage to all reader proxies.
Returns one datagram per proxy (or empty if none are registered).
§Errors
WireError::ValueOutOfRange on sequence-number overflow or
WireError::* from the DATA encoding pipeline.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StatelessMessageWriter
impl RefUnwindSafe for StatelessMessageWriter
impl Send for StatelessMessageWriter
impl Sync for StatelessMessageWriter
impl Unpin for StatelessMessageWriter
impl UnsafeUnpin for StatelessMessageWriter
impl UnwindSafe for StatelessMessageWriter
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