MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / serialize

Function serialize

chain/src/helpers.rs:15–18  ·  view source on GitHub ↗
(value: &V)

Source from the content-addressed store, hash-verified

13};
14
15pub(crate) fn serialize<V: Serialize>(value: &V) -> Result<Vec<u8>> {
16 let serialized = bincode::serialize(value).map_err(|e| SerializeError(e.to_string()))?;
17 Ok(serialized)
18}
19
20pub(crate) fn deserialize<V: DeserializeOwned>(value: &[u8]) -> Result<V> {
21 let deserialized =

Callers 10

hashMethod · 0.85
signMethod · 0.85
to_trieMethod · 0.85
newMethod · 0.85
upsertMethod · 0.85
add_contract_accountMethod · 0.85
send_a_raw_transactionFunction · 0.85

Calls

no outgoing calls

Tested by 1