pub struct ConfigLoader { /* private fields */ }
Expand description
Configuration loader
Implementations§
Source§impl ConfigLoader
impl ConfigLoader
Sourcepub fn load_from_directory<P: AsRef<Path>>(config_dir: P) -> Result<Self>
pub fn load_from_directory<P: AsRef<Path>>(config_dir: P) -> Result<Self>
Load configuration from JSON files
Sourcepub fn load_defaults() -> Self
pub fn load_defaults() -> Self
Load configuration with defaults (used when config files don’t exist)
Sourcepub fn config(&self) -> &SwiftConfig
pub fn config(&self) -> &SwiftConfig
Get the loaded configuration
Sourcepub fn is_field_mandatory(&self, field_tag: &str, message_type: &str) -> bool
pub fn is_field_mandatory(&self, field_tag: &str, message_type: &str) -> bool
Check if a field is mandatory for a specific message type
Sourcepub fn get_field_validation(
&self,
field_tag: &str,
) -> Option<&FieldValidationRule>
pub fn get_field_validation( &self, field_tag: &str, ) -> Option<&FieldValidationRule>
Get validation rule for a field
Sourcepub fn get_validation_pattern(
&self,
pattern_name: &str,
) -> Option<&ValidationPattern>
pub fn get_validation_pattern( &self, pattern_name: &str, ) -> Option<&ValidationPattern>
Get validation pattern by name
Sourcepub fn get_mandatory_fields(&self, message_type: &str) -> Vec<String>
pub fn get_mandatory_fields(&self, message_type: &str) -> Vec<String>
Get all mandatory fields for a message type
Auto Trait Implementations§
impl Freeze for ConfigLoader
impl RefUnwindSafe for ConfigLoader
impl Send for ConfigLoader
impl Sync for ConfigLoader
impl Unpin for ConfigLoader
impl UnwindSafe for ConfigLoader
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