Skip to main content

Runtime

Trait Runtime 

Source
pub trait Runtime:
    Send
    + Sync
    + 'static {
    // Required methods
    fn spawn(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>);
    fn sleep(
        &self,
        duration: Duration,
    ) -> Pin<Box<dyn Future<Output = ()> + Send>>;
}
Expand description

Trait abstracting asynchronous runtime operations for QUIC endpoints.

Required Methods§

Source

fn spawn(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>)

Spawns a future on the runtime.

Source

fn sleep(&self, duration: Duration) -> Pin<Box<dyn Future<Output = ()> + Send>>

Returns a future that completes after duration.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§