pub fn serialize<T: Serialize>(value: &T) -> NeoResult<Vec<u8>>Expand description
Serializes a value to bytes using bincode.
§Type Parameters
T- The type to serialize, must implementSerialize
§Arguments
value- A reference to the value to serialize
§Returns
Ok(Vec<u8>)- The serialized bytes on successErr(NeoError)- If serialization fails
§Examples
use neo_devpack::codec::serialize;
let value = 42i32;
let bytes = serialize(&value).unwrap();