Function cobhan::hashmap_json_to_cbuffer
source · Expand description
Takes a Hashmap<String, serde_json::Value>
and fallibly encodes it in JSON into a provided external Cobhan Buffer.
The JSON is fallibly checked to ensure UTF-8 formatting of any string properties.
Will cause an error code if the provided Cobhan Buffer is too small.
Notes
This function does a memcopy from the Rust data into the provided Cobhan Buffer.
Safety
Behavior is undefined if any of the following conditions are violated:
- The Cobhan Buffer Header size is not correctly reserved or formatted.
- Any of the Safety conditions of
std::slice::from_raw_parts
is violated.