[go: up one dir, main page]

Trait quinn::Runtime

source ·
pub trait Runtime: Send + Sync + Debug + 'static {
    fn new_timer(&self, i: Instant) -> Pin<Box<dyn AsyncTimer>>;
    fn spawn(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>);
    fn wrap_udp_socket(&self, t: UdpSocket) -> Result<Box<dyn AsyncUdpSocket>>;
}
Expand description

Abstracts I/O and timer operations for runtime independence

Required Methods

Construct a timer that will expire at i

Drive future to completion in the background

Convert t into the socket type used by this runtime

Implementors