Struct TcpSocket
pub struct TcpSocket<'a> { /* private fields */ }
Expand description
TCP socket for establishing connections.
This socket can handle one connection at a time. Create multiple instances for concurrent connections.
Implementations§
Trait Implementations§
§impl<'a> TcpSocket for TcpSocket<'a>
impl<'a> TcpSocket for TcpSocket<'a>
§async fn connect(
&mut self,
address: SocketAddr,
) -> Result<impl TcpConnection, Error>
async fn connect( &mut self, address: SocketAddr, ) -> Result<impl TcpConnection, Error>
Connects to a remote TCP server.
§async fn accept(
&mut self,
address: SocketAddr,
) -> Result<(impl TcpConnection, SocketAddr), Error>
async fn accept( &mut self, address: SocketAddr, ) -> Result<(impl TcpConnection, SocketAddr), Error>
Accepts an incoming TCP connection. Read more
Auto Trait Implementations§
impl<'a> Freeze for TcpSocket<'a>
impl<'a> !RefUnwindSafe for TcpSocket<'a>
impl<'a> !Send for TcpSocket<'a>
impl<'a> !Sync for TcpSocket<'a>
impl<'a> Unpin for TcpSocket<'a>
impl<'a> !UnwindSafe for TcpSocket<'a>
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