pub struct RequireScope(pub AuthenticatedCaller);Expand description
Axum extractor that enforces a minimum scope level.
Use as a handler parameter to gate access:
ⓘ
async fn admin_only(_scope: RequireScope<{ Scope::Admin as u8 }>) { ... }This extractor first resolves the AuthenticatedCaller and then
checks that the caller’s scopes satisfy the required level.
Tuple Fields§
§0: AuthenticatedCallerAuto Trait Implementations§
impl Freeze for RequireScope
impl RefUnwindSafe for RequireScope
impl Send for RequireScope
impl Sync for RequireScope
impl Unpin for RequireScope
impl UnsafeUnpin for RequireScope
impl UnwindSafe for RequireScope
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