pub trait NetCapability {
type Handle: Send + Unpin;
type Reader: Send + Unpin;
type Writer: Send + Unpin;
type Error: Into<GuestError>;
// Required methods
fn create(
&self,
protocol: NetProtocol,
domain: &str,
port: u16,
tls: Option<Arc<TlsServerConfig>>,
) -> BoxFuture<'_, Result<Self::Handle, Self::Error>>;
fn connect(
&self,
protocol: NetProtocol,
domain: &str,
port: u16,
tls: Option<Arc<TlsClientConfig>>,
) -> BoxFuture<'_, Result<(Self::Reader, Self::Writer, String), Self::Error>>;
fn accept(
&self,
handle: &Self::Handle,
) -> BoxFuture<'_, Result<(Self::Reader, Self::Writer, String), Self::Error>>;
}Required Associated Types§
type Handle: Send + Unpin
type Reader: Send + Unpin
type Writer: Send + Unpin
type Error: Into<GuestError>
Required Methods§
Sourcefn create(
&self,
protocol: NetProtocol,
domain: &str,
port: u16,
tls: Option<Arc<TlsServerConfig>>,
) -> BoxFuture<'_, Result<Self::Handle, Self::Error>>
fn create( &self, protocol: NetProtocol, domain: &str, port: u16, tls: Option<Arc<TlsServerConfig>>, ) -> BoxFuture<'_, Result<Self::Handle, Self::Error>>
Creates a new network listener for the selected protocol, returning a handle to the listener.