pub struct TcpServerTransport { /* private fields */ }Expand description
TCP listener transport for server-frame connections.
Implementations§
Source§impl TcpServerTransport
impl TcpServerTransport
Sourcepub fn bind(address: ServerAddress) -> Result<Self>
pub fn bind(address: ServerAddress) -> Result<Self>
Binds a TCP listener to address.
Sourcepub fn local_port(&self) -> Result<u16>
pub fn local_port(&self) -> Result<u16>
Returns the bound local port.
Trait Implementations§
Source§impl ServerTransport for TcpServerTransport
impl ServerTransport for TcpServerTransport
Source§fn address(&self) -> &ServerAddress
fn address(&self) -> &ServerAddress
Returns the address this transport is bound to.
Source§fn accept(&self, cx: &mut Cx) -> Result<Box<dyn ConnectionTransport>>
fn accept(&self, cx: &mut Cx) -> Result<Box<dyn ConnectionTransport>>
Blocks until a connection arrives and returns it.
Source§fn shutdown(&self, _cx: &mut Cx) -> Result<()>
fn shutdown(&self, _cx: &mut Cx) -> Result<()>
Shuts down the listener and releases its resources.
Source§fn accept_timeout(
&self,
_cx: &mut Cx,
_timeout: Duration,
) -> Result<Option<Box<dyn ConnectionTransport>>>
fn accept_timeout( &self, _cx: &mut Cx, _timeout: Duration, ) -> Result<Option<Box<dyn ConnectionTransport>>>
Accepts a connection, returning
None if timeout elapses first.Auto Trait Implementations§
impl Freeze for TcpServerTransport
impl RefUnwindSafe for TcpServerTransport
impl Send for TcpServerTransport
impl Sync for TcpServerTransport
impl Unpin for TcpServerTransport
impl UnsafeUnpin for TcpServerTransport
impl UnwindSafe for TcpServerTransport
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
Mutably borrows from an owned value. Read more