pub struct ModelManifest {
pub sha256: HashMap<String, String>,
}Expand description
A manifest file written alongside downloaded model files. Contains the SHA-256 hash of each file at download time so the explicit “Validate” action can detect corruption or tampering.
File: {model_dir}/orbok-manifest.json
Fields§
§sha256: HashMap<String, String>Map of relative file path → lowercase hex SHA-256 digest.
Implementations§
Source§impl ModelManifest
impl ModelManifest
Sourcepub fn load(model_dir: &Path) -> Option<Self>
pub fn load(model_dir: &Path) -> Option<Self>
Load a manifest from the model directory. Returns None if the
manifest file does not exist (e.g. model was placed manually).
Sourcepub fn save(&self, model_dir: &Path) -> Result<()>
pub fn save(&self, model_dir: &Path) -> Result<()>
Persist the manifest to the model directory.
Sourcepub fn sha256_of_file(path: &Path) -> Result<String>
pub fn sha256_of_file(path: &Path) -> Result<String>
Compute the SHA-256 hex digest of a file.
Trait Implementations§
Source§impl Clone for ModelManifest
impl Clone for ModelManifest
Source§fn clone(&self) -> ModelManifest
fn clone(&self) -> ModelManifest
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 ModelManifest
impl Debug for ModelManifest
Source§impl<'de> Deserialize<'de> for ModelManifest
impl<'de> Deserialize<'de> for ModelManifest
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 ModelManifest
impl RefUnwindSafe for ModelManifest
impl Send for ModelManifest
impl Sync for ModelManifest
impl Unpin for ModelManifest
impl UnsafeUnpin for ModelManifest
impl UnwindSafe for ModelManifest
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,
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