mod memory;
mod route;
mod traits;
mod operation;
mod state;
pub use self::memory::{MemoryBackend, MemoryDatabase, SharedMemoryBackend, Error as MemoryError};
pub use self::route::{tree_route, TreeRoute};
pub use self::operation::{BlockData, ImportOperation, Operation};
pub use self::traits::{Store, ChainQuery, ChainSettlement, OperationError, Committable, SharedCommittable};
pub use self::state::KeyValueMemoryState;
use std::sync::{Arc, Mutex, MutexGuard};
pub struct ImportLock(Arc<Mutex<()>>);
impl Clone for ImportLock {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl ImportLock {
pub fn new() -> Self {
Self(Arc::new(Mutex::new(())))
}
pub fn lock(&self) -> MutexGuard<()> {
self.0.lock().expect("Lock is poisoned")
}
}