pub struct DiagnosticStore { /* private fields */ }Expand description
Thread-safe per-file diagnostic store.
Receives textDocument/publishDiagnostics notifications and stores them
by absolute file path. Each update replaces previous diagnostics for that file.
Implementations§
Source§impl DiagnosticStore
impl DiagnosticStore
pub fn new() -> Self
Sourcepub fn update(&self, path: PathBuf, diags: Vec<DiagnosticEntry>)
pub fn update(&self, path: PathBuf, diags: Vec<DiagnosticEntry>)
Replace all diagnostics for path. Passing an empty vec removes the entry.
Sourcepub fn get(&self, path: &Path) -> Vec<DiagnosticEntry>
pub fn get(&self, path: &Path) -> Vec<DiagnosticEntry>
All diagnostics for path, or empty vec if none.
Sourcepub fn get_all(&self) -> Vec<(PathBuf, Vec<DiagnosticEntry>)>
pub fn get_all(&self) -> Vec<(PathBuf, Vec<DiagnosticEntry>)>
All diagnostics across all files.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Total number of diagnostic entries across all files.
Trait Implementations§
Source§impl Clone for DiagnosticStore
impl Clone for DiagnosticStore
Source§fn clone(&self) -> DiagnosticStore
fn clone(&self) -> DiagnosticStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiagnosticStore
impl Debug for DiagnosticStore
Source§impl Default for DiagnosticStore
impl Default for DiagnosticStore
Source§fn default() -> DiagnosticStore
fn default() -> DiagnosticStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DiagnosticStore
impl !RefUnwindSafe for DiagnosticStore
impl Send for DiagnosticStore
impl Sync for DiagnosticStore
impl Unpin for DiagnosticStore
impl UnsafeUnpin for DiagnosticStore
impl !UnwindSafe for DiagnosticStore
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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