pub struct EngineRegistry { /* private fields */ }Expand description
A registry mapping model alias → engine. Lets the server dispatch by
the model field in the request without the engine itself knowing.
Implementations§
Source§impl EngineRegistry
impl EngineRegistry
Sourcepub fn register(
&mut self,
alias: impl Into<String>,
engine: Arc<dyn DecisionEngine>,
)
pub fn register( &mut self, alias: impl Into<String>, engine: Arc<dyn DecisionEngine>, )
Register a decision engine under the specified model alias (e.g. "jev-latest").
Sourcepub fn get(&self, model: &str) -> Option<Arc<dyn DecisionEngine>>
pub fn get(&self, model: &str) -> Option<Arc<dyn DecisionEngine>>
Look up a decision engine by its registered model alias.
Sourcepub fn list_models(&self) -> Vec<ModelInfo>
pub fn list_models(&self) -> Vec<ModelInfo>
GET /v1/models payload — one entry per registered alias,
pulling metadata from the engine itself.
Sourcepub fn register_if_absent(
&self,
alias: String,
engine: Arc<dyn DecisionEngine>,
) -> bool
pub fn register_if_absent( &self, alias: String, engine: Arc<dyn DecisionEngine>, ) -> bool
Publish a loaded engine without replacing a live alias. Cloned registries share updates so HTTP and gRPC observe the same model lifecycle.
Sourcepub fn unregister(&self, alias: &str) -> Option<Arc<dyn DecisionEngine>>
pub fn unregister(&self, alias: &str) -> Option<Arc<dyn DecisionEngine>>
Stop new dispatches. Existing requests retain their engine handle until completion, so unloading does not interrupt an accepted request.
Trait Implementations§
Source§impl Clone for EngineRegistry
impl Clone for EngineRegistry
Source§impl Debug for EngineRegistry
impl Debug for EngineRegistry
Auto Trait Implementations§
impl Freeze for EngineRegistry
impl RefUnwindSafe for EngineRegistry
impl Send for EngineRegistry
impl Sync for EngineRegistry
impl Unpin for EngineRegistry
impl UnsafeUnpin for EngineRegistry
impl UnwindSafe for EngineRegistry
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