pub struct ModelRegistry { /* private fields */ }Implementations§
Source§impl ModelRegistry
impl ModelRegistry
pub fn with_initial( name: impl Into<String>, daemon: Arc<Daemon>, loader: ModelLoader, ) -> ModelRegistry
pub fn set_reloader(&self, reloader: ModelReloader)
pub fn remember_source(&self, name: &str, source: &str)
pub fn remember_source_on( &self, name: &str, source: &str, runtime: Option<RuntimeId>, )
pub fn reload_pending(&self, model: Option<&str>) -> bool
pub fn set_runtime_names(&self, names: RuntimeNames)
pub fn runtime_named(&self, name: &str) -> Result<RuntimeId, String>
pub fn single(name: impl Into<String>, daemon: Arc<Daemon>) -> ModelRegistry
pub fn default_name(&self) -> String
pub fn names(&self) -> Vec<String>
Sourcepub fn loose_name(&self, requested: &str) -> Option<String>
pub fn loose_name(&self, requested: &str) -> Option<String>
The model requested names under crate::openai::ModelNaming::Loose: exact, else
by case, else by substring.
pub fn resolve(&self, model: Option<&str>) -> Option<(String, Arc<Daemon>)>
pub fn try_resolve( &self, model: Option<&str>, ) -> Result<(String, Arc<Daemon>), ResolveError>
pub fn register_known(&self, name: &str, path: &Path)
pub fn is_known(&self, name: &str) -> bool
pub fn all_names(&self) -> Vec<String>
pub fn track_idle(&self)
pub fn sweep_idle(&self, max_idle: Duration) -> Vec<String>
pub fn is_loaded(&self, name: &str) -> bool
pub fn load(&self, name: &str) -> Result<(), DaemonError>
pub fn load_on( &self, name: &str, runtime: Option<RuntimeId>, ) -> Result<(), DaemonError>
pub fn load_as(&self, name: &str, source: &str) -> Result<bool, DaemonError>
pub fn load_as_on( &self, name: &str, source: &str, runtime: Option<RuntimeId>, ) -> Result<bool, DaemonError>
pub fn shutdown_all(&self)
pub fn unload(&self, name: &str) -> Result<bool, DaemonError>
Auto Trait Implementations§
impl !Freeze for ModelRegistry
impl !RefUnwindSafe for ModelRegistry
impl !UnwindSafe for ModelRegistry
impl Send for ModelRegistry
impl Sync for ModelRegistry
impl Unpin for ModelRegistry
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more