pub struct FieldNames { /* private fields */ }Expand description
The lowercase field names a section declares and forbids, with those of the sections it flattens, and whether it rejects unknown fields, as a constant.
The derive checks at compile time that no name is declared or forbidden at two levels, so that no declaration silently never receives values, and static_table_entries uses these names to classify a protocol’s static table. Declaration ids number a section’s own declarations first, in order, then each flattened section’s, in order.
Implementations§
Source§impl FieldNames
impl FieldNames
Sourcepub const fn count(&self) -> usize
pub const fn count(&self) -> usize
The number of declarations, including those of flattened sections.
Sourcepub const fn declaration(&self, name: &str) -> Option<usize>
pub const fn declaration(&self, name: &str) -> Option<usize>
The declaration id of a lowercase field name, or None when no declaration has it.
Sourcepub const fn forbids(&self, name: &str) -> bool
pub const fn forbids(&self, name: &str) -> bool
Whether this section, or a section it flattens, forbids a lowercase field name.
Sourcepub const fn rejects_unknown(&self) -> bool
pub const fn rejects_unknown(&self) -> bool
Whether the section rejects fields it neither declares nor forbids: because it says so, or because a section it flattens does.