[][src]Struct join_impl::expr_chain::group::GroupDeterminer

pub struct GroupDeterminer { /* fields omitted */ }

Methods

impl GroupDeterminer[src]

pub fn new(
    group_type: impl Into<Option<ActionGroup>>,
    check_input_fn: Box<dyn Fn(ParseStream) -> bool>,
    check_parsed_fn: Option<Box<dyn Fn(TokenStream) -> bool>>,
    length: usize
) -> Self
[src]

Constructs new GroupDeterminer. Example:

extern crate join_impl;
extern crate syn;

use syn::Token;
use join_impl::expr_chain::group::GroupDeterminer;

fn main() {
    let first_comma_determiner = GroupDeterminer::new(
        None, // Because comma is not an action group
        Box::new(|input| input.peek(Token![,])),
        None,
        1
    );
}

pub fn get_group_type(&self) -> Option<ActionGroup>[src]

Returns type of group of GroupDeterminer.

pub fn check_input(&self, input: ParseStream) -> bool[src]

Checks if input next tokens are of self group type.

pub fn check_parsed(&self, input: TokenStream) -> bool[src]

Checks already parsed tokens. In many cases it's used to check if parsed tokens are valid expression. in this case we can say for sure that we found separator.

pub fn erase_input<'a>(&self, input: ParseStream<'a>) -> Result<ParseStream<'a>>[src]

Used to parse length tokens of type TokenTree from input ParseStream.

pub fn length(&self) -> usize[src]

Returns value of length field.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]