dope_sys/table/permit/mod.rs
1//! Fixed indexed FIFO permits over staged admission.
2
3use o3::alloc;
4
5mod queue;
6pub mod raw;
7mod source;
8
9pub use queue::Queue;
10pub use source::Source;
11
12/// Allocates registration storage for a backend with receive permits.
13pub trait Create: Queue {
14 fn try_new(capacity: usize) -> Result<Self, alloc::Error>;
15}
16
17/// Constructs an absent registration domain without allocation or failure.
18pub trait Empty: Queue {
19 fn new() -> Self;
20}
21
22/// The selected backend has no provided-buffer receive registration.
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
24pub struct Absent;
25
26/// The exact registration phase observed by a removal attempt.
27#[derive(Clone, Copy, Debug, PartialEq, Eq)]
28pub enum State<Key> {
29 Gone,
30 Waiting,
31 Granted(Key),
32 Stale,
33}