comments
This commit is contained in:
parent
10b7550284
commit
a48d7bcc68
@ -20,8 +20,10 @@ pub struct GenerateParams {
|
||||
|
||||
impl Rpc {
|
||||
pub fn receive(&self, msg: Message) -> StdResult<Vec<u8>, RpcError> {
|
||||
// specify rpc message as the resulting type
|
||||
// consume the ws data into bytes
|
||||
let data = msg.into_data();
|
||||
|
||||
// cast the msg to this type to receive method name
|
||||
match from_slice::<RpcMessage>(&data) {
|
||||
Ok(v) => {
|
||||
|
||||
@ -53,11 +55,6 @@ pub enum RpcError {
|
||||
UnknownMethod,
|
||||
}
|
||||
|
||||
#[derive(Debug,Clone,Serialize,Deserialize)]
|
||||
enum RpcParam {
|
||||
GenerateParams { level: u16 },
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user