diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-03-06 21:32:56 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-03-06 21:38:14 +0100 |
| commit | a84b3c4086459a1fed5dfe7b4dc1359056e156d0 (patch) | |
| tree | 522a35c6d9c6577d9b8016159382c4cb035900c4 | |
| parent | 8ec9156f123e671f56663e3f1eba6f0820aeadd4 (diff) | |
| download | mullvadvpn-a84b3c4086459a1fed5dfe7b4dc1359056e156d0.tar.xz mullvadvpn-a84b3c4086459a1fed5dfe7b4dc1359056e156d0.zip | |
Make nop_ipc API same as zmq_ipc
| -rw-r--r-- | talpid_ipc/src/nop_ipc.rs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/talpid_ipc/src/nop_ipc.rs b/talpid_ipc/src/nop_ipc.rs index a0519fd6dd..9a767f229d 100644 --- a/talpid_ipc/src/nop_ipc.rs +++ b/talpid_ipc/src/nop_ipc.rs @@ -8,20 +8,27 @@ use serde; /// /// We plan on trying with ZMQ again in the future. /// Erik, 2017-02-09 -pub fn start_new_server<T, F>(on_message: F) -> Result<IpcServerId> +pub fn start_new_server<T, F>(_on_message: F) -> Result<IpcServerId> where T: serde::Deserialize + 'static, F: FnMut(Result<T>) + Send + 'static { Err(ErrorKind::CouldNotStartServer.into()) } -pub struct IpcClient; -impl IpcClient { - pub fn new(server_id: IpcServerId) -> Self { - IpcClient +pub struct IpcClient<T> + where T: serde::Serialize +{ + _phantom: ::std::marker::PhantomData<T>, +} + +impl<T> IpcClient<T> + where T: serde::Serialize +{ + pub fn new(_server_id: IpcServerId) -> Self { + IpcClient { _phantom: ::std::marker::PhantomData } } - pub fn send(mut self, message: &[u8]) -> Result<()> { + pub fn send(&mut self, _message: &T) -> Result<()> { Err(ErrorKind::SendError.into()) } } |
