pub struct ValidationErrorBody {
pub error: String,
pub issues: Vec<ValidationIssue>,
}Expand description
Validation error response body:
{ "error": "Validation failed", "issues": [...] }.
Fields§
§error: String§issues: Vec<ValidationIssue>Implementations§
Source§impl ValidationErrorBody
impl ValidationErrorBody
Sourcepub fn parse<__VldInputT: VldInput + ?Sized>(
input: &__VldInputT,
) -> Result<ValidationErrorBody, VldError>
pub fn parse<__VldInputT: VldInput + ?Sized>( input: &__VldInputT, ) -> Result<ValidationErrorBody, VldError>
Parse and validate input data into this struct.
Accepts any type implementing [VldInput]: JSON strings, file paths,
serde_json::Value, byte slices, etc.
Sourcepub fn parse_value(__vld_json: &Value) -> Result<ValidationErrorBody, VldError>
pub fn parse_value(__vld_json: &Value) -> Result<ValidationErrorBody, VldError>
Parse and validate directly from a serde_json::Value.
Source§impl ValidationErrorBody
impl ValidationErrorBody
Sourcepub fn validate<__VldT: Serialize>(instance: &__VldT) -> Result<(), VldError>
pub fn validate<__VldT: Serialize>(instance: &__VldT) -> Result<(), VldError>
Validate an existing Rust value that can be serialized to JSON.
The value is serialized via serde, then validated against the
schema under the fields’ serialize names (parse() reads
the deserialize names). Returns Ok(()) on success,
Err(VldError) with all issues on failure.
Trait Implementations§
Source§impl Clone for ValidationErrorBody
impl Clone for ValidationErrorBody
Source§impl Debug for ValidationErrorBody
impl Debug for ValidationErrorBody
Source§impl Serialize for ValidationErrorBody
impl Serialize for ValidationErrorBody
Source§impl VldParse for ValidationErrorBody
impl VldParse for ValidationErrorBody
Auto Trait Implementations§
impl Forget for ValidationErrorBody
impl Freeze for ValidationErrorBody
impl RefUnwindSafe for ValidationErrorBody
impl Send for ValidationErrorBody
impl Sync for ValidationErrorBody
impl Unpin for ValidationErrorBody
impl UnsafeUnpin for ValidationErrorBody
impl UnwindSafe for ValidationErrorBody
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