JoinSplit

Trait JoinSplit 

Source
pub trait JoinSplit {
    type A;
    type B;

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

Trait for splittable streams and other types, which can be separated into some two types (JoinSplit::A, JoinSplit::B), like a reader and writer streams.

Required Associated Types§

Source

type A

First separable type (like reader)

Source

type B

Second separable type (like writer)

Required Methods§

Source

fn join(left: Self::A, right: Self::B) -> Self

Reconstruct the type from the halves

Source

fn split(self) -> (Self::A, Self::B)

Split the type into two

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§