Serde
Fully qualified path: core::serde::Serde
pub trait Serde<T>
Trait functions
serialize
Serializes a value into a sequence of felt252
s. # Examples
let value: u256 = 1;
let mut serialized: Array<felt252> = array![];
value.serialize(ref serialized);
assert!(serialized == array![1, 0]) // `serialized` contains the [low, high] parts of the
`u256` value ```
Fully qualified path: core::serde::Serde::serialize
fn serialize(self: @T, ref output: Array<felt252>)
deserialize
Deserializes a value from a sequence of felt252
s. If the value cannot be deserialized, returns Option::None
. # Examples
let mut serialized: Span<felt252> = array![1, 0].span();
let value: u256 = Serde::deserialize(ref serialized).unwrap();
assert!(value == 1);
Fully qualified path: core::serde::Serde::deserialize
fn deserialize(ref serialized: Span<felt252>) -> Option<T>