pub struct ServerHandle { /* private fields */ }Expand description
A cloneable typed handle for messages sent to the connected LSP server.
Implementations§
Source§impl ServerHandle
impl ServerHandle
Sourcepub fn notify<N>(&self, params: N::Params) -> Result<(), ClientError>where
N: Notification,
pub fn notify<N>(&self, params: N::Params) -> Result<(), ClientError>where
N: Notification,
Encode and enqueue one typed client-to-server notification.
Sourcepub async fn request<R>(
&self,
params: R::Params,
) -> Result<R::Result, ClientError>where
R: Request,
pub async fn request<R>(
&self,
params: R::Params,
) -> Result<R::Result, ClientError>where
R: Request,
Send one typed client-to-server request and await its correlated result.
A top-level workDoneToken in the encoded LSP params is registered for
this request’s lifetime, so matching $/progress notifications use the
same ordered, connection-local lifecycle as server-created progress.
Sourcepub async fn shutdown(&self) -> Result<(), ClientError>
pub async fn shutdown(&self) -> Result<(), ClientError>
Request a graceful LSP shutdown from the connected server.
Success cancels every other pending request and reverse request. Only
Self::exit or Self::disconnect remains valid afterwards.
Sourcepub fn exit(&self) -> Result<(), ClientError>
pub fn exit(&self) -> Result<(), ClientError>
Send the required LSP exit notification after successful shutdown.
Sourcepub fn disconnect(&self)
pub fn disconnect(&self)
End the local connection without sending shutdown or exit traffic.
Disconnect is idempotent and resolves pending work through the shared session close path.
Trait Implementations§
Source§impl Clone for ServerHandle
impl Clone for ServerHandle
Source§fn clone(&self) -> ServerHandle
fn clone(&self) -> ServerHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more