pub struct ConfigSection {
pub name: String,
pub description: Option<String>,
pub fields: Vec<ConfigField>,
}
Expand description
Configuration section for grouping related fields
Fields§
§name: String
§description: Option<String>
§fields: Vec<ConfigField>
Implementations§
Source§impl ConfigSection
impl ConfigSection
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set section description
Sourcepub fn add_field(self, field: ConfigField) -> Self
pub fn add_field(self, field: ConfigField) -> Self
Add a field to this section
Sourcepub fn get_field(&self, name: &str) -> Option<&ConfigField>
pub fn get_field(&self, name: &str) -> Option<&ConfigField>
Get field by name
Sourcepub fn validate_fields(
&self,
config: &HashMap<String, Value>,
) -> Result<(), ConfigError>
pub fn validate_fields( &self, config: &HashMap<String, Value>, ) -> Result<(), ConfigError>
Validate fields in this section
Trait Implementations§
Source§impl Clone for ConfigSection
impl Clone for ConfigSection
Source§fn clone(&self) -> ConfigSection
fn clone(&self) -> ConfigSection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConfigSection
impl Debug for ConfigSection
Source§impl<'de> Deserialize<'de> for ConfigSection
impl<'de> Deserialize<'de> for ConfigSection
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
Auto Trait Implementations§
impl Freeze for ConfigSection
impl RefUnwindSafe for ConfigSection
impl Send for ConfigSection
impl Sync for ConfigSection
impl Unpin for ConfigSection
impl UnwindSafe for ConfigSection
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