dope_sys/engine/ring/backend.rs
1use crate::{
2 engine::ring::Context,
3 io::Close,
4 ring::{map::Unmap, ready::Ready},
5};
6
7/// Borrows the native reactor and its stable option storage from one owner.
8pub trait Backend<C: Context>: Close<State: Unmap> + Sized {
9 type Ring: Ready<Token = C::Token, Layout = C::Layout>;
10
11 fn new(ring: Self::Ring, tuning: C::Tuning) -> Self;
12 fn ring(&mut self) -> &mut Self::Ring;
13 fn tuning(&mut self) -> &mut C::Tuning;
14 fn split(&mut self) -> (&mut Self::Ring, &mut C::Tuning);
15}