@@ -233,10 +233,22 @@ impl<T: TlsUsage> EnvOpenOptions<T> {
233
233
/// [^7]: <https://github.com/LMDB/lmdb/blob/b8e54b4c31378932b69f1298972de54a565185b1/libraries/liblmdb/lmdb.h#L102-L105>
234
234
/// [^8]: <http://www.lmdb.tech/doc/index.html>
235
235
pub unsafe fn open < P : AsRef < Path > > ( & self , path : P ) -> Result < Env < T > > {
236
- self . raw_open_with_encryption (
236
+ self . raw_open_with_checksum_and_encryption (
237
237
path. as_ref ( ) ,
238
238
#[ cfg( master3) ]
239
239
None ,
240
+ #[ cfg( master3) ]
241
+ None ,
242
+ )
243
+ }
244
+
245
+ pub unsafe fn open_checksummed < P : AsRef < Path > > ( & self , path : P ) -> Result < Env < T > > {
246
+ self . raw_open_with_checksum_and_encryption (
247
+ path. as_ref ( ) ,
248
+ #[ cfg( master3) ]
249
+ None ,
250
+ #[ cfg( master3) ]
251
+ None ,
240
252
)
241
253
}
242
254
@@ -390,16 +402,18 @@ impl<T: TlsUsage> EnvOpenOptions<T> {
390
402
E : AeadMutInPlace + KeyInit ,
391
403
P : AsRef < Path > ,
392
404
{
393
- self . raw_open_with_encryption (
405
+ self . raw_open_with_checksum_and_encryption (
394
406
path. as_ref ( ) ,
407
+ None ,
395
408
Some ( ( Some ( encrypt_func_wrapper :: < E > ) , & key, <E as AeadCore >:: TagSize :: U32 ) ) ,
396
409
)
397
410
. map ( |inner| EncryptedEnv { inner } )
398
411
}
399
412
400
- fn raw_open_with_encryption (
413
+ fn raw_open_with_checksum_and_encryption (
401
414
& self ,
402
415
path : & Path ,
416
+ #[ cfg( master3) ] sum : Option < ( ffi:: MDB_sum_func , u32 ) > ,
403
417
#[ cfg( master3) ] enc : Option < ( ffi:: MDB_enc_func , & [ u8 ] , u32 ) > ,
404
418
) -> Result < Env < T > > {
405
419
let mut lock = OPENED_ENV . write ( ) . unwrap ( ) ;
0 commit comments