use crate::error::Error; pub fn cast_request(request: lsp_server::Request) -> Result where R: lsp_types::request::Request, R::Params: serde::de::DeserializeOwned, { let (_, params) = request.extract(R::METHOD)?; Ok(params) } pub fn cast_notification(notification: lsp_server::Notification) -> Result where N: lsp_types::notification::Notification, N::Params: serde::de::DeserializeOwned, { let params = notification.extract::(N::METHOD)?; Ok(params) }