1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use std::{ops::ControlFlow, time};
use o3::mem::quota;
use crate::io::reactor::ready::{Backend, Driver, delivery::Decoded, store::Exec};
pub trait Decode: Exec {
/// # Safety
/// The value was returned by this driver's registered kernel queue.
unsafe fn decode(raw: usize) -> Decoded<Self::Key>;
const SHUTDOWN: Self::Event;
}
pub trait Poll<C: Driver>: Backend<C> {
/// A blocked receive consumes its admission and ends this pass without being removed.
///
/// # Safety
/// Registered operations retain their submitted storage and admitted layouts.
unsafe fn resume<'a, Tag>(
&'a mut self,
budget: &mut quota::Lease<'_, Tag>,
) -> Result<ControlFlow<()>, Self::Failure>
where
C::Context: 'a;
/// # Safety
/// Registered operations retain their submitted storage and admitted layouts.
/// Kernel identities belong to this driver's live or retired flights.
unsafe fn wait<'a, Changes, Done>(
&'a mut self,
timeout: Option<time::Duration>,
changes: &mut quota::Lease<'_, Changes>,
done: &mut quota::Lease<'_, Done>,
) -> Result<(), Self::Failure>
where
C::Context: 'a;
}