pub struct LspProgressStore { /* private fields */ }Expand description
The relocated LSP progress/status accumulator (decision A). The LSP
actor only emits $/progress / serverStatus as events; this is the
single place they are folded into a queryable map. Two ArcSwaps for
wait-free reads + lock-free single-writer (forwarder) updates, so the
host can read Self::progress_snapshot from the actor thread for
:lsp-progress-cancel while the off-actor forwarder writes.
Implementations§
Source§impl LspProgressStore
impl LspProgressStore
pub fn new() -> Self
Sourcepub fn apply_progress(&self, ev: LspProgressUpdate)
pub fn apply_progress(&self, ev: LspProgressUpdate)
Fold one $/progress event: Begin inserts, Report merges
title/percentage from the prior entry, End removes. Relocated
verbatim from the host’s old drain_lsp_progress_events.
Sourcepub fn set_server_status(&self, ev: LspServerStatusChanged)
pub fn set_server_status(&self, ev: LspServerStatusChanged)
Record the latest experimental/serverStatus for a server.
Sourcepub fn progress_snapshot(
&self,
) -> Arc<HashMap<(Arc<str>, String), LspProgressUpdate>> ⓘ
pub fn progress_snapshot( &self, ) -> Arc<HashMap<(Arc<str>, String), LspProgressUpdate>> ⓘ
Wait-free snapshot of the in-flight progress map. :lsp-progress-cancel
reads this (host/actor thread) to find cancellable tokens.
Trait Implementations§
Source§impl Debug for LspProgressStore
impl Debug for LspProgressStore
Auto Trait Implementations§
impl !Freeze for LspProgressStore
impl RefUnwindSafe for LspProgressStore
impl Send for LspProgressStore
impl Sync for LspProgressStore
impl Unpin for LspProgressStore
impl UnsafeUnpin for LspProgressStore
impl UnwindSafe for LspProgressStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more