#[non_exhaustive]pub struct Refusal {
pub point: &'static str,
pub listener: String,
pub owner: Option<String>,
pub reason: String,
pub failed: bool,
}Expand description
A request stopped by one of its listeners: the listener refused it
(HookError::Refuse), or failed on a fail-closed point
(PointSpec::fail_closed). The listeners after it did not run.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.point: &'static strThe point emitted.
listener: StringThe listener that stopped the request.
owner: Option<String>Its owner.
reason: StringThe reason it gave, or its failure as text.
failed: boolWhether the listener failed (its Failure is in the result’s
failures) rather than refused.
Implementations§
Source§impl Refusal
impl Refusal
Sourcepub fn new(
point: &'static str,
listener: impl Into<String>,
owner: Option<String>,
reason: impl Into<String>,
) -> Refusal
pub fn new( point: &'static str, listener: impl Into<String>, owner: Option<String>, reason: impl Into<String>, ) -> Refusal
The refusal of point by the listener listener, for reason.
Sourcepub fn from_failure(failure: &Failure) -> Refusal
pub fn from_failure(failure: &Failure) -> Refusal
The refusal a listener’s failure makes on a fail-closed point.
Trait Implementations§
impl Eq for Refusal
impl StructuralPartialEq for Refusal
Auto Trait Implementations§
impl Forget for Refusal
impl Freeze for Refusal
impl Move for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusalwhere
RawVecInner: Sync,
impl Unpin for Refusal
impl UnsafeUnpin for Refusal
impl UnwindSafe for Refusal
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