Skip to main content

parse

Function parse 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn parse(ptr: *const u8, len: usize) -> *mut u8
Expand description

Parse raw JSON bytes into a normalised HookEvent and return it as length-prefixed JSON.

Side-effect: stores the detected CallerKind in the thread-local so that the subsequent serialize call can use it.

§Safety

ptr must point to len consecutive readable bytes valid for the duration of this call. The returned pointer must be freed with dealloc(ptr, 4 + payload_len) where payload_len is the LE-i32 at the first four bytes of the returned buffer.