Skip to main content

field_name

Function field_name 

Source
pub const fn field_name(
    fields: &'static [(&'static str, &'static str)],
    ident: &str,
) -> &'static str
Expand description

ident’s name in files among fields — a compile error when it’s used in a constant (as field! does) and there’s no such field.

§Panics

When fields has no ident — at compile time in a constant, which is how field! turns a misspelt field into a compile error.