Struct flexi_parse::punctuated::Punctuated
source · pub struct Punctuated<T, P: Punct> { /* private fields */ }Expand description
A series of pairs of T and P, optionally followed by another T.
Implementations§
source§impl<T, P: Punct> Punctuated<T, P>
impl<T, P: Punct> Punctuated<T, P>
sourcepub fn parse_separated(input: ParseStream<'_>) -> Result<Self>where
T: Parse,
pub fn parse_separated(input: ParseStream<'_>) -> Result<Self>where T: Parse,
Parses instances of T separated by instances of P, with no trailing
punctuation.
Note that this will stop as soon as it encounters a token that doesn’t fit this pattern.
sourcepub fn parse_separated_with<F: FnMut(ParseStream<'_>) -> Result<T>>(
input: ParseStream<'_>,
f: F
) -> Result<Self>
pub fn parse_separated_with<F: FnMut(ParseStream<'_>) -> Result<T>>( input: ParseStream<'_>, f: F ) -> Result<Self>
Parses instances of T using f, separated by instances of P, with
no trailing punctuation.
Note that this will stop as soon as it encounters a token that doesn’t fit this pattern.
sourcepub fn parse_separated_trailing(input: ParseStream<'_>) -> Result<Self>where
T: Parse,
pub fn parse_separated_trailing(input: ParseStream<'_>) -> Result<Self>where T: Parse,
Parses instances of T separated by instances of P, with optional
trailing punctuation.
Note that this will stop as soon as it encounters a token that doesn’t fit this pattern.
sourcepub fn parse_separated_trailing_with<F: FnMut(ParseStream<'_>) -> Result<T>>(
input: ParseStream<'_>,
f: F
) -> Result<Self>
pub fn parse_separated_trailing_with<F: FnMut(ParseStream<'_>) -> Result<T>>( input: ParseStream<'_>, f: F ) -> Result<Self>
Parses instances of T using f, separated by instances of P, with
optional trailing punctuation.
Note that this will stop as soon as it encounters a token that doesn’t fit this pattern.
sourcepub fn parse_terminated(input: ParseStream<'_>) -> Result<Self>where
T: Parse,
pub fn parse_terminated(input: ParseStream<'_>) -> Result<Self>where T: Parse,
Parses instances of T separated by instances of P, with trailing
punctuation.
Note that this attempts to consume the entire stream.
sourcepub fn parse_terminated_with<F: FnMut(ParseStream<'_>) -> Result<T>>(
input: ParseStream<'_>,
f: F
) -> Result<Self>
pub fn parse_terminated_with<F: FnMut(ParseStream<'_>) -> Result<T>>( input: ParseStream<'_>, f: F ) -> Result<Self>
trailing punctuation.
Note that this attempts to consume the entire stream.
sourcepub fn iter_mut(&mut self) -> IterMut<'_, T, P> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, T, P> ⓘ
Returns an iterator that allows modifying each value.
sourcepub fn pairs(&self) -> Pairs<'_, T, P> ⓘ
pub fn pairs(&self) -> Pairs<'_, T, P> ⓘ
Returns an iterator over the pairs of values and punctuation in this struct.
sourcepub fn pairs_mut(&mut self) -> PairsMut<'_, T, P> ⓘ
pub fn pairs_mut(&mut self) -> PairsMut<'_, T, P> ⓘ
Returns an iterator that allows modifying each pair.
sourcepub fn into_pairs(self) -> IntoPairs<T, P> ⓘ
pub fn into_pairs(self) -> IntoPairs<T, P> ⓘ
Returns a consuming iterator over the pairs in this struct.
Trait Implementations§
source§impl<T: Clone, P: Clone + Punct> Clone for Punctuated<T, P>
impl<T: Clone, P: Clone + Punct> Clone for Punctuated<T, P>
source§fn clone(&self) -> Punctuated<T, P>
fn clone(&self) -> Punctuated<T, P>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more