pub struct TokenMetadata {
pub issued_ip: Option<String>,
pub user_agent: Option<String>,
pub device_id: Option<String>,
pub session_id: Option<String>,
pub revoked: bool,
pub revoked_at: Option<DateTime<Utc>>,
pub revoked_reason: Option<String>,
pub last_used: Option<DateTime<Utc>>,
pub use_count: u64,
pub custom: HashMap<String, Value>,
}
Expand description
Additional metadata that can be attached to tokens.
Fields§
§issued_ip: Option<String>
IP address where the token was issued
user_agent: Option<String>
User agent of the client
device_id: Option<String>
Device identifier
session_id: Option<String>
Session identifier
revoked: bool
Whether this token has been revoked
revoked_at: Option<DateTime<Utc>>
When the token was revoked (if applicable)
revoked_reason: Option<String>
Reason for revocation
last_used: Option<DateTime<Utc>>
Last time this token was used
use_count: u64
Number of times this token has been used
custom: HashMap<String, Value>
Custom metadata
Trait Implementations§
Source§impl Clone for TokenMetadata
impl Clone for TokenMetadata
Source§fn clone(&self) -> TokenMetadata
fn clone(&self) -> TokenMetadata
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 TokenMetadata
impl Debug for TokenMetadata
Source§impl<'r> Decode<'r, Postgres> for TokenMetadata
impl<'r> Decode<'r, Postgres> for TokenMetadata
Source§fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
Decode a new value of this type using a raw value from the database.
Source§impl Default for TokenMetadata
impl Default for TokenMetadata
Source§fn default() -> TokenMetadata
fn default() -> TokenMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TokenMetadata
impl<'de> Deserialize<'de> for TokenMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TokenMetadata
impl Serialize for TokenMetadata
Source§impl Type<Postgres> for TokenMetadata
impl Type<Postgres> for TokenMetadata
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Auto Trait Implementations§
impl Freeze for TokenMetadata
impl RefUnwindSafe for TokenMetadata
impl Send for TokenMetadata
impl Sync for TokenMetadata
impl Unpin for TokenMetadata
impl UnwindSafe for TokenMetadata
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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