Struct grebedb::Database [−][src]
pub struct Database { /* fields omitted */ }
Expand description
GrebeDB database interface.
Implementations
Open a database using the given virtual file system and options.
Open a database in temporary memory.
Open a database to a path on the disk.
The path must be a directory.
Return whether the key exists.
Retrieve a stored value, by its key, as a vector.
Retrieve a stored value, by its key, into the given buffer.
Returns true if the key-value pair was found. The vector will be cleared and resized.
Store a key-value pair.
Remove a key-value pair by its key.
No error occurs if the key does not exist.
Return a cursor for iterating all the key-value pairs.
pub fn cursor_range<K, R>(&mut self, range: R) -> Result<Cursor<'_>, Error> where
K: AsRef<[u8]>,
R: RangeBounds<K>,
[src]
pub fn cursor_range<K, R>(&mut self, range: R) -> Result<Cursor<'_>, Error> where
K: AsRef<[u8]>,
R: RangeBounds<K>,
[src]Return a cursor for iterating all the key-value pairs within the given range.
This method is equivalent of obtaining a cursor and calling
Cursor::seek()
and Cursor::set_range()
Persist all modifications to the file system.
Calling this function ensures that all changes pending, whether cached in memory or in files, are atomically saved on the file system before this function returns. If the database is not flushed when dropped or the program exits, changes since the last successful flush will be discarded. This function effectively emulates a transaction.
For details about automatic flushing, see Options
.
Check the database for internal consistency and data integrity.
The provided callback function is called with the number of items processed and the estimated number of items.
The function returns an error on the first verification failure or other error.
Print the tree for debugging purposes.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Database
impl !UnwindSafe for Database