Struct bytecodec::fixnum::F32leEncoder [−][src]
pub struct F32leEncoder(_);
Expand description
Encoder which encodes f32
values by little-endian byte order.
Examples
use bytecodec::EncodeExt; use bytecodec::fixnum::F32leEncoder; use bytecodec::io::IoEncodeExt; let mut output = Vec::new(); let mut encoder = F32leEncoder::with_item(123.4).unwrap(); encoder.encode_all(&mut output).unwrap(); assert_eq!(output, [205, 204, 246, 66]);
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 F32leEncoder
impl Send for F32leEncoder
impl Sync for F32leEncoder
impl Unpin for F32leEncoder
impl UnwindSafe for F32leEncoder
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