Struct wasm_bindgen_backend::Diagnostic
source · pub struct Diagnostic { /* private fields */ }Expand description
A struct representing a diagnostic to emit to the end-user as an error.
Implementations§
source§impl Diagnostic
impl Diagnostic
sourcepub fn error<T: Into<String>>(text: T) -> Diagnostic
pub fn error<T: Into<String>>(text: T) -> Diagnostic
Generate a Diagnostic from an informational message with no Span
sourcepub fn span_error<T: Into<String>>(span: Span, text: T) -> Diagnostic
pub fn span_error<T: Into<String>>(span: Span, text: T) -> Diagnostic
Generate a Diagnostic from a Span and an informational message
sourcepub fn spanned_error<T: Into<String>>(node: &dyn ToTokens, text: T) -> Diagnostic
pub fn spanned_error<T: Into<String>>(node: &dyn ToTokens, text: T) -> Diagnostic
Generate a Diagnostic from the span of any tokenizable object and a message
sourcepub fn from_vec(diagnostics: Vec<Diagnostic>) -> Result<(), Diagnostic>
pub fn from_vec(diagnostics: Vec<Diagnostic>) -> Result<(), Diagnostic>
Attempt to generate a Diagnostic from a vector of other Diagnostic instances.
If the Vec is empty, returns Ok(()), otherwise returns the new Diagnostic
Trait Implementations§
source§impl Debug for Diagnostic
impl Debug for Diagnostic
source§impl From<Error> for Diagnostic
impl From<Error> for Diagnostic
source§fn from(err: Error) -> Diagnostic
fn from(err: Error) -> Diagnostic
Converts to this type from the input type.