pub struct CredentialRef {
pub provider: OAuthProviderId,
pub account: Account,
}Expand description
A fully addressed OAuth credential: provider + account slot.
Fields§
§provider: OAuthProviderId§account: AccountImplementations§
Source§impl CredentialRef
impl CredentialRef
pub fn new(provider: OAuthProviderId, account: Account) -> Self
pub fn default_for(provider: OAuthProviderId) -> Self
Sourcepub fn storage_key(&self) -> String
pub fn storage_key(&self) -> String
"openai-codex" for the default slot, "openai-codex@astra2" otherwise.
Sourcepub fn parse_storage_key(key: &str) -> Option<Self>
pub fn parse_storage_key(key: &str) -> Option<Self>
Inverse of storage_key. Returns None for keys
that are not OAuth provider keys (static keys, cloud state, unknown
providers) and for malformed labels ("x@default", "x@Bad Label").
Trait Implementations§
Source§impl Clone for CredentialRef
impl Clone for CredentialRef
Source§impl Debug for CredentialRef
impl Debug for CredentialRef
Source§impl<'de> Deserialize<'de> for CredentialRef
impl<'de> Deserialize<'de> for CredentialRef
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CredentialRef
impl Display for CredentialRef
impl Eq for CredentialRef
Source§impl Hash for CredentialRef
impl Hash for CredentialRef
Source§impl Ord for CredentialRef
impl Ord for CredentialRef
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for CredentialRef
impl PartialEq for CredentialRef
Source§impl PartialOrd for CredentialRef
impl PartialOrd for CredentialRef
Source§impl Serialize for CredentialRef
impl Serialize for CredentialRef
impl StructuralPartialEq for CredentialRef
Auto Trait Implementations§
impl Freeze for CredentialRef
impl RefUnwindSafe for CredentialRef
impl Send for CredentialRef
impl Sync for CredentialRef
impl Unpin for CredentialRef
impl UnsafeUnpin for CredentialRef
impl UnwindSafe for CredentialRef
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.