1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
use rmpv::Value;

pub trait Handler {
    fn handle_notify(&mut self, _name: &str, _args: Vec<Value>) {}

    fn handle_request(&mut self, _name: &str, _args: Vec<Value>) -> Result<Value, Value> {
        Err(Value::from("Not implemented"))
    }
}

pub struct DefaultHandler();

impl Handler for DefaultHandler {}