pub struct DomainRegistry { /* private fields */ }Expand description
Registry for domain agents
This struct manages the registration and discovery of domain agents. It supports auto-discovery of domains from configuration files and provides agent lookup by domain type.
§Examples
ⓘ
use ricecoder_agents::domain::DomainRegistry;
let registry = DomainRegistry::new();
registry.register_agent("web", agent);
let agent = registry.get_agent("web")?;Implementations§
Source§impl DomainRegistry
impl DomainRegistry
Sourcepub fn register_agent(
&self,
domain: &str,
agent: DomainAgent,
) -> DomainResult<()>
pub fn register_agent( &self, domain: &str, agent: DomainAgent, ) -> DomainResult<()>
Sourcepub fn get_agent(&self, domain: &str) -> DomainResult<DomainAgent>
pub fn get_agent(&self, domain: &str) -> DomainResult<DomainAgent>
Sourcepub fn discover_domains(&self) -> DomainResult<Vec<String>>
pub fn discover_domains(&self) -> DomainResult<Vec<String>>
Sourcepub fn list_capabilities(
&self,
domain: &str,
) -> DomainResult<Vec<DomainCapability>>
pub fn list_capabilities( &self, domain: &str, ) -> DomainResult<Vec<DomainCapability>>
Sourcepub fn has_domain(&self, domain: &str) -> DomainResult<bool>
pub fn has_domain(&self, domain: &str) -> DomainResult<bool>
Sourcepub fn get_all_agents(&self) -> DomainResult<Vec<DomainAgent>>
pub fn get_all_agents(&self) -> DomainResult<Vec<DomainAgent>>
Sourcepub fn clear(&self) -> DomainResult<()>
pub fn clear(&self) -> DomainResult<()>
Clear all registered agents
Sourcepub fn domain_count(&self) -> DomainResult<usize>
pub fn domain_count(&self) -> DomainResult<usize>
Get the number of registered domains
Trait Implementations§
Source§impl Clone for DomainRegistry
impl Clone for DomainRegistry
Source§fn clone(&self) -> DomainRegistry
fn clone(&self) -> DomainRegistry
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 DomainRegistry
impl Debug for DomainRegistry
Auto Trait Implementations§
impl Freeze for DomainRegistry
impl RefUnwindSafe for DomainRegistry
impl Send for DomainRegistry
impl Sync for DomainRegistry
impl Unpin for DomainRegistry
impl UnwindSafe for DomainRegistry
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