[][src]Struct simpledb::Database

pub struct Database {
    pub path: String,
    pub rocksdb: DB,
    pub options: Options,
    // some fields omitted
}

Database instance.

Fields

path: Stringrocksdb: DBoptions: Options

Implementations

impl Database[src]

pub fn open(path: &str) -> Result<Database>[src]

Open database with default options.

pub fn open_with_options(path: &str, options: Options) -> Result<Database>[src]

Open database with specific options.

pub fn destroy(path: &str) -> Result<()>[src]

Destroy database.

pub fn save_meta(
    &self,
    key: &str,
    meta: &KeyMeta,
    delete_if_empty: bool
) -> Result<()>
[src]

pub fn get_meta(&self, key: &str) -> Result<Option<KeyMeta>>[src]

pub fn get_or_create_meta(
    &self,
    key: &str,
    key_type: KeyType
) -> Result<KeyMeta>
[src]

pub fn for_each_key<F>(&self, f: F) -> Result<usize> where
    F: FnMut(&str, &KeyMeta) -> bool
[src]

pub fn for_each_key_with_limit<F>(&self, limit: usize, f: F) -> Result<usize> where
    F: FnMut(&str, &KeyMeta) -> bool
[src]

pub fn for_each_key_with_prefix<F>(&self, prefix: &str, f: F) -> Result<usize> where
    F: FnMut(&str, &KeyMeta) -> bool
[src]

pub fn keys(&self) -> Result<Vec<(String, KeyMeta)>>[src]

pub fn keys_with_prefix(&self, prefix: &str) -> Result<Vec<(String, KeyMeta)>>[src]

pub fn for_each_data<F>(
    &self,
    key: &str,
    prefix: Option<&str>,
    f: F
) -> Result<u64> where
    F: FnMut(Box<[u8]>, Box<[u8]>) -> bool
[src]

pub fn get_count(&self, key: &str) -> Result<u64>[src]

pub fn delete_all(&self, key: &str) -> Result<u64>[src]

pub fn map_count(&self, key: &str) -> Result<u64>[src]

pub fn map_get(&self, key: &str, field: &str) -> Result<Option<Vec<u8>>>[src]

pub fn map_put(&self, key: &str, field: &str, value: &[u8]) -> Result<()>[src]

pub fn map_delete(&self, key: &str, field: &str) -> Result<bool>[src]

pub fn map_for_each<F>(&self, key: &str, f: F) -> Result<u64> where
    F: FnMut(&str, Box<[u8]>) -> bool
[src]

pub fn map_items(&self, key: &str) -> Result<Vec<(String, Box<[u8]>)>>[src]

pub fn map_for_each_with_prefix<F>(
    &self,
    key: &str,
    prefix: &str,
    f: F
) -> Result<u64> where
    F: FnMut(&str, Box<[u8]>) -> bool
[src]

pub fn map_items_with_prefix(
    &self,
    key: &str,
    prefix: &str
) -> Result<Vec<(String, Box<[u8]>)>>
[src]

pub fn set_count(&self, key: &str) -> Result<u64>[src]

pub fn set_add(&self, key: &str, value: &[u8]) -> Result<bool>[src]

pub fn set_is_member(&self, key: &str, value: &[u8]) -> Result<bool>[src]

pub fn set_delete(&self, key: &str, value: &[u8]) -> Result<bool>[src]

pub fn set_for_each<F>(&self, key: &str, f: F) -> Result<u64> where
    F: FnMut(Box<[u8]>) -> bool
[src]

pub fn set_items(&self, key: &str) -> Result<Vec<Box<[u8]>>>[src]

pub fn list_count(&self, key: &str) -> Result<u64>[src]

pub fn list_left_push(&self, key: &str, value: &[u8]) -> Result<u64>[src]

pub fn list_right_push(&self, key: &str, value: &[u8]) -> Result<u64>[src]

pub fn list_left_pop(&self, key: &str) -> Result<Option<Box<[u8]>>>[src]

pub fn list_right_pop(&self, key: &str) -> Result<Option<Box<[u8]>>>[src]

pub fn list_for_each<F>(&self, key: &str, f: F) -> Result<u64> where
    F: FnMut(Box<[u8]>) -> bool
[src]

pub fn list_items(&self, key: &str) -> Result<Vec<Box<[u8]>>>[src]

pub fn sorted_list_count(&self, key: &str) -> Result<u64>[src]

pub fn sorted_list_add(
    &self,
    key: &str,
    score: &[u8],
    value: &[u8]
) -> Result<u64>
[src]

pub fn sorted_list_left_pop(
    &self,
    key: &str,
    max_score: Option<&[u8]>
) -> Result<Option<(Box<[u8]>, Box<[u8]>)>>
[src]

pub fn sorted_list_right_pop(
    &self,
    key: &str,
    min_score: Option<&[u8]>
) -> Result<Option<(Box<[u8]>, Box<[u8]>)>>
[src]

pub fn sorted_list_for_each<F>(&self, key: &str, f: F) -> Result<u64> where
    F: FnMut((Box<[u8]>, Box<[u8]>)) -> bool
[src]

pub fn sorted_list_items(
    &self,
    key: &str
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>
[src]

pub fn sorted_set_count(&self, key: &str) -> Result<u64>[src]

pub fn sorted_set_for_each<F>(&self, key: &str, f: F) -> Result<u64> where
    F: FnMut((Box<[u8]>, Box<[u8]>)) -> bool
[src]

pub fn sorted_set_items(&self, key: &str) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>[src]

pub fn sorted_set_add(
    &self,
    key: &str,
    score: &[u8],
    value: &[u8]
) -> Result<u64>
[src]

pub fn sorted_set_is_member(&self, key: &str, value: &[u8]) -> Result<bool>[src]

pub fn sorted_set_delete(&self, key: &str, value: &[u8]) -> Result<bool>[src]

pub fn sorted_set_left(
    &self,
    key: &str,
    max_score: Option<&[u8]>,
    limit: usize
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>
[src]

pub fn sorted_set_right(
    &self,
    key: &str,
    min_score: Option<&[u8]>,
    limit: usize
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>
[src]

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

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.