Struct lib_ruby_parser::Diagnostic
source · [−]#[repr(C)]pub struct Diagnostic {
pub level: ErrorLevel,
pub message: DiagnosticMessage,
pub loc: Loc,
}
Expand description
Diagnostic message that comes from the parser when there’s an error or warning
Fields
level: ErrorLevel
Level of the diagnostic (error or warnings)
message: DiagnosticMessage
Message of the diagnostic
loc: Loc
Location of the diagnostic
Implementations
sourceimpl Diagnostic
impl Diagnostic
sourcepub fn render_message(&self) -> String
pub fn render_message(&self) -> String
Returns rendered message
sourcepub fn render(&self, input: &DecodedInput) -> Option<String>
pub fn render(&self, input: &DecodedInput) -> Option<String>
Renders all data into a single String, produces an output like:
(test.rb):1:5: error: unexpected END_OF_INPUT
(test.rb):1: foo++
(test.rb):1: ^
sourcepub fn is_warning(&self) -> bool
pub fn is_warning(&self) -> bool
Returns true
if level of the diagnostic is Warning
Trait Implementations
sourceimpl Clone for Diagnostic
impl Clone for Diagnostic
sourcefn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Diagnostic
impl Debug for Diagnostic
sourceimpl PartialEq<Diagnostic> for Diagnostic
impl PartialEq<Diagnostic> for Diagnostic
sourcefn eq(&self, other: &Diagnostic) -> bool
fn eq(&self, other: &Diagnostic) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Diagnostic) -> bool
fn ne(&self, other: &Diagnostic) -> bool
This method tests for !=
.
impl Eq for Diagnostic
impl StructuralEq for Diagnostic
impl StructuralPartialEq for Diagnostic
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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more