add documentation for storage_size() method (#7416)

This commit is contained in:
Sunny Gleason 2019-12-11 09:47:12 -05:00 committed by GitHub
parent 7f6fc74c36
commit 601d7a52e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -1493,6 +1493,8 @@ impl Blocktree {
self.last_root()
}
// return the approximate size in bytes of the storage directory, or `None` if an error occurs
// while reading the directory (directory not found, file deleted, etc)
pub fn storage_size(&self) -> Option<u64> {
self.db.storage_size()
}

View File

@ -580,6 +580,8 @@ impl Database {
self.backend.write(batch.write_batch)
}
// return the approximate size in bytes of the storage directory, or `None` if an error occurs
// while reading the directory (directory not found, file deleted, etc)
pub fn storage_size(&self) -> Option<u64> {
get_size(&self.path).ok()
}