page_table_generic/
err.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use thiserror::Error;

/// The error type for page table operation failures.
#[derive(Error, Debug, PartialEq, Eq)]
pub enum PagingError {
    #[error("can't allocate memory")]
    NoMemory,
    #[error("{0} is not aligned")]
    NotAligned(&'static str),
    #[error("not mapped")]
    NotMapped,
    #[error("already mapped")]
    AlreadyMapped,
}

/// The specialized `Result` type for page table operations.
pub type PagingResult<T = ()> = Result<T, PagingError>;