1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
mod write;
pub use self::write::*;
use std::io::Write;
///Implementing the `Union Write` constructor for` Write`.
pub trait UnionWriteConst: Write {
#[inline]
fn union<B: Write>(self, b: B) -> UnionWrite<Self, B> where Self: Sized {
UnionWrite::new(self, b)
}
}
impl<T: Write> UnionWriteConst for T {}
impl<A: Write, B: Write> From<(A, B)> for UnionWrite<A, B> {
#[inline(always)]
fn from((a, b): (A, B)) -> Self {
a.union(b)
}
}