[−][src]Struct udp_dtls::DtlsStream
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]
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]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
impl<S: Read + Write> Read for DtlsStream<S>
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut]) -> Result<usize, Error>
1.36.0[src]
unsafe fn initializer(&self) -> Initializer
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn bytes(self) -> Bytes<Self>
1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
Auto Trait Implementations
impl<S> Send for DtlsStream<S> where
S: Send,
S: Send,
impl<S> Unpin for DtlsStream<S> where
S: Unpin,
S: Unpin,
impl<S> Sync for DtlsStream<S> where
S: Sync,
S: Sync,
impl<S> UnwindSafe for DtlsStream<S> where
S: UnwindSafe,
S: UnwindSafe,
impl<S> RefUnwindSafe for DtlsStream<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
Blanket Implementations
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,