[][src]Struct udp_dtls::DtlsAcceptor

pub struct DtlsAcceptor(pub SslAcceptor);

Acceptor for incoming UDP sessions secured with DTLS.

Methods

impl DtlsAcceptor[src]

pub fn default(identity: Identity) -> Result<DtlsAcceptor>[src]

Creates a DtlsAcceptor with default settings.

The identity acts as the server's private key/certificate chain.

pub fn new(builder: &DtlsAcceptorBuilder) -> Result<DtlsAcceptor>[src]

Creates a acceptor with the settings from the given builder.

The DtlsAcceptor will use the settings from the given builder.

The following properties will be applied from the builder:

  • Sets minimal/maximal protocol version
  • Sets srtp profile by enabling the DTLS extension 'use_srtp'
  • Sets the certificate and private key
  • Adds the certificates from the identity chain to the certificate chain.

pub fn builder(identity: Identity) -> DtlsAcceptorBuilder[src]

Returns a new builder for a DtlsAcceptor.

The identity acts as the server's private key/certificate chain.

pub fn accept<S>(&self, stream: S) -> Result<DtlsStream<S>, HandshakeError<S>> where
    S: Read + Write
[src]

Accepts a new client connection with the provided stream.

If the socket is nonblocking and a WouldBlock error is returned during the handshake, a HandshakeError::WouldBlock error will be returned which can be used to restart the handshake when the socket is ready again.

Trait Implementations

impl Clone for DtlsAcceptor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]