pub struct ValidationGenerator { /* private fields */ }Expand description
Validation error generator
Implementations§
Source§impl ValidationGenerator
impl ValidationGenerator
Sourcepub fn new(config: BehaviorModelConfig) -> Self
pub fn new(config: BehaviorModelConfig) -> Self
Create a new validation generator
Sourcepub fn learn_from_example(&mut self, example: ValidationErrorExample)
pub fn learn_from_example(&mut self, example: ValidationErrorExample)
Learn from an error example
Sourcepub async fn generate_validation_error(
&self,
issue: &ValidationIssue,
context: &RequestContext,
) -> Result<ValidationErrorResponse>
pub async fn generate_validation_error( &self, issue: &ValidationIssue, context: &RequestContext, ) -> Result<ValidationErrorResponse>
Generate validation error response
Creates a realistic, context-aware validation error based on the validation issue and request context.
Sourcepub async fn generate_field_error(
&self,
field: &str,
issue: &ValidationIssue,
context: &RequestContext,
) -> Result<FieldError>
pub async fn generate_field_error( &self, field: &str, issue: &ValidationIssue, context: &RequestContext, ) -> Result<FieldError>
Generate field-level error
Auto Trait Implementations§
impl Freeze for ValidationGenerator
impl !RefUnwindSafe for ValidationGenerator
impl Send for ValidationGenerator
impl Sync for ValidationGenerator
impl Unpin for ValidationGenerator
impl UnsafeUnpin for ValidationGenerator
impl !UnwindSafe for ValidationGenerator
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