#[no_mangle]
pub unsafe extern "C" fn iohk_jormungandr_fragment_from_raw(
buffer: *const u8,
buffer_length: usize,
fragment_out: *mut FragmentPtr
) -> ErrorPtr
Expand description
deserialize a fragment from bytes
Parameters
buffer
– a pointer to the serialized fragment bytes.buffer_length
– the length of the serialized fragment bytes array.fragment
– the location of the pointer to the deserialized fragemnt.
Errors
This functions may fail if:
buffer
is a null pointer.fragment
is a null pointer.buffer
contains invalid fragment bytes.
Safety
This function dereference raw pointers. Even though the function checks if the pointers are null. Mind not to put random values in or you may see unexpected behaviors
Don’t forget to delete the fragment object with iohk_jormungandr_delete_fragment
.