Module write
Traits and implementations for writing bits to a stream.
Example
Writing the initial STREAMINFO block to a FLAC file, as documented in its specification.
use TryInto;
use Write;
use ;
let mut flac: = Vecnew;
let mut writer = endian;
// stream marker
writer.write_bytes.unwrap;
// metadata block header
writer.build.unwrap;
// STREAMINFO block
writer.build.unwrap;
let comment = VorbisComment ;
// metadata block header
writer.build.unwrap;
// VORBIS_COMMENT block (little endian)
comment.write.unwrap;
assert_eq!;
Structs
- BitCounter For counting the number of bits written but generating no output.
-
BitRecorder
For recording writes in order to play them back on another writer
Example
use Write; use ; let mut recorder: = new; recorder.write.unwrap; recorder.write.unwrap; recorder.write.unwrap; assert_eq!; let mut writer = endian; recorder.playback; assert_eq!; - BitWriter For writing bit values to an underlying stream in a given endianness.
- ByteWriter For writing aligned bytes to a stream of bytes in a given endianness.
- SignedValue A generic signed value for stream recording purposes
- UnsignedValue A generic unsigned value for stream recording purposes
Traits
- BitWrite A trait for anything that can write a variable number of potentially un-aligned values to an output stream
- ByteWrite A trait for anything that can write aligned values to an output stream
- HuffmanWrite A trait for anything that can write Huffman codes of a given endianness to an output stream
- ToBitStream Implemented by complex types that don't require any additional context to build themselves to a writer
- ToBitStreamWith Implemented by complex types that require additional context to build themselves to a writer
- ToByteStream Implemented by complex types that don't require any additional context to build themselves to a writer
- ToByteStreamWith Implemented by complex types that require additional context to build themselves to a writer