pub struct MlRuntime { /* private fields */ }Expand description
Shared entrypoint used by every ML feature.
Cloning the runtime is cheap — registry and queue both wrap
Arcs internally.
Implementations§
Source§impl MlRuntime
impl MlRuntime
Sourcepub fn in_memory(
worker_fn: Arc<dyn Fn(JobHandle) -> Result<String, String> + Send + Sync>,
) -> MlRuntime
pub fn in_memory( worker_fn: Arc<dyn Fn(JobHandle) -> Result<String, String> + Send + Sync>, ) -> MlRuntime
Build a fully in-memory runtime. Jobs and versions disappear on drop — good for unit tests, bad for production.
Sourcepub fn with_backend(
backend: Arc<dyn MlPersistence>,
worker_fn: Arc<dyn Fn(JobHandle) -> Result<String, String> + Send + Sync>,
config: MlRuntimeConfig,
) -> MlRuntime
pub fn with_backend( backend: Arc<dyn MlPersistence>, worker_fn: Arc<dyn Fn(JobHandle) -> Result<String, String> + Send + Sync>, config: MlRuntimeConfig, ) -> MlRuntime
Build a runtime that persists registry + job state into
backend. On construction the registry and queue rehydrate
automatically so prior state is observable immediately.
pub fn registry(&self) -> &ModelRegistry
pub fn queue(&self) -> &MlJobQueue
Sourcepub fn backend(&self) -> &Arc<dyn MlPersistence> ⓘ
pub fn backend(&self) -> &Arc<dyn MlPersistence> ⓘ
Access the raw persistence backend — used by features that need their own namespace (e.g. semantic cache stats).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MlRuntime
impl !RefUnwindSafe for MlRuntime
impl Send for MlRuntime
impl Sync for MlRuntime
impl Unpin for MlRuntime
impl UnsafeUnpin for MlRuntime
impl !UnwindSafe for MlRuntime
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
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> 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 moreSource§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