pub enum SectionItem {
One {
name: String,
parser: ParserAst,
},
Counted {
name: String,
count: RepeatCount,
parser: ParserAst,
},
}Expand description
One named argument of a heterogeneous sections(...) other than its
unbounded tail (§7.5).
Each variant contributes exactly one field to the generated record; they
differ in how many sections they consume, which is what
sections_wanted answers. The count lives in the
item rather than in a parallel position map beside the field list, because
a position recorded twice is a position that can disagree with itself —
which is the drift ADR-073 was written about.
Variants§
One
name: P — one section, one field of result(P).
Counted
name: repeated(P, N) — exactly N consecutive sections, one field of
Vec[result(P)].
Implementations§
Source§impl SectionItem
impl SectionItem
Sourcepub fn parser_mut(&mut self) -> &mut ParserAst
pub fn parser_mut(&mut self) -> &mut ParserAst
The parser, mutably — for ParserAst::shift_spans.
Sourcepub fn sections_wanted(&self) -> usize
pub fn sections_wanted(&self) -> usize
How many sections this item consumes.
Trait Implementations§
Source§impl Clone for SectionItem
impl Clone for SectionItem
Source§fn clone(&self) -> SectionItem
fn clone(&self) -> SectionItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SectionItem
impl RefUnwindSafe for SectionItem
impl Send for SectionItem
impl Sync for SectionItem
impl Unpin for SectionItem
impl UnsafeUnpin for SectionItem
impl UnwindSafe for SectionItem
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