use crate::{
io::reactor::event::kind,
table::{reclaim, token::host::Flight},
};
pub trait Slots<F: Flight> {
type Index: Copy;
type Capacity: Copy;
type Physical: Copy + Eq;
type Outbound: Copy + Into<Self::Physical>;
type Creation: AsRef<Self::Outbound>;
type Accepted: TryFrom<(Self::Index, Self::Capacity), Error = (Self::Index, Self::Capacity)>;
type Reclaimed;
type Retirement: reclaim::Queue<Slot = Self::Physical>;
fn accept_cap(&self) -> Self::Capacity;
fn creation(&self, target: F::Target<kind::Socket>) -> Option<Self::Creation>;
fn fail_create(&self, creation: Self::Creation);
fn created(&self, creation: Self::Creation) -> Result<F::Created, F::SocketFailure>;
fn accepted(&self, accepted: Self::Accepted) -> Result<F::Descriptor, F::AcceptFailure>;
fn abandon(&self, accepted: Self::Accepted) -> Self::Reclaimed;
fn reclaim(&self, creation: Self::Creation);
fn retirement(&self) -> Self::Retirement;
}