BitEncodeExt

Trait BitEncodeExt 

Source
pub trait BitEncodeExt<Ctx = (), Tag = ()>: BitEncode<Ctx, Tag> {
    // Provided methods
    fn encode_bytes_ctx<E>(
        &self,
        byte_order: E,
        ctx: &mut Ctx,
        tag: Tag,
    ) -> Result<Vec<u8>>
       where E: Endianness { ... }
    fn encode_bytes_ctx_buf<E>(
        &self,
        byte_order: E,
        ctx: &mut Ctx,
        tag: Tag,
        buf: &mut [u8],
    ) -> Result<u64>
       where E: Endianness { ... }
}
Expand description

Utility functionality for bit-level encoding.

Provided Methods§

Source

fn encode_bytes_ctx<E>( &self, byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Vec<u8>>
where E: Endianness,

Available on crate feature alloc only.

Gets the raw bytes of this type with provided context and tag.

Source

fn encode_bytes_ctx_buf<E>( &self, byte_order: E, ctx: &mut Ctx, tag: Tag, buf: &mut [u8], ) -> Result<u64>
where E: Endianness,

Fills the buffer with the raw bytes of this type with provided context and tag.

Returns the number of bytes written

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, Ctx, Tag> BitEncodeExt<Ctx, Tag> for T
where T: BitEncode<Ctx, Tag>,