DtlsStack

Struct DtlsStack 

Source
pub struct DtlsStack<'a, const CONNECTIONS: usize> { /* private fields */ }

Implementations§

Source§

impl<'a, const CONNECTIONS: usize> DtlsStack<'a, CONNECTIONS>

Source

pub fn new( rng: &'a mut dyn CryptoRngCore, staging_buffer: &'a mut [u8], send_to_peer: &'a mut dyn FnMut(&SocketAddr, &[u8]), ) -> Result<Self, DtlsError>

Source

pub fn poll( &mut self, handshakes: &mut [HandshakeSlot<'_>], now_ms: u64, ) -> Result<DtlsPoll, DtlsError>

Source

pub fn open_connection( &mut self, slot: &mut HandshakeSlot<'_>, addr: &SocketAddr, ) -> bool

Source

pub fn close_connection(&mut self, connection_id: ConnectionId) -> bool

Returns whether the connection was closed successfully

Source

pub fn send_dtls_packet( &mut self, connection_id: ConnectionId, packet: &[u8], ) -> Result<(), DtlsError>

Source

pub fn staging_buffer(&mut self) -> &mut [u8]

Source

pub fn handle_dtls_packet( &mut self, handshakes: &mut [HandshakeSlot<'_>], addr: &SocketAddr, packet_len: usize, handle_app_data: &mut dyn FnMut(ConnectionId, Range<usize>, &mut Self), ) -> Result<(), DtlsError>

Auto Trait Implementations§

§

impl<'a, const CONNECTIONS: usize> Freeze for DtlsStack<'a, CONNECTIONS>

§

impl<'a, const CONNECTIONS: usize> !RefUnwindSafe for DtlsStack<'a, CONNECTIONS>

§

impl<'a, const CONNECTIONS: usize> !Send for DtlsStack<'a, CONNECTIONS>

§

impl<'a, const CONNECTIONS: usize> !Sync for DtlsStack<'a, CONNECTIONS>

§

impl<'a, const CONNECTIONS: usize> Unpin for DtlsStack<'a, CONNECTIONS>

§

impl<'a, const CONNECTIONS: usize> !UnwindSafe for DtlsStack<'a, CONNECTIONS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.