Struct tower_lsp::LspService
source · [−]pub struct LspService { /* 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::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
sourceimpl LspService
impl LspService
sourcepub fn new<T, F>(init: F) -> (Self, MessageStream) where
F: FnOnce(Client) -> T,
T: LanguageServer,
pub fn new<T, F>(init: F) -> (Self, MessageStream) where
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
sourceimpl Debug for LspService
impl Debug for LspService
sourceimpl Service<Incoming> for LspService
impl Service<Incoming> for LspService
type Error = ExitedError
type Error = ExitedError
Errors produced by the service.
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>
The future response value.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more