Expand description
上下文模块 - 用于在请求处理过程中传递 token 信息
tokio::task_local!:跨await、跨 Tokio worker 线程仍与同一异步任务绑定(推荐)。thread_local:兼容旧代码与同步路径(SaTokenContext::set_current/SaTokenContext::clear)。
Context module — carries token info during a request.
tokio::task_local!: stays bound to the same logical async task across awaits/workers (preferred).
thread_local: backward-compatible synchronous path (set_current / clear).
Structs§
- SaToken
Context - sa-token 上下文 | sa-token Context