macro_rules! derive_deftly_template_DynMethod {
({ $($driver:tt)* } [$($aoptions:tt)*] ($($future:tt)*) $($tpassthrough:tt)*) => { ... };
($($wrong:tt)*) => { ... };
}
Expand description
Declare that one or more space-separated types should be considered as dynamically dispatchable RPC methods.
§Example
use tor_rpcbase::{self as rpc, templates::*};
use derive_deftly::Deftly;
#[derive(Debug, serde::Deserialize, Deftly)]
#[derive_deftly(rpc::DynMethod)]
#[deftly(rpc(method_name = "x-example:castigate"))]
struct Castigate {
severity: f64,
offenses: Vec<String>,
accomplice: Option<rpc::ObjectId>,
}
impl rpc::RpcMethod for Castigate {
type Output = String;
type Update = rpc::NoUpdates;
}
This is a derive_deftly
template. Do not invoke it directly.
To use it, write: #[derive(Deftly)] #[derive_deftly(DynMethod)]
.