Skip to main content

dope_sys/engine/admit/
guard.rs

1use crate::{
2    engine::admit::Context,
3    io::{request, socket},
4};
5
6type Slot<C> = <<C as Context>::Inputs as request::Context>::Target;
7
8/// A reserved native submission slot, consumed before the host commits its flight.
9pub trait Guard<C: Context>: Sized {
10    fn socket(
11        self,
12        slot: <C::Inputs as request::Context>::Outbound,
13        domain: socket::Domain,
14        key: C::Key,
15    );
16    fn accept_multi(self, listener: Slot<C>, key: C::Key);
17    fn recv(self, slot: Slot<C>, key: C::Key);
18    fn recv_msg(self, fd: &<C::Inputs as request::Context>::Datagram<'_>, key: C::Key);
19    fn shutdown(self, slot: Slot<C>, key: C::Key);
20}