cuprate_rpc_types/misc/binary_string.rs
1//! JSON string containing binary data.
2
3//---------------------------------------------------------------------------------------------------- Import
4
5//---------------------------------------------------------------------------------------------------- BinaryString
6/// TODO: we need to figure out a type that (de)serializes correctly, `String` errors with `serde_json`
7///
8/// ```rust
9/// use serde::Deserialize;
10/// use serde_json::from_str;
11/// use cuprate_rpc_types::misc::BinaryString;
12///
13/// #[derive(Deserialize)]
14/// struct Key {
15/// key: BinaryString,
16/// }
17///
18/// let binary = r"�\b����������";
19/// let json = format!("{{\"key\":\"{binary}\"}}");
20/// let key = from_str::<Key>(&json).unwrap();
21/// let binary: BinaryString = key.key;
22/// ```
23pub type BinaryString = String;
24
25//---------------------------------------------------------------------------------------------------- Tests
26#[cfg(test)]
27mod test {
28 // use super::*;
29}