tailcall_valid

Struct Fusion

source
pub struct Fusion<A, E>(/* private fields */);

Implementations§

source§

impl<A, E> Fusion<A, E>

source

pub fn fuse<A1>(self, other: Valid<A1, E>) -> Fusion<A::Out, E>
where A: Append<A1>,

Trait Implementations§

source§

impl<A, E> From<Fusion<A, E>> for Valid<A, E>

source§

fn from(value: Fusion<A, E>) -> Self

Converts to this type from the input type.
source§

impl<A, E> Validator<A, E> for Fusion<A, E>

source§

fn to_result(self) -> Result<A, ValidationError<E>>

source§

fn is_succeed(&self) -> bool

source§

fn is_fail(&self) -> bool

source§

fn map<A1>(self, f: impl FnOnce(A) -> A1) -> Valid<A1, E>

source§

fn and<A1>(self, other: Valid<A1, E>) -> Valid<A1, E>

source§

fn zip<A1>(self, other: Valid<A1, E>) -> Valid<(A, A1), E>

source§

fn fuse<A1>(self, other: Valid<A1, E>) -> Fusion<(A, A1), E>

source§

fn trace(self, message: &str) -> Valid<A, E>

source§

fn fold<A1>( self, ok: impl FnOnce(A) -> Valid<A1, E>, err: impl FnOnce() -> Valid<A1, E>, ) -> Valid<A1, E>

source§

fn and_then<B>(self, f: impl FnOnce(A) -> Valid<B, E>) -> Valid<B, E>

source§

fn unit(self) -> Valid<(), E>

source§

fn some(self) -> Valid<Option<A>, E>

source§

fn map_to<B>(self, b: B) -> Valid<B, E>

source§

fn when(self, f: impl FnOnce() -> bool) -> Valid<(), E>

Auto Trait Implementations§

§

impl<A, E> Freeze for Fusion<A, E>
where A: Freeze,

§

impl<A, E> RefUnwindSafe for Fusion<A, E>

§

impl<A, E> Send for Fusion<A, E>
where A: Send, E: Send,

§

impl<A, E> Sync for Fusion<A, E>
where A: Sync, E: Sync,

§

impl<A, E> Unpin for Fusion<A, E>
where A: Unpin, E: Unpin,

§

impl<A, E> UnwindSafe for Fusion<A, E>
where A: UnwindSafe, E: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<S, T> ValidateInto<T> for S
where T: ValidateFrom<S>,

source§

type Error = <T as ValidateFrom<S>>::Error

source§

fn validate_into(self) -> Valid<T, <S as ValidateInto<T>>::Error>