pub struct Diagnostic { /* private fields */ }
Expand description
A Diagnostic is more flexible way to build and output errors and warnings.
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn warning(message: &str) -> Diagnostic
pub fn warning(message: &str) -> Diagnostic
Creates a new warning with the message message
Sourcepub fn error(message: &str) -> Diagnostic
pub fn error(message: &str) -> Diagnostic
Creates a new error with the message message
Sourcepub fn add_span_with_label(
self,
span: Span,
label: Option<&str>,
primary: bool,
) -> Diagnostic
pub fn add_span_with_label( self, span: Span, label: Option<&str>, primary: bool, ) -> Diagnostic
Adds a code span to the diagnostic.
The label
is printed next to the code fragment the span refers to.
If primary
is set to true the span is treated as the primary code fragment.
Sourcepub fn maybe_add_span_with_label(
self,
span: Option<Span>,
label: Option<&str>,
primary: bool,
) -> Diagnostic
pub fn maybe_add_span_with_label( self, span: Option<Span>, label: Option<&str>, primary: bool, ) -> Diagnostic
Adds a code span to the diagnostic if the span is available.
The label
is printed next to the code fragment the span refers to.
If primary
is set to true the span is treated as the primary code fragment.
Sourcepub fn add_note(self, note: &str) -> Diagnostic
pub fn add_note(self, note: &str) -> Diagnostic
Adds a note to the bottom of the diagnostic.
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<'de> Deserialize<'de> for Diagnostic
impl<'de> Deserialize<'de> for Diagnostic
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Diagnostic, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Diagnostic, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Diagnostic> for Diagnostic<()>
impl From<Diagnostic> for Diagnostic<()>
Source§fn from(diag: Diagnostic) -> Diagnostic<()>
fn from(diag: Diagnostic) -> Diagnostic<()>
Converts to this type from the input type.
Source§impl From<Diagnostic> for RtLolaError
impl From<Diagnostic> for RtLolaError
Source§fn from(diag: Diagnostic) -> RtLolaError
fn from(diag: Diagnostic) -> RtLolaError
Converts to this type from the input type.
Source§impl From<HashError> for Diagnostic
impl From<HashError> for Diagnostic
Source§impl FromIterator<Diagnostic> for RtLolaError
impl FromIterator<Diagnostic> for RtLolaError
Source§fn from_iter<T>(iter: T) -> RtLolaErrorwhere
T: IntoIterator<Item = Diagnostic>,
fn from_iter<T>(iter: T) -> RtLolaErrorwhere
T: IntoIterator<Item = Diagnostic>,
Creates a value from an iterator. Read more
Source§impl Serialize for Diagnostic
impl Serialize for Diagnostic
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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