Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Add Index::map_size
Browse files Browse the repository at this point in the history
  • Loading branch information
dureuill committed Jan 10, 2023
1 parent c3f4835 commit 00746b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions milli/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,16 @@ impl Index {
Ok(self.env.real_disk_size()?)
}

/// Returns the map size the underlying environment was opened with, in bytes.
///
/// This value does not represent the current on-disk size of the index.
///
/// This value is the maximum between the map size passed during the opening of the index
/// and the on-disk size of the index at the time of opening.
pub fn map_size(&self) -> Result<usize> {
Ok(self.env.map_size()?)
}

pub fn copy_to_path<P: AsRef<Path>>(&self, path: P, option: CompactionOption) -> Result<File> {
self.env.copy_to_path(path, option).map_err(Into::into)
}
Expand Down

0 comments on commit 00746b3

Please sign in to comment.