#[no_mangle]
pub unsafe extern "C" fn rustsecp256k1_v0_8_1_default_illegal_callback_fn(
message: *const c_char,
_data: *mut c_void
)
Expand description
This function is an override for the C function, this is the an edited version of the original description:
A callback function to be called when an illegal argument is passed to an API call. It will only trigger for violations that are mentioned explicitly in the header. This will cause a panic.
The philosophy is that these shouldn’t be dealt with through a specific return value, as calling code should not have branches to deal with the case that this code itself is broken.
On the other hand, during debug stage, one would want to be informed about such mistakes, and the default (crashing) may be inadvisable. When this callback is triggered, the API function called is guaranteed not to cause a crash, though its return value and output arguments are undefined.
See also secp256k1_default_error_callback_fn.
Safety
message
string should be a null terminated C string and, up to the first null byte, must be valid UTF8.
For exact safety constraints see std::slice::from_raw_parts
and std::str::from_utf8_unchecked
.