pub struct LspMessage {
pub jsonrpc: String,
pub id: Option<Value>,
pub method: Option<String>,
pub params: Option<Value>,
pub result: Option<Value>,
pub error: Option<Value>,
}Expand description
Represents an LSP-style message from Copilot logs
Fields§
§jsonrpc: StringJSON-RPC version
id: Option<Value>Message ID (for request/response correlation)
method: Option<String>Method name
params: Option<Value>Parameters
result: Option<Value>Result (for responses)
error: Option<Value>Error (for error responses)
Implementations§
Source§impl LspMessage
impl LspMessage
Sourcepub fn notification(method: &str) -> Self
pub fn notification(method: &str) -> Self
Create a new notification message (no id)
Sourcepub fn is_request(&self) -> bool
pub fn is_request(&self) -> bool
Check if this is a request (has id and method)
Sourcepub fn is_response(&self) -> bool
pub fn is_response(&self) -> bool
Check if this is a response (has id and result or error)
Sourcepub fn is_notification(&self) -> bool
pub fn is_notification(&self) -> bool
Check if this is a notification (has method but no id)
Sourcepub fn with_params(self, params: Value) -> Self
pub fn with_params(self, params: Value) -> Self
Add parameters to the message
Trait Implementations§
Source§impl Clone for LspMessage
impl Clone for LspMessage
Source§fn clone(&self) -> LspMessage
fn clone(&self) -> LspMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LspMessage
impl Debug for LspMessage
Source§impl<'de> Deserialize<'de> for LspMessage
impl<'de> Deserialize<'de> for LspMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LspMessage
impl PartialEq for LspMessage
Source§impl Serialize for LspMessage
impl Serialize for LspMessage
impl Eq for LspMessage
impl StructuralPartialEq for LspMessage
Auto Trait Implementations§
impl Freeze for LspMessage
impl RefUnwindSafe for LspMessage
impl Send for LspMessage
impl Sync for LspMessage
impl Unpin for LspMessage
impl UnwindSafe for LspMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more