Standard single-threaded deserialization. Use this for leaf nodes or simple structs that fit in memory.
(&self)
| 901 | /// Standard single-threaded deserialization. |
| 902 | /// Use this for leaf nodes or simple structs that fit in memory. |
| 903 | pub fn decode<T: DeserializeOwned>(&self) -> Result<T> { |
| 904 | let payload = self.read_raw()?; |
| 905 | bincode::serde::decode_from_slice(&payload, bincode::config::standard()) |
| 906 | .map(|(obj, _)| obj) |
| 907 | .map_err(|e| ParcodeError::Serialization(e.to_string())) |
| 908 | } |
| 909 | |
| 910 | /// **Parallel Shard Reconstruction** |
| 911 | /// |