Skip to main content

BitEncode

Trait BitEncode 

Source
pub trait BitEncode {
    const LAYOUT: Layout = _;

    // Required method
    fn bit_encode<K: Sink>(&self, w: &mut K) -> Result<(), BitError>;
}
Expand description

A message encoded to a bit stream — the dual of BitDecode.

Provided Associated Constants§

Source

const LAYOUT: Layout = _

The message’s bit/byte order, used to size a fresh BitWriter when encoding to a Vec/writer. The derive sets it from the struct’s declared bit_order/bytes; a hand-written impl that only ever encodes into a caller-supplied Sink can leave the default.

Required Methods§

Source

fn bit_encode<K: Sink>(&self, w: &mut K) -> Result<(), BitError>

Encodes self into any Sink, advancing its cursor.

§Errors

Propagates the sink’s BitError.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§