[][src]Trait semval::Validate

pub trait Validate {
    type Invalidity: Invalidity;
    pub fn validate(&self) -> Result<Self::Invalidity>;
}

A trait for validating types

Validation is expected to be an expensive operation that should only be invoked when crossing boundaries between independent components.

Associated Types

type Invalidity: Invalidity[src]

Invalidity objectives

Loading content...

Required methods

pub fn validate(&self) -> Result<Self::Invalidity>[src]

Perform the validation

Loading content...

Implementations on Foreign Types

impl<'a, V> Validate for &'a V where
    V: Validate
[src]

Validate is implemented for any reference of a type that implements Validate.

type Invalidity = V::Invalidity

impl<V> Validate for Option<V> where
    V: Validate
[src]

Validate Some or otherwise implicitly evaluate to Ok in case of None

If the absence of an optional value is considered a validation error this must be checked separately.

type Invalidity = V::Invalidity

impl<V> Validate for [V] where
    V: Validate
[src]

Validate all elements of a slice

type Invalidity = V::Invalidity

impl<V> Validate for Vec<V> where
    V: Validate
[src]

type Invalidity = V::Invalidity

Loading content...

Implementors

Loading content...