dispatch_buf

This commit is contained in:
NikVolf
2016-04-03 23:39:49 +03:00
parent 0a60da622f
commit b04d8196c7
3 changed files with 36 additions and 1 deletions

View File

@@ -23,6 +23,10 @@ use std::sync::atomic::*;
pub trait IpcInterface<T> {
/// reads the message from io, dispatches the call and returns result
fn dispatch<R>(&self, r: &mut R) -> Vec<u8> where R: Read;
/// deserialize the payload from the io `r` and invokes method specified by `method_num`
/// (for non-blocking io)
fn dispatch_buf<R>(&self, method_num: u16, r: &mut R) -> Vec<u8> where R: Read;
}
/// serializes method invocation (method_num and parameters) to the stream specified by `w`