pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError> {
        let conn = &mut *self.0.lock().unwrap();
        if let Some(ref x) = conn.error {
            return Err(SendDatagramError::ConnectionClosed(x.clone()));
        }
        use proto::SendDatagramError::*;
        match conn.inner.send_datagram(data) {
            Ok(()) => {
                conn.wake();
                Ok(())
            }
            Err(e) => Err(match e {
                UnsupportedByPeer => SendDatagramError::UnsupportedByPeer,
                Disabled => SendDatagramError::Disabled,
                TooLarge => SendDatagramError::TooLarge,
            }),
        }
    }
/// Transmit `data` as an unreliable, unordered application datagram
///
/// Application datagrams are a low-level primitive. They may be lost or delivered out of order,
/// and `data` must both fit inside a single QUIC packet and be smaller than the maximum
/// dictated by the peer.
Transmit `data` as an unreliable, unordered application datagram
Application datagrams are a low-level primitive. They may be lost or delivered out of order,
and `data` must both fit inside a single QUIC packet and be smaller than the maximum
dictated by the peer.
Transmit ` data ` as an unreliable unordered application datagram Application datagrams are a low - level primitive . They may be lost or delivered out of order and ` data ` must both fit inside a single QUIC packet and be smaller than the maximum dictated by the peer .
pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError> {
        let conn = &mut *self.0.lock().unwrap();
        if let Some(ref x) = conn.error {
            return Err(SendDatagramError::ConnectionClosed(x.clone()));
        }
        use proto::SendDatagramError::*;
        match conn.inner.send_datagram(data) {
            Ok(()) => {
                conn.wake();
                Ok(())
            }
            Err(e) => Err(match e {
                UnsupportedByPeer => SendDatagramError::UnsupportedByPeer,
                Disabled => SendDatagramError::Disabled,
                TooLarge => SendDatagramError::TooLarge,
            }),
        }
    }
pub fn send_datagram ( & self , data : Bytes ) -> Result < ( ) , SendDatagramError > { let conn = & mut * self . 0 . lock ( ) . unwrap ( ) ; if let Some ( ref x ) = conn . error { return Err ( SendDatagramError :: ConnectionClosed ( x . clone ( ) ) ) ; } use proto :: SendDatagramError :: * ; match conn . inner . send_datagram ( data ) { Ok ( ( ) ) => { conn . wake ( ) ; Ok ( ( ) ) } Err ( e ) => Err ( match e { UnsupportedByPeer => SendDatagramError :: UnsupportedByPeer , Disabled => SendDatagramError :: Disabled , TooLarge => SendDatagramError :: TooLarge , } ) , } }
Transmit `data` as an unreliable, unordered application datagram
Application datagrams are a low-level primitive.
Transmit ` data ` as an unreliable unordered application datagram Application datagrams are a low - level primitive .
&self
data
Bytes