Skip to content

Commit

Permalink
add DeserializeOwned trait to Data parameter type
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime2 committed Aug 5, 2019
1 parent c987022 commit e705444
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::errors::Result;
use libcommon_rs::peer::{PeerId, PeerList};
use serde::{Deserialize, Serialize};
use serde::de::DeserializeOwned;
use serde::Serialize;
use std::sync::mpsc::Sender;

// Transport trait for various implementations of message
Expand All @@ -14,7 +15,7 @@ use std::sync::mpsc::Sender;
// it can be a truct containing message type and payload data
pub trait Transport<Id, Data, Error, Pl>
where
Data: AsRef<u8> + Serialize,
Data: AsRef<u8> + Serialize + DeserializeOwned,
Id: PeerId,
Pl: PeerList<Id, Error>,
{
Expand Down

0 comments on commit e705444

Please sign in to comment.