1use o3::base::marker::ThreadBound;
4use std::{convert::Infallible, marker};
5
6pub mod client;
7pub mod control;
8pub mod driver;
9pub mod executor;
10pub mod io;
11pub mod platform;
12pub mod signal;
13pub mod topology;
14
15pub use dope_sys::{self, Errno};
16use dope_sys::{
17 engine::{Removal, Source, Storage, admit},
18 table::permit,
19};
20use driver::{
21 life::native::{Context, Receive, host::Host},
22 receive,
23 result::{IoOperation, Kernel, poll},
24 schedule::ready::Stored,
25 storage::Failure,
26};
27pub use o3;
28
29type LocalMarker<T> = marker::PhantomData<(fn(T) -> T, ThreadBound)>;
30type Engine = <Backend as Source<Host<Backend>>>::Backend;
31type Resources = <Backend as Storage<Context, Receive, Failure, (IoOperation, Kernel)>>::Cleanup;
32type Released = <Backend as Storage<Context, Receive, Failure, (IoOperation, Kernel)>>::Release;
33type RemoveSlot = <Backend as Removal>::Slot;
34type ReleasePrimary = ((IoOperation, Kernel), RemoveSlot);
35type Permits = <Backend as permit::Source>::Queue<Stored, receive::Index>;
36use dope_sys::table::token::host;
37use driver::retained::flight::{Arena, Echo};
38
39type CancelRejection = <Backend as admit::Native>::Error<(Echo, admit::Cause<poll::Cause>)>;
40type Fault = <Arena as host::raw::Drain>::Fault;
41type Reported = <Arena as host::raw::Drain>::Reported;
42
43#[derive(Debug)]
45pub enum BranchError<A, B> {
46 First(A),
48 Second(B),
50}
51
52impl<A, B> From<Infallible> for BranchError<A, B> {
53 fn from(value: Infallible) -> Self {
54 match value {}
55 }
56}
57
58cfg_select! {
59 target_os = "linux" => {
60 pub use dope_uring::Backend;
61 }
62 target_os = "macos" => {
63 pub use dope_kqueue::Backend;
64 }
65}