pub trait AsyncListener: 'static + Send {
// Required method
fn poll_accept(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
local_addr: Option<&mut String>,
peer_addr: Option<&mut String>,
) -> Poll<Result<Option<Box<dyn AsyncStream>>>>;
}Expand description
AsyncListener lets an implementation implement a slightly modified form of std::net::TcpListener::accept.
Required Methods§
Sourcefn poll_accept(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
local_addr: Option<&mut String>,
peer_addr: Option<&mut String>,
) -> Poll<Result<Option<Box<dyn AsyncStream>>>>
fn poll_accept( self: Pin<&mut Self>, cx: &mut Context<'_>, local_addr: Option<&mut String>, peer_addr: Option<&mut String>, ) -> Poll<Result<Option<Box<dyn AsyncStream>>>>
The enclave may optionally request the local or peer addresses
be returned in local_addr or peer_addr, respectively.
If local_addr and/or peer_addr are not None, they will point to an empty String.
On success, user-space can fill in the strings as appropriate.
The enclave must not make any security decisions based on the local address received.