Derive Macro fluvio_protocol_derive::Encoder[][src]

    // Attributes available to this derive:
Expand description

Custom derive for encoding structure or enum to bytes using Kafka protocol format. This assumes all fields(or enum variants) implement kafka encode traits.


use fluvio_protocol::Encoder;

pub struct SimpleRecord {
    val: u8

let mut data = vec![];

let record = SimpleRecord { val: 4 };
record.encode(&mut data,0);

Encoder applies to either Struct of Enum.

Encoder respects version attributes. See Decoder derive.