xencall/
error.rs

1use std::io;
2
3use tokio::task::JoinError;
4
5#[derive(thiserror::Error, Debug)]
6pub enum Error {
7    #[error("version of xen is not supported")]
8    XenVersionUnsupported,
9    #[error("kernel error: {0}")]
10    Kernel(#[from] nix::errno::Errno),
11    #[error("io issue encountered: {0}")]
12    Io(#[from] io::Error),
13    #[error("failed to acquire semaphore: {0}")]
14    AcquireSemaphoreFailed(#[from] tokio::sync::AcquireError),
15    #[error("populate physmap failed")]
16    PopulatePhysmapFailed,
17    #[error("mmap batch failed: {0}")]
18    MmapBatchFailed(nix::errno::Errno),
19    #[error("specified value is too long")]
20    ValueTooLong,
21    #[error("failed to join async task: {0}")]
22    JoinError(JoinError),
23}
24
25pub type Result<T> = std::result::Result<T, Error>;