#[non_exhaustive]pub enum Error {
Backend {
message: String,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
},
MemoryOutOfRange(String),
InvalidProtection(String),
Unsupported(&'static str),
InvalidVcpuState(&'static str),
InvalidArgument(String),
}Expand description
Errors that can surface from a hypervisor backend, a vCPU, or a memory operation.
Variants are intentionally coarse — backend-specific error context is captured in the
source field of Error::Backend so consumers can downcast without coupling to a
specific backend’s error enum.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Backend
A backend (HVF, VZ, mock) reported a failure while executing a hypervisor operation.
Fields
MemoryOutOfRange(String)
A guest memory operation referenced an address or range that is not mapped.
InvalidProtection(String)
A guest memory operation requested an unsupported protection change.
Unsupported(&'static str)
The capability the caller requested is not implemented by the active backend.
InvalidVcpuState(&'static str)
A vCPU was driven from an unexpected lifecycle state.
InvalidArgument(String)
The argument supplied by the caller was rejected by validation.
Implementations§
Source§impl Error
impl Error
Sourcepub fn backend(message: impl Into<String>) -> Self
pub fn backend(message: impl Into<String>) -> Self
Build a Error::Backend from a static message.
Sourcepub fn backend_source<E>(message: impl Into<String>, source: E) -> Self
pub fn backend_source<E>(message: impl Into<String>, source: E) -> Self
Build a Error::Backend from a message and a wrapped source error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()