pub fn extract_bytes_with_logging(
inline_datum: &Option<InlineDatum>,
) -> Option<Register>Expand description
Extracts byte values from an InlineDatum with detailed logging.
This function attempts to extract two byte strings from the fields array inside the InlineDatum.
If the extraction fails due to missing keys, incorrect types, or insufficient elements, an error
message is logged to standard error.
§Arguments
inline_datum- An optional reference to anInlineDatum. TheInlineDatumis expected to contain avaluekey, which maps to an object with afieldsarray of at least two elements.
§Returns
Some(Register)- ARegisterinstance containing the two extracted byte strings.None- If the extraction fails orinline_datumisNone.
§Behavior
Logs errors to stderr using eprintln! when:
inline_datumisNone.- The
valuekey is missing or is not an object. - The
fieldskey is missing or is not an array. - The
fieldsarray has fewer than two elements.