pub enum ControlFlow {
Continue,
Break(Response),
}Expand description
Control flow for middleware before hooks.
Determines whether request processing should continue to the handler or short-circuit with an early response.
Variants§
Continue
Continue processing - call the next middleware or handler.
Break(Response)
Short-circuit - return this response immediately without calling the handler.
Subsequent before hooks and the handler will NOT run.
However, after hooks for middleware that already ran their before WILL run.
Implementations§
Source§impl ControlFlow
impl ControlFlow
Trait Implementations§
Source§impl Debug for ControlFlow
impl Debug for ControlFlow
Source§impl From<ControlFlow> for ControlFlow<Response, ()>
impl From<ControlFlow> for ControlFlow<Response, ()>
Source§fn from(cf: ControlFlow) -> Self
fn from(cf: ControlFlow) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ControlFlow
impl !RefUnwindSafe for ControlFlow
impl Send for ControlFlow
impl !Sync for ControlFlow
impl Unpin for ControlFlow
impl !UnwindSafe for ControlFlow
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).