Struct devise::Diagnostic [−]
pub struct Diagnostic { /* fields omitted */ }
Expand description
A structure representing a diagnostic message and associated children messages.
Implementations
impl Diagnostic
impl Diagnostic
pub fn new<T>(level: Level, message: T) -> Diagnostic where
T: Into<String>,
pub fn new<T>(level: Level, message: T) -> Diagnostic where
T: Into<String>,
Creates a new diagnostic with the given level
and message
.
pub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
pub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
Creates a new diagnostic with the given level
and message
pointing
to the given set of spans
.
pub fn spanned_child<S, T>(
self,
spans: S,
level: Level,
message: T
) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
pub fn spanned_child<S, T>(
self,
spans: S,
level: Level,
message: T
) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
Adds a new child diagnostic message to self
with the level
and the
given spans
and message
.
pub fn child<T>(self, level: Level, message: T) -> Diagnostic where
T: Into<String>,
pub fn child<T>(self, level: Level, message: T) -> Diagnostic where
T: Into<String>,
Adds a new child diagnostic message to self
with level
and the given
message
.
pub fn span_error<S, T>(self, spans: S, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
pub fn span_error<S, T>(self, spans: S, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
Adds a new child diagnostic message to self
with the level
identified by this method’s name with the given spans
and
message
.
pub fn error<T>(self, message: T) -> Diagnostic where
T: Into<String>,
pub fn error<T>(self, message: T) -> Diagnostic where
T: Into<String>,
Adds a new child diagnostic message to self
with the level
identified by this method’s name with the given message
.
pub fn span_warning<S, T>(self, spans: S, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
pub fn span_warning<S, T>(self, spans: S, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
Adds a new child diagnostic message to self
with the level
identified by this method’s name with the given spans
and
message
.
pub fn warning<T>(self, message: T) -> Diagnostic where
T: Into<String>,
pub fn warning<T>(self, message: T) -> Diagnostic where
T: Into<String>,
Adds a new child diagnostic message to self
with the level
identified by this method’s name with the given message
.
pub fn span_note<S, T>(self, spans: S, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
pub fn span_note<S, T>(self, spans: S, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
Adds a new child diagnostic message to self
with the level
identified by this method’s name with the given spans
and
message
.
pub fn note<T>(self, message: T) -> Diagnostic where
T: Into<String>,
pub fn note<T>(self, message: T) -> Diagnostic where
T: Into<String>,
Adds a new child diagnostic message to self
with the level
identified by this method’s name with the given message
.
pub fn span_help<S, T>(self, spans: S, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
pub fn span_help<S, T>(self, spans: S, message: T) -> Diagnostic where
T: Into<String>,
S: MultiSpan,
Adds a new child diagnostic message to self
with the level
identified by this method’s name with the given spans
and
message
.
pub fn help<T>(self, message: T) -> Diagnostic where
T: Into<String>,
pub fn help<T>(self, message: T) -> Diagnostic where
T: Into<String>,
Adds a new child diagnostic message to self
with the level
identified by this method’s name with the given message
.
pub fn children(&self) -> impl Iterator<Item = &Diagnostic>
pub fn children(&self) -> impl Iterator<Item = &Diagnostic>
Return the children diagnostics of self
.
pub fn emit_as_item_tokens(self) -> TokenStream
pub fn emit_as_item_tokens(self) -> TokenStream
Emit tokens, suitable for item contexts, to generate a comple-time
diagnostic corresponding to self
. On nightly, this directly emits the
error and returns an empty token stream.
pub fn emit_as_item_tokens_or(self, default: TokenStream) -> TokenStream
pub fn emit_as_item_tokens_or(self, default: TokenStream) -> TokenStream
Emit tokens, suitable for item contexts, to generate a comple-time
diagnostic corresponding to self
. On nightly, this directly emits the
error and returns default
.
pub fn emit_as_expr_tokens(self) -> TokenStream
pub fn emit_as_expr_tokens(self) -> TokenStream
Emit tokens, suitable for expression contexts, to generate a comple-time
diagnostic corresponding to self
. On nightly, this directly emits the
error and returns a ()
token stream.
pub fn emit_as_expr_tokens_or(self, default: TokenStream) -> TokenStream
pub fn emit_as_expr_tokens_or(self, default: TokenStream) -> TokenStream
Emit tokens, suitable for expressioon contexts, to generate a
comple-time diagnostic corresponding to self
. On nightly, this
directly emits the error and returns default
.
Trait Implementations
impl Clone for Diagnostic
impl Clone for Diagnostic
pub fn clone(&self) -> Diagnostic
pub fn clone(&self) -> Diagnostic
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl Debug for Diagnostic
impl Debug for Diagnostic
impl From<Diagnostic> for Error
impl From<Diagnostic> for Error
pub fn from(diag: Diagnostic) -> Error
pub fn from(diag: Diagnostic) -> Error
Performs the conversion.
impl From<Diagnostic> for Diagnostic
impl From<Diagnostic> for Diagnostic
pub fn from(diag: Diagnostic) -> Diagnostic
pub fn from(diag: Diagnostic) -> Diagnostic
Performs the conversion.
impl From<Error> for Diagnostic
impl From<Error> for Diagnostic
pub fn from(error: Error) -> Diagnostic
pub fn from(error: Error) -> Diagnostic
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Diagnostic
impl !Send for Diagnostic
impl !Sync for Diagnostic
impl Unpin for Diagnostic
impl UnwindSafe for Diagnostic
Blanket Implementations
Mutably borrows from an owned value. Read more