Trait ByteWrite
trait ByteWrite
A trait for anything that can write aligned values to an output stream
Required Methods
fn write<V>(self: &mut Self, value: V) -> Result<()> where V: PrimitiveWrites whole numeric value to stream
Errors
Passes along any I/O error from the underlying stream.
Examples
use Write; use ; let mut writer = endian; writer.write.unwrap; assert_eq!;use Write; use ; let mut writer = endian; writer.write.unwrap; assert_eq!;fn write_as<F, V>(self: &mut Self, value: V) -> Result<()> where F: Endianness, V: PrimitiveWrites whole numeric value to stream in a potentially different endianness
Errors
Passes along any I/O error from the underlying stream.
Examples
use Write; use ; let mut writer = endian; writer..unwrap; assert_eq!;use Write; use ; let mut writer = endian; writer..unwrap; assert_eq!;fn write_bytes(self: &mut Self, buf: &[u8]) -> Result<()>Writes the entirety of a byte buffer to the stream.
Errors
Passes along any I/O error from the underlying stream.
fn writer_ref(self: &mut Self) -> &mut dyn WriteReturns mutable reference to underlying writer
Provided Methods
fn build<T: ToByteStream>(self: &mut Self, build: &T) -> Result<(), <T as >::Error>Builds and writes complex type
fn build_with<'a, T: ToByteStreamWith<'a>>(self: &mut Self, build: &T, context: &<T as >::Context) -> Result<(), <T as >::Error>Builds and writes complex type with context
Implementors
impl<W: io::Write, E: Endianness> ByteWrite for ByteWriter<W, E>