pub struct SaveFingerprint {
pub hash: String,
pub mod_ids: SmallVec<[String; 8]>,
}Expand description
A fingerprint of the save-breaking mods active when a save was captured.
Computed as SHA-256 over the sorted list of enabled, save-breaking mod IDs (and their versions). Two profiles with the same save-breaking mods produce the same fingerprint, regardless of cosmetic mod differences.
Stored as a Mod-Fingerprint: trailer in save vault commit messages.
Fields§
§hash: StringHex-encoded SHA-256 hash (first 16 characters for display).
mod_ids: SmallVec<[String; 8]>The save-breaking mod IDs that contributed to this fingerprint.
Typically 5–15 mods; SmallVec<[_; 8]> keeps ≤8 inline (no heap allocation).
Implementations§
Source§impl SaveFingerprint
impl SaveFingerprint
Sourcepub fn compute(mods: &[EnabledMod], classify: impl Fn(&str) -> bool) -> Self
pub fn compute(mods: &[EnabledMod], classify: impl Fn(&str) -> bool) -> Self
Compute a fingerprint from a list of mods and a classification function.
classify takes a mod_id and returns whether it’s save-breaking.
This is intentionally a callback so the caller can resolve staging
paths and call GamePlugin::classify_mod — keeping modde-core
independent of modde-games.
Sourcepub fn short_hash(&self) -> &str
pub fn short_hash(&self) -> &str
Short hash for display (first 12 hex chars).
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for SaveFingerprint
impl Clone for SaveFingerprint
Source§fn clone(&self) -> SaveFingerprint
fn clone(&self) -> SaveFingerprint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SaveFingerprint
impl Debug for SaveFingerprint
Source§impl Hash for SaveFingerprint
impl Hash for SaveFingerprint
Source§impl PartialEq for SaveFingerprint
impl PartialEq for SaveFingerprint
Source§fn eq(&self, other: &SaveFingerprint) -> bool
fn eq(&self, other: &SaveFingerprint) -> bool
self and other values to be equal, and is used by ==.impl Eq for SaveFingerprint
impl StructuralPartialEq for SaveFingerprint
Auto Trait Implementations§
impl Freeze for SaveFingerprint
impl RefUnwindSafe for SaveFingerprint
impl Send for SaveFingerprint
impl Sync for SaveFingerprint
impl Unpin for SaveFingerprint
impl UnsafeUnpin for SaveFingerprint
impl UnwindSafe for SaveFingerprint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.