[][src]Struct leveldb::database::db::Database

pub struct Database { /* fields omitted */ }

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]

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]

pub fn put_u8(
    &self,
    options: &WriteOptions,
    key: &[u8],
    value: &[u8]
) -> Result<(), Error>
[src]

pub fn get(
    &self,
    options: &ReadOptions,
    key: &dyn IntoLevelDBKey
) -> Result<Option<Vec<u8>>, Error>
[src]

pub fn get_u8(
    &self,
    options: &ReadOptions,
    key: &[u8]
) -> Result<Option<Vec<u8>>, Error>
[src]

pub fn delete(
    &self,
    options: &WriteOptions,
    key: &dyn IntoLevelDBKey
) -> Result<(), Error>
[src]

pub fn delete_u8(&self, options: &WriteOptions, key: &[u8]) -> Result<(), Error>[src]

Trait Implementations

impl Batch for Database[src]

impl<'a> Compaction<'a> for Database[src]

impl Debug for Database[src]

impl<'a> Iterable<'a> for Database[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.