pub struct AppConfig {
pub global: GlobalConfig,
pub profiles: HashMap<String, RuntimeProfile>,
pub backends: HashMap<String, BackendDefinition>,
}Expand description
Complete application configuration.
Names are the keys in the HashMaps; there is no duplicate name field inside the structs themselves.
Fields§
§global: GlobalConfig§profiles: HashMap<String, RuntimeProfile>§backends: HashMap<String, BackendDefinition>Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn profile(&self, name: &str) -> Option<&RuntimeProfile>
pub fn profile(&self, name: &str) -> Option<&RuntimeProfile>
Retrieves a profile by name.
This is a pure data lookup; no validation is performed.
Sourcepub fn backend(&self, name: &str) -> Option<&BackendDefinition>
pub fn backend(&self, name: &str) -> Option<&BackendDefinition>
Retrieves a backend definition by name.
This is a pure data lookup; no validation is performed.
Sourcepub fn resolve_backend(&self, profile_name: &str) -> Option<&BackendDefinition>
pub fn resolve_backend(&self, profile_name: &str) -> Option<&BackendDefinition>
Resolves the backend selected by the specified profile.
This is a pure data lookup. No validation is performed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for AppConfig
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfig
impl UnwindSafe for AppConfig
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
Mutably borrows from an owned value. Read more