pub struct ModelManager { /* private fields */ }Expand description
Atomic manager for current and retained exact compiled model runtimes.
Implementations§
Source§impl ModelManager
impl ModelManager
pub fn new( authored: BTreeMap<ProviderId, ProviderDefinition>, catalog: Arc<CatalogSnapshot>, store: ProviderStore, ) -> Result<Self, ModelManagerError>
pub fn new_with_headers( authored: BTreeMap<ProviderId, ProviderDefinition>, global_headers: BTreeMap<HeaderName, SafeStaticHeaderValue>, catalog: Arc<CatalogSnapshot>, store: ProviderStore, ) -> Result<Self, ModelManagerError>
pub fn current(&self) -> Arc<CompiledModelRuntime>
pub fn retained( &self, revision: &ModelRevision, ) -> Option<Arc<CompiledModelRuntime>>
pub fn retained_all( &self, revision: &ModelRevision, ) -> Vec<Arc<CompiledModelRuntime>>
pub fn connect<P>( &self, request: ProviderConnectRequest, prepare_publication: impl FnOnce(&Arc<CompiledModelRuntime>, &ProviderStoreMutation) -> Result<P, ModelManagerError>, ) -> Result<ModelMutationResult<P>, ModelManagerError>
pub fn disconnect<P>( &self, request: ProviderDisconnectRequest, prepare_publication: impl FnOnce(&Arc<CompiledModelRuntime>, &ProviderStoreMutation) -> Result<P, ModelManagerError>, ) -> Result<ModelMutationResult<P>, ModelManagerError>
Sourcepub fn reload_store_if_changed<P>(
&self,
prepare_publication: impl FnOnce(&Arc<CompiledModelRuntime>) -> Result<P, ModelManagerError>,
) -> Result<Option<(Arc<CompiledModelRuntime>, P)>, ModelManagerError>
pub fn reload_store_if_changed<P>( &self, prepare_publication: impl FnOnce(&Arc<CompiledModelRuntime>) -> Result<P, ModelManagerError>, ) -> Result<Option<(Arc<CompiledModelRuntime>, P)>, ModelManagerError>
Recompiles and publishes another process’s newer provider-store generation.
Sourcepub fn reload_inputs<P>(
&self,
authored: BTreeMap<ProviderId, ProviderDefinition>,
catalog: Arc<CatalogSnapshot>,
prepare_publication: impl FnOnce(&Arc<CompiledModelRuntime>) -> Result<P, ModelManagerError>,
) -> Result<(Arc<CompiledModelRuntime>, P), ModelManagerError>
pub fn reload_inputs<P>( &self, authored: BTreeMap<ProviderId, ProviderDefinition>, catalog: Arc<CatalogSnapshot>, prepare_publication: impl FnOnce(&Arc<CompiledModelRuntime>) -> Result<P, ModelManagerError>, ) -> Result<(Arc<CompiledModelRuntime>, P), ModelManagerError>
Atomically recompiles a config/catalog replacement before publication.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ModelManager
impl !RefUnwindSafe for ModelManager
impl !UnwindSafe for ModelManager
impl Send for ModelManager
impl Sync for ModelManager
impl Unpin for ModelManager
impl UnsafeUnpin for ModelManager
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