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