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