Module syn::punctuated [−][src]
A punctuated sequence of syntax tree nodes separated by punctuation.
Lots of things in Rust are punctuated sequences.
- The fields of a struct are
Punctuated<Field, Token![,]>
. - The segments of a path are
Punctuated<PathSegment, Token![::]>
. - The bounds on a generic parameter are
Punctuated<TypeParamBound, Token![+]>
. - The arguments to a function call are
Punctuated<Expr, Token![,]>
.
This module provides a common representation for these punctuated sequences
in the form of the Punctuated<T, P>
type. We store a vector of pairs of
syntax tree node + punctuation, where every node in the sequence is followed
by punctuation except for possibly the final one.
a_function_call(arg1, arg2, arg3);
~~~~^ ~~~~^ ~~~~
Structs
IntoIter | An iterator over owned values of type |
IntoPairs | An iterator over owned pairs of type |
Iter | An iterator over borrowed values of type |
IterMut | An iterator over mutably borrowed values of type |
Pairs | An iterator over borrowed pairs of type |
PairsMut | An iterator over mutably borrowed pairs of type |
Punctuated | A punctuated sequence of syntax tree nodes of type |
Enums
Pair | A single syntax tree node of type |