Remove the DbCursor struct (#6441)

This commit is contained in:
TristanDebrunner 2019-10-18 13:11:59 -06:00 committed by GitHub
parent 171c0d5421
commit 8c29700402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 40 deletions

View File

@ -212,20 +212,6 @@ pub trait Column {
fn as_index(slot: Slot) -> Self::Index;
}
pub trait DbCursor {
fn valid(&self) -> bool;
fn seek(&mut self, key: &[u8]);
fn seek_to_first(&mut self);
fn next(&mut self);
fn key(&self) -> Option<Vec<u8>>;
fn value(&self) -> Option<Vec<u8>>;
}
pub trait IWriteBatch {
fn put_cf(&mut self, cf: ColumnFamily, key: &[u8], value: &[u8]) -> Result<()>;
fn delete_cf(&mut self, cf: ColumnFamily, key: &[u8]) -> Result<()>;
@ -756,32 +742,6 @@ impl WriteBatch {
}
}
impl DbCursor for DBRawIterator {
fn valid(&self) -> bool {
DBRawIterator::valid(self)
}
fn seek(&mut self, key: &[u8]) {
DBRawIterator::seek(self, key);
}
fn seek_to_first(&mut self) {
DBRawIterator::seek_to_first(self);
}
fn next(&mut self) {
DBRawIterator::next(self);
}
fn key(&self) -> Option<Vec<u8>> {
DBRawIterator::key(self)
}
fn value(&self) -> Option<Vec<u8>> {
DBRawIterator::value(self)
}
}
impl IWriteBatch for RWriteBatch {
fn put_cf(&mut self, cf: ColumnFamily, key: &[u8], value: &[u8]) -> Result<()> {
RWriteBatch::put_cf(self, cf, key, value)?;