pub struct CommaSeparated<'a, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> { /* private fields */ }
Expand description
This is a generic type that can be used for AST nodes representing multiple multiple items separated with commas.
This can be used for any grammar which defines a Comma Separated group ([]#
).
The given <T>
will be parsed first, followed by a comma. Parsing completes if the comma isn’t found.
As <T>
is parsed first, it can have any number of interior commas, however if T should ideally not consume
trailing commas, as doing so would likely mean only a single T in this struct.
The effective grammar for this struct is:
<comma-separated>
│├─╭─ <T> ─╮─ "," ─╭─┤│
│ ╰───────╯
╰───────╯
Implementations§
Trait Implementations§
Source§impl<'a, T: Clone + Peek<'a> + Parse<'a> + ToCursors + ToSpan> Clone for CommaSeparated<'a, T>
impl<'a, T: Clone + Peek<'a> + Parse<'a> + ToCursors + ToSpan> Clone for CommaSeparated<'a, T>
Source§fn clone(&self) -> CommaSeparated<'a, T>
fn clone(&self) -> CommaSeparated<'a, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, T: Debug + Peek<'a> + Parse<'a> + ToCursors + ToSpan> Debug for CommaSeparated<'a, T>
impl<'a, T: Debug + Peek<'a> + Parse<'a> + ToCursors + ToSpan> Debug for CommaSeparated<'a, T>
Source§impl<'a, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan, I> IndexMut<I> for CommaSeparated<'a, T>
impl<'a, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan, I> IndexMut<I> for CommaSeparated<'a, T>
Source§impl<'a, 'b, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> IntoIterator for &'b CommaSeparated<'a, T>
impl<'a, 'b, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> IntoIterator for &'b CommaSeparated<'a, T>
Source§impl<'a, 'b, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> IntoIterator for &'b mut CommaSeparated<'a, T>
impl<'a, 'b, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> IntoIterator for &'b mut CommaSeparated<'a, T>
Source§impl<'a, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> IntoIterator for CommaSeparated<'a, T>
impl<'a, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> IntoIterator for CommaSeparated<'a, T>
Source§impl<'a, T: Ord + Peek<'a> + Parse<'a> + ToCursors + ToSpan> Ord for CommaSeparated<'a, T>
impl<'a, T: Ord + Peek<'a> + Parse<'a> + ToCursors + ToSpan> Ord for CommaSeparated<'a, T>
Source§fn cmp(&self, other: &CommaSeparated<'a, T>) -> Ordering
fn cmp(&self, other: &CommaSeparated<'a, T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, T: PartialEq + Peek<'a> + Parse<'a> + ToCursors + ToSpan> PartialEq for CommaSeparated<'a, T>
impl<'a, T: PartialEq + Peek<'a> + Parse<'a> + ToCursors + ToSpan> PartialEq for CommaSeparated<'a, T>
Source§impl<'a, T: PartialOrd + Peek<'a> + Parse<'a> + ToCursors + ToSpan> PartialOrd for CommaSeparated<'a, T>
impl<'a, T: PartialOrd + Peek<'a> + Parse<'a> + ToCursors + ToSpan> PartialOrd for CommaSeparated<'a, T>
Source§impl<'a, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> ToCursors for CommaSeparated<'a, T>
impl<'a, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> ToCursors for CommaSeparated<'a, T>
fn to_cursors(&self, s: &mut impl CursorSink)
impl<'a, T: Eq + Peek<'a> + Parse<'a> + ToCursors + ToSpan> Eq for CommaSeparated<'a, T>
impl<'a, T: Peek<'a> + Parse<'a> + ToCursors + ToSpan> StructuralPartialEq for CommaSeparated<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for CommaSeparated<'a, T>
impl<'a, T> !RefUnwindSafe for CommaSeparated<'a, T>
impl<'a, T> !Send for CommaSeparated<'a, T>
impl<'a, T> !Sync for CommaSeparated<'a, T>
impl<'a, T> Unpin for CommaSeparated<'a, T>
impl<'a, T> !UnwindSafe for CommaSeparated<'a, T>
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