Struct syn::punctuated::Punctuated [] [src]

pub struct Punctuated<T, P> { /* fields omitted */ }

A punctuated sequence of syntax tree nodes of type T separated by punctuation of type P.

Refer to the module documentation for details about punctuated sequences.

Methods

impl<T, P> Punctuated<T, P>
[src]

[src]

Creates an empty punctuated sequence.

[src]

Determines whether this punctuated sequence is empty, meaning it contains no syntax tree nodes or punctuation.

[src]

Returns the number of syntax tree nodes in this punctuated sequence.

This is the number of nodes of type T, not counting the punctuation of type P.

[src]

Borrows the first punctuated pair in this sequence.

[src]

Borrows the last punctuated pair in this sequence.

[src]

Mutably borrows the last punctuated pair in this sequence.

Important traits for Iter<'a, T>
[src]

Returns an iterator over borrowed syntax tree nodes of type &T.

Important traits for IterMut<'a, T>
[src]

Returns an iterator over mutably borrowed syntax tree nodes of type &mut T.

Important traits for Pairs<'a, T, P>
[src]

Returns an iterator over the contents of this sequence as borrowed punctuated pairs.

Important traits for PairsMut<'a, T, P>
[src]

Returns an iterator over the contents of this sequence as mutably borrowed punctuated pairs.

Important traits for IntoPairs<T, P>
[src]

Returns an iterator over the contents of this sequence as owned punctuated pairs.

[src]

Appends a syntax tree node onto the end of this punctuated sequence. The sequence must previously have a trailing punctuation.

Use push instead if the punctuated sequence may or may not already have trailing punctuation.

Panics

Panics if the sequence does not already have a trailing punctuation when this method is called.

[src]

Appends a trailing punctuation onto the end of this punctuated sequence. The sequence must be non-empty and must not already have trailing punctuation.

Panics

Panics if the sequence is empty or already has a trailing punctuation.

[src]

Removes the last punctuated pair from this sequence, or None if the sequence is empty.

[src]

Determines whether this punctuated sequence ends with a trailing punctuation.

[src]

Returns true if either this Punctuated is empty, or it has a trailing punctuation.

Equivalent to punctuated.is_empty() || punctuated.trailing_punct().

impl<T, P> Punctuated<T, P> where
    P: Default
[src]

[src]

Appends a syntax tree node onto the end of this punctuated sequence.

If there is not a trailing punctuation in this sequence when this method is called, the default value of punctuation type P is inserted before the given value of type T.

[src]

Inserts an element at position index.

Panics

Panics if index is greater than the number of elements previously in this punctuated sequence.

impl<T, P> Punctuated<T, P> where
    T: Synom,
    P: Synom
[src]

[src]

Parse zero or more syntax tree nodes with punctuation in between and no trailing punctuation.

[src]

Parse one or more syntax tree nodes with punctuation in bewteen and no trailing punctuation. allowing trailing punctuation.

[src]

Parse zero or more syntax tree nodes with punctuation in between and optional trailing punctuation.

[src]

Parse one or more syntax tree nodes with punctuation in between and optional trailing punctuation.

impl<T, P> Punctuated<T, P> where
    P: Synom
[src]

[src]

Parse zero or more syntax tree nodes using the given parser with punctuation in between and no trailing punctuation.

[src]

Parse one or more syntax tree nodes using the given parser with punctuation in between and no trailing punctuation.

[src]

Parse zero or more syntax tree nodes using the given parser with punctuation in between and optional trailing punctuation.

[src]

Parse one or more syntax tree nodes using the given parser with punctuation in between and optional trailing punctuation.

Trait Implementations

impl<T, P> ToTokens for Punctuated<T, P> where
    T: ToTokens,
    P: ToTokens
[src]

[src]

Write self to the given Tokens. Read more

[src]

Convert self directly into a Tokens object. Read more

impl<T: Eq, P: Eq> Eq for Punctuated<T, P>
[src]

impl<T: PartialEq, P: PartialEq> PartialEq for Punctuated<T, P>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: Hash, P: Hash> Hash for Punctuated<T, P>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Clone, P: Clone> Clone for Punctuated<T, P>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug, P: Debug> Debug for Punctuated<T, P>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T, P> FromIterator<T> for Punctuated<T, P> where
    P: Default
[src]

[src]

Creates a value from an iterator. Read more

impl<T, P> Extend<T> for Punctuated<T, P> where
    P: Default
[src]

[src]

Extends a collection with the contents of an iterator. Read more

impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P>
[src]

[src]

Creates a value from an iterator. Read more

impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P>
[src]

[src]

Extends a collection with the contents of an iterator. Read more

impl<T, P> IntoIterator for Punctuated<T, P>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<'a, T, P> IntoIterator for &'a Punctuated<T, P>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<'a, T, P> IntoIterator for &'a mut Punctuated<T, P>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<T, P> Default for Punctuated<T, P>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T, P> Index<usize> for Punctuated<T, P>
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<T, P> IndexMut<usize> for Punctuated<T, P>
[src]

[src]

Performs the mutable indexing (container[index]) operation.

Auto Trait Implementations

impl<T, P> Send for Punctuated<T, P> where
    P: Send,
    T: Send

impl<T, P> Sync for Punctuated<T, P> where
    P: Sync,
    T: Sync