Struct sled_typed::Database
source · pub struct Database { /* private fields */ }
Implementations
sourceimpl 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 !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more