pub struct RequiresScope { /* private fields */ }Expand description
Route middleware that requires the client to have a scope, as #[RequiresScope] does in PHP.
Guests get a 401 unauthenticated, and clients without the scope a 403 insufficient_scope.
route
.post("/orders/{order}/cancel", cancel)
.middleware(fusion_stack::RequiresScope::new("orders:write"));Implementations§
Trait Implementations§
Source§impl Clone for RequiresScope
impl Clone for RequiresScope
Auto Trait Implementations§
impl Forget for RequiresScope
impl Freeze for RequiresScope
impl Move for RequiresScope
impl RefUnwindSafe for RequiresScope
impl Send for RequiresScopewhere
RawVecInner: Send,
impl Sync for RequiresScopewhere
RawVecInner: Sync,
impl Unpin for RequiresScope
impl UnsafeUnpin for RequiresScope
impl UnwindSafe for RequiresScopewhere
RawVecInner: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<M> IntoMiddleware for Mwhere
M: Middleware,
impl<M> IntoMiddleware for Mwhere
M: Middleware,
Source§fn into_group(self) -> MiddlewareGroup
fn into_group(self) -> MiddlewareGroup
Convert into a group.