pub struct Environment {
pub name: String,
pub profiles: Vec<String>,
pub label: Option<String>,
pub version: Option<String>,
pub state: Option<String>,
pub property_sources: Vec<PropertySource>,
}Expand description
Spring Cloud Config Environment payload returned by /{application}/{profile}.
Fields§
§name: StringApplication name resolved by the Config Server.
profiles: Vec<String>Active profiles returned by the Config Server.
label: Option<String>Git label, branch, tag, or commit used by the Config Server.
version: Option<String>Backend version metadata, when available.
state: Option<String>Backend state metadata, when available.
property_sources: Vec<PropertySource>Ordered property sources. Earlier entries have higher precedence.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn effective_properties(&self) -> BTreeMap<String, Value>
pub fn effective_properties(&self) -> BTreeMap<String, Value>
Returns the effective flat property map after applying Spring property-source precedence.
Spring Cloud Config returns higher-precedence property sources earlier in the list. This method applies them accordingly and returns the final flat key-value map.
Sourcepub fn to_value(&self) -> Value
pub fn to_value(&self) -> Value
Converts the effective flat property map into a nested JSON value without scalar coercion.
Sourcepub fn to_value_with_coercion(&self, coercion: ScalarCoercion) -> Value
pub fn to_value_with_coercion(&self, coercion: ScalarCoercion) -> Value
Converts the effective flat property map into a nested JSON value.
Sourcepub fn deserialize<T>(&self) -> Result<T>where
T: DeserializeOwned,
pub fn deserialize<T>(&self) -> Result<T>where
T: DeserializeOwned,
Deserializes the effective configuration into a Rust type using smart scalar coercion.
Sourcepub fn deserialize_with_coercion<T>(
&self,
coercion: ScalarCoercion,
) -> Result<T>where
T: DeserializeOwned,
pub fn deserialize_with_coercion<T>(
&self,
coercion: ScalarCoercion,
) -> Result<T>where
T: DeserializeOwned,
Deserializes the effective configuration into a Rust type using the requested coercion mode.
Sourcepub fn deserialize_strict<T>(&self) -> Result<T>where
T: DeserializeOwned,
pub fn deserialize_strict<T>(&self) -> Result<T>where
T: DeserializeOwned,
Deserializes the effective configuration into a Rust type without scalar coercion.
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more