Lines Matching defs:peek
11 /// An important advantage over [`ParseStream::peek`] is that here we
14 /// go ahead and use `ParseStream::peek` instead.
18 /// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
50 /// if lookahead.peek(Ident) {
52 /// } else if lookahead.peek(Lifetime) {
54 /// } else if lookahead.peek(Token![const]) {
78 peek: fn(Cursor) -> bool,
81 if peek(lookahead.cursor) {
94 /// Note that this method does not use turbofish syntax. Pass the peek type
97 /// - `input.peek(Token![struct])`
98 /// - `input.peek(Token![==])`
99 /// - `input.peek(Ident)` *(does not accept keywords)*
100 /// - `input.peek(Ident::peek_any)`
101 /// - `input.peek(Lifetime)`
102 /// - `input.peek(token::Brace)`
103 pub fn peek<T: Peek>(&self, token: T) -> bool {
105 peek_impl(self, T::Token::peek, T::Token::display)
141 /// Use [`ParseStream::peek`] to peek one of these types in a parse stream
146 /// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek