Struct bytecodec::fixnum::I16leEncoder [−][src]
pub struct I16leEncoder(_);
Expand description
Encoder which encodes i16
values by little-endian byte order.
Examples
use bytecodec::EncodeExt; use bytecodec::fixnum::I16leEncoder; use bytecodec::io::IoEncodeExt; let mut output = Vec::new(); let mut encoder = I16leEncoder::with_item(-2).unwrap(); encoder.encode_all(&mut output).unwrap(); assert_eq!(output, [0xFE, 0xFF]);
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
Returns the exact number of bytes required to encode all the items remaining in the encoder.
Auto Trait Implementations
impl RefUnwindSafe for I16leEncoder
impl Send for I16leEncoder
impl Sync for I16leEncoder
impl Unpin for I16leEncoder
impl UnwindSafe for I16leEncoder
Blanket Implementations
Mutably borrows from an owned value. Read more
Encodes the items remaining in the encoder and writes the encoded bytes to the given write buffer. Read more
Encodes the items remaining in the encoder and
writes the encoded bytes to the given write buffer.
If the write buffer is full and the writing cannot be performed,
the given WriteBuf will memorize cx’s Waker
.
This Waker
’s wake
will later be called when the WriteBuf
regains its free space. Read more