@@ -429,11 +429,16 @@ impl Iterator for StatsIterator {
429429
430430 match self . handle . pin_mut ( ) . next ( ) {
431431 Ok ( data) => Some ( Ok ( StatsElement {
432- location : data. location ,
433- field_count : data. field_count ,
434- total_size : data. total_size ,
435- duplicate_count : data. duplicate_count ,
436- duplicate_size : data. duplicate_size ,
432+ index_statistics : IndexStats {
433+ fields_count : data. index_statistics . fields_count ,
434+ fields_size : data. index_statistics . fields_size ,
435+ duplicates_count : data. index_statistics . duplicates_count ,
436+ duplicates_size : data. index_statistics . duplicates_size ,
437+ report : data. index_statistics . report ,
438+ } ,
439+ db_statistics : DbStats {
440+ report : data. db_statistics . report ,
441+ } ,
437442 } ) ) ,
438443 Err ( e) => {
439444 self . exhausted = true ;
@@ -451,19 +456,46 @@ impl Iterator for StatsIterator {
451456#[ allow( clippy:: non_send_fields_in_send_ty) ]
452457unsafe impl Send for StatsIterator { }
453458
454- /// A stats element containing database statistics.
459+ /// Index-level statistics — mirrors `fdb5::IndexStats`.
460+ ///
461+ /// Bundles the four numeric accessors upstream exposes
462+ /// (`fieldsCount` / `fieldsSize` / `duplicatesCount` / `duplicatesSize`)
463+ /// plus the captured `report()` text.
464+ #[ derive( Debug , Clone ) ]
465+ pub struct IndexStats {
466+ /// Number of fields covered by this index.
467+ pub fields_count : u64 ,
468+ /// Total size in bytes of those fields.
469+ pub fields_size : u64 ,
470+ /// Number of duplicate (masked) entries.
471+ pub duplicates_count : u64 ,
472+ /// Total size in bytes of the duplicate entries.
473+ pub duplicates_size : u64 ,
474+ /// Captured `fdb5::IndexStats::report()` output — the same text
475+ /// `fdb-stats --details` prints for the index portion.
476+ pub report : String ,
477+ }
478+
479+ /// Database-level statistics — mirrors `fdb5::DbStats`.
480+ ///
481+ /// Upstream's `DbStats` is fully content-opaque; the only public
482+ /// readable accessor is `report(std::ostream&)`. The captured report
483+ /// text is therefore the only thing this binding can surface — same
484+ /// rule the C++ tools play by.
485+ #[ derive( Debug , Clone ) ]
486+ pub struct DbStats {
487+ /// Captured `fdb5::DbStats::report()` output — the same text
488+ /// `fdb-stats --details` prints for the database portion.
489+ pub report : String ,
490+ }
491+
492+ /// A stats element — mirrors `fdb5::StatsElement`.
455493#[ derive( Debug , Clone ) ]
456494pub struct StatsElement {
457- /// Location of the database.
458- pub location : String ,
459- /// Number of fields.
460- pub field_count : u64 ,
461- /// Total size in bytes.
462- pub total_size : u64 ,
463- /// Number of duplicate entries.
464- pub duplicate_count : u64 ,
465- /// Size of duplicate data in bytes.
466- pub duplicate_size : u64 ,
495+ /// Index-level statistics for this database.
496+ pub index_statistics : IndexStats ,
497+ /// Database-level statistics for this database.
498+ pub db_statistics : DbStats ,
467499}
468500
469501// =============================================================================
0 commit comments