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
. TheInlineDatum
is expected to contain avalue
key, which maps to an object with afields
array of at least two elements.
§Returns
Some(Register)
- ARegister
instance containing the two extracted byte strings.None
- If the extraction fails orinline_datum
isNone
.
§Behavior
Logs errors to stderr
using eprintln!
when:
inline_datum
isNone
.- The
value
key is missing or is not an object. - The
fields
key is missing or is not an array. - The
fields
array has fewer than two elements.