#codec #derive #macros #fixed #muta

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

#25 in Encoding

Download history 297/week @ 2020-07-01 686/week @ 2020-07-08 379/week @ 2020-07-15 305/week @ 2020-07-22 335/week @ 2020-07-29 370/week @ 2020-08-05 297/week @ 2020-08-12 52/week @ 2020-08-19 112/week @ 2020-08-26 191/week @ 2020-09-02 275/week @ 2020-09-09 171/week @ 2020-09-16 49/week @ 2020-09-23 3/week @ 2020-09-30 2/week @ 2020-10-07 9/week @ 2020-10-14

1,180 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

~0.4–0.8MB
~21K SLoC