[−][src]Trait leveldb::database::kv::KV
Key-Value-Access to the leveldb database, providing a basic interface.
Required methods
fn get<'a, BK: Borrow<K>>(
&self,
options: ReadOptions<'a, K>,
key: BK
) -> Result<Option<Vec<u8>>, Error>
&self,
options: ReadOptions<'a, K>,
key: BK
) -> Result<Option<Vec<u8>>, Error>
get a value from the database.
The passed key will be compared using the comparator.
fn put<BK: Borrow<K>>(
&self,
options: WriteOptions,
key: BK,
value: &[u8]
) -> Result<(), Error>
&self,
options: WriteOptions,
key: BK,
value: &[u8]
) -> Result<(), Error>
put a binary value into the database.
If the key is already present in the database, it will be overwritten.
The passed key will be compared using the comparator.
The database will be synced to disc if options.sync == true
. This is
NOT the default.
fn delete<BK: Borrow<K>>(
&self,
options: WriteOptions,
key: BK
) -> Result<(), Error>
&self,
options: WriteOptions,
key: BK
) -> Result<(), Error>
delete a value from the database.
The passed key will be compared using the comparator.
The database will be synced to disc if options.sync == true
. This is
NOT the default.
Implementors
impl<K: Key> KV<K> for Database<K>
[src]
fn put<BK: Borrow<K>>(
&self,
options: WriteOptions,
key: BK,
value: &[u8]
) -> Result<(), Error>
[src]
&self,
options: WriteOptions,
key: BK,
value: &[u8]
) -> Result<(), Error>
put a binary value into the database.
If the key is already present in the database, it will be overwritten.
The passed key will be compared using the comparator.
The database will be synced to disc if options.sync == true
. This is
NOT the default.
fn delete<BK: Borrow<K>>(
&self,
options: WriteOptions,
key: BK
) -> Result<(), Error>
[src]
&self,
options: WriteOptions,
key: BK
) -> Result<(), Error>
delete a value from the database.
The passed key will be compared using the comparator.
The database will be synced to disc if options.sync == true
. This is
NOT the default.
fn get<'a, BK: Borrow<K>>(
&self,
options: ReadOptions<'a, K>,
key: BK
) -> Result<Option<Vec<u8>>, Error>
[src]
&self,
options: ReadOptions<'a, K>,
key: BK
) -> Result<Option<Vec<u8>>, Error>
get a value from the database.
The passed key will be compared using the comparator.