Trait netemul::RealmTcpStream
source · pub trait RealmTcpStream: Sized {
// Required methods
fn connect_in_realm<'a>(
realm: &'a TestRealm<'a>,
addr: SocketAddr
) -> LocalBoxFuture<'a, Result<Self, Error>>;
fn bind_and_connect_in_realm<'a>(
realm: &'a TestRealm<'a>,
local: SocketAddr,
dst: SocketAddr
) -> LocalBoxFuture<'a, Result<Self, Error>>;
fn connect_in_realm_with_sock<'a, F: FnOnce(&Socket) -> Result<(), Error> + 'a>(
realm: &'a TestRealm<'a>,
dst: SocketAddr,
with_sock: F
) -> LocalBoxFuture<'a, Result<Self, Error>>;
}
Expand description
Trait describing TCP streams in a testing realm.
Required Methods§
sourcefn connect_in_realm<'a>(
realm: &'a TestRealm<'a>,
addr: SocketAddr
) -> LocalBoxFuture<'a, Result<Self, Error>>
fn connect_in_realm<'a>( realm: &'a TestRealm<'a>, addr: SocketAddr ) -> LocalBoxFuture<'a, Result<Self, Error>>
Creates a TCP stream in realm
connected to addr
.
sourcefn bind_and_connect_in_realm<'a>(
realm: &'a TestRealm<'a>,
local: SocketAddr,
dst: SocketAddr
) -> LocalBoxFuture<'a, Result<Self, Error>>
fn bind_and_connect_in_realm<'a>( realm: &'a TestRealm<'a>, local: SocketAddr, dst: SocketAddr ) -> LocalBoxFuture<'a, Result<Self, Error>>
Creates a TCP stream in realm
bound to local
and connected to dst
.
sourcefn connect_in_realm_with_sock<'a, F: FnOnce(&Socket) -> Result<(), Error> + 'a>(
realm: &'a TestRealm<'a>,
dst: SocketAddr,
with_sock: F
) -> LocalBoxFuture<'a, Result<Self, Error>>
fn connect_in_realm_with_sock<'a, F: FnOnce(&Socket) -> Result<(), Error> + 'a>( realm: &'a TestRealm<'a>, dst: SocketAddr, with_sock: F ) -> LocalBoxFuture<'a, Result<Self, Error>>
Creates a TCP stream in realm
connected to addr
.
Closure with_sock
is called with the reference of the socket before
the socket is connected to addr
.
Object Safety§
This trait is not object safe.