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 new() -> EngineRegistry
pub fn new() -> EngineRegistry
Construct an empty 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§fn clone(&self) -> EngineRegistry
fn clone(&self) -> EngineRegistry
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 EngineRegistry
impl Debug for EngineRegistry
Source§impl Default for EngineRegistry
impl Default for EngineRegistry
Source§fn default() -> EngineRegistry
fn default() -> EngineRegistry
Returns the “default value” for a type. Read more
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§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request