[][src]Struct udp_dtls::DtlsConnector

pub struct DtlsConnector { /* fields omitted */ }

A builder for client-side DTLS-connections.

Methods

impl DtlsConnector[src]

pub fn new(builder: &DtlsConnectorBuilder) -> Result<DtlsConnector, Error>[src]

Creates a new DtlsConnector.

The DtlsConnector will use the settings from the given builder.

The following propperties 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 root certificates to the certificate store.

pub fn builder() -> DtlsConnectorBuilder[src]

Returns a new builder for a DtlsConnector from which you can create the DtlsConnector.

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

Initiates a DTLS handshake.

The provided domain will be used for both SNI and certificate hostname validation.

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.

The domain is ignored if both SNI and hostname verification are disabled.

Trait Implementations

impl Clone for DtlsConnector[src]

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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

type Error = Infallible

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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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