pub struct MiddlewareResult {
pub action: MiddlewareAction,
pub modified_data: Option<MiddlewareData>,
pub reason: Option<String>,
}Expand description
Result of middleware execution.
Fields§
§action: MiddlewareActionHow the pipeline should proceed after this middleware runs.
modified_data: Option<MiddlewareData>If set, the pipeline replaces the current data with this before continuing.
reason: Option<String>Human-readable explanation, typically set on block or terminate.
Implementations§
Source§impl MiddlewareResult
impl MiddlewareResult
Sourcepub fn modify(data: MiddlewareData) -> Self
pub fn modify(data: MiddlewareData) -> Self
Continue but replace the middleware data (e.g. modify params).
Sourcepub fn is_continue(&self) -> bool
pub fn is_continue(&self) -> bool
Returns true if the action is MiddlewareAction::Continue.
Sourcepub fn is_block(&self) -> bool
pub fn is_block(&self) -> bool
Returns true if the action is MiddlewareAction::Block.
Sourcepub fn is_terminate(&self) -> bool
pub fn is_terminate(&self) -> bool
Returns true if the action is MiddlewareAction::Terminate.
Trait Implementations§
Source§impl Clone for MiddlewareResult
impl Clone for MiddlewareResult
Source§fn clone(&self) -> MiddlewareResult
fn clone(&self) -> MiddlewareResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MiddlewareResult
impl RefUnwindSafe for MiddlewareResult
impl Send for MiddlewareResult
impl Sync for MiddlewareResult
impl Unpin for MiddlewareResult
impl UnsafeUnpin for MiddlewareResult
impl UnwindSafe for MiddlewareResult
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