pub struct UnifiedTokenStore { /* private fields */ }Expand description
Unified token storage that abstracts over keyring and file backends.
Implementations§
Source§impl UnifiedTokenStore
impl UnifiedTokenStore
Sourcepub fn new(
preferred_backend: TokenStorageBackend,
) -> Result<Self, UnifiedTokenError>
pub fn new( preferred_backend: TokenStorageBackend, ) -> Result<Self, UnifiedTokenError>
Create a new unified token store with the specified backend preference.
If keyring is requested but unavailable, falls back to file storage.
Sourcepub fn save(&self, token: &Token) -> Result<(), UnifiedTokenError>
pub fn save(&self, token: &Token) -> Result<(), UnifiedTokenError>
Save a token using the active backend.
Sourcepub fn load(&self) -> Result<Token, UnifiedTokenError>
pub fn load(&self) -> Result<Token, UnifiedTokenError>
Load a token from the active backend.
For keyring backend, falls back to file if keyring is empty (migration support).
Sourcepub fn delete(&self) -> Result<(), UnifiedTokenError>
pub fn delete(&self) -> Result<(), UnifiedTokenError>
Delete the token from storage.
Attempts to delete from both backends to ensure clean removal.
Sourcepub fn backend(&self) -> TokenStorageBackend
pub fn backend(&self) -> TokenStorageBackend
Get the active backend type.
Auto Trait Implementations§
impl Freeze for UnifiedTokenStore
impl !RefUnwindSafe for UnifiedTokenStore
impl Send for UnifiedTokenStore
impl Sync for UnifiedTokenStore
impl Unpin for UnifiedTokenStore
impl !UnwindSafe for UnifiedTokenStore
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