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.).
Sourcepub fn resolve_blocking(&self) -> Result<SecretString, SecretError>
pub fn resolve_blocking(&self) -> Result<SecretString, SecretError>
Synchronous resolve for callers outside an async context (CLI factories, config loaders). Inside a multi-thread tokio runtime it uses block_in_place; otherwise it spins a current-thread runtime.
Sourcepub fn resolve_to_string_blocking(&self) -> Option<String>
pub fn resolve_to_string_blocking(&self) -> Option<String>
Blocking analogue of resolve_to_string — same materialization
caveats apply.
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>
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
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
key and return true if they are equal.