1#![cfg_attr(not(test), no_std)]
2#![doc = include_str!("../README.md")]
3
4extern crate alloc;
5
6mod area;
7mod backend;
8mod set;
9
10#[cfg(test)]
11mod tests;
12
13pub use self::{area::MemoryArea, backend::MappingBackend, set::MemorySet};
14
15#[derive(Debug, Eq, PartialEq, thiserror::Error)]
17pub enum MappingError {
18 #[error("invalid mapping parameter")]
20 InvalidParam,
21 #[error("mapping already exists")]
23 AlreadyExists,
24 #[error("mapping backend is in a bad state")]
26 BadState,
27 #[error("mapping operation requires repair")]
31 NeedsRepair,
32}
33
34pub type MappingResult<T = ()> = Result<T, MappingError>;