pub struct MerkleSignature {
pub root: [u8; 32],
pub chunk_size: u64,
pub file_size: u64,
pub leaf_hashes: Vec<[u8; 32]>,
pub chunk_entropies: Option<Vec<f32>>,
pub chunk_simhashes: Option<Vec<u64>>,
}Expand description
Serializable Merkle signature for xattr/sidecar storage.
Fields§
§root: [u8; 32]BLAKE3 root hash of the Merkle tree
chunk_size: u64Chunk size used when building the tree
file_size: u64File size at signature creation time
leaf_hashes: Vec<[u8; 32]>Ordered leaf hashes (one per chunk)
chunk_entropies: Option<Vec<f32>>Per-chunk Shannon entropy (bits/byte, 0.0-8.0). Present when any leaf has non-zero entropy.
chunk_simhashes: Option<Vec<u64>>Per-chunk SimHash fingerprints. Present when similarity feature computed the hashes.
Implementations§
Source§impl MerkleSignature
impl MerkleSignature
Sourcepub fn serialized_size(&self) -> usize
pub fn serialized_size(&self) -> usize
Estimated serialized size for xattr storage bounds checking.
Sourcepub fn fits_in_xattr(&self) -> bool
pub fn fits_in_xattr(&self) -> bool
Check if this signature fits within xattr limits.
Trait Implementations§
Source§impl Clone for MerkleSignature
impl Clone for MerkleSignature
Source§fn clone(&self) -> MerkleSignature
fn clone(&self) -> MerkleSignature
Returns a duplicate of the value. Read more
1.0.0 · 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 MerkleSignature
impl Debug for MerkleSignature
Source§impl<'de> Deserialize<'de> for MerkleSignature
impl<'de> Deserialize<'de> for MerkleSignature
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 MerkleSignature
impl RefUnwindSafe for MerkleSignature
impl Send for MerkleSignature
impl Sync for MerkleSignature
impl Unpin for MerkleSignature
impl UnsafeUnpin for MerkleSignature
impl UnwindSafe for MerkleSignature
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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