pub struct RedisSecondaryStorage { /* private fields */ }Implementations§
Source§impl RedisSecondaryStorage
impl RedisSecondaryStorage
pub async fn connect(redis_url: &str) -> Result<Self, RustAuthError>
pub async fn connect_with_options( redis_url: &str, options: RedisSecondaryStorageOptions, ) -> Result<Self, RustAuthError>
pub fn new( manager: ConnectionManager, options: RedisSecondaryStorageOptions, ) -> Self
pub async fn list_keys(&self) -> Result<Vec<String>, RustAuthError>
pub async fn clear(&self) -> Result<(), RustAuthError>
Trait Implementations§
Source§impl Clone for RedisSecondaryStorage
impl Clone for RedisSecondaryStorage
Source§fn clone(&self) -> RedisSecondaryStorage
fn clone(&self) -> RedisSecondaryStorage
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 SecondaryStorage for RedisSecondaryStorage
impl SecondaryStorage for RedisSecondaryStorage
fn get<'a>(&'a self, key: &'a str) -> SecondaryStorageFuture<'a, Option<String>>
Source§fn set<'a>(
&'a self,
key: &'a str,
value: String,
ttl_seconds: Option<u64>,
) -> SecondaryStorageFuture<'a, ()>
fn set<'a>( &'a self, key: &'a str, value: String, ttl_seconds: Option<u64>, ) -> SecondaryStorageFuture<'a, ()>
ttl_seconds == Some(0) means the value is already expired: implementations
must remove any existing key and must not store value without expiry.Source§fn set_if_not_exists<'a>(
&'a self,
key: &'a str,
value: String,
ttl_seconds: Option<u64>,
) -> SecondaryStorageFuture<'a, bool>
fn set_if_not_exists<'a>( &'a self, key: &'a str, value: String, ttl_seconds: Option<u64>, ) -> SecondaryStorageFuture<'a, bool>
fn delete<'a>(&'a self, key: &'a str) -> SecondaryStorageFuture<'a, ()>
Source§fn take<'a>(
&'a self,
key: &'a str,
) -> SecondaryStorageFuture<'a, Option<String>>
fn take<'a>( &'a self, key: &'a str, ) -> SecondaryStorageFuture<'a, Option<String>>
Atomically remove and return the stored value when present.
Source§fn compare_and_set<'a>(
&'a self,
key: &'a str,
expected: Option<String>,
value: String,
ttl_seconds: Option<u64>,
) -> SecondaryStorageFuture<'a, bool>
fn compare_and_set<'a>( &'a self, key: &'a str, expected: Option<String>, value: String, ttl_seconds: Option<u64>, ) -> SecondaryStorageFuture<'a, bool>
Atomically replace the key only when the currently stored value matches
expected. expected == None means the key must be absent. Read moreSource§fn delete_if_value<'a>(
&'a self,
key: &'a str,
expected: Option<String>,
) -> SecondaryStorageFuture<'a, bool>
fn delete_if_value<'a>( &'a self, key: &'a str, expected: Option<String>, ) -> SecondaryStorageFuture<'a, bool>
Atomically delete the key only when the currently stored value matches
expected. expected == None means the key must already be absent and
therefore no deletion is performed. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RedisSecondaryStorage
impl !UnwindSafe for RedisSecondaryStorage
impl Freeze for RedisSecondaryStorage
impl Send for RedisSecondaryStorage
impl Sync for RedisSecondaryStorage
impl Unpin for RedisSecondaryStorage
impl UnsafeUnpin for RedisSecondaryStorage
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