Trait amplify::Bipolar

source ·
pub trait Bipolar {
    type Left;
    type Right;

    // Required methods
    fn join(left: Self::Left, right: Self::Right) -> Self;
    fn split(self) -> (Self::Left, Self::Right);
}
Expand description

Trait for splittable streams and other types, which can be separated into some two types (Bipolar::Left, Bipolar::Right), like a reader and writer streams.

Required Associated Types§

source

type Left

First separable type (like reader)

source

type Right

Second separable type (like writer)

Required Methods§

source

fn join(left: Self::Left, right: Self::Right) -> Self

Reconstruct the type from the halves

source

fn split(self) -> (Self::Left, Self::Right)

Split the type into two

Implementors§