pub trait AuthPersistence: Send + Sync {
// Required methods
fn set(&self, state: Option<PersistedAuthState>) -> AuthResult<()>;
fn get(&self) -> AuthResult<Option<PersistedAuthState>>;
// Provided method
fn subscribe(
&self,
_listener: PersistenceListener,
) -> AuthResult<PersistenceSubscription> { ... }
}Expand description
Storage backend for serialized authentication state.
Library consumers can implement this trait to plug in platform-specific
persistence (filesystem, databases, JS shims, etc.). Callbacks registered via
subscribe should emit whenever the underlying state changes outside the
current process so multi-instance listeners stay in sync.