Trait QuicRuntime
pub trait QuicRuntime:
Send
+ Sync
+ Debug
+ 'static {
// Required methods
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<Arc<dyn AsyncUdpSocket>, Error>;
// Provided method
fn now(&self) -> Instant { ... }
}Expand description
quinn’s runtime: spawns its tasks, and gives its timers and UDP sockets. Implement it to run QUIC on your own I/O reactor. Abstracts I/O and timer operations for runtime independence
Required Methods§
fn spawn(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>)
fn spawn(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>)
Drive future to completion in the background
fn wrap_udp_socket(
&self,
t: UdpSocket,
) -> Result<Arc<dyn AsyncUdpSocket>, Error>
fn wrap_udp_socket( &self, t: UdpSocket, ) -> Result<Arc<dyn AsyncUdpSocket>, Error>
Convert t into the socket type used by this runtime
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".