Skip to main content

ostd/
error.rs

1// SPDX-License-Identifier: MPL-2.0
2use vstd::prelude::*;
3
4use crate::mm::page_table::PageTableError;
5
6verus! {
7
8/// The error type which is returned from the APIs of this crate.
9#[derive(Clone, Copy, PartialEq, Eq, Debug)]
10pub enum Error {
11    /// Invalid arguments provided.
12    pub InvalidArgs,
13    /// Insufficient memory available.
14    pub NoMemory,
15    /// Page fault occurred.
16    pub PageFault,
17    /// Access to a resource is denied.
18    pub AccessDenied,
19    /// Input/output error.
20    pub IoError,
21    /// Insufficient system resources.
22    pub NotEnoughResources,
23    /// Arithmetic Overflow occurred.
24    pub Overflow,
25}
26
27} // verus!
28impl From<PageTableError> for Error {
29    fn from(_err: PageTableError) -> Error {
30        Error::AccessDenied
31    }
32}