#[non_exhaustive]pub enum HookError {
Failed(String),
Refuse(String),
}Expand description
What a listener returns instead of Ok(()): it failed, or it refuses
the request.
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.
Failed(String)
The listener failed: its contribution is dropped and the other
listeners run, unless its point is fail-closed
(PointSpec::fail_closed).
Refuse(String)
The listener refuses the request, with a reason. On a
PointKind::Request point the emit stops: no later listener
runs, and the result names the refusal (Refusal). On another
kind it counts as HookError::Failed.
Implementations§
Trait Implementations§
impl Eq for HookError
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()
impl StructuralPartialEq for HookError
Auto Trait Implementations§
impl Forget for HookError
impl Freeze for HookError
impl Move for HookError
impl RefUnwindSafe for HookError
impl Send for HookErrorwhere
RawVecInner: Send,
impl Sync for HookErrorwhere
RawVecInner: Sync,
impl Unpin for HookError
impl UnsafeUnpin for HookError
impl UnwindSafe for HookErrorwhere
RawVecInner: UnwindSafe,
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