pub struct SaTokenContextBuilder { /* private fields */ }Expand description
Builder:供 router / 测试 / 插件构造上下文,避免公开 inner 字段
Builder: for router/tests/plugins to construct context without exposing inner field.
Implementations§
Source§impl SaTokenContextBuilder
impl SaTokenContextBuilder
Sourcepub fn token(self, token: TokenValue) -> Self
pub fn token(self, token: TokenValue) -> Self
设置 token | Set token
Sourcepub fn token_info(self, info: Arc<TokenInfo>) -> Self
pub fn token_info(self, info: Arc<TokenInfo>) -> Self
设置 token_info | Set token_info
Sourcepub fn switch_login_id(self, login_id: impl Into<String>) -> Self
pub fn switch_login_id(self, login_id: impl Into<String>) -> Self
设置 switch_login_id(仅测试用,生产环境用 StpUtil::switch_to 运行时切换)
Set switch_login_id (test-only; use StpUtil::switch_to for runtime switching in production).
Sourcepub fn auth_meta(self, meta: RequestAuthMeta) -> Self
pub fn auth_meta(self, meta: RequestAuthMeta) -> Self
Set captured auth headers | 设置已捕获的鉴权头
Sourcepub fn build(self) -> SaTokenContext
pub fn build(self) -> SaTokenContext
构建 SaTokenContext(消耗 builder)
Build SaTokenContext (consumes builder).
Trait Implementations§
Source§impl Debug for SaTokenContextBuilder
impl Debug for SaTokenContextBuilder
Auto Trait Implementations§
impl Freeze for SaTokenContextBuilder
impl RefUnwindSafe for SaTokenContextBuilder
impl Send for SaTokenContextBuilder
impl Sync for SaTokenContextBuilder
impl Unpin for SaTokenContextBuilder
impl UnsafeUnpin for SaTokenContextBuilder
impl UnwindSafe for SaTokenContextBuilder
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