pub struct Database { /* private fields */ }
Implementations§
Source§impl Database
impl Database
pub fn open(path: &Path) -> Result<Self, DiskMapError>
pub fn document<K, V>(&self, name: &str) -> Result<DiskMap<K, V>, DiskMapError>
pub fn drop(&self, name: &str) -> bool
pub fn list(&self) -> Vec<String>
Sourcepub fn size_on_disk(&self) -> Result<u64, DiskMapError>
pub fn size_on_disk(&self) -> Result<u64, DiskMapError>
Returns the on-disk size of the storage files for this database.
Sourcepub async fn flush(&self) -> Result<usize, DiskMapError>
pub async fn flush(&self) -> Result<usize, DiskMapError>
Asynchronously flushes all dirty IO buffers and calls fsync.
If this succeeds, it is guaranteed that all previous writes will be recovered if the system crashes.
Returns the number of bytes flushed during this call.
Flushing can take quite a lot of time, and you should measure the performance impact of using it on realistic sustained workloads running on realistic hardware.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more