pub struct Diagnostic { /* private fields */ }Expand description
Diagnostic returned by the procedural macro.
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn new(level: Severity, message: impl ToString) -> Self
pub fn new(level: Severity, message: impl ToString) -> Self
Create new diagnostic with the given severity and message.
Sourcepub fn spanned(span: TextSpan, level: Severity, message: impl ToString) -> Self
pub fn spanned(span: TextSpan, level: Severity, message: impl ToString) -> Self
Creates new diagnostic with the given span, severity level, and message.
Sourcepub fn error(message: impl ToString) -> Self
pub fn error(message: impl ToString) -> Self
Create new diagnostic with severity Severity::Error.
Sourcepub fn warn(message: impl ToString) -> Self
pub fn warn(message: impl ToString) -> Self
Create new diagnostic with severity Severity::Warning.
Sourcepub fn span_error(span: TextSpan, message: impl ToString) -> Self
pub fn span_error(span: TextSpan, message: impl ToString) -> Self
Create new error diagnostic with severity Severity::Error, and the given span and message.
Sourcepub fn span_warning(span: TextSpan, message: impl ToString) -> Self
pub fn span_warning(span: TextSpan, message: impl ToString) -> Self
Create new warning diagnostic with severity Severity::Warning, and the given span and message.
pub fn span(&self) -> Option<TextSpan>
pub fn message(&self) -> &str
pub fn severity(&self) -> Severity
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
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 Diagnostic
impl Debug for Diagnostic
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 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 Diagnostic
impl Hash for Diagnostic
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
impl Eq for Diagnostic
impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnwindSafe for Diagnostic
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