ostd/
error.rs

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