Skip to main content

Check

Trait Check 

Source
pub trait Check<T, PreState>
where Self: Sized,
{ type PostState; type Error; // Required method fn check( self, value: CheckState<T, PreState>, ) -> CheckOutcome<T, Self::PostState, Self::Error>; // Provided methods fn and<B, C>(self, b: B) -> And<Self, B, C> where B: Check<T, Self::PostState>, C: CombineErrorBuilder<Self::Error, B::Error> { ... } fn or<B, C>(self, b: B) -> Or<Self, B, C> where B: Check<T, Self::PostState>, C: CombineErrorBuilder<Self::Error, B::Error> { ... } }

Required Associated Types§

Required Methods§

Source

fn check( self, value: CheckState<T, PreState>, ) -> CheckOutcome<T, Self::PostState, Self::Error>

Provided Methods§

Source

fn and<B, C>(self, b: B) -> And<Self, B, C>
where B: Check<T, Self::PostState>, C: CombineErrorBuilder<Self::Error, B::Error>,

Source

fn or<B, C>(self, b: B) -> Or<Self, B, C>
where B: Check<T, Self::PostState>, C: CombineErrorBuilder<Self::Error, B::Error>,

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§

Source§

impl<T, PreState, A, B, C> Check<T, PreState> for And<A, B, C>
where A: Check<T, PreState>, B: Check<T, A::PostState>, C: CombineErrorBuilder<A::Error, B::Error>,

Source§

type PostState = <B as Check<T, <A as Check<T, PreState>>::PostState>>::PostState

Source§

type Error = <<C as CombineErrorBuilder<<A as Check<T, PreState>>::Error, <B as Check<T, <A as Check<T, PreState>>::PostState>>::Error>>::Combiner as CombineError<<A as Check<T, PreState>>::Error, <B as Check<T, <A as Check<T, PreState>>::PostState>>::Error>>::Out

Source§

impl<T, PreState, A, B, C> Check<T, PreState> for Or<A, B, C>
where A: Check<T, PreState>, B: Check<T, A::PostState>, C: CombineErrorBuilder<A::Error, B::Error>,

Source§

type PostState = <B as Check<T, <A as Check<T, PreState>>::PostState>>::PostState

Source§

type Error = <C as CombineErrorBuilder<<A as Check<T, PreState>>::Error, <B as Check<T, <A as Check<T, PreState>>::PostState>>::Error>>::Out

Source§

impl<T, PreState, PostState, F, E> Check<T, PreState> for F
where F: Fn(CheckState<T, PreState>) -> CheckOutcome<T, PostState, E>,

Source§

type PostState = PostState

Source§

type Error = E