Skip to main content

extract_required_array_field

Function extract_required_array_field 

Source
fn extract_required_array_field<'a>(
    object: &'a CanonicalJsonObject,
    field: &'a str,
    max_len: usize,
) -> Result<&'a [CanonicalJsonValue]>
Expand description

Extract the required array field with the given name from the given canonical JSON object.

Returns Ok(value) if the field is present and a valid array or Err(_) if the field is missing, not an array or its length is bigger than the given value.