pub struct ModelRuntime {Show 13 fields
pub id: Uuid,
pub model_id: Uuid,
pub name: String,
pub port: u16,
pub process_id: Option<u32>,
pub config: RuntimeConfig,
pub started_at: Option<DateTime<Utc>>,
pub stopped_at: Option<DateTime<Utc>>,
pub status: ModelStatus,
pub health_endpoint: String,
pub api_endpoint: String,
pub log_file: Option<String>,
pub environment: HashMap<String, String>,
}Expand description
模型运行时实例
Fields§
§id: Uuid运行时ID
model_id: Uuid模型ID
name: String运行时名称
port: u16绑定端口
process_id: Option<u32>进程ID
config: RuntimeConfig运行时配置
started_at: Option<DateTime<Utc>>启动时间
stopped_at: Option<DateTime<Utc>>停止时间
status: ModelStatus运行状态
health_endpoint: String健康检查端点
api_endpoint: StringAPI 端点
log_file: Option<String>日志文件路径
environment: HashMap<String, String>环境变量
Implementations§
Source§impl ModelRuntime
impl ModelRuntime
Sourcepub fn mark_started(&mut self, process_id: u32)
pub fn mark_started(&mut self, process_id: u32)
标记为启动
Sourcepub fn mark_stopped(&mut self)
pub fn mark_stopped(&mut self)
标记为停止
Sourcepub fn uptime_seconds(&self) -> Option<i64>
pub fn uptime_seconds(&self) -> Option<i64>
获取运行时长 (秒)
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
检查是否健康
Trait Implementations§
Source§impl Clone for ModelRuntime
impl Clone for ModelRuntime
Source§fn clone(&self) -> ModelRuntime
fn clone(&self) -> ModelRuntime
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 ModelRuntime
impl Debug for ModelRuntime
Source§impl<'de> Deserialize<'de> for ModelRuntime
impl<'de> Deserialize<'de> for ModelRuntime
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModelRuntime
impl RefUnwindSafe for ModelRuntime
impl Send for ModelRuntime
impl Sync for ModelRuntime
impl Unpin for ModelRuntime
impl UnsafeUnpin for ModelRuntime
impl UnwindSafe for ModelRuntime
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