pub struct ParseReport { /* private fields */ }Expand description
The outcome of parsing one file.
Implementations§
Source§impl ParseReport
impl ParseReport
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
All diagnostics, including the file-name check.
Sourcepub fn modules(&self) -> Vec<String>
pub fn modules(&self) -> Vec<String>
Names of the top-level module and every nested module, in order.
Sourcepub fn render_human(&self) -> String
pub fn render_human(&self) -> String
The diagnostics in a human-readable form, one per line, like
file:3:7: error[DIVE-S0012]: message.
Sourcepub fn to_json(&self, cst: bool) -> Value
pub fn to_json(&self, cst: bool) -> Value
The versioned JSON report. With cst, the whole concrete syntax tree
is included under "cst".
Shape (schema version 3):
{ "schema_version": 3, "command": "parse", "file": "...",
"accepted": bool, "module": "Name" | null, "modules": ["Name", ...],
"diagnostics": [ { "code", "severity", "message", "help",
"span": { "start", "end", "line", "column",
"end_line", "end_column" } } ],
"cst": { "kind", "start", "end", "children" | "text" } // optional
}Offsets are bytes; lines and columns are 1-based, columns count Unicode scalar values.
Trait Implementations§
Source§impl Clone for ParseReport
impl Clone for ParseReport
Auto Trait Implementations§
impl Forget for ParseReport
impl Freeze for ParseReport
impl Move for ParseReport
impl RefUnwindSafe for ParseReport
impl Send for ParseReport
impl Sync for ParseReport
impl Unpin for ParseReport
impl UnsafeUnpin for ParseReport
impl UnwindSafe for ParseReport
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