pub struct Datagrams {
pub ecn: Option<EcnCodepoint>,
pub segment_size: Option<NonZeroU16>,
pub contents: Bytes,
}Expand description
One or multiple datagrams being transferred via the relay.
This type is modeled after quinn_proto::Transmit
(or even more similarly quinn_udp::Transmit, but we don’t depend on that library here).
Fields§
§ecn: Option<EcnCodepoint>Explicit congestion notification bits
segment_size: Option<NonZeroU16>The segment size if this transmission contains multiple datagrams.
This is None if the transmit only contains a single datagram
contents: BytesThe contents of the datagram(s)
Implementations§
Source§impl Datagrams
impl Datagrams
Sourcepub fn take_segments(&mut self, num_segments: usize) -> Datagrams
pub fn take_segments(&mut self, num_segments: usize) -> Datagrams
Splits the current datagram into at maximum num_segments segments, returning
the batch with at most num_segments and leaving only the rest in self.
Calling this on a datagram batch that only contains a single datagram (segment_size == None)
will result in returning essentially a clone of self, while making self empty afterwards.
Calling this on a datagram batch with e.g. 15 datagrams with num_segments == 10 will
result in returning a datagram batch that contains the first 10 datagrams and leave self
containing the remaining 5 datagrams.
Calling this on a datagram batch with less than num_segments datagrams will result in
making self empty and returning essentially a clone of self.
Trait Implementations§
impl Eq for Datagrams
impl StructuralPartialEq for Datagrams
Auto Trait Implementations§
impl !Freeze for Datagrams
impl RefUnwindSafe for Datagrams
impl Send for Datagrams
impl Sync for Datagrams
impl Unpin for Datagrams
impl UnwindSafe for Datagrams
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.