pub struct Diagnostics(/* private fields */);Expand description
A set of diagnostics that arose during the computation.
Implementations§
Source§impl Diagnostics
impl Diagnostics
Sourcepub fn new(diagnostics: Vec<Diagnostic>) -> Self
pub fn new(diagnostics: Vec<Diagnostic>) -> Self
Create new Diagnostics from a vector of diagnostics.
Sourcepub fn error(self, message: impl ToString) -> Self
pub fn error(self, message: impl ToString) -> Self
Create new diagnostic with severity Severity::Error
and push to the vector.
Sourcepub fn warn(self, message: impl ToString) -> Self
pub fn warn(self, message: impl ToString) -> Self
Create new diagnostic with severity Severity::Warning
and push to the vector.
Sourcepub fn span_error(self, span: TextSpan, message: impl ToString) -> Self
pub fn span_error(self, span: TextSpan, message: impl ToString) -> Self
Create new diagnostic with severity Severity::Error and the given span
and push to the vector.
Sourcepub fn span_warning(self, span: TextSpan, message: impl ToString) -> Self
pub fn span_warning(self, span: TextSpan, message: impl ToString) -> Self
Create new diagnostic with severity Severity::Warning and the given span
and push to the vector.
Trait Implementations§
Source§impl Clone for Diagnostics
impl Clone for Diagnostics
Source§fn clone(&self) -> Diagnostics
fn clone(&self) -> Diagnostics
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 Diagnostics
impl Debug for Diagnostics
Source§impl Extend<Diagnostic> for Diagnostics
impl Extend<Diagnostic> for Diagnostics
Source§fn extend<T: IntoIterator<Item = Diagnostic>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Diagnostic>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬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
Source§impl From<Diagnostic> for Diagnostics
impl From<Diagnostic> for Diagnostics
Source§fn from(diagnostics: Diagnostic) -> Self
fn from(diagnostics: Diagnostic) -> Self
Converts to this type from the input type.
Source§impl From<Vec<Diagnostic>> for Diagnostics
impl From<Vec<Diagnostic>> for Diagnostics
Source§fn from(diagnostics: Vec<Diagnostic>) -> Self
fn from(diagnostics: Vec<Diagnostic>) -> Self
Converts to this type from the input type.
Source§impl FromIterator<Diagnostic> for Diagnostics
impl FromIterator<Diagnostic> for Diagnostics
Source§fn from_iter<T: IntoIterator<Item = Diagnostic>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Diagnostic>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl Hash for Diagnostics
impl Hash for Diagnostics
Source§impl IntoIterator for Diagnostics
impl IntoIterator for Diagnostics
Source§type Item = Diagnostic
type Item = Diagnostic
The type of the elements being iterated over.
Source§type IntoIter = IntoIter<<Diagnostics as IntoIterator>::Item>
type IntoIter = IntoIter<<Diagnostics as IntoIterator>::Item>
Which kind of iterator are we turning this into?
Source§impl PartialEq for Diagnostics
impl PartialEq for Diagnostics
impl Eq for Diagnostics
impl StructuralPartialEq for Diagnostics
Auto Trait Implementations§
impl Freeze for Diagnostics
impl RefUnwindSafe for Diagnostics
impl Send for Diagnostics
impl Sync for Diagnostics
impl Unpin for Diagnostics
impl UnwindSafe for Diagnostics
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