pub struct TcpSocket;
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§
Source§impl TcpSocket for TcpSocket
impl TcpSocket for TcpSocket
Source§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.
Source§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 Freeze for TcpSocket
impl RefUnwindSafe for TcpSocket
impl Send for TcpSocket
impl Sync for TcpSocket
impl Unpin for TcpSocket
impl UnwindSafe for TcpSocket
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