pub struct ValidationIssue {
pub severity: Severity,
pub category: IssueCategory,
pub message: String,
pub error_code: Option<String>,
pub field: Option<String>,
pub row: Option<usize>,
pub column: Option<usize>,
pub value: Option<String>,
pub suggestion: Option<String>,
pub auto_fixed: bool,
}Expand description
Represents a single validation issue
Fields§
§severity: Severity§category: IssueCategory§message: String§error_code: Option<String>§field: Option<String>§row: Option<usize>§column: Option<usize>§value: Option<String>§suggestion: Option<String>§auto_fixed: boolImplementations§
Source§impl ValidationIssue
impl ValidationIssue
Sourcepub fn new(
severity: Severity,
category: IssueCategory,
message: impl Into<String>,
) -> Self
pub fn new( severity: Severity, category: IssueCategory, message: impl Into<String>, ) -> Self
Creates a new validation issue
Sourcepub fn with_error_code(self, code: impl Into<String>) -> Self
pub fn with_error_code(self, code: impl Into<String>) -> Self
Sets the error code for this issue
Sourcepub fn mark_auto_fixed(self) -> Self
pub fn mark_auto_fixed(self) -> Self
Marks this issue as auto-fixed
Sourcepub fn with_field(self, field: impl Into<String>) -> Self
pub fn with_field(self, field: impl Into<String>) -> Self
Sets the field name for this issue
Sourcepub fn with_column(self, column: usize) -> Self
pub fn with_column(self, column: usize) -> Self
Sets the column number for this issue
Sourcepub fn with_value(self, value: impl Into<String>) -> Self
pub fn with_value(self, value: impl Into<String>) -> Self
Sets the problematic value
Sourcepub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
Sets a suggestion for fixing the 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