pub struct ProviderCache {
pub pushed: PushedPairs,
/* private fields */
}Expand description
What provider dogs have pushed: the values, and which
(namespace, environment) pairs carry a push at all.
The two travel together because they are read together and must come from one moment: a values map from before a push read beside a pair set from after it would call a key permanently missing that the push had just supplied.
An empty push is why the pair set is not derivable from the values. A dog saying “I have nothing for staging” registers the pair and holds no keys, which is a different answer from a dog that has not pushed.
Debug does not leak a value: it prints two counts.
Fields§
§pushed: PushedPairsEvery (namespace, environment) pair a push has landed for.
Names, never values, which is why this half stays public: the shepherd’s boot log prints it as it stands.
Implementations§
Source§impl ProviderCache
impl ProviderCache
Sourcepub fn new(values: NamespaceValues, pushed: PushedPairs) -> Self
pub fn new(values: NamespaceValues, pushed: PushedPairs) -> Self
A cache holding values, pushed as the pairs in pushed.
Sourcepub fn namespace(&self, name: &str) -> Option<&NamespaceTable>
pub fn namespace(&self, name: &str) -> Option<&NamespaceTable>
One namespace’s values, or nothing when no push has carried that namespace.
Present and empty is a dog that pushed no keys. Whether that dog
has spoken for a given environment is Self::pushed’s answer,
not this one’s.
Sourcepub fn namespaces(&self) -> impl Iterator<Item = (&String, &NamespaceTable)>
pub fn namespaces(&self) -> impl Iterator<Item = (&String, &NamespaceTable)>
Every namespace and its values, in name order.
Sourcepub fn namespace_count(&self) -> usize
pub fn namespace_count(&self) -> usize
How many namespaces a push has carried.
Sourcepub fn into_parts(self) -> (NamespaceValues, PushedPairs)
pub fn into_parts(self) -> (NamespaceValues, PushedPairs)
Both halves, moved out, for a caller that owns them afterwards.
Trait Implementations§
Source§impl Clone for ProviderCache
impl Clone for ProviderCache
Source§impl Debug for ProviderCache
Redacted (IR-41): values holds provider values in the clear.
impl Debug for ProviderCache
Redacted (IR-41): values holds provider values in the clear.