Macro cbor_event::cbor

source ·
macro_rules! cbor {
    ($x:expr) => { ... };
}
Expand description

macro to efficiently serialise the given structure into cbor binary.

This performs an in memory serialisation and returns the buffer wrapped in a Result.

#[macro_use]
extern crate cbor_event;

let value = 0u64;
let bytes = cbor!(value).unwrap();