pub struct ResolvedConfiguration { /* private fields */ }Expand description
One immutable, lazily materialized phase configuration combination.
Implementations§
Source§impl ResolvedConfiguration
impl ResolvedConfiguration
Sourcepub fn phase_group(&self) -> &str
pub fn phase_group(&self) -> &str
Returns the stable string key of the containing phase group.
Sourcepub fn global_ordinal(&self) -> u64
pub fn global_ordinal(&self) -> u64
Returns the selection ordinal contributed by the global scope.
Sourcepub fn group_ordinal(&self) -> u64
pub fn group_ordinal(&self) -> u64
Returns the selection ordinal contributed by the group shared scope.
Sourcepub fn phase_ordinal(&self) -> u64
pub fn phase_ordinal(&self) -> u64
Returns the selection ordinal contributed by the phase-local scope.
Sourcepub fn value(&self, key: &str) -> Option<&Value>
pub fn value(&self, key: &str) -> Option<&Value>
Borrows an exact leaf or lazily reconstructed nested subtree.
Sourcepub fn require_value(&self, key: &str) -> Result<&Value, ConfigurationError>
pub fn require_value(&self, key: &str) -> Result<&Value, ConfigurationError>
Borrows a required value or returns an ordinal-qualified error.
Sourcepub fn decode_value<T>(&self, key: &str) -> Result<T, ConfigurationError>where
T: DeserializeOwned,
pub fn decode_value<T>(&self, key: &str) -> Result<T, ConfigurationError>where
T: DeserializeOwned,
Deserializes one exact leaf or reconstructed subtree into T.
Sourcepub fn decode_values<Values, Keys>(
&self,
keys: Keys,
) -> Result<Values, ConfigurationError>where
Keys: ParameterKeyTuple<Values>,
pub fn decode_values<Values, Keys>(
&self,
keys: Keys,
) -> Result<Values, ConfigurationError>where
Keys: ParameterKeyTuple<Values>,
Deserializes a tuple of required paths without an intermediate struct.
Sourcepub fn contains(&self, key: &str) -> bool
pub fn contains(&self, key: &str) -> bool
Reports whether this resolved combination contains key or descendants.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Reports whether the resolved document contains no terminal values.
Sourcepub fn keys(&self) -> impl Iterator<Item = &str>
pub fn keys(&self) -> impl Iterator<Item = &str>
Iterates canonical terminal parameter identifiers.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &Value)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &Value)>
Iterates resolved terminal keys and borrowed values in declaration order.
Sourcepub fn to_json(&self) -> String
pub fn to_json(&self) -> String
Serializes the complete rehydrated nested configuration document.
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Clones the complete rehydrated nested configuration document.
The document is cached after its first reconstruction. This method is intended for durable provenance records that must own their JSON value.
Trait Implementations§
Source§impl Clone for ResolvedConfiguration
impl Clone for ResolvedConfiguration
Auto Trait Implementations§
impl !Freeze for ResolvedConfiguration
impl RefUnwindSafe for ResolvedConfiguration
impl Send for ResolvedConfiguration
impl Sync for ResolvedConfiguration
impl Unpin for ResolvedConfiguration
impl UnsafeUnpin for ResolvedConfiguration
impl UnwindSafe for ResolvedConfiguration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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