Struct napi_derive_backend::error::Diagnostic
source · [−]pub struct Diagnostic { /* private fields */ }Expand description
A struct representing a diagnostic to emit to the end-user as an error.
Implementations
sourceimpl 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>) -> BindgenResult<()>
pub fn from_vec(diagnostics: Vec<Diagnostic>) -> BindgenResult<()>
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
sourceimpl Debug for Diagnostic
impl Debug for Diagnostic
sourceimpl From<Error> for Diagnostic
impl From<Error> for Diagnostic
sourcefn from(err: Error) -> Diagnostic
fn from(err: Error) -> Diagnostic
Performs the conversion.
sourceimpl ToTokens for Diagnostic
impl ToTokens for Diagnostic
sourcefn to_tokens(&self, dst: &mut TokenStream)
fn to_tokens(&self, dst: &mut TokenStream)
Write self to the given TokenStream. Read more
sourcefn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Convert self directly into a TokenStream object. Read more
sourcefn into_token_stream(self) -> TokenStream
fn into_token_stream(self) -> TokenStream
Convert self directly into a TokenStream object. Read more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Spanned for T where
T: Spanned + ?Sized,
impl<T> Spanned for T where
T: Spanned + ?Sized,
sourcefn span(&self) -> Span
fn span(&self) -> Span
Returns a Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty. Read more