[−][src]Struct udp_dtls::DtlsConnector
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]
&self,
domain: &str,
stream: S
) -> Result<DtlsStream<S>, HandshakeError<S>> where
S: Read + Write,
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]
fn clone(&self) -> DtlsConnector
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl Send for DtlsConnector
impl Unpin for DtlsConnector
impl Sync for DtlsConnector
impl UnwindSafe for DtlsConnector
impl RefUnwindSafe for DtlsConnector
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,