pub trait Validator<A, E, T>: Sized {
Show 15 methods
// Required methods
fn is_succeed(&self) -> bool;
fn is_fail(&self) -> bool;
fn to_result(self) -> Result<A, Vec<Cause<E, T>>>;
// Provided methods
fn map<A1>(self, f: impl FnOnce(A) -> A1) -> Valid<A1, E, T> { ... }
fn foreach(self, f: impl FnMut(A)) -> Valid<A, E, T>
where A: Clone { ... }
fn and<A1>(self, other: Valid<A1, E, T>) -> Valid<A1, E, T> { ... }
fn zip<A1>(self, other: Valid<A1, E, T>) -> Valid<(A, A1), E, T> { ... }
fn fuse<A1>(self, other: Valid<A1, E, T>) -> Fusion<(A, A1), E, T> { ... }
fn trace(self, trace: impl Into<T> + Clone) -> Valid<A, E, T> { ... }
fn fold<A1>(
self,
ok: impl FnOnce(A) -> Valid<A1, E, T>,
err: impl FnOnce() -> Valid<A1, E, T>,
) -> Valid<A1, E, T> { ... }
fn and_then<B>(self, f: impl FnOnce(A) -> Valid<B, E, T>) -> Valid<B, E, T> { ... }
fn unit(self) -> Valid<(), E, T> { ... }
fn some(self) -> Valid<Option<A>, E, T> { ... }
fn map_to<B>(self, b: B) -> Valid<B, E, T> { ... }
fn when(self, f: impl FnOnce() -> bool) -> Valid<(), E, T> { ... }
}
Required Methods§
fn is_succeed(&self) -> bool
fn is_fail(&self) -> bool
fn to_result(self) -> Result<A, Vec<Cause<E, T>>>
Provided Methods§
fn map<A1>(self, f: impl FnOnce(A) -> A1) -> Valid<A1, E, T>
fn foreach(self, f: impl FnMut(A)) -> Valid<A, E, T>where
A: Clone,
fn and<A1>(self, other: Valid<A1, E, T>) -> Valid<A1, E, T>
fn zip<A1>(self, other: Valid<A1, E, T>) -> Valid<(A, A1), E, T>
fn fuse<A1>(self, other: Valid<A1, E, T>) -> Fusion<(A, A1), E, T>
fn trace(self, trace: impl Into<T> + Clone) -> Valid<A, E, T>
fn fold<A1>( self, ok: impl FnOnce(A) -> Valid<A1, E, T>, err: impl FnOnce() -> Valid<A1, E, T>, ) -> Valid<A1, E, T>
fn and_then<B>(self, f: impl FnOnce(A) -> Valid<B, E, T>) -> Valid<B, E, T>
fn unit(self) -> Valid<(), E, T>
fn some(self) -> Valid<Option<A>, E, T>
fn map_to<B>(self, b: B) -> Valid<B, E, T>
fn when(self, f: impl FnOnce() -> bool) -> Valid<(), E, T>
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.