Skip to content

Commit

Permalink
feat: Add DeserializeOwned + Serialize bounds on request/notifications
Browse files Browse the repository at this point in the history
This will always be true since otherwise there would be no way to
send/receive the params or result.

Fixes #140
  • Loading branch information
Marwes committed Feb 29, 2020
1 parent 6a7fe61 commit fb945a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/notification.rs
@@ -1,7 +1,9 @@
use super::*;

use serde::{de::DeserializeOwned, Serialize};

pub trait Notification {
type Params;
type Params: DeserializeOwned + Serialize;
const METHOD: &'static str;
}

Expand Down
6 changes: 4 additions & 2 deletions src/request.rs
@@ -1,8 +1,10 @@
use super::*;

use serde::{de::DeserializeOwned, Serialize};

pub trait Request {
type Params;
type Result;
type Params: DeserializeOwned + Serialize;
type Result: DeserializeOwned + Serialize;
const METHOD: &'static str;
}

Expand Down

0 comments on commit fb945a9

Please sign in to comment.