pub struct SaCheckRoleMiddleware {
pub state: SaTokenState,
/* private fields */
}Expand description
中文 | English Sa-Token 角色检查中间件 | Sa-Token role check middleware
检查当前请求用户是否拥有指定角色 | Checks if current request user has specified role
Fields§
§state: SaTokenStateImplementations§
Source§impl SaCheckRoleMiddleware
impl SaCheckRoleMiddleware
Sourcepub fn new(state: SaTokenState, role: impl Into<String>) -> Self
pub fn new(state: SaTokenState, role: impl Into<String>) -> Self
中文 | English 创建新的角色检查中间件 | Create new role check middleware
Trait Implementations§
Source§impl Clone for SaCheckRoleMiddleware
impl Clone for SaCheckRoleMiddleware
Source§fn clone(&self) -> SaCheckRoleMiddleware
fn clone(&self) -> SaCheckRoleMiddleware
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Handler for SaCheckRoleMiddleware
impl Handler for SaCheckRoleMiddleware
Source§fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Handle http request.
Source§fn arc(self) -> ArcHandlerwhere
Self: Sized,
fn arc(self) -> ArcHandlerwhere
Self: Sized,
Wrap to
ArcHandler.Source§fn hoop<H>(self, hoop: H) -> HoopedHandler
fn hoop<H>(self, hoop: H) -> HoopedHandler
Hoop this handler with middleware.
Auto Trait Implementations§
impl Freeze for SaCheckRoleMiddleware
impl !RefUnwindSafe for SaCheckRoleMiddleware
impl Send for SaCheckRoleMiddleware
impl Sync for SaCheckRoleMiddleware
impl Unpin for SaCheckRoleMiddleware
impl !UnwindSafe for SaCheckRoleMiddleware
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)