rpc dependencies relayout

This commit is contained in:
NikVolf
2016-07-16 15:51:06 +02:00
parent 98ddff1326
commit 4cb1c906b0
10 changed files with 63 additions and 31 deletions

View File

@@ -44,4 +44,18 @@ fn main() {
codegen::register(&mut registry);
registry.expand("", &intermediate, &dst).unwrap();
}
// chain notify interface
{
let src = Path::new("src/client/chain_notify.rs");
let intermediate = Path::new(&out_dir).join("chain_notify.intermediate.rs.in");
let mut registry = syntex::Registry::new();
codegen::register(&mut registry);
registry.expand("", &src, &intermediate).unwrap();
let dst = Path::new(&out_dir).join("chain_notify.ipc.rs");
let mut registry = syntex::Registry::new();
codegen::register(&mut registry);
registry.expand("", &intermediate, &dst).unwrap();
}
}

View File

@@ -15,8 +15,13 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use util::numbers::*;
use ipc::{IpcConfig, BinaryConvertError};
use std::sync::Arc;
use std::collections::VecDeque;
use std::mem;
/// Represents what has to be handled by actor listening to chain events
#[derive(Ipc)]
pub trait ChainNotify : Send + Sync {
/// fires when chain has new blocks
fn new_blocks(&self,
@@ -38,3 +43,5 @@ pub trait ChainNotify : Send + Sync {
// does nothing by default
}
}
impl IpcConfig<ChainNotify> for Arc<ChainNotify> { }

View File

@@ -20,7 +20,6 @@ mod config;
mod error;
mod test_client;
mod trace;
mod chain_notify;
pub use self::client::*;
pub use self::config::{Mode, ClientConfig, DatabaseCompactionProfile, BlockQueueConfig, BlockChainConfig, Switch, VMType};
@@ -60,6 +59,13 @@ pub mod client {
include!(concat!(env!("OUT_DIR"), "/client.ipc.rs"));
}
pub mod chain_notify {
//! Chain notify interface
#![allow(dead_code, unused_assignments, unused_variables, missing_docs)] // codegen issues
include!(concat!(env!("OUT_DIR"), "/chain_notify.ipc.rs"));
}
/// Blockchain database client. Owns and manages a blockchain and a block queue.
pub trait BlockChainClient : Sync + Send {