TeeWriter

Struct TeeWriter 

Source
pub struct TeeWriter<W1, W2> {
    pub w1: W1,
    pub w2: W2,
}
Expand description

A BufWriter that writes the bytes to two writers W1 and W2.

Fields§

§w1: W1§w2: W2

Implementations§

Source§

impl<W1, W2> TeeWriter<W1, W2>
where W1: BufWriter, W2: BufWriter,

Source

pub fn new(w1: W1, w2: W2) -> TeeWriter<W1, W2>

Trait Implementations§

Source§

impl<W1, W2> BufWriter for TeeWriter<W1, W2>
where W1: BufWriter, W2: BufWriter,

Source§

fn put_slice(&mut self, slice: &[u8])

Writes the slice to the buffer. Read more
Source§

fn put_u8(&mut self, val: u8)

Writes a u8 to the buffer in little-endian (LE) encoding.
Source§

fn put_u16(&mut self, val: u16)

Writes a u16 to the buffer in little-endian (LE) encoding.
Source§

fn put_u32(&mut self, val: u32)

Writes a u32 to the buffer in little-endian (LE) encoding.
Source§

fn put_u64(&mut self, val: u64)

Writes a u64 to the buffer in little-endian (LE) encoding.
Source§

fn put_u128(&mut self, val: u128)

Writes a u128 to the buffer in little-endian (LE) encoding.
Source§

fn put_u256(&mut self, val: U256)

Writes a u256 to the buffer in little-endian (LE) encoding.
Source§

fn put_i8(&mut self, val: i8)

Writes an i8 to the buffer in little-endian (LE) encoding.
Source§

fn put_i16(&mut self, val: i16)

Writes an i16 to the buffer in little-endian (LE) encoding.
Source§

fn put_i32(&mut self, val: i32)

Writes an i32 to the buffer in little-endian (LE) encoding.
Source§

fn put_i64(&mut self, val: i64)

Writes an i64 to the buffer in little-endian (LE) encoding.
Source§

fn put_i128(&mut self, val: i128)

Writes an i128 to the buffer in little-endian (LE) encoding.
Source§

fn put_i256(&mut self, val: I256)

Writes an i256 to the buffer in little-endian (LE) encoding.

Auto Trait Implementations§

§

impl<W1, W2> Freeze for TeeWriter<W1, W2>
where W1: Freeze, W2: Freeze,

§

impl<W1, W2> RefUnwindSafe for TeeWriter<W1, W2>

§

impl<W1, W2> Send for TeeWriter<W1, W2>
where W1: Send, W2: Send,

§

impl<W1, W2> Sync for TeeWriter<W1, W2>
where W1: Sync, W2: Sync,

§

impl<W1, W2> Unpin for TeeWriter<W1, W2>
where W1: Unpin, W2: Unpin,

§

impl<W1, W2> UnwindSafe for TeeWriter<W1, W2>
where W1: UnwindSafe, W2: 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.