pub struct ConfigLoader { /* private fields */ }Expand description
Configuration loader for domain agents
This struct provides methods to load and validate domain agent configurations from YAML and JSON files.
§Examples
ⓘ
use ricecoder_agents::domain::ConfigLoader;
use std::path::Path;
let loader = ConfigLoader::new();
let config = loader.load_from_file(Path::new("config/domains/web.yaml"))?;Implementations§
Source§impl ConfigLoader
impl ConfigLoader
Sourcepub fn with_schema(schema_json: &str) -> DomainResult<Self>
pub fn with_schema(schema_json: &str) -> DomainResult<Self>
Sourcepub fn load_from_file(&self, path: &Path) -> DomainResult<AgentConfig>
pub fn load_from_file(&self, path: &Path) -> DomainResult<AgentConfig>
Sourcepub fn load_from_yaml(&self, yaml: &str) -> DomainResult<AgentConfig>
pub fn load_from_yaml(&self, yaml: &str) -> DomainResult<AgentConfig>
Sourcepub fn load_from_json(&self, json: &str) -> DomainResult<AgentConfig>
pub fn load_from_json(&self, json: &str) -> DomainResult<AgentConfig>
Sourcepub fn validate(&self, config: &AgentConfig) -> DomainResult<()>
pub fn validate(&self, config: &AgentConfig) -> DomainResult<()>
Sourcepub fn with_builtin_schema() -> DomainResult<Self>
pub fn with_builtin_schema() -> DomainResult<Self>
Trait Implementations§
Source§impl Clone for ConfigLoader
impl Clone for ConfigLoader
Source§fn clone(&self) -> ConfigLoader
fn clone(&self) -> ConfigLoader
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 ConfigLoader
impl Debug for ConfigLoader
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