pub struct AuthStorage(/* private fields */);Expand description
Auth storage loaded from ~/.rab/auth.json.
Implementations§
Source§impl AuthStorage
impl AuthStorage
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load auth from ~/.rab/agent/auth.json. Returns empty if file doesn’t exist.
Sourcepub fn api_key(&self, provider: &str) -> Option<String>
pub fn api_key(&self, provider: &str) -> Option<String>
Get the API key for a provider. Returns None if not configured or if OAuth.
Sourcepub fn oauth_token(&self, provider: &str) -> Option<String>
pub fn oauth_token(&self, provider: &str) -> Option<String>
Get the OAuth access token for a provider. Returns None if not configured or if API key.
Trait Implementations§
Source§impl Clone for AuthStorage
impl Clone for AuthStorage
Source§fn clone(&self) -> AuthStorage
fn clone(&self) -> AuthStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AuthStorage
impl Debug for AuthStorage
Source§impl Default for AuthStorage
impl Default for AuthStorage
Source§fn default() -> AuthStorage
fn default() -> AuthStorage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AuthStorage
impl<'de> Deserialize<'de> for AuthStorage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuthStorage
impl RefUnwindSafe for AuthStorage
impl Send for AuthStorage
impl Sync for AuthStorage
impl Unpin for AuthStorage
impl UnsafeUnpin for AuthStorage
impl UnwindSafe for AuthStorage
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