pub struct DiagnosticSet { /* private fields */ }
Expand description
A set of diagnostics with the associated source info
Implementations§
Source§impl DiagnosticSet
impl DiagnosticSet
Sourcepub fn new(
messages: Vec<Diagnostic>,
tree: &ParseTree,
max_to_print: usize,
) -> Self
pub fn new( messages: Vec<Diagnostic>, tree: &ParseTree, max_to_print: usize, ) -> Self
Create a new DiagnosticSet
.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
true
if any of the messages in this set indicate hard errors
Sourcepub fn set_max_to_print(&mut self, max_to_print: usize)
pub fn set_max_to_print(&mut self, max_to_print: usize)
Set the max number of messages to print.
Sourcepub fn discard_warnings(&mut self)
pub fn discard_warnings(&mut self)
Discard any warnings, keeping only errors
Sourcepub fn split_off_warnings(&mut self) -> Option<DiagnosticSet>
pub fn split_off_warnings(&mut self) -> Option<DiagnosticSet>
Remove and return any warnings in this set.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Return the underlying diagnostics, as a slice
Trait Implementations§
Source§impl Clone for DiagnosticSet
impl Clone for DiagnosticSet
Source§fn clone(&self) -> DiagnosticSet
fn clone(&self) -> DiagnosticSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for DiagnosticSet
impl RefUnwindSafe for DiagnosticSet
impl Send for DiagnosticSet
impl Sync for DiagnosticSet
impl Unpin for DiagnosticSet
impl UnwindSafe for DiagnosticSet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T
, using the provided data to resolve any offsets.