pub struct Endpoint { /* private fields */ }Expand description
The main entry point to the library
This object performs no I/O whatsoever. Instead, it generates a stream of packets to send via
poll_transmit, and consumes incoming packets and connections-generated events via handle and
handle_event.
Implementations§
source§impl Endpoint
impl Endpoint
sourcepub fn new(server_config: Option<Arc<HandshakeConfig>>) -> Self
pub fn new(server_config: Option<Arc<HandshakeConfig>>) -> Self
Create a new endpoint
Returns Err if the configuration is invalid.
sourcepub fn set_server_config(&mut self, server_config: Option<Arc<HandshakeConfig>>)
pub fn set_server_config(&mut self, server_config: Option<Arc<HandshakeConfig>>)
Replace the server configuration, affecting new incoming associations only
sourcepub fn poll_transmit(&mut self) -> Option<Transmit>
pub fn poll_transmit(&mut self) -> Option<Transmit>
Get the next packet to transmit
sourcepub fn get_connections_keys(&self) -> Keys<'_, SocketAddr, DTLSConn>
pub fn get_connections_keys(&self) -> Keys<'_, SocketAddr, DTLSConn>
Get keys of Connections
sourcepub fn get_connection_state(&self, remote: SocketAddr) -> Option<&State>
pub fn get_connection_state(&self, remote: SocketAddr) -> Option<&State>
Get Connection State
sourcepub fn connect(
&mut self,
remote: SocketAddr,
client_config: Arc<HandshakeConfig>,
initial_state: Option<State>
) -> Result<()>
pub fn connect( &mut self, remote: SocketAddr, client_config: Arc<HandshakeConfig>, initial_state: Option<State> ) -> Result<()>
Initiate an Association
sourcepub fn close(&mut self, remote: SocketAddr) -> Option<DTLSConn>
pub fn close(&mut self, remote: SocketAddr) -> Option<DTLSConn>
Process close
sourcepub fn read(
&mut self,
now: Instant,
remote: SocketAddr,
local_ip: Option<IpAddr>,
ecn: Option<EcnCodepoint>,
data: BytesMut
) -> Result<Vec<EndpointEvent>>
pub fn read( &mut self, now: Instant, remote: SocketAddr, local_ip: Option<IpAddr>, ecn: Option<EcnCodepoint>, data: BytesMut ) -> Result<Vec<EndpointEvent>>
Process an incoming UDP datagram
pub fn write(&mut self, remote: SocketAddr, data: &[u8]) -> Result<()>
pub fn handle_timeout(&mut self, remote: SocketAddr, now: Instant) -> Result<()>
pub fn poll_timeout(&self, remote: SocketAddr, eto: &mut Instant) -> Result<()>
Auto Trait Implementations§
impl !RefUnwindSafe for Endpoint
impl !Send for Endpoint
impl !Sync for Endpoint
impl Unpin for Endpoint
impl !UnwindSafe for Endpoint
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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