Lines Matching defs:punctuated

1 //! A punctuated sequence of syntax tree nodes separated by punctuation.
3 //! Lots of things in Rust are punctuated sequences.
11 //! This module provides a common representation for these punctuated sequences
40 /// **A punctuated sequence of syntax tree nodes of type `T` separated by
43 /// Refer to the [module documentation] for details about punctuated sequences.
52 /// Creates an empty punctuated sequence.
60 /// Determines whether this punctuated sequence is empty, meaning it
66 /// Returns the number of syntax tree nodes in this punctuated sequence.
116 /// punctuated pairs.
125 /// borrowed punctuated pairs.
134 /// punctuated pairs.
142 /// Appends a syntax tree node onto the end of this punctuated sequence. The
145 /// Use [`push`] instead if the punctuated sequence may or may not already
163 /// Appends a trailing punctuation onto the end of this punctuated sequence.
180 /// Removes the last punctuated pair from this sequence, or `None` if the
190 /// Removes the trailing punctuation from this punctuated sequence, or
202 /// Determines whether this punctuated sequence ends with a trailing
211 /// Equivalent to `punctuated.is_empty() || punctuated.trailing_punct()`.
216 /// Appends a syntax tree node onto the end of this punctuated sequence.
236 /// this punctuated sequence.
291 let mut punctuated = Punctuated::new();
298 punctuated.push_value(value);
303 punctuated.push_punct(punct);
306 Ok(punctuated)
343 let mut punctuated = Punctuated::new();
347 punctuated.push_value(value);
352 punctuated.push_punct(punct);
355 Ok(punctuated)
473 fn do_extend<T, P, I>(punctuated: &mut Punctuated<T, P>, i: I)
483 Pair::Punctuated(a, b) => punctuated.inner.push((a, b)),
485 punctuated.last = Some(Box::new(a));
533 /// Refer to the [module documentation] for details about punctuated sequences.
583 /// Refer to the [module documentation] for details about punctuated sequences.
623 /// Refer to the [module documentation] for details about punctuated sequences.
676 /// Refer to the [module documentation] for details about punctuated sequences.
720 /// Refer to the [module documentation] for details about punctuated sequences.
834 /// Refer to the [module documentation] for details about punctuated sequences.
924 /// Refer to the [module documentation] for details about punctuated sequences.
933 /// Extracts the syntax tree node from this punctuated pair, discarding the
941 /// Borrows the syntax tree node from this punctuated pair.
948 /// Mutably borrows the syntax tree node from this punctuated pair.
955 /// Borrows the punctuation from this punctuated pair, unless this pair is
964 /// Mutably borrows the punctuation from this punctuated pair, unless the
971 /// # use syn::punctuated::Punctuated;
974 /// # let mut punctuated = Punctuated::<TypeParamBound, Token![+]>::new();
977 /// punctuated.insert(0, parse_quote!('lifetime));
978 /// if let Some(punct) = punctuated.pairs_mut().next().unwrap().punct_mut() {
989 /// Creates a punctuated pair out of a syntax tree node and an optional
998 /// Produces this punctuated pair as a tuple of syntax tree node and