pub struct SourceInfoErrors {
inner: Vec<SourceInfoError>,
file_content: String,
}
Expand description
A helper struct to provide proper line based error/linting messages.
Provides a list of SourceInfoError
s and the SRCINFO data in which the errors occurred.
Fields§
§inner: Vec<SourceInfoError>
§file_content: String
Implementations§
Source§impl SourceInfoErrors
impl SourceInfoErrors
Sourcepub fn new(errors: Vec<SourceInfoError>, file_content: String) -> Self
pub fn new(errors: Vec<SourceInfoError>, file_content: String) -> Self
Creates a new SourceInfoErrors
.
Sourcepub fn errors(&self) -> &Vec<SourceInfoError>
pub fn errors(&self) -> &Vec<SourceInfoError>
Returns a reference to the list of errors.
Sourcepub fn check_unrecoverable_errors(self) -> Result<(), Error>
pub fn check_unrecoverable_errors(self) -> Result<(), Error>
Filters for and errors on unrecoverable errors.
Consumes self
and simply returns if self
contains no SourceInfoError
of type
SourceInfoErrorType::Unrecoverable
.
§Errors
Returns an error if self
contains any SourceInfoError
of type
SourceInfoErrorType::Unrecoverable
.
Sourcefn sort_errors(&mut self)
fn sort_errors(&mut self)
Sorts the errors.
The following order is applied:
- Hard errors without line numbers
- Hard errors with line numbers, by ascending line number
- Deprecation warnings without line numbers
- Deprecation warnings with line numbers, by ascending line number
- Linter warnings without line numbers
- Linter warnings with line numbers, by ascending line number
Trait Implementations§
Source§impl Clone for SourceInfoErrors
impl Clone for SourceInfoErrors
Source§fn clone(&self) -> SourceInfoErrors
fn clone(&self) -> SourceInfoErrors
Returns a copy 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 moreSource§impl Debug for SourceInfoErrors
impl Debug for SourceInfoErrors
Auto Trait Implementations§
impl Freeze for SourceInfoErrors
impl RefUnwindSafe for SourceInfoErrors
impl Send for SourceInfoErrors
impl Sync for SourceInfoErrors
impl Unpin for SourceInfoErrors
impl UnwindSafe for SourceInfoErrors
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