dope_core/driver/ops/poll/
mod.rs1use std::{io, time};
2
3use crate::driver::schedule;
4
5mod backend;
6mod dispatch;
7mod source;
8
9pub(crate) use backend::Backend;
10pub use dispatch::Dispatch;
11pub use source::Source;
12
13#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14#[must_use = "pending backend events must be drained before blocking"]
15pub enum Drain {
16 Drained,
18 Pending,
20}
21
22#[derive(Clone, Copy, Debug, Eq, PartialEq)]
23#[must_use = "pending backend changes must be committed in a later reactor turn"]
24pub enum Commit {
25 Drained,
27 Pending,
29}
30
31pub trait Poll<'d>: Backend {
32 fn commit(&mut self, work: schedule::Reactor<'_, 'd>) -> io::Result<Commit>;
33
34 fn wait(
35 &mut self,
36 work: schedule::Reactor<'_, 'd>,
37 timeout: Option<time::Duration>,
38 ) -> io::Result<()>;
39}