Skip to main content

AuthStore

Trait AuthStore 

Source
pub trait AuthStore:
    Send
    + Sync
    + Debug {
    // Required methods
    fn token(&self) -> Option<String>;
    fn refresh_token(&self) -> Option<String>;
    fn user(&self) -> Option<User>;
    fn is_valid(&self) -> bool;
    fn save(&self, token: String, refresh_token: String, user: User);
    fn clear(&self);
    fn subscribe(&self) -> Receiver<(Option<String>, Option<User>)>;
}
Expand description

Trait représentant le stockage d’authentification.

Required Methods§

Source

fn token(&self) -> Option<String>

Source

fn refresh_token(&self) -> Option<String>

Source

fn user(&self) -> Option<User>

Source

fn is_valid(&self) -> bool

Source

fn save(&self, token: String, refresh_token: String, user: User)

Source

fn clear(&self)

Source

fn subscribe(&self) -> Receiver<(Option<String>, Option<User>)>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§