Struct bitcoinleveldb_table::Table
source · pub struct Table { /* private fields */ }
Expand description
| A Table is a sorted map from strings to | strings. Tables are immutable and persistent. | A Table may be safely accessed from multiple | threads without external synchronization.
Implementations§
source§impl Table
impl Table
pub fn new(rep: *mut TableRep) -> Self
sourcepub fn open(
&mut self,
options: &Options,
file: Rc<RefCell<dyn RandomAccessFile>>,
size: u64,
table: *mut *mut Table
) -> Status
pub fn open( &mut self, options: &Options, file: Rc<RefCell<dyn RandomAccessFile>>, size: u64, table: *mut *mut Table ) -> Status
| Attempt to open the table that is stored in | bytes [0..file_size) of “file”, and read the | metadata entries necessary to allow | retrieving data from the table. | | If successful, returns ok and sets “*table” | to the newly opened table. The client should | delete “*table” when no longer needed. If | there was an error while initializing the | table, sets “*table” to nullptr and returns | a non-ok status. Does not take ownership of | “*source”, but the client must ensure that | “source” remains live for the duration of the | returned table’s lifetime. | | *file must remain live while this Table is in | use.
pub fn read_meta(&mut self, footer: &Footer)
pub fn read_filter(&mut self, filter_handle_value: &Slice)
sourcepub fn block_reader(
&mut self,
arg: *mut c_void,
options: &ReadOptions,
index_value: &Slice
) -> *mut LevelDBIterator
pub fn block_reader( &mut self, arg: *mut c_void, options: &ReadOptions, index_value: &Slice ) -> *mut LevelDBIterator
| Convert an index iterator value (i.e., | an encoded BlockHandle) into an iterator | over the contents of the corresponding | block. |
sourcepub fn new_iterator(&self, options: &ReadOptions) -> *mut LevelDBIterator
pub fn new_iterator(&self, options: &ReadOptions) -> *mut LevelDBIterator
| Returns a new iterator over the table | contents. | | The result of NewIterator() is initially | invalid (caller must call one of the Seek | methods on the iterator before using it).
sourcepub fn internal_get(
&mut self,
options: &ReadOptions,
k: &Slice,
arg: *mut c_void,
handle_result: fn(_0: *mut c_void, _1: &Slice, _2: &Slice) -> c_void
) -> Status
pub fn internal_get( &mut self, options: &ReadOptions, k: &Slice, arg: *mut c_void, handle_result: fn(_0: *mut c_void, _1: &Slice, _2: &Slice) -> c_void ) -> Status
| Calls (*handle_result)(arg, …) with the | entry found after a call to Seek(key). May | not make such a call if filter policy says | that key is not present.
sourcepub fn approximate_offset_of(&self, key_: &Slice) -> u64
pub fn approximate_offset_of(&self, key_: &Slice) -> u64
| Given a key, return an approximate byte | offset in the file where the data for that | key begins (or would begin if the key were | present in the file). The returned value is | in terms of file bytes, and so includes | effects like compression of the underlying | data. | | E.g., the approximate offset of the last key | in the table will be close to the file | length.