Skip to main content

entry_required_str

Function entry_required_str 

Source
pub fn entry_required_str<'a>(
    entries: &'a [(Expr, Expr)],
    name: &str,
    expected: &'static str,
) -> Result<&'a str>
Expand description

Read a required string-valued field from an entry slice by bare-symbol key. Returns a Error::TypeMismatch naming the found variant when the field is present but not an Expr::String. The typed, slice-level counterpart of required_str and the one home for the bare-symbol string_field readers. Use entry_required_str_any when string keys must also match.