Trait ValidateSeq

Source
pub trait ValidateSeq<S: Span> {
    type Error: Error;

    // Required methods
    fn with_span(&mut self, span: Option<S>) -> &mut Self;
    fn validate_element<V>(&mut self, value: &V) -> Result<(), Self::Error>
       where V: ?Sized + Validate<Span = S> + Hash;
    fn end(self) -> Result<(), Self::Error>;
}
Expand description

Type returned by validate_seq.

Required Associated Types§

Source

type Error: Error

The error returned by the validator.

Required Methods§

Source

fn with_span(&mut self, span: Option<S>) -> &mut Self

Set the span for the current value that is being validated.

In some cases this is needed to ensure that the validator returns the correct span in its errors.

Source

fn validate_element<V>(&mut self, value: &V) -> Result<(), Self::Error>
where V: ?Sized + Validate<Span = S> + Hash,

Validate an element in the sequence.

Source

fn end(self) -> Result<(), Self::Error>

End the sequence.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§