[][src]Trait runtime_raw::Runtime

pub trait Runtime: Send + Sync + 'static {
    fn spawn_obj(&self, fut: FutureObj<'static, ()>) -> Result<(), SpawnError>;
fn connect_tcp_stream(
        &self,
        addr: &SocketAddr
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn TcpStream>>>> + Send>>;
fn bind_tcp_listener(
        &self,
        addr: &SocketAddr
    ) -> Result<Pin<Box<dyn TcpListener>>>;
fn bind_udp_socket(
        &self,
        addr: &SocketAddr
    ) -> Result<Pin<Box<dyn UdpSocket>>>; }

The runtime trait.

Required methods

fn spawn_obj(&self, fut: FutureObj<'static, ()>) -> Result<(), SpawnError>

Spawn a new future.

fn connect_tcp_stream(
    &self,
    addr: &SocketAddr
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn TcpStream>>>> + Send>>

Create a new TcpStream.

This method is defined on the Runtime trait because defining it on TcpStream would prevent it from being a trait object.

fn bind_tcp_listener(
    &self,
    addr: &SocketAddr
) -> Result<Pin<Box<dyn TcpListener>>>

Create a new TcpListener.

This method is defined on the Runtime trait because defining it on TcpListener would prevent it from being a trait object.

fn bind_udp_socket(&self, addr: &SocketAddr) -> Result<Pin<Box<dyn UdpSocket>>>

Create a new UdpSocket.

This method is defined on the Runtime trait because defining it on UdpSocket would prevent it from being a trait object.

Loading content...

Implementors

Loading content...