pub struct ValidationIssue {
pub severity: Severity,
pub code: IssueCode,
pub message: String,
pub span: Option<Span>,
pub suggestion: Option<String>,
}Expand description
A validation issue found in the script.
Fields§
§severity: SeveritySeverity level.
code: IssueCodeIssue category code.
message: StringHuman-readable message.
span: Option<Span>Optional source location.
suggestion: Option<String>Optional suggestion for fixing the issue.
Implementations§
Source§impl ValidationIssue
impl ValidationIssue
Sourcepub fn error(code: IssueCode, message: impl Into<String>) -> Self
pub fn error(code: IssueCode, message: impl Into<String>) -> Self
Create a new validation error.
Sourcepub fn warning(code: IssueCode, message: impl Into<String>) -> Self
pub fn warning(code: IssueCode, message: impl Into<String>) -> Self
Create a new validation warning.
Sourcepub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
Add a suggestion to this issue.
Trait Implementations§
Source§impl Clone for ValidationIssue
impl Clone for ValidationIssue
Source§fn clone(&self) -> ValidationIssue
fn clone(&self) -> ValidationIssue
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 moreSource§impl Debug for ValidationIssue
impl Debug for ValidationIssue
Auto Trait Implementations§
impl Freeze for ValidationIssue
impl RefUnwindSafe for ValidationIssue
impl Send for ValidationIssue
impl Sync for ValidationIssue
impl Unpin for ValidationIssue
impl UnwindSafe for ValidationIssue
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