use rmpv::Value;
use crate::error::Error;
pub trait RequestHandler {
fn handle_request(
&self,
_msgid: u64,
method: String,
_params: Vec<Value>,
) -> Result<Value, Error> {
Err(Error::NotImplemented(method))
}
}
pub trait NotificationHandler {
fn handle_notification(&self, _method: String, _params: Vec<Value>) {}
}
#[derive(Default)]
pub struct DefaultHandler {}
impl DefaultHandler {
pub fn new() -> Self {
DefaultHandler {}
}
}
impl RequestHandler for DefaultHandler {}
impl NotificationHandler for DefaultHandler {}