Skip to content

Commit

Permalink
add DesrializeOwned trait requirement for PeerId
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime2 committed Aug 7, 2019
1 parent 4dd6aff commit c32839e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/peer.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use serde::{Deserialize, Serialize};
use serde::de::DeserializeOwned;
use serde::Serialize;
use std::fmt::Debug;

pub trait PeerId: Eq + Ord + Clone + Debug + Send + Serialize + Sync {}
impl<N> PeerId for N where N: Eq + Ord + Clone + Debug + Send + Serialize + Sync {}
pub trait PeerId: Eq + Ord + Clone + Debug + Send + Serialize + DeserializeOwned + Sync {}
impl<N> PeerId for N where N: Eq + Ord + Clone + Debug + Send + Serialize + DeserializeOwned + Sync {}

//#[derive(Clone, Debug, Serialize, Deserialize)]
//pub struct Peer<Id: PeerId> {
Expand Down

0 comments on commit c32839e

Please sign in to comment.