Trait rocksdb_table::Table
source · [−]pub trait Table<M>: Sized {
type Counts;
type Error: From<Error>;
type Key;
type KeyBytes: AsRef<[u8]>;
type Value;
type ValueBytes: AsRef<[u8]>;
type Index;
type IndexBytes: AsRef<[u8]>;
Show 17 methods
fn database(&self) -> &Database<M>;
fn from_database(database: Database<M>) -> Self;
fn get_counts(&self) -> Result<Self::Counts, Self::Error>;
fn key_to_bytes(key: &Self::Key) -> Result<Self::KeyBytes, Self::Error>;
fn value_to_bytes(
key: &Self::Value
) -> Result<Self::ValueBytes, Self::Error>;
fn index_to_bytes(
index: &Self::Index
) -> Result<Self::IndexBytes, Self::Error>;
fn bytes_to_key<T: AsRef<[u8]>>(bytes: T) -> Result<Self::Key, Self::Error>;
fn bytes_to_value<T: AsRef<[u8]>>(
bytes: T
) -> Result<Self::Value, Self::Error>;
fn default_compression_type() -> Option<DBCompressionType> { ... }
fn statistics(&self) -> Option<String> { ... }
fn get_estimated_key_count(&self) -> Result<Option<u64>, Error> { ... }
fn open_with_defaults<P: AsRef<Path>>(path: P) -> Result<Self, Error>
where
M: Mode,
{ ... }
fn open<P: AsRef<Path>, F: FnMut(Options) -> Options>(
path: P,
options_init: F
) -> Result<Self, Error>
where
M: Mode,
{ ... }
fn iter(&self) -> TableIterator<'_, M, Self>ⓘNotable traits for TableIterator<'a, M, T>impl<'a, M: Mode, T: Table<M>> Iterator for TableIterator<'a, M, T> type Item = Result<(T::Key, T::Value), T::Error>;
where
M: 'static,
{ ... }
fn lookup_key(
&self,
key: &Self::Key
) -> Result<Option<Self::Value>, Self::Error> { ... }
fn lookup_index(
&self,
index: &Self::Index
) -> Result<Vec<(Self::Key, Self::Value)>, Self::Error> { ... }
fn put(&self, key: &Self::Key, value: &Self::Value) -> Result<(), Self::Error>
where
M: IsWriteable,
{ ... }
}
Expand description
A database table.