pub struct VersionControl { /* private fields */ }Expand description
Version control system for model checkpoints
Features:
- Complete version history
- Parent-child relationships (branching)
- Metadata tracking
- Checksum verification
- Generation/lineage tracking
Compliance:
- CMMC AU.3.046: Alert in the event of an audit logging process failure
- CMMC AU.3.049: Protect audit information from unauthorized access
Implementations§
Source§impl VersionControl
impl VersionControl
Sourcepub fn vault_path(&self) -> &Path
pub fn vault_path(&self) -> &Path
Return the vault directory path
Sourcepub fn add_version(
&mut self,
model_name: &str,
file_path: &str,
format: &str,
size_bytes: u64,
compressed_size_bytes: u64,
checksum: &str,
metadata: Option<HashMap<String, String>>,
parent_version: Option<u32>,
) -> Result<ModelVersion>
pub fn add_version( &mut self, model_name: &str, file_path: &str, format: &str, size_bytes: u64, compressed_size_bytes: u64, checksum: &str, metadata: Option<HashMap<String, String>>, parent_version: Option<u32>, ) -> Result<ModelVersion>
Add new model version
Sourcepub fn get_version(
&self,
model_name: &str,
version: Option<u32>,
) -> Option<&ModelVersion>
pub fn get_version( &self, model_name: &str, version: Option<u32>, ) -> Option<&ModelVersion>
Get specific model version
Sourcepub fn list_versions(&self, model_name: &str) -> Vec<&ModelVersion>
pub fn list_versions(&self, model_name: &str) -> Vec<&ModelVersion>
List all versions of a model
Sourcepub fn get_lineage(&self, model_name: &str, version: u32) -> Vec<&ModelVersion>
pub fn get_lineage(&self, model_name: &str, version: u32) -> Vec<&ModelVersion>
Get complete lineage/generation history for a version
Sourcepub fn delete_version(&mut self, model_name: &str, version: u32) -> Result<bool>
pub fn delete_version(&mut self, model_name: &str, version: u32) -> Result<bool>
Delete a specific version
Sourcepub fn cleanup_old_versions(
&mut self,
model_name: &str,
keep_count: usize,
) -> Result<Vec<u32>>
pub fn cleanup_old_versions( &mut self, model_name: &str, keep_count: usize, ) -> Result<Vec<u32>>
Clean up old versions, keeping only the most recent
Sourcepub fn verify_checksum(
&self,
model_name: &str,
version: u32,
data: &[u8],
) -> bool
pub fn verify_checksum( &self, model_name: &str, version: u32, data: &[u8], ) -> bool
Verify data integrity using stored checksum
Sourcepub fn update_metadata(
&mut self,
model_name: &str,
version: u32,
key: &str,
value: String,
) -> Result<()>
pub fn update_metadata( &mut self, model_name: &str, version: u32, key: &str, value: String, ) -> Result<()>
Update metadata for a specific model version
Sourcepub fn get_metadata(
&self,
model_name: &str,
version: u32,
key: &str,
) -> Option<String>
pub fn get_metadata( &self, model_name: &str, version: u32, key: &str, ) -> Option<String>
Get metadata for a specific model version
Sourcepub fn list_models_owned(&self) -> Vec<String>
pub fn list_models_owned(&self) -> Vec<String>
Return an owned list of model names (useful when the caller needs ownership, e.g. for export/import operations).
Sourcepub fn import_version(
&mut self,
model_name: &str,
version: ModelVersion,
) -> Result<()>
pub fn import_version( &mut self, model_name: &str, version: ModelVersion, ) -> Result<()>
Import a pre-built ModelVersion for a model — used during vault
bundle import to transplant versions from another vault.
Trait Implementations§
Source§impl VersionRepo for VersionControl
impl VersionRepo for VersionControl
Source§fn add_version(
&mut self,
model: &str,
file_path: &str,
format: &str,
size_bytes: u64,
compressed_size_bytes: u64,
checksum: &str,
metadata: Option<HashMap<String, String>>,
parent_version: Option<u32>,
) -> Result<ModelVersion>
fn add_version( &mut self, model: &str, file_path: &str, format: &str, size_bytes: u64, compressed_size_bytes: u64, checksum: &str, metadata: Option<HashMap<String, String>>, parent_version: Option<u32>, ) -> Result<ModelVersion>
Add a new version for a model.
Source§fn get_version(
&self,
model: &str,
version: Option<u32>,
) -> Option<&ModelVersion>
fn get_version( &self, model: &str, version: Option<u32>, ) -> Option<&ModelVersion>
Get a specific version, or the latest if version is None.
Source§fn list_versions(&self, model: &str) -> Vec<&ModelVersion>
fn list_versions(&self, model: &str) -> Vec<&ModelVersion>
List all versions of a model, sorted by version number.
Source§fn get_lineage(&self, model: &str, version: u32) -> Vec<&ModelVersion>
fn get_lineage(&self, model: &str, version: u32) -> Vec<&ModelVersion>
Get the lineage chain for a version.
Source§fn delete_version(&mut self, model: &str, version: u32) -> Result<bool>
fn delete_version(&mut self, model: &str, version: u32) -> Result<bool>
Delete a specific version. Returns true if it existed.
Source§fn cleanup_old_versions(
&mut self,
model: &str,
keep_count: usize,
) -> Result<Vec<u32>>
fn cleanup_old_versions( &mut self, model: &str, keep_count: usize, ) -> Result<Vec<u32>>
Clean up old versions, keeping
keep_count most recent.Source§fn verify_checksum(&self, model: &str, version: u32, data: &[u8]) -> bool
fn verify_checksum(&self, model: &str, version: u32, data: &[u8]) -> bool
Verify data checksum against stored checksum.
Source§fn update_metadata(
&mut self,
model: &str,
version: u32,
key: &str,
value: String,
) -> Result<()>
fn update_metadata( &mut self, model: &str, version: u32, key: &str, value: String, ) -> Result<()>
Update metadata for a version.
Source§fn get_metadata(&self, model: &str, version: u32, key: &str) -> Option<String>
fn get_metadata(&self, model: &str, version: u32, key: &str) -> Option<String>
Get metadata for a version.
Source§fn list_models(&self) -> Vec<String>
fn list_models(&self) -> Vec<String>
List all model names.
Auto Trait Implementations§
impl Freeze for VersionControl
impl RefUnwindSafe for VersionControl
impl Send for VersionControl
impl Sync for VersionControl
impl Unpin for VersionControl
impl UnsafeUnpin for VersionControl
impl UnwindSafe for VersionControl
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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::RequestCreates a shared type from an unshared type.