move to gen-server impl

This commit is contained in:
Aleksey Kladov 2018-09-01 17:40:45 +03:00
parent 3588d6b2da
commit 8f1ce82753
7 changed files with 181 additions and 575 deletions

View file

@ -120,6 +120,16 @@ impl RawResponse {
}
impl RawNotification {
pub fn new<N>(params: N::Params) -> RawNotification
where
N: Notification,
N::Params: Serialize,
{
RawNotification {
method: N::METHOD.to_string(),
params: to_value(&params).unwrap(),
}
}
pub fn cast<N>(self) -> ::std::result::Result<N::Params, RawNotification>
where
N: Notification,