pub struct ModelRegistry {
pub schema_version: u32,
pub models: BTreeMap<String, ModelEntry>,
pub roles: BTreeMap<String, RoleEntry>,
}Fields§
§schema_version: u32§models: BTreeMap<String, ModelEntry>§roles: BTreeMap<String, RoleEntry>Implementations§
Source§impl ModelRegistry
impl ModelRegistry
pub fn load_from(path: &Path) -> Result<Self>
pub fn save_to(&self, path: &Path) -> Result<()>
pub fn default_path() -> Result<PathBuf>
Sourcepub fn resolve_role(&self, role: &str) -> Option<&str>
pub fn resolve_role(&self, role: &str) -> Option<&str>
Return the primary model ID for role, or the fallback if the primary
is not in the models map, or None if the role is not configured.
Trait Implementations§
Source§impl Clone for ModelRegistry
impl Clone for ModelRegistry
Source§fn clone(&self) -> ModelRegistry
fn clone(&self) -> ModelRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ModelRegistry
impl Debug for ModelRegistry
Source§impl Default for ModelRegistry
impl Default for ModelRegistry
Source§impl<'de> Deserialize<'de> for ModelRegistry
impl<'de> Deserialize<'de> for ModelRegistry
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ModelRegistry
impl PartialEq for ModelRegistry
Source§fn eq(&self, other: &ModelRegistry) -> bool
fn eq(&self, other: &ModelRegistry) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ModelRegistry
impl Serialize for ModelRegistry
impl StructuralPartialEq for ModelRegistry
Auto Trait Implementations§
impl Freeze for ModelRegistry
impl RefUnwindSafe for ModelRegistry
impl Send for ModelRegistry
impl Sync for ModelRegistry
impl Unpin for ModelRegistry
impl UnsafeUnpin for ModelRegistry
impl UnwindSafe for ModelRegistry
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