pub struct ClosurePersistence { /* private fields */ }Implementations§
Source§impl ClosurePersistence
impl ClosurePersistence
Sourcepub fn new<Set, Get>(set: Set, get: Get) -> Selfwhere
Set: Fn(Option<PersistedAuthState>) -> AuthResult<()> + Send + Sync + 'static,
Get: Fn() -> AuthResult<Option<PersistedAuthState>> + Send + Sync + 'static,
pub fn new<Set, Get>(set: Set, get: Get) -> Selfwhere
Set: Fn(Option<PersistedAuthState>) -> AuthResult<()> + Send + Sync + 'static,
Get: Fn() -> AuthResult<Option<PersistedAuthState>> + Send + Sync + 'static,
Creates a persistence backend from set/get closures.
Sourcepub fn with_subscribe<Set, Get, Subscribe>(
set: Set,
get: Get,
subscribe: Subscribe,
) -> Selfwhere
Set: Fn(Option<PersistedAuthState>) -> AuthResult<()> + Send + Sync + 'static,
Get: Fn() -> AuthResult<Option<PersistedAuthState>> + Send + Sync + 'static,
Subscribe: Fn(PersistenceListener) -> AuthResult<PersistenceSubscription> + Send + Sync + 'static,
pub fn with_subscribe<Set, Get, Subscribe>(
set: Set,
get: Get,
subscribe: Subscribe,
) -> Selfwhere
Set: Fn(Option<PersistedAuthState>) -> AuthResult<()> + Send + Sync + 'static,
Get: Fn() -> AuthResult<Option<PersistedAuthState>> + Send + Sync + 'static,
Subscribe: Fn(PersistenceListener) -> AuthResult<PersistenceSubscription> + Send + Sync + 'static,
Creates a persistence backend with custom set/get/subscribe behavior.
Trait Implementations§
Source§impl AuthPersistence for ClosurePersistence
impl AuthPersistence for ClosurePersistence
fn set(&self, state: Option<PersistedAuthState>) -> AuthResult<()>
fn get(&self) -> AuthResult<Option<PersistedAuthState>>
fn subscribe( &self, listener: PersistenceListener, ) -> AuthResult<PersistenceSubscription>
Auto Trait Implementations§
impl Freeze for ClosurePersistence
impl !RefUnwindSafe for ClosurePersistence
impl Send for ClosurePersistence
impl Sync for ClosurePersistence
impl Unpin for ClosurePersistence
impl !UnwindSafe for ClosurePersistence
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