pub unsafe fn return_error(
error: &str,
result_buf: *mut *mut u8,
result_len: *mut usize,
) -> i32Expand description
Return an error result to the framework
This wraps the error message in a JSON object and returns it with an error code.
§Safety
The caller must ensure that:
result_bufpoints to valid, properly aligned memory for writing a pointerresult_lenpoints to valid, properly aligned memory for writing a usize- These pointers remain valid for the duration of the call
- The pointers are not aliased (no other mutable references exist)
§Example
ⓘ
unsafe {
return return_error("Product not found", result_buf, result_len);
}