pub struct DomainRegistry { /* private fields */ }Expand description
A registry of domain packages and the routing logic that selects one (PSP-8 System 1 / Phase 10). Domain selection is a routing decision; it does not bypass the SDK’s residual, scheduler, capability, ledger, or dashboard contracts — every registered package implements the same trait.
Implementations§
Source§impl DomainRegistry
impl DomainRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, package: Arc<dyn AgentDomainPackage>)
pub fn register(&mut self, package: Arc<dyn AgentDomainPackage>)
Register a domain package. The SDK admits any number of domains without forking the control plane.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn domain_ids(&self) -> Vec<DomainId>
pub fn domain_ids(&self) -> Vec<DomainId>
All registered domain ids.
Sourcepub fn by_id(&self, id: &DomainId) -> Option<Arc<dyn AgentDomainPackage>>
pub fn by_id(&self, id: &DomainId) -> Option<Arc<dyn AgentDomainPackage>>
Look up a package by explicit domain id.
Sourcepub fn detect_best(
&self,
workspace: &WorkspaceSnapshot,
) -> Option<Arc<dyn AgentDomainPackage>>
pub fn detect_best( &self, workspace: &WorkspaceSnapshot, ) -> Option<Arc<dyn AgentDomainPackage>>
The activated package with the highest detection confidence.
Sourcepub fn select(
&self,
explicit: Option<&DomainId>,
workspace: &WorkspaceSnapshot,
) -> Option<Arc<dyn AgentDomainPackage>>
pub fn select( &self, explicit: Option<&DomainId>, workspace: &WorkspaceSnapshot, ) -> Option<Arc<dyn AgentDomainPackage>>
Select a domain: an explicit id wins; otherwise detect the best match.
Trait Implementations§
Source§impl Debug for DomainRegistry
impl Debug for DomainRegistry
Source§impl Default for DomainRegistry
impl Default for DomainRegistry
Source§fn default() -> DomainRegistry
fn default() -> DomainRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DomainRegistry
impl !RefUnwindSafe for DomainRegistry
impl Send for DomainRegistry
impl Sync for DomainRegistry
impl Unpin for DomainRegistry
impl UnsafeUnpin 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
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.