[−][src]Struct simpledb::Database
Database instance.
Fields
path: String
rocksdb: DB
options: 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]
&self,
key: &str,
meta: &KeyMeta,
delete_if_empty: bool
) -> Result<()>
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]
&self,
key: &str,
key_type: KeyType
) -> Result<KeyMeta>
pub fn for_each_key<F>(&self, f: F) -> Result<usize> where
F: FnMut(&str, &KeyMeta) -> bool,
[src]
F: FnMut(&str, &KeyMeta) -> bool,
pub fn for_each_key_with_limit<F>(&self, limit: usize, f: F) -> Result<usize> where
F: FnMut(&str, &KeyMeta) -> bool,
[src]
F: FnMut(&str, &KeyMeta) -> bool,
pub fn for_each_key_with_prefix<F>(&self, prefix: &str, f: F) -> Result<usize> where
F: FnMut(&str, &KeyMeta) -> bool,
[src]
F: FnMut(&str, &KeyMeta) -> bool,
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]
&self,
key: &str,
prefix: Option<&str>,
f: F
) -> Result<u64> where
F: FnMut(Box<[u8]>, Box<[u8]>) -> bool,
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]
F: FnMut(&str, Box<[u8]>) -> bool,
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]
&self,
key: &str,
prefix: &str,
f: F
) -> Result<u64> where
F: FnMut(&str, Box<[u8]>) -> bool,
pub fn map_items_with_prefix(
&self,
key: &str,
prefix: &str
) -> Result<Vec<(String, Box<[u8]>)>>
[src]
&self,
key: &str,
prefix: &str
) -> Result<Vec<(String, Box<[u8]>)>>
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]
F: FnMut(Box<[u8]>) -> bool,
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]
F: FnMut(Box<[u8]>) -> bool,
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]
&self,
key: &str,
score: &[u8],
value: &[u8]
) -> Result<u64>
pub fn sorted_list_left_pop(
&self,
key: &str,
max_score: Option<&[u8]>
) -> Result<Option<(Box<[u8]>, Box<[u8]>)>>
[src]
&self,
key: &str,
max_score: Option<&[u8]>
) -> Result<Option<(Box<[u8]>, Box<[u8]>)>>
pub fn sorted_list_right_pop(
&self,
key: &str,
min_score: Option<&[u8]>
) -> Result<Option<(Box<[u8]>, Box<[u8]>)>>
[src]
&self,
key: &str,
min_score: Option<&[u8]>
) -> Result<Option<(Box<[u8]>, Box<[u8]>)>>
pub fn sorted_list_for_each<F>(&self, key: &str, f: F) -> Result<u64> where
F: FnMut((Box<[u8]>, Box<[u8]>)) -> bool,
[src]
F: FnMut((Box<[u8]>, Box<[u8]>)) -> bool,
pub fn sorted_list_items(
&self,
key: &str
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>
[src]
&self,
key: &str
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>
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]
F: FnMut((Box<[u8]>, Box<[u8]>)) -> bool,
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]
&self,
key: &str,
score: &[u8],
value: &[u8]
) -> Result<u64>
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]
&self,
key: &str,
max_score: Option<&[u8]>,
limit: usize
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>
pub fn sorted_set_right(
&self,
key: &str,
min_score: Option<&[u8]>,
limit: usize
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>
[src]
&self,
key: &str,
min_score: Option<&[u8]>,
limit: usize
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>
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]
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,
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.
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>,