bin_proto/impls/
phantom_pinned.rs1use bitstream_io::{BitRead, BitWrite, Endianness};
2
3use crate::{BitDecode, BitEncode, Result};
4use core::marker::PhantomPinned;
5
6impl<Ctx> BitDecode<Ctx> for PhantomPinned {
7 fn decode<R, E>(_: &mut R, _: &mut Ctx, (): ()) -> Result<Self>
8 where
9 R: BitRead,
10 E: Endianness,
11 {
12 Ok(Self)
13 }
14}
15
16impl<Ctx> BitEncode<Ctx> for PhantomPinned {
17 fn encode<W, E>(&self, _: &mut W, _: &mut Ctx, (): ()) -> Result<()>
18 where
19 W: BitWrite,
20 E: Endianness,
21 {
22 Ok(())
23 }
24}
25
26test_codec!(PhantomPinned; PhantomPinned => []);