I am trying to use the rmp_rpc Rust libary to make a server that accepts commands from a client that is written in Python. I am modifying this example to reach my goal.
How can I handle an argument of varying type (integer/string/boolean) into a match statement without getting a "mismatched types; expected i32, found enum 'rmp_rpc::Value'" error? For each method the params types might be different.
fn handle_request(&mut self, method: &str, params: &[Value]) -> Self::RequestFuture {
match method {
"sum" => Methods::sum(params[0], params[1]),
"draw" => Methods::draw(params),
"conc" => Methods::concatenate(params[0], params[1])
}