pub struct LspService<S> { /* private fields */ }
Expand description

Service abstraction for the Language Server Protocol.

This service takes an incoming JSON-RPC message as input and produces an outgoing message as output. If the incoming message is a server notification or a client response, then the corresponding response will be None.

This implements tower::Service in order to remain independent from the underlying transport and to facilitate further abstraction with middleware.

Pending requests can be canceled by issuing a $/cancelRequest notification.

The service shuts down and stops serving requests after the exit notification is received.

Implementations

Creates a new LspService with the given server backend, also returning a channel for server-to-client communication.

Starts building a new LspService.

Returns an LspServiceBuilder, which allows adding custom JSON-RPC methods to the server.

Trait Implementations

Formats the value using the given formatter. Read more

Responses given by the service.

Errors produced by the service.

The future response value.

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more

Process the request and return the response asynchronously. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Yields a mutable reference to the service when it is ready to accept a request.

👎 Deprecated since 0.4.6:

please use the ServiceExt::ready method instead

Yields a mutable reference to the service when it is ready to accept a request.

Yields the service when it is ready to accept a request.

Consume this Service, calling with the providing request once it is ready.

Process all requests from the given Stream, and produce a Stream of their responses. Read more

Executes a new future after this service’s future resolves. This does not alter the behaviour of the poll_ready method. Read more

Maps this service’s response value to a different value. This does not alter the behaviour of the poll_ready method. Read more

Maps this service’s error value to a different value. This does not alter the behaviour of the poll_ready method. Read more

Maps this service’s result type (Result<Self::Response, Self::Error>) to a different value, regardless of whether the future succeeds or fails. Read more

Composes a function in front of the service. Read more

Composes an asynchronous function after this service. Read more

Composes a function that transforms futures produced by the service. Read more

Convert the service into a Service + Send trait object. Read more

Convert the service into a Service + Clone + Send trait object. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.