pub struct FileTokenStorage { /* private fields */ }Expand description
File-based token storage for desktop platforms.
Stores the authentication token in a file on the local filesystem. By
default, uses the platform-specific config directory
(e.g., ~/.config/EdgeFirst Studio/token on Linux).
§Examples
use edgefirst_client::FileTokenStorage;
use std::path::PathBuf;
// Use default path
let storage = FileTokenStorage::new().unwrap();
// Use custom path
let storage = FileTokenStorage::with_path(PathBuf::from("/custom/path/token"));Implementations§
Source§impl FileTokenStorage
impl FileTokenStorage
Sourcepub fn new() -> Result<Self, StorageError>
pub fn new() -> Result<Self, StorageError>
Create a new FileTokenStorage using the default platform config
directory.
The default path is determined by the directories crate:
- Linux:
~/.config/EdgeFirst Studio/token - macOS:
~/Library/Application Support/ai.EdgeFirst.EdgeFirst-Studio/token - Windows:
C:\Users\<User>\AppData\Roaming\EdgeFirst\EdgeFirst Studio\token
Trait Implementations§
Source§impl Clone for FileTokenStorage
impl Clone for FileTokenStorage
Source§fn clone(&self) -> FileTokenStorage
fn clone(&self) -> FileTokenStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileTokenStorage
impl Debug for FileTokenStorage
Source§impl TokenStorage for FileTokenStorage
impl TokenStorage for FileTokenStorage
Auto Trait Implementations§
impl Freeze for FileTokenStorage
impl RefUnwindSafe for FileTokenStorage
impl Send for FileTokenStorage
impl Sync for FileTokenStorage
impl Unpin for FileTokenStorage
impl UnwindSafe for FileTokenStorage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more