Re-exports§
pub use crate::validate_insert;pub use crate::validate_row;pub use crate::validate_rows;pub use crate::validate_update;pub use crate::Validated;pub use crate::VldBool;pub use crate::VldFloat;pub use crate::VldInt;pub use crate::VldSqlxError;pub use crate::VldText;
Structs§
- Field
Result - Result of validating a single field.
- Issue
Builder - Fluent builder for constructing a single
ValidationIssue. - Parse
Result - Result of lenient parsing: contains the (possibly partial) struct and per-field diagnostics.
- Validation
Issue - A single validation issue with path, message and received value.
- VldError
- Collection of validation errors.
- ZAny
- Schema that accepts any JSON value. Created via
vld::any(). - ZArray
- Schema for array validation. Created via
vld::array(). - ZBoolean
- Schema for boolean validation. Created via
vld::boolean(). - ZBytes
- ZCatch
- Wraps a schema with a fallback value returned on ANY validation error.
- ZCustom
- Schema from a custom validation function.
- ZDefault
- Wraps a schema to provide a default value when the input is
nullor missing. - ZDescribe
- Wraps a schema with a human-readable description.
- ZDiscriminated
Union - Discriminated union: chooses a schema based on a discriminator field value.
- ZDuration
- ZEnum
- Schema for string enum validation. Created via
vld::enumeration(). - ZInt
- Schema for integer validation (
i64). Created viavld::number().int(). - ZIntersection
- Intersection of two schemas: input must satisfy both.
- ZJson
Value - ZLazy
- Lazy schema for recursive/self-referencing data structures.
- ZLiteral
- Schema for exact value matching. Created via
vld::literal(). - ZMap
- Schema for validating a JSON array of
[key, value]pairs into aHashMap. - ZMessage
- Override the error message for an inner schema.
- ZNullable
- Wraps a schema to allow null values.
- ZNullish
- Wraps a schema to make it both optional and nullable (nullish).
- ZNumber
- Schema for number validation (
f64). Created viavld::number(). - ZObject
- ZOptional
- Wraps a schema to make it optional.
- ZPath
- ZPipe
- Chains two schemas: output of the first is serialized to JSON, then parsed by the second.
- ZPreprocess
- Applies a preprocessing function to the JSON value before validation.
- ZRecord
- Schema for validating JSON objects as key-value records.
Created via
vld::record(). - ZRefine
- Adds a custom refinement check to a schema without changing its output type.
- ZSet
- Schema for validating a JSON array into a
HashSet(unique elements). - ZSocket
Addr - ZString
- Schema for string validation. Created via
vld::string(). - ZSuper
Refine - Refinement that can produce multiple errors at once.
- ZTransform
- Transforms the output of a schema after successful parsing.
- ZUnion2
- Union of two schemas. Tries the first, then the second.
- ZUnion3
- Union of three schemas.
Enums§
- Either
- A value that can be one of two types.
- Either3
- A value that can be one of three types.
- Issue
Code - Validation issue code — describes what went wrong.
- Path
Segment - A segment in a validation error path.
Traits§
- Into
Literal - Trait for types that can be used as literal values.
- VldInput
- Trait for types that can be used as input to schema parsing.
- VldParse
- Trait for types that can be parsed from a
serde_json::Value. - VldSchema
- Core validation schema trait.
Functions§
- flatten_
error - Flatten a
VldErrorinto a simple field-based structure. - prettify_
error - Format a
VldErrorinto a human-readable string. - treeify_
error - Convert a
VldErrorinto a tree structure that mirrors the schema.