pub struct FieldMeta<'a>(/* private fields */);Expand description
Metadata for one AST field of one node type.
Use this to build generic inspectors, serializers, or debug UIs that can walk arbitrary grammars.
Implementations§
Source§impl FieldMeta<'_>
impl FieldMeta<'_>
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The field name as a &str.
§Panics
Panics if the grammar table contains invalid UTF-8 in the field name (which would indicate a codegen bug).
Sourcepub fn display_name(&self, idx: usize) -> Option<&'static str>
pub fn display_name(&self, idx: usize) -> Option<&'static str>
The idx-th display name for enum variants, if present.
§Panics
Panics if the grammar table contains invalid UTF-8 in a display name (which would indicate a codegen bug).
Sourcepub fn display_count(&self) -> usize
pub fn display_count(&self) -> usize
Number of display names for this field.
Auto Trait Implementations§
impl<'a> Freeze for FieldMeta<'a>
impl<'a> RefUnwindSafe for FieldMeta<'a>
impl<'a> !Send for FieldMeta<'a>
impl<'a> !Sync for FieldMeta<'a>
impl<'a> Unpin for FieldMeta<'a>
impl<'a> UnsafeUnpin for FieldMeta<'a>
impl<'a> UnwindSafe for FieldMeta<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more