#[non_exhaustive]pub enum Fault {
Panic {
message: String,
},
CapabilityViolation {
token_id: String,
capability: Capability,
},
TokenExpired {
token_id: String,
expires_at_epoch_s: u64,
},
ProtocolViolation {
detail: String,
},
PolicyDenied {
reason: String,
},
}Expand description
Structured error type for kernel dispatch failures.
Unlike KernelError (which covers all kernel operations including setup),
Fault represents runtime dispatch failures that callers can match on
to decide recovery strategy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl Fault
impl Fault
pub fn from_policy_error(err: PolicyError) -> Fault
pub fn from_kernel_error(err: KernelError) -> Fault
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Fault
impl<'de> Deserialize<'de> for Fault
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Fault, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Fault, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Error for Fault
impl Error for Fault
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl Serialize for Fault
impl Serialize for Fault
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Fault
impl StructuralPartialEq for Fault
Auto Trait Implementations§
impl Freeze for Fault
impl RefUnwindSafe for Fault
impl Send for Fault
impl Sync for Fault
impl Unpin for Fault
impl UnsafeUnpin for Fault
impl UnwindSafe for Fault
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more