Skip to main content

SpecEncode

Trait SpecEncode 

Source
pub trait SpecEncode {
    const SPEC_LAYOUT: Layout;

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

The “write reserved fields as their spec value” encode path, generated for a #[bin] message that has a reserved field. The inherent to_spec_bytes / spec_encode_into ride on this; the std-only SpecEncodeExt adds spec_encode(writer).

Required Associated Constants§

Source

const SPEC_LAYOUT: Layout

The message’s bit/byte order (mirrors BitEncode::LAYOUT).

Required Methods§

Source

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

Encodes self into a Sink, writing reserved fields as their spec value (ignoring any stored override).

§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§