pub struct FlowCtrl { /* private fields */ }Expand description
Control the flow of execute handlers.
When a request is coming, Router will detect it and get the matched router.
And then salvo will collect all handlers (including added as middlewares) from the matched router tree.
All handlers in this list will executed one by one.
Each handler can use FlowCtrl to control execute flow, let the flow call next handler or skip all rest handlers.
NOTE: When Response’s status code is set, and the status code Response::is_stamped() is returns false,
all remaining handlers will be skipped.
Implementations§
Source§impl FlowCtrl
impl FlowCtrl
Sourcepub async fn call_next(
&mut self,
req: &mut Request,
depot: &mut Depot,
res: &mut Response,
) -> bool
pub async fn call_next( &mut self, req: &mut Request, depot: &mut Depot, res: &mut Response, ) -> bool
Call next handler. If get next handler and executed, returns true``, otherwise returns false`.
NOTE: If response status code is error or is redirection, all reset handlers will be skipped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlowCtrl
impl !RefUnwindSafe for FlowCtrl
impl Send for FlowCtrl
impl Sync for FlowCtrl
impl Unpin for FlowCtrl
impl !UnwindSafe for FlowCtrl
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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