pub struct DTLSConn { /* private fields */ }Expand description
One DTLS association: the handshake state machine plus the record layer around it.
Implementations§
Source§impl DTLSConn
impl DTLSConn
Sourcepub fn new(
handshake_config: Arc<HandshakeConfig>,
is_client: bool,
initial_state: Option<State>,
) -> Self
pub fn new( handshake_config: Arc<HandshakeConfig>, is_client: bool, initial_state: Option<State>, ) -> Self
Creates a connection in the given role, ready to handshake.
§Errors
Fails if the configuration is invalid — no certificate for a server, or an unusable cipher suite list.
Sourcepub fn incoming_application_data(&mut self) -> Option<BytesMut>
pub fn incoming_application_data(&mut self) -> Option<BytesMut>
Takes the next decrypted application payload, if one is ready.
Sourcepub fn outgoing_raw_packet(&mut self) -> Option<BytesMut>
pub fn outgoing_raw_packet(&mut self) -> Option<BytesMut>
Takes the next datagram the caller should send.
Sourcepub fn write(&mut self, p: &[u8]) -> Result<()>
pub fn write(&mut self, p: &[u8]) -> Result<()>
Queues p as application data, encrypting it once the handshake has completed.
§Errors
Fails if the connection is closed or the handshake has not finished.
Sourcepub fn connection_state(&self) -> &State
pub fn connection_state(&self) -> &State
connection_state returns basic DTLS details about the connection.
Note that this replaced the Export function of v1.
Auto Trait Implementations§
impl !RefUnwindSafe for DTLSConn
impl !UnwindSafe for DTLSConn
impl Freeze for DTLSConn
impl Send for DTLSConn
impl Sync for DTLSConn
impl Unpin for DTLSConn
impl UnsafeUnpin for DTLSConn
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.