pub struct RUser {
pub id: String,
pub token: String,
}Expand description
§日本語
actix-web / axum から抽出される認証済みユーザーコンテキストです。
抽出が成功した場合:
idはRTokenManager::loginに渡したユーザー IDtokenはリクエストに含まれていた token の生文字列
token は Authorization header から読み取ります。次の形式に対応します:
Authorization: <token>Authorization: Bearer <token>
§English
An authenticated request context extracted from actix-web / axum.
If extraction succeeds, id is the user id previously passed to
RTokenManager::login, and token is the original token from the request.
The token is read from Authorization header. Both of the following formats
are accepted:
Authorization: <token>Authorization: Bearer <token>
Fields§
§id: String§token: StringTrait Implementations§
Source§impl FromRequest for RUser
Available on crate feature actix only.
impl FromRequest for RUser
Available on crate feature
actix only.失敗時:
- 500:
app_dataにマネージャが無い、または mutex が poisoned - 401:token が無い/無効/期限切れ
§English
Extracts RUser from an actix-web request.
Failure modes:
- 500: manager is missing from
app_data, or mutex is poisoned - 401: token is missing, invalid, or expired
Auto Trait Implementations§
impl Freeze for RUser
impl RefUnwindSafe for RUser
impl Send for RUser
impl Sync for RUser
impl Unpin for RUser
impl UnwindSafe for RUser
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