[][src]Derive Macro fluvio_protocol_derive::Encode

    // Attributes available to this derive:

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 data = vec![];

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

Encode applys to either Struct of Enum.

Encode respects version attributes. See Decode derive.