Struct FlatPairs

struct FlatPairs<'i, R> { ... }

An iterator over Pairs. It is created by Pairs::flatten.

Implementations

impl<'i, R: RuleType> FlatPairs<'i, R>

fn tokens(self: Self) -> Tokens<'i, R>

Returns the Tokens for these pairs.

Examples

# use std::rc::Rc;
# use pest;
# #[allow(non_camel_case_types)]
# #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
enum Rule {
    a
}

let input = "";
let pairs = pest::state(input, |state| {
    // generating Token pair with Rule::a ...
#     state.rule(Rule::a, |s| Ok(s))
}).unwrap();
let tokens: Vec<_> = pairs.flatten().tokens().collect();

assert_eq!(tokens.len(), 2);

impl<'i, R> Freeze for FlatPairs<'i, R>

impl<'i, R> RefUnwindSafe for FlatPairs<'i, R>

impl<'i, R> Send for FlatPairs<'i, R>

impl<'i, R> Sync for FlatPairs<'i, R>

impl<'i, R> Unpin for FlatPairs<'i, R>

impl<'i, R> UnsafeUnpin for FlatPairs<'i, R>

impl<'i, R> UnwindSafe for FlatPairs<'i, R>

impl<'i, R: Clone> Clone for FlatPairs<'i, R>

fn clone(self: &Self) -> FlatPairs<'i, R>

impl<'i, R: RuleType> Debug for FlatPairs<'i, R>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<'i, R: RuleType> DoubleEndedIterator for FlatPairs<'i, R>

fn next_back(self: &mut Self) -> Option<<Self as >::Item>

impl<'i, R: RuleType> ExactSizeIterator for FlatPairs<'i, R>

fn len(self: &Self) -> usize

impl<'i, R: RuleType> Iterator for FlatPairs<'i, R>

fn next(self: &mut Self) -> Option<<Self as >::Item>
fn size_hint(self: &Self) -> (usize, Option<usize>)

impl<I> IntoIterator for FlatPairs<'i, R>

fn into_iter(self: Self) -> I

impl<T> Any for FlatPairs<'i, R>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for FlatPairs<'i, R>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for FlatPairs<'i, R>

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

impl<T> CloneToUninit for FlatPairs<'i, R>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for FlatPairs<'i, R>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for FlatPairs<'i, R>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for FlatPairs<'i, R>

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for FlatPairs<'i, R>

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

impl<T, U> TryInto for FlatPairs<'i, R>

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