[][src]Struct udp_dtls::DtlsStream

pub struct DtlsStream<S>(pub SslStream<S>);

A stream managing a DTLS session.

A DtlsStream<S> represents a handshake that has been completed successfully and both the server and the client are ready for receiving and sending data. Bytes read from a DtlsStream are decrypted from S and bytes written to a DtlsStream are encrypted when passing through to S.

Methods

impl<S: Read + Write> DtlsStream<S>[src]

pub fn keying_material(&self, len: usize) -> Result<Vec<u8>, Error>[src]

Export keying material

Underlying SSL

This corresponds to SSL_export_keying_material.

pub fn selected_srtp_profile(&self) -> Result<Option<SrtpProfile>, Error>[src]

Gets the SRTP profile selected by handshake.

Underlying SSL

DTLS extension "use_srtp" as defined in RFC5764 has to be enabled.

This corresponds to SSL_get_selected_srtp_profile.

pub fn get_ref(&self) -> &S[src]

Returns a shared reference to the underlying stream.

pub fn get_mut(&mut self) -> &mut S[src]

Returns a mutable reference to the inner stream.

pub fn buffered_read_size(&self) -> Result<usize, Error>[src]

Returns the number of bytes remaining in the currently processed TLS record.

If this is greater than 0, the next call to read will not call down to the underlying stream.

Underlying SSL

This corresponds to SSL_pending.

pub fn peer_certificate(&self) -> Result<Option<Certificate>, Error>[src]

Returns the peer's certificate, if present.

Underlying SSL

This corresponds to SSL_get_peer_certificate.

pub fn shutdown(&mut self) -> Result<()>[src]

Shuts down the session.

The shutdown process consists of two steps. The first step sends a close notify message to the peer, after which ShutdownResult::Sent is returned. The second step awaits the receipt of a close notify message from the peer, after which ShutdownResult::Received is returned.

While the connection may be closed after the first step, it is recommended to fully shut the session down. In particular, it must be fully shut down if the connection is to be used for further communication in the future.

Underlying SSL

This corresponds to SSL_shutdown.

Trait Implementations

impl<S: Debug> Debug for DtlsStream<S>[src]

impl<S: Read + Write> Write for DtlsStream<S>[src]

impl<S: Read + Write> Read for DtlsStream<S>[src]

Auto Trait Implementations

impl<S> Send for DtlsStream<S> where
    S: Send

impl<S> Unpin for DtlsStream<S> where
    S: Unpin

impl<S> Sync for DtlsStream<S> where
    S: Sync

impl<S> UnwindSafe for DtlsStream<S> where
    S: UnwindSafe

impl<S> RefUnwindSafe for DtlsStream<S> where
    S: RefUnwindSafe

Blanket Implementations

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]