#fixed #codec #macro-derive #muta #procedural #proc-macro

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
~35K SLoC