pub struct Registry {
pub providers: HashMap<String, ProviderDef>,
pub models: HashMap<String, ModelDef>,
pub specialists: HashMap<String, Specialist>,
}Expand description
The on-disk catalog backing spawningpool define / spawningpool list / spawningpool delete. Tools
aren’t here — they live as scripts in the crate::tools folder.
Fields§
§providers: HashMap<String, ProviderDef>§models: HashMap<String, ModelDef>§specialists: HashMap<String, Specialist>Implementations§
Source§impl Registry
impl Registry
Sourcepub fn resolve_model(&self, specialist: &Specialist) -> Result<Model, String>
pub fn resolve_model(&self, specialist: &Specialist) -> Result<Model, String>
Resolve a specialist’s provider + model into a runtime Model.
Sourcepub fn missing_model_ref(&self, model: &ModelDef) -> Option<MissingRef>
pub fn missing_model_ref(&self, model: &ModelDef) -> Option<MissingRef>
The first reference a model makes that the registry can’t resolve — only
its provider — or None when every reference is satisfied. The gate
spawningpool define (or a UI) runs before persisting a model.
Sourcepub fn missing_specialist_ref(
&self,
specialist: &Specialist,
tool_exists: impl Fn(&str) -> bool,
) -> Option<MissingRef>
pub fn missing_specialist_ref( &self, specialist: &Specialist, tool_exists: impl Fn(&str) -> bool, ) -> Option<MissingRef>
The first reference a specialist makes that the registry can’t resolve —
its provider, then its model, then each tool — or None when all resolve.
Uses Specialist::tool_names, so a constrained specialist’s forced tool
is checked too. Tools live in a folder, not the registry, so the caller
supplies tool_exists (e.g. crate::tools::exists) to check them.
Sourcepub fn referrers(&self, target: EntityKind, name: &str) -> Vec<Referrer>
pub fn referrers(&self, target: EntityKind, name: &str) -> Vec<Referrer>
Entities that reference name as a target, so a delete can warn about
the references it would orphan. For a provider that’s the specialists
pointing at it plus the models defined under it; specialists are listed
before models, each group sorted by name.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Registry
impl<'de> Deserialize<'de> for Registry
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>,
impl Eq for Registry
impl StructuralPartialEq for Registry
Auto Trait Implementations§
impl Forget for Registry
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.