Remove the DbCursor struct (#6441)
This commit is contained in:
parent
171c0d5421
commit
8c29700402
|
@ -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)?;
|
||||
|
|
Loading…
Reference in New Issue