parent
dec9272813
commit
48eafcc74f
|
@ -71,7 +71,7 @@ pub mod columns {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Rocks(rocksdb::DB);
|
struct Rocks(rocksdb::DB);
|
||||||
|
|
||||||
impl Rocks {
|
impl Rocks {
|
||||||
fn open(path: &Path) -> Result<Rocks> {
|
fn open(path: &Path) -> Result<Rocks> {
|
||||||
|
@ -212,11 +212,6 @@ pub trait Column {
|
||||||
fn as_index(slot: Slot) -> Self::Index;
|
fn as_index(slot: Slot) -> Self::Index;
|
||||||
}
|
}
|
||||||
|
|
||||||
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<()>;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait TypedColumn: Column {
|
pub trait TypedColumn: Column {
|
||||||
type Type: Serialize + DeserializeOwned;
|
type Type: Serialize + DeserializeOwned;
|
||||||
}
|
}
|
||||||
|
@ -742,18 +737,6 @@ impl WriteBatch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IWriteBatch for RWriteBatch {
|
|
||||||
fn put_cf(&mut self, cf: ColumnFamily, key: &[u8], value: &[u8]) -> Result<()> {
|
|
||||||
RWriteBatch::put_cf(self, cf, key, value)?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn delete_cf(&mut self, cf: ColumnFamily, key: &[u8]) -> Result<()> {
|
|
||||||
RWriteBatch::delete_cf(self, cf, key)?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::convert::From<rocksdb::Error> for BlocktreeError {
|
impl std::convert::From<rocksdb::Error> for BlocktreeError {
|
||||||
fn from(e: rocksdb::Error) -> BlocktreeError {
|
fn from(e: rocksdb::Error) -> BlocktreeError {
|
||||||
BlocktreeError::RocksDb(e)
|
BlocktreeError::RocksDb(e)
|
||||||
|
|
Loading…
Reference in New Issue