#muta #derive #codec

archived macro muta-codec-derive

Muta fixed codec derive procedural macros

3 releases

0.2.2 Sep 2, 2020
0.2.1 Sep 2, 2020
0.2.0 Apr 15, 2020

#3 in #muta

Download history 22/week @ 2023-10-28 16/week @ 2023-11-04 15/week @ 2023-11-11 17/week @ 2023-11-18 30/week @ 2023-11-25 14/week @ 2023-12-02 12/week @ 2023-12-09 19/week @ 2023-12-16 20/week @ 2023-12-23 5/week @ 2023-12-30 15/week @ 2024-01-06 13/week @ 2024-01-13 17/week @ 2024-01-20 13/week @ 2024-01-27 5/week @ 2024-02-03 20/week @ 2024-02-10

56 downloads per month

MIT license

12KB
278 lines

Muta Fixed Codec Derive

FixedCodec Trait

pub trait FixedCodec: Sized {
    fn encode_fixed(&self) -> ProtocolResult<Bytes>;

    fn decode_fixed(bytes: Bytes) -> ProtocolResult<Self>;
}

#[derive(RlpFixedCodec)]

Use rlp to derive FixedCodec trait.


lib.rs:

Derive macro #[derive(RlpFixedCodec)]

Dependencies

~1.5MB
~33K SLoC