pub struct SaTokenContext {
pub token: Option<TokenValue>,
pub token_info: Option<Arc<TokenInfo>>,
pub login_id: Option<String>,
}Expand description
sa-token 上下文 | sa-token Context
用于在请求处理过程中传递 Token 相关信息 Used to pass token-related information during request processing
§字段说明 | Field Description
token: 当前请求的 token | Current request’s tokentoken_info: Token 详细信息 | Token detailed informationlogin_id: 登录用户 ID | Logged-in user ID
Fields§
§token: Option<TokenValue>当前请求的 token | Current request’s token
token_info: Option<Arc<TokenInfo>>当前请求的 token 信息 | Current request’s token info
login_id: Option<String>登录 ID | Login ID
Implementations§
Source§impl SaTokenContext
impl SaTokenContext
pub fn new() -> Self
Sourcepub fn set_current(ctx: SaTokenContext)
pub fn set_current(ctx: SaTokenContext)
Sourcepub fn get_current() -> Option<SaTokenContext>
pub fn get_current() -> Option<SaTokenContext>
获取当前上下文 | Get Current Context
§返回 | Returns
当前线程的上下文,如果不存在则返回 None Current thread’s context, or None if not exists
Trait Implementations§
Source§impl Clone for SaTokenContext
impl Clone for SaTokenContext
Source§fn clone(&self) -> SaTokenContext
fn clone(&self) -> SaTokenContext
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 Debug for SaTokenContext
impl Debug for SaTokenContext
Auto Trait Implementations§
impl Freeze for SaTokenContext
impl RefUnwindSafe for SaTokenContext
impl Send for SaTokenContext
impl Sync for SaTokenContext
impl Unpin for SaTokenContext
impl UnwindSafe for SaTokenContext
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)