pub struct Errors { /* private fields */ }Implementations§
source§impl Errors
impl Errors
sourcepub fn push_abbreviated<E: ErrorLoc>(&mut self, eloc: E, key: ErrorKey)
pub fn push_abbreviated<E: ErrorLoc>(&mut self, eloc: E, key: ErrorKey)
Immediately log a single-line report about this error.
This is intended for voluminous almost-identical errors, such as from the “unused localization” check.
sourcepub fn push_header(&mut self, _key: ErrorKey, msg: &str)
pub fn push_header(&mut self, _key: ErrorKey, msg: &str)
Immediately print an error message. It is intended to introduce a following block of
messages printed with Errors::push_abbreviated.
sourcepub fn take_reports(&mut self) -> Vec<LogReport>
pub fn take_reports(&mut self) -> Vec<LogReport>
Extract the stored reports, sort them, and return them as a vector of LogReport.
The stored reports will be left empty.
sourcepub fn emit_reports(&mut self, json: bool)
pub fn emit_reports(&mut self, json: bool)
Print all the stored reports to the error output.
Set json if they should be printed as a JSON array. Otherwise they are printed in the
default output format.
Note that the default output format is not stable across versions. It is meant for human readability and occasionally gets changed to improve that.
sourcepub fn get_mut() -> MutexGuard<'static, Errors>
pub fn get_mut() -> MutexGuard<'static, Errors>
Get a mutable lock on the global ERRORS struct.
Panics
May panic when the mutex has been poisoned by another thread.
sourcepub fn get() -> MutexGuard<'static, Errors>
pub fn get() -> MutexGuard<'static, Errors>
Like Errors::get_mut but intended for read-only access.
Currently there is no difference, but if the locking mechanism changes there may be a difference.
Panics
May panic when the mutex has been poisoned by another thread.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Errors
impl Send for Errors
impl !Sync for Errors
impl Unpin for Errors
impl !UnwindSafe for Errors
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
source§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere T: AsAny + ?Sized,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().