pub struct ModelVersion {
pub version: u64,
pub created_at: i64,
pub algorithm: String,
pub hyperparameters: HashMap<String, String>,
pub training_range: (i64, i64),
pub metrics: Option<AccuracyMetrics>,
pub tag: ModelTag,
pub model_bytes: Vec<u8>,
pub model_hash: [u8; 32],
}Expand description
A single model version with metadata.
Fields§
§version: u64Auto-incrementing version number (1-based).
created_at: i64Creation timestamp (epoch seconds).
algorithm: StringAlgorithm name (e.g. “ses”, “holt_winters”, “arima”).
hyperparameters: HashMap<String, String>Hyperparameters as key-value pairs.
training_range: (i64, i64)Training data time range: (start_ns, end_ns).
metrics: Option<AccuracyMetrics>Accuracy metrics (if evaluated).
tag: ModelTagLifecycle tag.
model_bytes: Vec<u8>Serialized model bytes (postcard).
model_hash: [u8; 32]SHA-256 hash of model_bytes for integrity verification.
Computed at registration time. Use ModelVersion::verify_integrity
to check that the model bytes haven’t been corrupted.
Implementations§
Source§impl ModelVersion
impl ModelVersion
Sourcepub fn verify_integrity(&self) -> bool
pub fn verify_integrity(&self) -> bool
Verify that model_bytes haven’t been corrupted since registration.
Returns true if the SHA-256 hash matches.
Trait Implementations§
Source§impl Clone for ModelVersion
impl Clone for ModelVersion
Source§fn clone(&self) -> ModelVersion
fn clone(&self) -> ModelVersion
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 ModelVersion
impl Debug for ModelVersion
Source§impl<'de> Deserialize<'de> for ModelVersion
impl<'de> Deserialize<'de> for ModelVersion
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 ModelVersion
impl RefUnwindSafe for ModelVersion
impl Send for ModelVersion
impl Sync for ModelVersion
impl Unpin for ModelVersion
impl UnsafeUnpin for ModelVersion
impl UnwindSafe for ModelVersion
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more