pub struct ValidationError {
pub kind: ValidationErrorKind,
pub message: String,
pub location: Option<String>,
pub context: Vec<String>,
pub suggestions: Vec<String>,
}Expand description
Validation error representing a critical issue that prevents execution
Fields§
§kind: ValidationErrorKindError type category
message: StringHuman-readable error message
location: Option<String>Location in query where error occurred
context: Vec<String>Context information about the error
suggestions: Vec<String>Suggested fixes for the error
Implementations§
Source§impl ValidationError
impl ValidationError
Sourcepub fn new(kind: ValidationErrorKind, message: String) -> Self
pub fn new(kind: ValidationErrorKind, message: String) -> Self
Create a new validation error
Sourcepub fn with_location(self, location: String) -> Self
pub fn with_location(self, location: String) -> Self
Add location information
Sourcepub fn with_context(self, context: Vec<String>) -> Self
pub fn with_context(self, context: Vec<String>) -> Self
Add context information
Sourcepub fn with_suggestions(self, suggestions: Vec<String>) -> Self
pub fn with_suggestions(self, suggestions: Vec<String>) -> Self
Add suggestions
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
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