pub struct TrustedDevice {Show 16 fields
pub device_id: String,
pub user_id: UserId,
pub tenant_id: TenantId,
pub fingerprint: DeviceFingerprint,
pub device_type: DeviceType,
pub device_name: Option<String>,
pub registered_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub last_auth_at: DateTime<Utc>,
pub last_ip: Option<String>,
pub last_location: Option<String>,
pub is_trusted: bool,
pub revoked_reason: Option<String>,
pub revoked_at: Option<DateTime<Utc>>,
pub usage_count: u64,
pub risk_score: u8,
}Expand description
Trusted device information
Fields§
§device_id: StringUnique device ID
user_id: UserIdUser ID this device belongs to
tenant_id: TenantIdTenant ID
fingerprint: DeviceFingerprintDevice fingerprint
device_type: DeviceTypeDevice type
device_name: Option<String>User-provided device name (optional)
registered_at: DateTime<Utc>When device was registered
expires_at: DateTime<Utc>When trust expires
last_auth_at: DateTime<Utc>Last authentication time
last_ip: Option<String>Last seen IP address
last_location: Option<String>Last seen location (city, country)
is_trusted: boolIs device currently trusted
revoked_reason: Option<String>Revocation reason (if revoked)
revoked_at: Option<DateTime<Utc>>Revoked timestamp
usage_count: u64Number of times device was used
risk_score: u8Risk score (0-100)
Implementations§
Source§impl TrustedDevice
impl TrustedDevice
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if device trust is expired
Sourcepub fn requires_reauth(&self, reauth_interval: Duration) -> bool
pub fn requires_reauth(&self, reauth_interval: Duration) -> bool
Check if device requires re-authentication
Sourcepub fn is_revoked(&self) -> bool
pub fn is_revoked(&self) -> bool
Check if device is revoked
Sourcepub fn is_valid(&self) -> Result<(), DeviceBindingError>
pub fn is_valid(&self) -> Result<(), DeviceBindingError>
Check if device is valid for use
Trait Implementations§
Source§impl Clone for TrustedDevice
impl Clone for TrustedDevice
Source§fn clone(&self) -> TrustedDevice
fn clone(&self) -> TrustedDevice
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TrustedDevice
impl Debug for TrustedDevice
Source§impl<'de> Deserialize<'de> for TrustedDevice
impl<'de> Deserialize<'de> for TrustedDevice
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
Auto Trait Implementations§
impl Freeze for TrustedDevice
impl RefUnwindSafe for TrustedDevice
impl Send for TrustedDevice
impl Sync for TrustedDevice
impl Unpin for TrustedDevice
impl UnsafeUnpin for TrustedDevice
impl UnwindSafe for TrustedDevice
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