Trait nommy::Peek[][src]

pub trait Peek<T>: Sized {
    fn peek(input: &mut impl Buffer<T>) -> bool;
}

An interface with dealing with parser-peeking. The required function peek takes in a Cursor iterator and will attempt to loosely parse the data provided, asserting that if the equivalent Buffer is given to the Parse::parse function, it should succeed.

use nommy::{Peek, Buffer, IntoBuf, text::Tag};
let mut buffer = ".".chars().into_buf();
assert!(Tag::<".">::peek(&mut buffer.cursor()));

Required methods

fn peek(input: &mut impl Buffer<T>) -> bool[src]

Loading content...

Implementations on Foreign Types

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

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

impl<P: Peek<T>, T, const N: usize> Peek<T> for [P; N][src]

Loading content...

Implementors

impl Peek<char> for LineEnding[src]

impl Peek<char> for Space[src]

impl Peek<char> for WhiteSpace[src]

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

impl<Prefix: Peek<T>, P: Peek<T>, Suffix: Peek<T>, T> Peek<T> for SurroundedBy<Prefix, P, Suffix>[src]

impl<Prefix: Peek<T>, P: Peek<T>, T> Peek<T> for PrefixedBy<Prefix, P>[src]

impl<Suffix: Peek<T>, P: Peek<T>, T> Peek<T> for SuffixedBy<P, Suffix>[src]

impl<const BYTES: &'static [u8]> Peek<u8> for nommy::bytes::AnyOf1<BYTES>[src]

impl<const BYTES: &'static [u8]> Peek<u8> for nommy::bytes::OneOf<BYTES>[src]

impl<const BYTE_RANGE: RangeInclusive<u8>> Peek<u8> for nommy::bytes::OneInRange<BYTE_RANGE>[src]

impl<const CHARS: &'static str> Peek<char> for nommy::text::AnyOf1<CHARS>[src]

impl<const CHARS: &'static str> Peek<char> for AnyOf<CHARS>[src]

impl<const CHARS: &'static str> Peek<char> for nommy::text::OneOf<CHARS>[src]

impl<const CHARS: &'static str> Peek<char> for WhileNot1<CHARS>[src]

impl<const CHAR_RANGE: RangeInclusive<char>> Peek<char> for AnyInRange<CHAR_RANGE>[src]

impl<const CHAR_RANGE: RangeInclusive<char>> Peek<char> for nommy::text::OneInRange<CHAR_RANGE>[src]

impl<const TAG: &'static str> Peek<char> for nommy::text::Tag<TAG>[src]

impl<const TAG: &'static [u8]> Peek<u8> for nommy::bytes::Tag<TAG>[src]

Loading content...