if this == 0 {
set_last_error(ALEF_INVALID_HANDLE_ERROR, "zero is not a valid handle");
{{ fail_ret }}
}
let snapshot_ptr = match locked_handle_ptr::<{{ handle_qualified }}>(&mut __alef_guards, this) {
Ok(value) => value,
Err(error) => { set_handle_error(&error); {{ fail_ret }} }
};
// SAFETY: the registry entry guard remains held for the duration of this call.
let snapshot = unsafe { &*snapshot_ptr };
let obj: {{ qualified }} = match serde_json::from_str(&snapshot.json) {
Ok(value) => value,
Err(error) => { set_last_error(2, &error.to_string()); {{ fail_ret }} }
};