Skip to main content

AuthProvider

Trait AuthProvider 

Source
pub trait AuthProvider: Send + Sync {
    // Required method
    fn availability(&self) -> SyncResult<()>;

    // Provided methods
    fn enabled(&self) -> bool { ... }
    fn generation(&self) -> u64 { ... }
    fn account_scope(&self) -> Option<String> { ... }
    fn bearer(&self) -> SyncResult<Option<String>> { ... }
}
Expand description

Account state and session credentials. generation changes on account switch; an in-flight pass observing a different generation cancels itself.

Required Methods§

Provided Methods§

Source

fn enabled(&self) -> bool

Master switch (user toggle).

Source

fn generation(&self) -> u64

Source

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

Stable opaque identity of the signed-in account/container/zone (CloudKit helper: sha256(container|zone|userRecordName)), valid after a successful availability(). The engine binds its ledger to it and resets the ledger when it changes. None = no isolation.

Source

fn bearer(&self) -> SyncResult<Option<String>>

Bearer value for HTTP-style backends, fetched per pass by the app’s own secure store; CloudKit backends return None.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§