1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! Contains an implementation of Bincode serialization format.

use bincode;

/// A representation of a Bincode data. Use it as wrapper to
/// set a format you want to use for conversion:
///
/// ```rust
/// // Converts (lazy) data to a Bincode
///# use yew::format::Bincode;
///# fn dont_execute() {
///# let data: String = unimplemented!();
/// let dump = Bincode(&data);
///
/// // Converts Bincode to a data (lazy).
/// let Bincode(data) = dump;
///# }
/// ```
#[derive(Debug)]
pub struct Bincode<T>(pub T);

binary_format!(Bincode, bincode::serialize, bincode::deserialize);