Struct lspower::LspService [−][src]
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::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.
[exit]: https://microsoft.github.io/language-server-protocol/specification#exit
Implementations
impl LspService[src]
pub fn new<T, F>(init: F) -> (Self, MessageStream) where
F: FnOnce(Client) -> T,
T: LanguageServer, [src]
F: FnOnce(Client) -> T,
T: LanguageServer,
Creates a new LspService with the given server backend, also returning a stream of
notifications from the server back to the client.
Trait Implementations
impl Debug for LspService[src]
impl Service<Incoming> for LspService[src]
type Error = ExitedError
Errors produced by the service.
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>
The future response value.
type Response = Option<Outgoing>
Responses given by the service.
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>[src]
fn call(&mut self, request: Incoming) -> Self::Future[src]
Auto Trait Implementations
impl !RefUnwindSafe for LspService
impl Send for LspService
impl Sync for LspService
impl Unpin for LspService
impl !UnwindSafe for LspService
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,