pub struct ShardDiagnostics {
pub file_to_shard: HashMap<String, u64>,
pub file_hashes: HashMap<String, ContentHash>,
pub shard_cids: HashMap<u64, String>,
pub shard_files: HashMap<u64, Vec<String>>,
pub shard_sizes: HashMap<u64, u64>,
pub dir_listing_counts: HashMap<u64, usize>,
}Expand description
Diagnostics snapshot for a sealed commit.
Fields§
§file_to_shard: HashMap<String, u64>File path → shard ID.
file_hashes: HashMap<String, ContentHash>File path → content hash.
shard_cids: HashMap<u64, String>Shard ID → CID string.
shard_files: HashMap<u64, Vec<String>>Shard ID → sorted file list.
shard_sizes: HashMap<u64, u64>Shard ID → compressed body size.
dir_listing_counts: HashMap<u64, usize>Shard ID → directory listing count.
Implementations§
Source§impl ShardDiagnostics
impl ShardDiagnostics
Sourcepub fn from_manifest(
manifest: &TreeManifest,
metadata: &MetadataBundle,
) -> Result<Self>
pub fn from_manifest( manifest: &TreeManifest, metadata: &MetadataBundle, ) -> Result<Self>
Builds diagnostics from a TreeManifest (no shard decryption needed).
Sourcepub fn from_commit(
ctx: &VoidContext,
commit: &Commit,
metadata: &MetadataBundle,
reader: &CommitReader,
) -> Result<Self>
pub fn from_commit( ctx: &VoidContext, commit: &Commit, metadata: &MetadataBundle, reader: &CommitReader, ) -> Result<Self>
Builds diagnostics by loading the manifest from a commit.
Sourcepub fn from_metadata(
ctx: &VoidContext,
metadata: &MetadataBundle,
reader: &CommitReader,
) -> Result<Self>
pub fn from_metadata( ctx: &VoidContext, metadata: &MetadataBundle, reader: &CommitReader, ) -> Result<Self>
Convenience: loads HEAD commit and builds diagnostics.
Used by tests that have a VoidContext + MetadataBundle but not the commit object.
Sourcepub fn total_files(&self) -> usize
pub fn total_files(&self) -> usize
Returns the number of files indexed in the diagnostics snapshot.
Sourcepub fn shard_count(&self) -> usize
pub fn shard_count(&self) -> usize
Returns the number of shards with data in the snapshot.
Trait Implementations§
Source§impl Clone for ShardDiagnostics
impl Clone for ShardDiagnostics
Source§fn clone(&self) -> ShardDiagnostics
fn clone(&self) -> ShardDiagnostics
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 moreAuto Trait Implementations§
impl Freeze for ShardDiagnostics
impl RefUnwindSafe for ShardDiagnostics
impl Send for ShardDiagnostics
impl Sync for ShardDiagnostics
impl Unpin for ShardDiagnostics
impl UnsafeUnpin for ShardDiagnostics
impl UnwindSafe for ShardDiagnostics
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,
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