pub unsafe fn cbuffer_to_hashmap_json(
    buffer: *const c_char
) -> Result<HashMap<String, Value>, i32>
Expand description

Takes a pointer to an external Cobhan Buffer and fallibly attempts to interpret it as a Hashmap<String, serde_json::Value>.

The JSON is fallibly checked to ensure UTF-8 formatting of any string properties.

Notes

This function does a memcopy from the provided Cobhan Buffer into Rust owned data.

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.