[][src]Struct bitstream_io::write::ByteWriter

pub struct ByteWriter<W: Write, E: Endianness> { /* fields omitted */ }

For writing aligned bytes to a stream of bytes in a given endianness.

This only writes aligned values and maintains no internal state.

Implementations

impl<W: Write, E: Endianness> ByteWriter<W, E>[src]

pub fn new(writer: W) -> ByteWriter<W, E>[src]

Wraps a ByteWriter around something that implements Write

pub fn endian(writer: W, _endian: E) -> ByteWriter<W, E>[src]

Wraps a BitWriter around something that implements Write with the given endianness.

pub fn into_writer(self) -> W[src]

Unwraps internal writer and disposes of ByteWriter. Any unwritten partial bits are discarded.

pub fn writer(&mut self) -> &mut W[src]

Provides mutable reference to internal writer.

pub fn into_bitwriter(self) -> BitWriter<W, E>[src]

Converts ByteWriter to BitWriter in the same endianness.

pub fn bitwriter(&mut self) -> BitWriter<&mut W, E>[src]

Provides temporary BitWriter in the same endianness.

Warning

Any unwritten bits left over when BitWriter is dropped are lost.

Trait Implementations

impl<W: Write, E: Endianness> ByteWrite for ByteWriter<W, E>[src]

Auto Trait Implementations

impl<W, E> RefUnwindSafe for ByteWriter<W, E> where
    E: RefUnwindSafe,
    W: RefUnwindSafe
[src]

impl<W, E> Send for ByteWriter<W, E> where
    E: Send,
    W: Send
[src]

impl<W, E> Sync for ByteWriter<W, E> where
    E: Sync,
    W: Sync
[src]

impl<W, E> Unpin for ByteWriter<W, E> where
    E: Unpin,
    W: Unpin
[src]

impl<W, E> UnwindSafe for ByteWriter<W, E> where
    E: UnwindSafe,
    W: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.