[][src]Module verify::serde

This is supported on feature="serde" only.

This module contains tools to make Serde Serializable values being able to be validated.

Spanned implements Validate and wraps a value that implements Serde Serialize allowing it to be validated by a Validator.

Spans is used to provide spans for values during validation.

An example validation:

This example is not tested
let value = SerializableValue::new();
let validator = SomeValidator::new();

let result = Spanned::new(&value, KeySpans::default()).validate(&validator);

Or using Verifier:

This example is not tested
let value = SerializableValue::new();
let validator = SomeValidator::new();

let result = validator.verify_value(&Spanned::new(&value, KeySpans::default());

Structs

KeySpansfeature="serde"

KeySpans associates nested values with their full path from the first value as a Vec of Strings.

Spannedfeature="serde"

Spanned allows validation of any value that implements Serde Serialize with a given Spans.

Enums

NewSpanfeature="serde"

Type returned by Spans, it dictates how the newly returned spans should be used.

Traits

Spansfeature="serde"

Spans is used to provide spans for values that implement Serde Serialize.