pub struct Table { /* private fields */ }
Expand description
Table
is used for accessing SSTables.
Implementations§
source§impl Table
impl Table
sourcepub fn new_from_file(opt: Options, path: &Path) -> Result<Table>
pub fn new_from_file(opt: Options, path: &Path) -> Result<Table>
Creates a new table reader from a file at path
.
sourcepub fn new(
opt: Options,
file: Box<dyn RandomAccess>,
size: usize
) -> Result<Table>
pub fn new( opt: Options, file: Box<dyn RandomAccess>, size: usize ) -> Result<Table>
Creates a new table reader.
sourcepub fn approx_offset_of(&self, key: &[u8]) -> usize
pub fn approx_offset_of(&self, key: &[u8]) -> usize
Returns the offset of the block that contains key
.
sourcepub fn iter(&self) -> TableIterator
pub fn iter(&self) -> TableIterator
Returns an iterator over an SSTable. Iterators hold internal references to the table, so make sure to let them expire when not needed anymore.
sourcepub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>
pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>
Retrieve an entry for a key from the table. This function uses the attached filters, so is better suited if you frequently look for non-existing values (as it will detect the non-existence of an entry in a block without having to load the block).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl !UnwindSafe for Table
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more