Struct aggligator_util::transport::Acceptor
source · pub struct Acceptor { /* private fields */ }Expand description
Accepts incoming connections from remote endpoints using a variety of transports.
Dropping this stops listening and accepting incoming connections.
Implementations§
source§impl Acceptor
impl Acceptor
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new acceptor using the default configuration.
Use AcceptorBuilder for customization.
sourcepub fn wrapped(wrapper: impl AcceptingWrapper) -> Self
pub fn wrapped(wrapper: impl AcceptingWrapper) -> Self
Creates a new acceptor using the default configuration and a single connection wrapper.
sourcepub fn add(&self, transport: impl AcceptingTransport) -> AcceptingTransportHandle
pub fn add(&self, transport: impl AcceptingTransport) -> AcceptingTransportHandle
Adds a new transport.
sourcepub async fn accept(
&self
) -> Result<(Channel, Control<IoTxBox, IoRxBox, LinkTagBox>)>
pub async fn accept(
&self
) -> Result<(Channel, Control<IoTxBox, IoRxBox, LinkTagBox>)>
Waits for an incoming connection and accepts it.
Returns the aggregated link channel and control handle.
This function is cancel-safe.
sourcepub fn link_errors(&self) -> Receiver<LinkError<LinkTagBox>>
pub fn link_errors(&self) -> Receiver<LinkError<LinkTagBox>>
Subscribes to the stream of link errors.