Trait Driver

Source
pub trait Driver {
    type Unpark: Unpark;

    // Required methods
    fn with<R>(&self, f: impl FnOnce() -> R) -> R;
    fn submit(&self) -> Result<()>;
    fn park(&self) -> Result<()>;
    fn park_timeout(&self, duration: Duration) -> Result<()>;
    fn unpark(&self) -> Self::Unpark;
}
Expand description

Core driver trait.

Required Associated Types§

Source

type Unpark: Unpark

The struct to wake thread from another.

Required Methods§

Source

fn with<R>(&self, f: impl FnOnce() -> R) -> R

Run with driver TLS.

Source

fn submit(&self) -> Result<()>

Submit ops to kernel and process returned events.

Source

fn park(&self) -> Result<()>

Wait infinitely and process returned events.

Source

fn park_timeout(&self, duration: Duration) -> Result<()>

Wait with timeout and process returned events.

Source

fn unpark(&self) -> Self::Unpark

Get Unpark.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Driver for IoUringDriver

Source§

type Unpark = UnparkHandle

Source§

impl Driver for LegacyDriver

Source§

type Unpark = UnparkHandle

Source§

impl<D> Driver for TimeDriver<D>
where D: Driver + 'static,