pub struct Report {
pub kind: ReportKind,
pub fragments: Vec<ReportFragment>,
pub color: bool,
}Expand description
A rich-text error/diagnostic report
Fields§
§kind: ReportKindWhat kind of report this is
fragments: Vec<ReportFragment>The rich-text fragments of the report
color: boolWhether to color the report with ANSI escape codes when converting it to a string
Defaults to true
Implementations§
source§impl Report
impl Report
sourcepub fn color(self, color: bool) -> Self
pub fn color(self, color: bool) -> Self
Change whether to color the report with ANSI escape codes when converting it to a string
Defaults to true
sourcepub fn trace(self, trace: &[TraceFrame]) -> Self
pub fn trace(self, trace: &[TraceFrame]) -> Self
Add a trace to the report
sourcepub fn new(kind: ReportKind, message: impl Into<String>) -> Self
pub fn new(kind: ReportKind, message: impl Into<String>) -> Self
Create a new report
sourcepub fn new_multi<I, T>(kind: ReportKind, inputs: &Inputs, errors: I) -> Self
pub fn new_multi<I, T>(kind: ReportKind, inputs: &Inputs, errors: I) -> Self
Create a new report with multiple messages
Trait Implementations§
source§impl PartialEq for Report
impl PartialEq for Report
impl Eq for Report
impl StructuralPartialEq for Report
Auto Trait Implementations§
impl RefUnwindSafe for Report
impl Send for Report
impl Sync for Report
impl Unpin for Report
impl UnwindSafe for Report
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more