yew_stdweb/format/cbor.rs
1//! Contains an implementation of CBOR serialization format.
2
3/// A representation of a CBOR data. Use it as wrapper to
4/// set a format you want to use for conversion:
5///
6/// ```
7/// // Converts (lazy) data to a Cbor
8///# use yew::format::Cbor;
9///# fn dont_execute() {
10///# let data: String = unimplemented!();
11/// let dump = Cbor(&data);
12///
13/// // Converts CBOR string to a data (lazy).
14/// let Cbor(data) = dump;
15///# }
16/// ```
17/// This is a binary only format.
18#[derive(Debug)]
19pub struct Cbor<T>(pub T);
20
21binary_format!(Cbor based on serde_cbor);
22text_format_is_an_error!(Cbor);