pub struct LazyEnvBindingsProvider { /* private fields */ }Expand description
Environment-backed provider that defers cloud client configuration until the first binding is actually used.
Runtime-less Containers and Daemons resolve bindings in the application process. They should still start when no startup secret needs loading, even if cloud metadata is temporarily unavailable.
On first binding use it resolves credentials in a fixed order (see
LazyEnvBindingsProvider::select): native/projected ClientConfig::from_env
first, then minting-backed resolution if an external/bootstrap caller
explicitly supplied the mint environment contract, otherwise the original
from_env error is surfaced unchanged.
Implementations§
Source§impl LazyEnvBindingsProvider
impl LazyEnvBindingsProvider
Sourcepub async fn provider(&self) -> Result<Arc<BindingsProvider>>
pub async fn provider(&self) -> Result<Arc<BindingsProvider>>
Resolve (once) which credential strategy to use, then return a provider backed by fresh-enough credentials.
The strategy selection happens exactly once (via OnceCell); on the
minting path each call additionally checks credential freshness and
re-mints on access if stale.
Trait Implementations§
Source§impl BindingsProviderApi for LazyEnvBindingsProvider
impl BindingsProviderApi for LazyEnvBindingsProvider
Source§fn load_storage<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Storage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_storage<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Storage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_build<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Build>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_build<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Build>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_artifact_registry<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ArtifactRegistry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_artifact_registry<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ArtifactRegistry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Vault>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Vault>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_kv<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Kv>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_kv<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Kv>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_postgres<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Postgres>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_postgres<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Postgres>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_queue<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Queue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_queue<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Queue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_worker<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Worker>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_worker<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Worker>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_container<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Container>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_container<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Container>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_service_account<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ServiceAccount>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_service_account<'life0, 'life1, 'async_trait>(
&'life0 self,
binding_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ServiceAccount>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn resolve_runtime_only_binding_env<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_binding_name: &'life1 str,
_resource_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<String, String>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve_runtime_only_binding_env<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_binding_name: &'life1 str,
_resource_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<String, String>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
None: cloud providers carry a
secret locator (not a raw secret) and use the normal persisted path.Auto Trait Implementations§
impl !Freeze for LazyEnvBindingsProvider
impl !RefUnwindSafe for LazyEnvBindingsProvider
impl !UnwindSafe for LazyEnvBindingsProvider
impl Send for LazyEnvBindingsProvider
impl Sync for LazyEnvBindingsProvider
impl Unpin for LazyEnvBindingsProvider
impl UnsafeUnpin for LazyEnvBindingsProvider
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<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more