pub struct HttpModelServer { /* private fields */ }Expand description
Enhanced model server with HTTP capabilities
Implementations§
Source§impl HttpModelServer
impl HttpModelServer
Sourcepub fn new(config: ServerConfig) -> Self
pub fn new(config: ServerConfig) -> Self
Create a new HTTP model server
Sourcepub fn set_registry(&mut self, registry: Arc<dyn ModelRegistry>)
pub fn set_registry(&mut self, registry: Arc<dyn ModelRegistry>)
Set model registry
Sourcepub fn register_model(
&mut self,
name: String,
model: Box<dyn ModelServing>,
) -> Result<()>
pub fn register_model( &mut self, name: String, model: Box<dyn ModelServing>, ) -> Result<()>
Register a model
Sourcepub fn handle_predict(
&self,
model_name: &str,
request: PredictionRequest,
context: RequestContext,
) -> HttpResponse<PredictionResponse>
pub fn handle_predict( &self, model_name: &str, request: PredictionRequest, context: RequestContext, ) -> HttpResponse<PredictionResponse>
Handle prediction request
Sourcepub fn handle_predict_batch(
&self,
model_name: &str,
request: BatchPredictionRequest,
context: RequestContext,
) -> HttpResponse<BatchPredictionResponse>
pub fn handle_predict_batch( &self, model_name: &str, request: BatchPredictionRequest, context: RequestContext, ) -> HttpResponse<BatchPredictionResponse>
Handle batch prediction request
Sourcepub fn handle_model_info(
&self,
model_name: &str,
context: RequestContext,
) -> HttpResponse<ModelInfo>
pub fn handle_model_info( &self, model_name: &str, context: RequestContext, ) -> HttpResponse<ModelInfo>
Handle model info request
Sourcepub fn handle_health_check(
&self,
model_name: Option<&str>,
context: RequestContext,
) -> HttpResponse<ServerHealthStatus>
pub fn handle_health_check( &self, model_name: Option<&str>, context: RequestContext, ) -> HttpResponse<ServerHealthStatus>
Handle health check request
Sourcepub fn handle_list_models(
&self,
context: RequestContext,
) -> HttpResponse<Vec<String>>
pub fn handle_list_models( &self, context: RequestContext, ) -> HttpResponse<Vec<String>>
Handle list models request
Sourcepub fn get_server_stats(&self) -> Result<ServerStats>
pub fn get_server_stats(&self) -> Result<ServerStats>
Get server statistics
Sourcepub fn get_routes(&self) -> Vec<RouteInfo>
pub fn get_routes(&self) -> Vec<RouteInfo>
Get API routes documentation
Auto Trait Implementations§
impl Freeze for HttpModelServer
impl !RefUnwindSafe for HttpModelServer
impl !Send for HttpModelServer
impl !Sync for HttpModelServer
impl Unpin for HttpModelServer
impl UnsafeUnpin for HttpModelServer
impl !UnwindSafe for HttpModelServer
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> 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