Derive Macro fluvio_protocol_derive::Encode[][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;
use fluvio_protocol::derive::Encode;

pub struct SimpleRecord {
    val: u8

let mut data = vec![];

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

Encode applies to either Struct of Enum.

Encode respects version attributes. See Decode derive.