pub enum Credential {
ApiKey {
key: Option<String>,
env: Option<BTreeMap<String, String>>,
},
Oauth {
access: String,
refresh: String,
expires: i64,
},
}Expand description
A stored credential. Mirrors the TS Credential union
(packages/ai/src/auth/types.ts). The Oauth variant exists for forward
compatibility but v1 never writes it (no OAuth device-code flow); resolve
does not consume it.
Variants§
ApiKey
An API key, optionally sourced from an env var map. v1 stores only the
literal key (the env field is kept for upstream-shape compatibility).
Oauth
OAuth tokens (access + refresh + expiry). v1 does not write this.
Trait Implementations§
Source§impl Clone for Credential
impl Clone for Credential
Source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
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 Credential
impl Debug for Credential
Source§impl<'de> Deserialize<'de> for Credential
impl<'de> Deserialize<'de> for Credential
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 Credential
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnsafeUnpin for Credential
impl UnwindSafe for Credential
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