pub enum OnViolation {
Reject,
LogAndPass,
Custom(Arc<dyn Fn(&Violation) -> ViolationAction + Send + Sync>),
}Expand description
Policy for handling violations.
Variants§
Reject
Return the appropriate 4xx/5xx response immediately.
LogAndPass
Log the violation via tracing::warn but forward the request. Does NOT apply to Timeout violations (no response to forward).
Custom(Arc<dyn Fn(&Violation) -> ViolationAction + Send + Sync>)
Custom callback. Must be Fn(&Violation) -> ViolationAction + Send + Sync + ’static.
Implementations§
Source§impl OnViolation
impl OnViolation
Trait Implementations§
Source§impl Clone for OnViolation
impl Clone for OnViolation
Source§fn clone(&self) -> OnViolation
fn clone(&self) -> OnViolation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OnViolation
impl Debug for OnViolation
Source§impl Default for OnViolation
impl Default for OnViolation
Source§fn default() -> OnViolation
fn default() -> OnViolation
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OnViolation
impl !RefUnwindSafe for OnViolation
impl Send for OnViolation
impl Sync for OnViolation
impl Unpin for OnViolation
impl UnsafeUnpin for OnViolation
impl !UnwindSafe for OnViolation
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