SeparatedBy

Struct SeparatedBy 

Source
pub struct SeparatedBy<P, T> { /* private fields */ }
Expand description

Parsable type that repeatedly and alternatingly invokes a sub-parser and consumes a punctuation token.

Trait Implementations§

Source§

impl<S, P, T> Parse<S> for SeparatedBy<P, [T; 16]>
where S: TokenStream, P: Separator, T: Parse<S>,

Source§

type Output = [<T as Parse<S>>::Output; 16]

The type that is parsed.
Source§

fn parse<'a>( tokens: &'a [TokenTree<S>], ) -> (Option<Self::Output>, &'a [TokenTree<S>])

This function should return an instance of the type if it can be parsed, or None otherwise, and a slice of tokens that remain after parsing if successful (or the original slice otherwise).
Source§

impl<S, P, T> Parse<S> for SeparatedBy<P, [T; 6]>
where S: TokenStream, P: Separator, T: Parse<S>,

Source§

type Output = [<T as Parse<S>>::Output; 6]

The type that is parsed.
Source§

fn parse<'a>( tokens: &'a [TokenTree<S>], ) -> (Option<Self::Output>, &'a [TokenTree<S>])

This function should return an instance of the type if it can be parsed, or None otherwise, and a slice of tokens that remain after parsing if successful (or the original slice otherwise).
Source§

impl<S, P, A, B> Parse<S> for SeparatedBy<P, (A, B)>
where S: TokenStream, P: Separator, A: Parse<S>, B: Parse<S>,

Source§

type Output = (<A as Parse<S>>::Output, <B as Parse<S>>::Output)

The type that is parsed.
Source§

fn parse<'a>( tokens: &'a [TokenTree<S>], ) -> (Option<Self::Output>, &'a [TokenTree<S>])

This function should return an instance of the type if it can be parsed, or None otherwise, and a slice of tokens that remain after parsing if successful (or the original slice otherwise).
Source§

impl<S, P, A, B, C> Parse<S> for SeparatedBy<P, (A, B, C)>
where S: TokenStream, P: Separator, A: Parse<S>, B: Parse<S>, C: Parse<S>,

Source§

type Output = (<A as Parse<S>>::Output, <B as Parse<S>>::Output, <C as Parse<S>>::Output)

The type that is parsed.
Source§

fn parse<'a>( tokens: &'a [TokenTree<S>], ) -> (Option<Self::Output>, &'a [TokenTree<S>])

This function should return an instance of the type if it can be parsed, or None otherwise, and a slice of tokens that remain after parsing if successful (or the original slice otherwise).
Source§

impl<S, P, A, B, C, D> Parse<S> for SeparatedBy<P, (A, B, C, D)>
where S: TokenStream, P: Separator, A: Parse<S>, B: Parse<S>, C: Parse<S>, D: Parse<S>,

Source§

type Output = (<A as Parse<S>>::Output, <B as Parse<S>>::Output, <C as Parse<S>>::Output, <D as Parse<S>>::Output)

The type that is parsed.
Source§

fn parse<'a>( tokens: &'a [TokenTree<S>], ) -> (Option<Self::Output>, &'a [TokenTree<S>])

This function should return an instance of the type if it can be parsed, or None otherwise, and a slice of tokens that remain after parsing if successful (or the original slice otherwise).
Source§

impl<S, P, A, B, C, D, E> Parse<S> for SeparatedBy<P, (A, B, C, D, E)>
where S: TokenStream, P: Separator, A: Parse<S>, B: Parse<S>, C: Parse<S>, D: Parse<S>, E: Parse<S>,

Source§

type Output = (<A as Parse<S>>::Output, <B as Parse<S>>::Output, <C as Parse<S>>::Output, <D as Parse<S>>::Output, <E as Parse<S>>::Output)

The type that is parsed.
Source§

fn parse<'a>( tokens: &'a [TokenTree<S>], ) -> (Option<Self::Output>, &'a [TokenTree<S>])

This function should return an instance of the type if it can be parsed, or None otherwise, and a slice of tokens that remain after parsing if successful (or the original slice otherwise).
Source§

impl<S, P, A, B, C, D, E, F> Parse<S> for SeparatedBy<P, (A, B, C, D, E, F)>
where S: TokenStream, P: Separator, A: Parse<S>, B: Parse<S>, C: Parse<S>, D: Parse<S>, E: Parse<S>, F: Parse<S>,

Source§

type Output = (<A as Parse<S>>::Output, <B as Parse<S>>::Output, <C as Parse<S>>::Output, <D as Parse<S>>::Output, <E as Parse<S>>::Output, <F as Parse<S>>::Output)

The type that is parsed.
Source§

fn parse<'a>( tokens: &'a [TokenTree<S>], ) -> (Option<Self::Output>, &'a [TokenTree<S>])

This function should return an instance of the type if it can be parsed, or None otherwise, and a slice of tokens that remain after parsing if successful (or the original slice otherwise).

Auto Trait Implementations§

§

impl<P, T> Freeze for SeparatedBy<P, T>

§

impl<P, T> RefUnwindSafe for SeparatedBy<P, T>

§

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

§

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

§

impl<P, T> Unpin for SeparatedBy<P, T>
where P: Unpin, T: Unpin,

§

impl<P, T> UnwindSafe for SeparatedBy<P, T>
where P: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.