Struct quinn_proto::Datagrams
source · pub struct Datagrams<'a> { /* private fields */ }
Expand description
API to control datagram traffic
Implementations§
source§impl<'a> Datagrams<'a>
impl<'a> Datagrams<'a>
sourcepub fn send(&mut self, data: Bytes) -> Result<(), SendDatagramError>
pub fn send(&mut self, data: Bytes) -> Result<(), SendDatagramError>
Queue an unreliable, unordered datagram for immediate transmission
Returns Err
iff a len
-byte datagram cannot currently be sent
sourcepub fn max_size(&self) -> Option<usize>
pub fn max_size(&self) -> Option<usize>
Compute the maximum size of datagrams that may passed to send_datagram
Returns None
if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
sourcepub fn send_buffer_space(&self) -> usize
pub fn send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer
When greater than zero, send
ing a datagram of at most this size is
guaranteed not to cause older datagrams to be dropped.