pub struct AuthMetadata {
pub traffic_limit: u64,
pub traffic_used: u64,
pub expires_at: u64,
pub enabled: bool,
}Expand description
Optional metadata associated with an authenticated user.
Fields§
§traffic_limit: u64Traffic limit in bytes (0 = unlimited).
traffic_used: u64Traffic used in bytes.
expires_at: u64Expiration timestamp (0 = never).
enabled: boolWhether the user is enabled.
Implementations§
Source§impl AuthMetadata
impl AuthMetadata
Sourcepub fn is_over_limit(&self) -> bool
pub fn is_over_limit(&self) -> bool
Check if the user has exceeded their traffic limit.
Sourcepub fn is_expired(&self, now: u64) -> bool
pub fn is_expired(&self, now: u64) -> bool
Check if the user has expired.
Trait Implementations§
Source§impl Clone for AuthMetadata
impl Clone for AuthMetadata
Source§fn clone(&self) -> AuthMetadata
fn clone(&self) -> AuthMetadata
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 AuthMetadata
impl Debug for AuthMetadata
Source§impl Default for AuthMetadata
impl Default for AuthMetadata
Source§fn default() -> AuthMetadata
fn default() -> AuthMetadata
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuthMetadata
impl RefUnwindSafe for AuthMetadata
impl Send for AuthMetadata
impl Sync for AuthMetadata
impl Unpin for AuthMetadata
impl UnwindSafe for AuthMetadata
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