Trait embedded_nal_async::TcpConnect
source · pub trait TcpConnect {
type Error: Error;
type Connection<'a>: Read<Error = Self::Error> + Write<Error = Self::Error>
where Self: 'a;
// Required method
async fn connect<'a>(
&'a self,
remote: SocketAddr
) -> Result<Self::Connection<'a>, Self::Error>;
}
Expand description
This trait is implemented by TCP/IP stacks. The trait allows the underlying driver to construct multiple connections that implement the I/O traits from embedded-io-async.
The associated connection type should close the connection when dropped.
Required Associated Types§
Required Methods§
sourceasync fn connect<'a>(
&'a self,
remote: SocketAddr
) -> Result<Self::Connection<'a>, Self::Error>
async fn connect<'a>( &'a self, remote: SocketAddr ) -> Result<Self::Connection<'a>, Self::Error>
Connect to the given remote host and port.
Returns Ok
if the connection was successful.
Object Safety§
This trait is not object safe.