Place Sync/Send in trait.

This commit is contained in:
Gav Wood
2016-03-11 13:19:10 +01:00
parent e461916f5a
commit d71c5d4c17
5 changed files with 17 additions and 17 deletions

View File

@@ -26,9 +26,9 @@ use std::env;
/// A HashDB which can manage a short-term journal potentially containing many forks of mutually
/// exclusive actions.
pub trait JournalDB : HashDB {
pub trait JournalDB : HashDB + Sync + Send {
/// Return a copy of ourself, in a box.
fn spawn(&self) -> Box<JournalDB + Send>;
fn spawn(&self) -> Box<Box<JournalDB>>;
/// Returns heap memory size used
fn mem_used(&self) -> usize;
@@ -418,7 +418,7 @@ impl HashDB for OptionOneDB {
}
impl JournalDB for OptionOneDB {
fn spawn(&self) -> Box<JournalDB + Send> {
fn spawn(&self) -> Box<Box<JournalDB>> {
Box::new(OptionOneDB {
overlay: MemoryDB::new(),
backing: self.backing.clone(),