client msgs without responses
This commit is contained in:
@@ -274,6 +274,7 @@ impl ClientHandler {
|
||||
}
|
||||
});
|
||||
}
|
||||
ClientMsg::Test(_) => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-4
@@ -70,6 +70,7 @@ def_msgs! {
|
||||
} => enum {
|
||||
Ok
|
||||
},
|
||||
10: Test;,
|
||||
}
|
||||
ServerNotif {
|
||||
0: struct Dummy;,
|
||||
@@ -107,7 +108,7 @@ impl From<ReqErr> for ServerResp {
|
||||
macro_rules! def_msgs {
|
||||
(
|
||||
$c_msg:ident => $s_resp:ident {
|
||||
$($c_num:literal: $c_name:ident $c_def:tt => $c_resp_kind:tt $c_resp_def:tt,)*
|
||||
$($c_num:literal: $c_name:ident $c_def:tt $(=> $c_resp_kind:tt $c_resp_def:tt)?,)*
|
||||
}
|
||||
$s_notif:ident {
|
||||
$($s_num:literal: $s_kind:tt $s_name:ident $s_def:tt,)*
|
||||
@@ -119,14 +120,18 @@ macro_rules! def_msgs {
|
||||
}
|
||||
|
||||
msg_type! { $s_resp;
|
||||
$($c_num: $c_resp_kind ${concat($c_name, Resp)} $c_resp_def,)*
|
||||
$($($c_num: $c_resp_kind ${concat($c_name, Resp)} $c_resp_def,)?)*
|
||||
}
|
||||
|
||||
msg_type! { $s_notif;
|
||||
$($s_num: $s_kind $s_name $s_def,)*
|
||||
}
|
||||
|
||||
$(
|
||||
$($(
|
||||
#[allow(non_snake_case)]
|
||||
fn ${concat(__, $c_name)}() {
|
||||
stringify!($c_resp_kind);
|
||||
}
|
||||
impl From<${concat($c_name, Resp)}> for $resp {
|
||||
fn from(value: ${concat($c_name, Resp)}) -> Self {
|
||||
Self::Ok(value.into())
|
||||
@@ -142,7 +147,7 @@ macro_rules! def_msgs {
|
||||
}
|
||||
}
|
||||
}
|
||||
)*
|
||||
)?)*
|
||||
};
|
||||
}
|
||||
use def_msgs;
|
||||
|
||||
Reference in New Issue
Block a user