pub struct Not<G>(pub G);
Expand description
Wraps a guard and inverts the outcome of its Guard
implementation.
Examples
The handler below will be called for any request method apart from GET
.
use actix_web::{guard, web, HttpResponse};
web::route()
.guard(guard::Not(guard::Get()))
.to(|| HttpResponse::Ok());
Tuple Fields§
§0: G
Trait Implementations§
Auto Trait Implementations§
impl<G> RefUnwindSafe for Not<G>where G: RefUnwindSafe,
impl<G> Send for Not<G>where G: Send,
impl<G> Sync for Not<G>where G: Sync,
impl<G> Unpin for Not<G>where G: Unpin,
impl<G> UnwindSafe for Not<G>where G: UnwindSafe,
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