pub struct ConnectionOrientedListener { /* private fields */ }
Expand description
A connection-oriented network listener.
ConnectionOrientedListener
is conceptually the same as Listener
, but specifically works with connection-oriented
protocols. This variant is provided to facilitate usages where only a connection-oriented stream makes sense, such
as an HTTP server.
Implementations§
Source§impl ConnectionOrientedListener
impl ConnectionOrientedListener
Sourcepub async fn from_listen_address(
listen_address: ListenAddress,
) -> Result<Self, ListenerError>
pub async fn from_listen_address( listen_address: ListenAddress, ) -> Result<Self, ListenerError>
Creates a new ConnectionOrientedListener
from the given listen address.
§Errors
If the listen address is not a connection-oriented address family, or if the listen address cannot be bound, or if the listener cannot be configured correctly, an error is returned.
Sourcepub fn listen_address(&self) -> &ListenAddress
pub fn listen_address(&self) -> &ListenAddress
Gets a reference to the listen address.
Sourcepub async fn accept(&mut self) -> Result<Connection, ListenerError>
pub async fn accept(&mut self) -> Result<Connection, ListenerError>
Accepts a new connection from the listener.
§Errors
If the listener fails to accept a new connection, or if the accepted connection cannot be configured correctly, an error is returned.
Auto Trait Implementations§
impl !Freeze for ConnectionOrientedListener
impl RefUnwindSafe for ConnectionOrientedListener
impl Send for ConnectionOrientedListener
impl Sync for ConnectionOrientedListener
impl Unpin for ConnectionOrientedListener
impl UnwindSafe for ConnectionOrientedListener
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
Tracked
wrapper. Read moreSource§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Tracked
wrapper. Read more