Struct snoot::diagnostic::DiagnosticBag
[−]
[src]
pub struct DiagnosticBag { /* fields omitted */ }
A structure that contains Snoot errors for easy sorting and printing
Methods
impl DiagnosticBag
[src]
fn singleton(d: Diagnostic) -> DiagnosticBag
Constructs a DiagnosticBag with a single diagnostic
fn new() -> DiagnosticBag
Constructs an empty DiagnosticBag
fn from_vec(v: Vec<Diagnostic>) -> DiagnosticBag
Costructs a diagnostic bag from a Vec
fn len(&self) -> usize
fn sort(&mut self)
Sorts the errors contained in the bag for better printing.
The sort order is by filename (primary) and by file location (secondary)
fn append(&mut self, other: DiagnosticBag)
Appends another ErrorBag onto this one.
fn add(&mut self, error: Diagnostic)
Adds a new error to the bag.
fn contains_errors(&self) -> bool
Returns true if the bag contains any error with error level "Error"
fn contains_warnings(&self) -> bool
Returns true if the bag contains any error with error level "Warn"
fn contains_info(&self) -> bool
Returns true if the bag contains any error with error level "Info"
fn contains_any_custom(&self) -> bool
Returns true if the bag contains any error with a custom error level
fn contains_custom(&self, custom: &str) -> bool
Returns true if the bag contains any error with the specified custom error level.
fn is_empty(&self) -> bool
Returns true if there are no diagnostics
fn assert_empty(&self)
If the bag isn't empty, this will panic with the diagnostic messages as the panic string.
fn assert_no_errors(&self)
If the bag contains any errors, this will panic with the diagnostic messages as the panic string.
fn assert_no_warnings(&self)
If the bag contains any warnings, this will panic with the diagnostic messages as the panic string.
fn to_json(&self) -> Value
fn iter(&self) -> Iter<Diagnostic>
Trait Implementations
impl Eq for DiagnosticBag
[src]
impl PartialEq for DiagnosticBag
[src]
fn eq(&self, __arg_0: &DiagnosticBag) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &DiagnosticBag) -> bool
This method tests for !=
.
impl FromIterator<Diagnostic> for DiagnosticBag
[src]
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = Diagnostic>,
T: IntoIterator<Item = Diagnostic>,
Creates a value from an iterator. Read more
impl Display for DiagnosticBag
[src]
fn fmt(&self, formatter: &mut Formatter) -> FmtResult
Formats the value using the given formatter. Read more