Struct fog_pack::validator::MultiValidator[][src]

pub struct MultiValidator(pub Vec<Validator>);

“Multi” validator that checks with several validators at once.

This validator will accept any value that passes at least one of its contained validators. This can be used like an “any of” operator, or a logical OR of validators.

When going through the contained validators, some rules are followed to avoid possible cyclic references:

  • Contained Multi-validators are skipped
  • Contained Ref validators that refer to a Multi-validator are skipped.
  • Contained Ref validators that refer to a Ref validator are skipped.

More succintly, the banned sequences are: Multi->Multi, Multi->Ref->Multi, Multi->Ref->Ref.

Query Checking

The validator for a query must be accepted by at least one of the validators in the Multi-validator. Contained validators that violate the cyclic reference rules are skipped (see above).

Implementations

impl MultiValidator[src]

pub fn new() -> Self[src]

Make a new validator with the default configuration.

pub fn push(self, validator: Validator) -> Self[src]

Add a new validator to the list.

pub fn build(self) -> Validator[src]

Build this into a Validator enum.

pub fn iter(&self) -> Iter<'_, Validator>[src]

Trait Implementations

impl Clone for MultiValidator[src]

impl Debug for MultiValidator[src]

impl Default for MultiValidator[src]

impl<'de> Deserialize<'de> for MultiValidator[src]

impl PartialEq<MultiValidator> for MultiValidator[src]

impl Serialize for MultiValidator[src]

impl StructuralPartialEq for MultiValidator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,