[−][src]Struct leveldb::database::db::Database
Implementations
impl Database
[src]
pub fn open(name: &Path, options: &Options) -> Result<Database, Error>
[src]
Open a new database
If the database is missing, the behaviour depends on options.create_if_missing
.
The database will be created using the settings given in options
.
pub fn open_with_comparator<C: Comparator>(
name: &Path,
options: &Options,
comparator: C
) -> Result<Database, Error>
[src]
name: &Path,
options: &Options,
comparator: C
) -> Result<Database, Error>
Open a new database with a custom comparator
If the database is missing, the behaviour depends on options.create_if_missing
.
The database will be created using the settings given in options
.
The comparator must implement a total ordering over the keyspace.
For keys that implement Ord, consider the OrdComparator
.
pub fn put(
&self,
options: &WriteOptions,
key: &dyn IntoLevelDBKey,
value: &[u8]
) -> Result<(), Error>
[src]
&self,
options: &WriteOptions,
key: &dyn IntoLevelDBKey,
value: &[u8]
) -> Result<(), Error>
pub fn put_u8(
&self,
options: &WriteOptions,
key: &[u8],
value: &[u8]
) -> Result<(), Error>
[src]
&self,
options: &WriteOptions,
key: &[u8],
value: &[u8]
) -> Result<(), Error>
pub fn get(
&self,
options: &ReadOptions,
key: &dyn IntoLevelDBKey
) -> Result<Option<Vec<u8>>, Error>
[src]
&self,
options: &ReadOptions,
key: &dyn IntoLevelDBKey
) -> Result<Option<Vec<u8>>, Error>
pub fn get_u8(
&self,
options: &ReadOptions,
key: &[u8]
) -> Result<Option<Vec<u8>>, Error>
[src]
&self,
options: &ReadOptions,
key: &[u8]
) -> Result<Option<Vec<u8>>, Error>
pub fn delete(
&self,
options: &WriteOptions,
key: &dyn IntoLevelDBKey
) -> Result<(), Error>
[src]
&self,
options: &WriteOptions,
key: &dyn IntoLevelDBKey
) -> Result<(), Error>
pub fn delete_u8(&self, options: &WriteOptions, key: &[u8]) -> Result<(), Error>
[src]
Trait Implementations
impl Batch for Database
[src]
pub fn write(
&self,
options: &WriteOptions,
batch: &WriteBatch
) -> Result<(), Error>
[src]
&self,
options: &WriteOptions,
batch: &WriteBatch
) -> Result<(), Error>
impl<'a> Compaction<'a> for Database
[src]
impl Debug for Database
[src]
impl<'a> Iterable<'a> for Database
[src]
pub fn iter(&'a self, options: &ReadOptions) -> Iterator<'a>ⓘ
[src]
pub fn keys_iter(&'a self, options: &ReadOptions) -> KeyIterator<'a>ⓘNotable traits for KeyIterator<'a>
impl<'a> Iterator for KeyIterator<'a> type Item = Vec<u8>;
[src]
Notable traits for KeyIterator<'a>
impl<'a> Iterator for KeyIterator<'a> type Item = Vec<u8>;
pub fn value_iter(&'a self, options: &ReadOptions) -> ValueIterator<'a>ⓘNotable traits for ValueIterator<'a>
impl<'a> Iterator for ValueIterator<'a> type Item = Vec<u8>;
[src]
Notable traits for ValueIterator<'a>
impl<'a> Iterator for ValueIterator<'a> type Item = Vec<u8>;
impl Send for Database
[src]
impl Snapshots for Database
[src]
impl Sync for Database
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,