pub struct Session { /* private fields */ }Expand description
A DTLS-SRTP handshake over a media socket.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(
socket: UdpSocket,
peer: SocketAddr,
identity: &Identity,
timeout: Duration,
) -> Result<Self, DtlsError>
pub fn new( socket: UdpSocket, peer: SocketAddr, identity: &Identity, timeout: Duration, ) -> Result<Self, DtlsError>
Prepare a handshake with peer, presenting identity.
timeout bounds the handshake. DTLS retransmits its own flights, so without one a lost
final flight leaves both ends waiting — and a media path that never keys is worse than one
that fails, because the call is up and silent.
Trait Implementations§
Source§impl Handshake for Session
impl Handshake for Session
Source§fn run(&mut self, role: Role) -> Result<(), Self::Error>
fn run(&mut self, role: Role) -> Result<(), Self::Error>
Run the handshake to completion. Read more
Source§fn peer_certificate(&self) -> Option<Vec<u8>>
fn peer_certificate(&self) -> Option<Vec<u8>>
The peer’s certificate, DER-encoded, once the handshake has produced one. Read more
Auto Trait Implementations§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl !Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl !UnwindSafe for Session
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more