bin_proto/impls/
mut_reference.rs

1use bitstream_io::{BitWrite, Endianness};
2
3use crate::{BitEncode, Result};
4
5impl<Ctx, Tag, T> BitEncode<Ctx, Tag> for &mut T
6where
7    T: BitEncode<Ctx, Tag>,
8{
9    fn encode<W, E>(&self, write: &mut W, ctx: &mut Ctx, tag: Tag) -> Result<()>
10    where
11        W: BitWrite,
12        E: Endianness,
13    {
14        (**self).encode::<_, E>(write, ctx, tag)
15    }
16}
17
18test_encode!(&mut u8; &mut 1 => [0x01]);