Struct sctp_proto::Endpoint

source ·
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 association-generated events via handle and handle_event.

Implementations§

source§

impl Endpoint

source

pub fn new( config: Arc<EndpointConfig>, server_config: Option<Arc<ServerConfig>> ) -> Self

Create a new endpoint

Returns Err if the configuration is invalid.

source

pub fn poll_transmit(&mut self) -> Option<Transmit>

Get the next packet to transmit

source

pub fn set_server_config(&mut self, server_config: Option<Arc<ServerConfig>>)

Replace the server configuration, affecting new incoming associations only

source

pub fn handle_event( &mut self, ch: AssociationHandle, event: EndpointEvent ) -> Option<AssociationEvent>

Process EndpointEvents emitted from related Associations

In turn, processing this event may return a AssociationEvent for the same Association.

source

pub fn handle( &mut self, now: Instant, remote: SocketAddr, local_ip: Option<IpAddr>, ecn: Option<EcnCodepoint>, data: Bytes ) -> Option<(AssociationHandle, DatagramEvent)>

Process an incoming UDP datagram

source

pub fn connect( &mut self, config: ClientConfig, remote: SocketAddr ) -> Result<(AssociationHandle, Association), ConnectError>

Initiate an Association

source

pub fn reject_new_associations(&mut self)

Unconditionally reject future incoming associations

source

pub fn config(&self) -> &EndpointConfig

Access the configuration used by this endpoint

Trait Implementations§

source§

impl Debug for Endpoint

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V