pub struct InMemoryDeviceStorage { /* private fields */ }Expand description
In-memory storage for testing
Implementations§
Trait Implementations§
Source§impl Default for InMemoryDeviceStorage
impl Default for InMemoryDeviceStorage
Source§impl DeviceBindingStorage for InMemoryDeviceStorage
impl DeviceBindingStorage for InMemoryDeviceStorage
Source§fn save_device<'life0, 'life1, 'async_trait>(
&'life0 self,
device: &'life1 TrustedDevice,
) -> Pin<Box<dyn Future<Output = Result<(), DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_device<'life0, 'life1, 'async_trait>(
&'life0 self,
device: &'life1 TrustedDevice,
) -> Pin<Box<dyn Future<Output = Result<(), DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save a trusted device
Source§fn get_device<'life0, 'life1, 'async_trait>(
&'life0 self,
device_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TrustedDevice, DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_device<'life0, 'life1, 'async_trait>(
&'life0 self,
device_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TrustedDevice, DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get device by ID
Source§fn get_user_devices<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrustedDevice>, DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user_devices<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrustedDevice>, DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all devices for a user
Source§fn update_last_auth<'life0, 'life1, 'async_trait>(
&'life0 self,
device_id: &'life1 str,
timestamp: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_last_auth<'life0, 'life1, 'async_trait>(
&'life0 self,
device_id: &'life1 str,
timestamp: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update device last authentication time
Source§fn revoke_device<'life0, 'life1, 'async_trait>(
&'life0 self,
device_id: &'life1 str,
reason: String,
revoked_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revoke_device<'life0, 'life1, 'async_trait>(
&'life0 self,
device_id: &'life1 str,
reason: String,
revoked_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Revoke device
Source§fn delete_device<'life0, 'life1, 'async_trait>(
&'life0 self,
device_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_device<'life0, 'life1, 'async_trait>(
&'life0 self,
device_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete device
Source§fn find_similar_devices<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
fingerprint: &'life2 DeviceFingerprint,
min_similarity: f64,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrustedDevice>, DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn find_similar_devices<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
fingerprint: &'life2 DeviceFingerprint,
min_similarity: f64,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrustedDevice>, DeviceBindingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Find devices by fingerprint similarity
Auto Trait Implementations§
impl !Freeze for InMemoryDeviceStorage
impl !RefUnwindSafe for InMemoryDeviceStorage
impl Send for InMemoryDeviceStorage
impl Sync for InMemoryDeviceStorage
impl Unpin for InMemoryDeviceStorage
impl UnsafeUnpin for InMemoryDeviceStorage
impl UnwindSafe for InMemoryDeviceStorage
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