pub struct SaTokenMiddleware {
pub state: SaTokenState,
pub path_config: Option<PathAuthConfig>,
}Expand description
Sa-Token middleware with optional path-based authentication 支持可选路径鉴权的 Sa-Token 中间件
Fields§
§state: SaTokenState§path_config: Option<PathAuthConfig>Optional path authentication configuration 可选的路径鉴权配置
Implementations§
Source§impl SaTokenMiddleware
impl SaTokenMiddleware
Sourcepub fn new(state: SaTokenState) -> Self
pub fn new(state: SaTokenState) -> Self
Create middleware without path authentication 创建不带路径鉴权的中间件
Sourcepub fn with_path_auth(state: SaTokenState, config: PathAuthConfig) -> Self
pub fn with_path_auth(state: SaTokenState, config: PathAuthConfig) -> Self
Create middleware with path-based authentication 创建带路径鉴权的中间件
Trait Implementations§
Source§impl<S, B> Transform<S, ServiceRequest> for SaTokenMiddlewarewhere
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
B: 'static,
impl<S, B> Transform<S, ServiceRequest> for SaTokenMiddlewarewhere
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
B: 'static,
Source§type Response = ServiceResponse<B>
type Response = ServiceResponse<B>
Responses produced by the service.
Source§type Transform = SaTokenMiddlewareService<S>
type Transform = SaTokenMiddlewareService<S>
The
TransformService value created by this factorySource§type Future = Ready<Result<<SaTokenMiddleware as Transform<S, ServiceRequest>>::Transform, <SaTokenMiddleware as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<SaTokenMiddleware as Transform<S, ServiceRequest>>::Transform, <SaTokenMiddleware as Transform<S, ServiceRequest>>::InitError>>
The future response value.
Source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations§
impl Freeze for SaTokenMiddleware
impl !RefUnwindSafe for SaTokenMiddleware
impl Send for SaTokenMiddleware
impl Sync for SaTokenMiddleware
impl Unpin for SaTokenMiddleware
impl !UnwindSafe for SaTokenMiddleware
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