use confik::Configuration; use serde::Deserialize; #[derive(Debug, Default, Configuration)] pub struct ExampleConfig { pub server_addr: String, #[confik(from = DbConfig)] pub pg: deadpool_postgres::Config, } #[derive(Debug, Deserialize)] #[serde(transparent)] struct DbConfig(deadpool_postgres::Config); impl From for deadpool_postgres::Config { fn from(value: DbConfig) -> Self { value.0 } } impl confik::Configuration for DbConfig { type Builder = Option; }