pub struct OutboundDatagram {
pub bytes: Vec<u8>,
pub targets: Rc<Vec<Locator>>,
}Expand description
A fully aggregated datagram with targets.
targets is shared as Rc<Vec<Locator>> to avoid allocation overhead
in multi-reader tick loops — the same proxy
locator set is reused across all submessages of a proxy.
Fields§
§bytes: Vec<u8>Wire bytes (RTPS header + N submessages).
targets: Rc<Vec<Locator>>Target locators. The transport layer sends to all.
Implementations§
Source§impl OutboundDatagram
impl OutboundDatagram
Opt-6 (Spec zerodds-zero-copy-1.0 §9): converts the
internal Vec into a shared Arc<[u8]> representation
without a copy (boxed-slice conversion is O(1) if bytes
has no excess capacity; otherwise a single realloc).
Useful for multi-reader hot paths: instead of passing &dg.bytes to
each reader send and implicitly letting it Vec::clone,
the caller takes the Arc<[u8]> out once and
clones only the refcount. Eliminates the per-reader Vec clone.
Trait Implementations§
Source§impl Clone for OutboundDatagram
impl Clone for OutboundDatagram
Source§fn clone(&self) -> OutboundDatagram
fn clone(&self) -> OutboundDatagram
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OutboundDatagram
impl Debug for OutboundDatagram
impl Eq for OutboundDatagram
Source§impl PartialEq for OutboundDatagram
impl PartialEq for OutboundDatagram
Source§fn eq(&self, other: &OutboundDatagram) -> bool
fn eq(&self, other: &OutboundDatagram) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OutboundDatagram
Auto Trait Implementations§
impl !Send for OutboundDatagram
impl !Sync for OutboundDatagram
impl Freeze for OutboundDatagram
impl RefUnwindSafe for OutboundDatagram
impl Unpin for OutboundDatagram
impl UnsafeUnpin for OutboundDatagram
impl UnwindSafe for OutboundDatagram
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