Skip to main content

dope_sys/ring/create/
error.rs

1use crate::ring::{layout::Layout, map::Map};
2
3/// Setup rejection or retained ownership of incomplete mapping cleanup.
4#[derive(Debug)]
5pub enum Error<S, M, C> {
6    Setup(S),
7    Layout(Layout),
8    Map(Map<M>),
9    Cleanup(C),
10}
11
12impl<S, M, C> From<super::Cause<S, M>> for Error<S, M, C> {
13    fn from(cause: super::Cause<S, M>) -> Self {
14        match cause {
15            super::Cause::Setup(cause) => Self::Setup(cause),
16            super::Cause::Layout(cause) => Self::Layout(cause),
17            super::Cause::Map(cause) => Self::Map(cause),
18        }
19    }
20}