Skip to main content

dope_sys/ring/create/
retain.rs

1use crate::{memory, memory::buffer::provided};
2
3/// Retains all ring and payload owners while construction cleanup is incomplete.
4pub trait Retain<P>: memory::Cleanup<P> {
5    type Build: super::Build<P, Context = Self::Context, Cleanup = Self>;
6    type Ring;
7    type Probe;
8    type Canary;
9    type Context: provided::Context<Cleanup = Self::Buffers>;
10    type Buffers: provided::Cleanup<Context = Self::Context>;
11    type Producer;
12    type Registration;
13    type Registered;
14    type BufferError;
15
16    fn probe(state: Self::Probe) -> Self;
17    fn open<F: provided::Failure<Cleanup = Self::Buffers>>(
18        ring: Self::Ring,
19        fault: F,
20    ) -> Self::Build;
21    fn canary(ring: Self::Ring, primary: P, buffers: Self::Canary) -> Result<P, Self>;
22    fn unmap(ring: Self::Ring, primary: P, buffers: Self::Buffers) -> Self;
23    fn registration(state: Self::Registration, buffers: Self::Producer) -> Self::Build;
24    fn provided(
25        cause: Self::BufferError,
26        ring: Self::Registered,
27        buffers: Self::Producer,
28    ) -> Self::Build;
29}