pub enum SecretRef {
Env(String),
Keychain {
service: String,
account: String,
},
File(PathBuf),
Cmd(String),
}Variants§
Implementations§
Source§impl SecretRef
impl SecretRef
pub async fn resolve(&self) -> Result<SecretString, SecretError>
Sourcepub async fn check(&self) -> bool
pub async fn check(&self) -> bool
Probe whether the secret resolves successfully without surfacing the
value. Used by GUI/CLI status indicators. Note: for Cmd refs this
actually runs the command, which may have side effects or be slow.
Sourcepub async fn resolve_to_string(&self) -> Option<String>
pub async fn resolve_to_string(&self) -> Option<String>
Resolve and expose the secret as a plain String for callers that must
hand the raw value to an external API (e.g. an Authorization: Bearer
header). This is the deliberate materialization boundary — keep the
returned value short-lived and never log or persist it. Returns None
on any resolution failure (missing env var, keychain entry, etc.).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SecretRef
impl<'de> Deserialize<'de> for SecretRef
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SecretRef
impl StructuralPartialEq for SecretRef
Auto Trait Implementations§
impl Freeze for SecretRef
impl RefUnwindSafe for SecretRef
impl Send for SecretRef
impl Sync for SecretRef
impl Unpin for SecretRef
impl UnsafeUnpin for SecretRef
impl UnwindSafe for SecretRef
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.