use 0x1::option;
use 0x1::string;
use 0x2::simple_map;
Error if the CBOR bytes are invalid
const ERROR_INVALID_CBOR_BYTES: u64 = 1;
Function to deserialize a type T from CBOR bytes.
Function to deserialize a type T from CBOR bytes. If the CBOR bytes are invalid, it will return None.
#[data_struct(#[T])]
public fun from_cbor_option<T: drop>(bytes: vector<u8>): option::Option<T>
Parse a cbor object bytes to a SimpleMap If the cbor bytes is invalid, it will return an empty SimpleMap If the field type is primitive type, it will be parsed to bytes, array or object will be parsed to cbor bytes
public fun to_map(bytes: vector<u8>): simple_map::SimpleMap<string::String, vector<u8>>
Serialize a value of type T to CBOR bytes.