Struct ByteWriter
struct ByteWriter<W: io::Write, E: Endianness> { ... }
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: io::Write, E: Endianness> ByteWriter<W, E>
fn new(writer: W) -> ByteWriter<W, E>Wraps a ByteWriter around something that implements
Writefn endian(writer: W, _endian: E) -> ByteWriter<W, E>Wraps a BitWriter around something that implements
Writewith the given endianness.fn into_writer(self: Self) -> WUnwraps internal writer and disposes of
ByteWriter. Any unwritten partial bits are discarded.fn writer(self: &mut Self) -> &mut WProvides mutable reference to internal writer.
fn into_bitwriter(self: Self) -> BitWriter<W, E>Converts
ByteWritertoBitWriterin the same endianness.fn bitwriter(self: &mut Self) -> BitWriter<&mut W, E>Provides temporary
BitWriterin the same endianness.Warning
Any unwritten bits left over when
BitWriteris dropped are lost.
impl<T> Any for ByteWriter<W, E>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for ByteWriter<W, E>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for ByteWriter<W, E>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for ByteWriter<W, E>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for ByteWriter<W, E>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for ByteWriter<W, E>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for ByteWriter<W, E>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<W, E> Freeze for ByteWriter<W, E>
impl<W, E> RefUnwindSafe for ByteWriter<W, E>
impl<W, E> Send for ByteWriter<W, E>
impl<W, E> Sync for ByteWriter<W, E>
impl<W, E> Unpin for ByteWriter<W, E>
impl<W, E> UnsafeUnpin for ByteWriter<W, E>
impl<W, E> UnwindSafe for ByteWriter<W, E>
impl<W: io::Write, E: Endianness> ByteWrite for ByteWriter<W, E>
fn write<V>(self: &mut Self, value: V) -> Result<()> where V: Primitivefn write_as<F, V>(self: &mut Self, value: V) -> Result<()> where F: Endianness, V: Primitivefn write_bytes(self: &mut Self, buf: &[u8]) -> Result<()>fn writer_ref(self: &mut Self) -> &mut dyn Write