@@ -161,17 +161,17 @@ pub struct Snapshot {
161
161
version : u8 ,
162
162
163
163
/// The address of the snapshotted database.
164
- database_address : Address ,
164
+ pub database_address : Address ,
165
165
/// The instance ID of the snapshotted database.
166
- database_instance_id : u64 ,
166
+ pub database_instance_id : u64 ,
167
167
168
168
/// ABI version of the module from which this snapshot was created, as [MAJOR, MINOR].
169
169
///
170
170
/// As of this proposal, [7, 0].
171
171
module_abi_version : [ u16 ; 2 ] ,
172
172
173
173
/// The transaction offset of the state this snapshot reflects.
174
- tx_offset : TxOffset ,
174
+ pub tx_offset : TxOffset ,
175
175
176
176
/// The hashes and reference counts of all objects in the blob store.
177
177
blobs : Vec < BlobEntry > ,
@@ -450,6 +450,15 @@ impl Snapshot {
450
450
. map ( |tbl| Self :: reconstruct_one_table ( object_repo, tbl) )
451
451
. collect ( )
452
452
}
453
+
454
+ /// Obtain an iterator over the [`blake3::Hash`]es of all objects
455
+ /// this snapshot is referring to.
456
+ pub fn objects ( & self ) -> impl Iterator < Item = blake3:: Hash > + ' _ {
457
+ self . blobs
458
+ . iter ( )
459
+ . map ( |b| blake3:: Hash :: from_bytes ( b. hash . data ) )
460
+ . chain ( self . tables . iter ( ) . flat_map ( |t| t. pages . iter ( ) . copied ( ) ) )
461
+ }
453
462
}
454
463
455
464
/// A repository of snapshots of a particular database instance.
0 commit comments