pub struct FredSecondaryStorage { /* private fields */ }Implementations§
Source§impl FredSecondaryStorage
impl FredSecondaryStorage
pub async fn connect(url: &str) -> Result<Self, RustAuthError>
pub async fn connect_with_options( url: &str, options: FredSecondaryStorageOptions, ) -> Result<Self, RustAuthError>
pub fn new(client: Client, options: FredSecondaryStorageOptions) -> Self
pub async fn list_keys(&self) -> Result<Vec<String>, RustAuthError>
pub async fn clear(&self) -> Result<(), RustAuthError>
Trait Implementations§
Source§impl Clone for FredSecondaryStorage
impl Clone for FredSecondaryStorage
Source§fn clone(&self) -> FredSecondaryStorage
fn clone(&self) -> FredSecondaryStorage
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 FredSecondaryStorage
impl SecondaryStorage for FredSecondaryStorage
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 FredSecondaryStorage
impl !UnwindSafe for FredSecondaryStorage
impl Freeze for FredSecondaryStorage
impl Send for FredSecondaryStorage
impl Sync for FredSecondaryStorage
impl Unpin for FredSecondaryStorage
impl UnsafeUnpin for FredSecondaryStorage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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