tower_lsp::jsonrpc

Trait IntoResponse

Source
pub trait IntoResponse:
    Sealed
    + Send
    + 'static {
    // Required methods
    fn into_response(self, id: Option<Id>) -> Option<Response>;
    fn is_notification() -> bool;
}
Expand description

A trait implemented by all JSON-RPC response types.

Required Methods§

Source

fn into_response(self, id: Option<Id>) -> Option<Response>

Attempts to construct a Response using Self and a corresponding Id.

Source

fn is_notification() -> bool

Returns true if this is a notification response type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IntoResponse for ()

Support JSON-RPC notification methods.

Source§

impl<R: Serialize + Send + 'static> IntoResponse for Result<R, Error>

Support JSON-RPC request methods.

Implementors§