#muta #derive #fixed #codec #decode #quote

archived macro fixed-codec-derive

Muta fixed codec derive procedural macros

1 unstable release

0.1.0 Apr 2, 2020

#6 in #muta

MIT license

11KB
287 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