#[non_exhaustive]pub enum HookError {
BudgetExceeded,
CapabilityDenied(CapToken),
Trapped(&'static str),
PolicyReValidationFailed,
}Expand description
Hook execution outcome.
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.
BudgetExceeded
Hook invocation exceeded the 10 ms / fuel budget. Surfaces only from sandbox-backed hosts; the no-op pass-through never returns this.
CapabilityDenied(CapToken)
Hook tried to import a host function not in its capability set. Rejected at module-load (sandbox-backed host) or as a call-site fallback.
Trapped(&'static str)
Hook invocation trapped — host catches and quarantines without propagating the unwind (analog of L0 A22).
PolicyReValidationFailed
Post-hook policy re-validation rejected the mutated extra bytes (confused-deputy defense — hook attempted to flip policy outcome).
Trait Implementations§
Source§impl Error for HookError
impl Error for HookError
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()
Auto Trait Implementations§
impl Freeze for HookError
impl RefUnwindSafe for HookError
impl Send for HookError
impl Sync for HookError
impl Unpin for HookError
impl UnsafeUnpin for HookError
impl UnwindSafe for HookError
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