sync_ls

Struct TypedLspClient

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

A Lsp client with typed service S.

Implementations§

Source§

impl<S: 'static> TypedLspClient<S>

Source

pub fn send_dap_event<E: IEvent>(&self, body: E::Body)

Sends a dap event to the client.

Source

pub fn send_dap_event_(&self, evt: Event)

Sends an untyped dap_event to the client.

Source§

impl<S: 'static> TypedLspClient<S>

Source

pub fn send_lsp_request<R: Req>( &self, params: R::Params, handler: impl FnOnce(&mut S, Response) + Send + Sync + 'static, )

Sends a request to the client and registers a handler handled by the service S.

Source§

impl<S> TypedLspClient<S>

Source

pub fn to_untyped(self) -> LspClient

Converts the client to an untyped client.

Source§

impl<S: 'static> TypedLspClient<S>

Source

pub fn untyped(&self) -> &LspClient

Returns the untyped lsp client.

Source

pub fn cast<T: 'static>(&self, f: fn(_: &mut S) -> &mut T) -> TypedLspClient<T>

Casts the service to another type.

Source

pub fn send_event<T: Any + Send + 'static>(&self, event: T)

Sends a event to the client itself.

Methods from Deref<Target = LspClient>§

Source

pub fn send_lsp_request_<R: Req>( &self, params: R::Params, handler: impl FnOnce(&mut dyn Any, Response) + Send + Sync + 'static, )

Sends a request to the client and registers a handler.

Source

pub fn respond_lsp(&self, response: Response)

Completes an client2server request in the request queue.

Source

pub fn send_notification<N: Notif>(&self, params: &N::Params)

Sends a typed notification to the client.

Source

pub fn send_notification_(&self, notif: Notification)

Sends an untyped notification to the client.

Source

pub fn untyped(&self) -> &Self

Returns the untyped lsp client.

Source

pub fn to_typed<S: Any>(&self) -> TypedLspClient<S>

converts the client to a typed client.

Source

pub fn has_pending_requests(&self) -> bool

Checks if there are pending requests.

Source

pub fn begin_panic(&self)

Prints states of the request queue and panics.

Source

pub fn send_event<T: Any + Send + 'static>(&self, event: T)

Sends a event to the server itself.

Source

pub fn complete_lsp_request<S: Any>(&self, service: &mut S, response: Response)

Completes an server2client request in the request queue.

Source

pub fn complete_dap_request<S: Any>(&self, service: &mut S, response: Response)

Completes an server2client request in the request queue.

Source

pub fn register_request( &self, method: &str, id: &RequestId, received_at: Instant, )

Registers an client2server request in the request queue.

Source

pub fn respond_result<T: Serialize>(&self, id: RequestId, result: LspResult<T>)

Responds a typed result to the client.

Source

pub fn respond(&self, id: RequestId, response: Message)

Completes an client2server request in the request queue.

Source

pub fn schedule<T: Serialize + 'static>( &self, req_id: RequestId, resp: SchedulableResponse<T>, ) -> ScheduledResult

Schedules a request from the client.

Trait Implementations§

Source§

impl<S> Clone for TypedLspClient<S>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S> Deref for TypedLspClient<S>

Source§

type Target = LspClient

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<S> Freeze for TypedLspClient<S>

§

impl<S> !RefUnwindSafe for TypedLspClient<S>

§

impl<S> Send for TypedLspClient<S>

§

impl<S> Sync for TypedLspClient<S>

§

impl<S> Unpin for TypedLspClient<S>

§

impl<S> !UnwindSafe for TypedLspClient<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T
where T: Send + Sync,