pub struct TokenRow {
pub token_hash: String,
pub name: String,
pub create_time: i64,
pub last_used: i64,
pub use_count: i64,
pub last_ip: String,
pub revoked: i64,
pub secret: String,
}Expand description
访问令牌的展示信息。不含明文 —— 明文只在生成那一刻返回一次
Fields§
§token_hash: StringSHA-256 十六进制,同时是主键
name: String人给的名字,用来认出「这个 token 是给谁的」
create_time: i64§last_used: i640 表示从没被用过
use_count: i64§last_ip: String§revoked: i640 表示有效,否则是作废时刻
secret: String令牌明文的密文(nonce||ciphertext 的十六进制)。
空串表示没保存 —— 没配 DTMRS_TOKEN_KEY 时就是这样,退化成「只显示一次」
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TokenRow
impl RefUnwindSafe for TokenRow
impl Send for TokenRow
impl Sync for TokenRow
impl Unpin for TokenRow
impl UnsafeUnpin for TokenRow
impl UnwindSafe for TokenRow
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more