diff --git a/heed/src/env.rs b/heed/src/env.rs index 2ab436ea..886fbf52 100644 --- a/heed/src/env.rs +++ b/heed/src/env.rs @@ -40,13 +40,13 @@ struct EnvEntry { options: SimplifiedOpenOptions, } -/// A Simplified version of the options used to open a given [`Env`]. +/// A simplified version of the options that were used to open a given [`Env`]. #[derive(Debug, Clone, PartialEq, Eq)] pub struct SimplifiedOpenOptions { - /// Whether this [`Env`] is checksum checked or not. - pub is_checksumming: bool, - /// Whether this [`Env`] is encrypted or not. - pub is_encrypted: bool, + /// The name of the checksum algorithm this [`Env`] has been opened with. + pub checksum_name: Option, + /// The name of the encryption/decryption algorithm this [`Env`] has been opened with. + pub encrypt_name: Option, /// The maximum size this [`Env`] with take in bytes or [`None`] if it was not specified. pub map_size: Option, /// The maximum number of concurrent readers or [`None`] if it was not specified. @@ -61,8 +61,8 @@ impl From<&EnvOpenOptions> for SimplifiedOpenOpti fn from(eoo: &EnvOpenOptions) -> SimplifiedOpenOptions { let EnvOpenOptions { checksum, encrypt, map_size, max_readers, max_dbs, flags } = eoo; SimplifiedOpenOptions { - is_checksumming: checksum.is_some(), - is_encrypted: encrypt.is_some(), + checksum_name: checksum.map(|_| E::name()), + encrypt_name: encrypt.as_ref().map(|_| C::name()), map_size: *map_size, max_readers: *max_readers, max_dbs: *max_dbs, @@ -219,8 +219,8 @@ impl fmt::Debug for EnvOpenOptions { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let EnvOpenOptions { checksum, encrypt, map_size, max_readers, max_dbs, flags } = self; f.debug_struct("EnvOpenOptions") - .field("checksum", &checksum.is_some()) - .field("encrypt", &encrypt.is_some()) + .field("checksum", &checksum.map(|_| C::name())) + .field("encrypt", &encrypt.as_ref().map(|_| E::name())) .field("map_size", &map_size) .field("max_readers", &max_readers) .field("max_dbs", &max_dbs)