pub struct Collector { /* private fields */ }Expand description
Collects diagnostics up to a capacity and counts the ones past it.
Implementations§
Source§impl Collector
impl Collector
Sourcepub const DEFAULT_CAPACITY: usize = 1000
pub const DEFAULT_CAPACITY: usize = 1000
The most diagnostics collected for one document by default.
Sourcepub fn push(&mut self, diagnostic: Diagnostic)
pub fn push(&mut self, diagnostic: Diagnostic)
Adds a diagnostic, or counts it when full.
Sourcepub fn items(&self) -> &[Diagnostic]
pub fn items(&self) -> &[Diagnostic]
The diagnostics kept.
Sourcepub fn items_mut(&mut self) -> &mut [Diagnostic]
pub fn items_mut(&mut self) -> &mut [Diagnostic]
The diagnostics kept, for change.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Whether an error was kept.
Sourcepub fn into_parts(self) -> (Vec<Diagnostic>, usize)
pub fn into_parts(self) -> (Vec<Diagnostic>, usize)
The diagnostics kept and the count of those dropped.
Trait Implementations§
Source§impl Extend<Diagnostic> for Collector
impl Extend<Diagnostic> for Collector
Source§fn extend<I: IntoIterator<Item = Diagnostic>>(&mut self, items: I)
fn extend<I: IntoIterator<Item = Diagnostic>>(&mut self, items: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl Forget for Collector
impl Freeze for Collector
impl Move for Collector
impl RefUnwindSafe for Collector
impl Send for Collectorwhere
RawVecInner: Send,
impl Sync for Collectorwhere
RawVecInner: Sync,
impl Unpin for Collector
impl UnsafeUnpin for Collector
impl UnwindSafe for Collectorwhere
RawVecInner: UnwindSafe,
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