1use o3::buffer;
2
3use crate::{
4 io,
5 memory::{self, buffer::raw::Release},
6};
7
8pub mod admit;
9mod cancel;
10mod install;
11pub mod life;
12pub mod raw;
13pub mod register;
14pub mod ring;
15pub mod shutdown;
16pub use cancel::Cancel;
17pub use install::Install;
18
19pub trait Buffer: Release<Self::Token> {
21 type Layout: memory::raw::Layout;
22 type Token;
23 type Context: memory::Context<Layout = Self::Layout> + buffer::raw::Fixed<Self::Token>;
24}
25
26pub trait Source<C> {
28 type Backend: io::Close<State = Self::Closing> + shutdown::Shutdown;
29 type Closing: io::Retry;
30}
31
32pub trait Storage<C, P: Copy, R: Copy>: Removal {
34 type Cleanup: memory::Cleanup<P>;
35 type Release: memory::Cleanup<(R, Self::Slot)>;
36}
37
38pub trait Removal {
40 type Slot: Copy + Eq;
41}