#![cfg_attr(not(test), no_std)]
#![doc = include_str!("../README.md")]
extern crate alloc;
mod area;
mod backend;
mod set;
#[cfg(test)]
mod tests;
pub use self::area::MemoryArea;
pub use self::backend::MappingBackend;
pub use self::set::MemorySet;
#[derive(Debug, Eq, PartialEq)]
pub enum MappingError {
InvalidParam,
AlreadyExists,
BadState,
}
#[cfg(feature = "axerrno")]
impl From<MappingError> for axerrno::AxError {
fn from(err: MappingError) -> Self {
match err {
MappingError::InvalidParam => axerrno::AxError::InvalidInput,
MappingError::AlreadyExists => axerrno::AxError::AlreadyExists,
MappingError::BadState => axerrno::AxError::BadState,
}
}
}
pub type MappingResult<T = ()> = Result<T, MappingError>;