pub struct SaTokenContext {
pub token: Option<TokenValue>,
pub token_info: Option<Arc<TokenInfo>>,
pub login_id: Option<String>,
}Expand description
sa-token 上下文
Fields§
§token: Option<TokenValue>当前请求的 token
token_info: Option<Arc<TokenInfo>>当前请求的 token 信息
login_id: Option<String>登录 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>
获取当前上下文
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 · Source§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§
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