#[non_exhaustive]pub enum InboundMessage {
Response(JsonRpcResponse),
Request(JsonRpcRequest),
Notification(JsonRpcNotification),
UndecodableResponse {
id: RequestId,
},
UndecodableRequest {
id: RequestId,
},
UndecodableNotification,
UndecodableFrame,
}Expand description
Inbound message from LSP server.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Response(JsonRpcResponse)
Response to a request.
Request(JsonRpcRequest)
Request from server to client.
Notification(JsonRpcNotification)
Notification from server.
UndecodableResponse
A response whose body could not be decoded (for example a result
nested deeper than the JSON parser allows) but whose framing and id
were intact: only the request it answers fails, the connection stays
up.
UndecodableRequest
A server request whose body could not be decoded but whose framing
and id were intact: it is answered with an error and the connection
stays up.
UndecodableNotification
A server notification that could not be decoded; it is dropped.
UndecodableFrame
A framed message that is not JSON, or that carries nothing to tell what it was or whom it addresses; it is dropped.
Implementations§
Source§impl InboundMessage
impl InboundMessage
Sourcepub const fn is_undecodable(&self) -> bool
pub const fn is_undecodable(&self) -> bool
Whether this message stands for a frame that could not be decoded.
§Examples
use mcpls_core::lsp::{InboundMessage, RequestId};
assert!(InboundMessage::UndecodableResponse { id: RequestId::Number(1) }.is_undecodable());
assert!(InboundMessage::UndecodableNotification.is_undecodable());Trait Implementations§
Source§impl Clone for InboundMessage
impl Clone for InboundMessage
Auto Trait Implementations§
impl Freeze for InboundMessage
impl RefUnwindSafe for InboundMessage
impl Send for InboundMessage
impl Sync for InboundMessage
impl Unpin for InboundMessage
impl UnsafeUnpin for InboundMessage
impl UnwindSafe for InboundMessage
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