fn key_envar<'a, D>(deserializer: D) -> Result<HashMap<String, String>, D::Error>
where
	D: Deserializer<'a>,
{
	// new type to be able to define a specific deserialize_with function to apply upon
	#[derive(Deserialize, PartialEq, Eq, Hash)]
	struct Wrapper(#[serde(deserialize_with = "string_envar")] String);

	let v = HashMap::<Wrapper, String>::deserialize(deserializer)?;
	Ok(v.into_iter().map(|(Wrapper(k), v)| (k, v)).collect())
}
/// Substitute environement variables in the keys (path) of secrets hashmaps before serializing
Substitute environement variables in the keys (path) of secrets hashmaps before serializing
Substitute environement variables in the keys ( path ) of secrets hashmaps before serializing
fn key_envar<'a, D>(deserializer: D) -> Result<HashMap<String, String>, D::Error>
where
	D: Deserializer<'a>,
{
	// new type to be able to define a specific deserialize_with function to apply upon
	#[derive(Deserialize, PartialEq, Eq, Hash)]
	struct Wrapper(#[serde(deserialize_with = "string_envar")] String);
	let v = HashMap::<Wrapper, String>::deserialize(deserializer)?;
	Ok(v.into_iter().map(|(Wrapper(k), v)| (k, v)).collect())
}
fn key_envar < ' a , D > ( deserializer : D ) -> Result < HashMap < String , String > , D :: Error > where D : Deserializer < ' a > , { // new type to be able to define a specific deserialize_with function to apply upon # [ derive ( Deserialize PartialEq Eq Hash ) ] struct Wrapper ( # [ serde ( deserialize_with " " ) ] String ) ; let v = HashMap :: < Wrapper , String > :: deserialize ( deserializer ) ? ; Ok ( v . into_iter ( ) . map ( | ( Wrapper ( k ) , v ) | ( k , v ) ) . collect ( ) ) }
Substitute environement variables in the keys (path) of secrets hashmaps before serializing
Substitute environement variables in the keys ( path ) of secrets hashmaps before serializing
deserializer
D
deserializer
D