pub struct Input { /* private fields */ }
Implementations§
Source§impl Input
impl Input
Sourcepub fn with_lookahead(
self,
k: usize,
) -> BufferedStream<State<Input, SpanPosition>>
pub fn with_lookahead( self, k: usize, ) -> BufferedStream<State<Input, SpanPosition>>
Wraps the input in a BufferedStream that supports lookahead grammars.
By default combine
produces an LL(1) parser, unless the attempt
combinator is used, so 1
is the recommended default value for k
.
Trait Implementations§
Source§impl DefaultPositioned for Input
impl DefaultPositioned for Input
type Positioner = SpanPosition
Source§impl From<Input> for TokenStream
impl From<Input> for TokenStream
Source§fn from(input: Input) -> TokenStream
fn from(input: Input) -> TokenStream
Converts to this type from the input type.
Source§impl From<TokenStream> for Input
impl From<TokenStream> for Input
Source§fn from(stream: TokenStreamBuiltin) -> Input
fn from(stream: TokenStreamBuiltin) -> Input
Converts to this type from the input type.
Source§impl From<TokenStream> for Input
impl From<TokenStream> for Input
Source§fn from(stream: TokenStream) -> Input
fn from(stream: TokenStream) -> Input
Converts to this type from the input type.
Source§impl Positioned for Input
impl Positioned for Input
Source§impl StreamOnce for Input
impl StreamOnce for Input
Source§type Range = <Input as StreamOnce>::Item
type Range = <Input as StreamOnce>::Item
The type of a range of items yielded from this stream.
Types which do not a have a way of yielding ranges of items should just use the
Self::Item
for this type.Source§type Position = usize
type Position = usize
Type which represents the position in a stream.
Ord
is required to allow parsers to determine which of two positions are further ahead.type Error = Error<<Input as StreamOnce>::Item, <Input as StreamOnce>::Range>
Source§fn uncons(&mut self) -> Result<Self::Item, StreamErrorFor<Self>>
fn uncons(&mut self) -> Result<Self::Item, StreamErrorFor<Self>>
Takes a stream and removes its first item, yielding the item and the rest of the elements.
Returns
Err
if no element could be retrieved.Source§fn is_partial(&self) -> bool
fn is_partial(&self) -> bool
Returns
true
if this stream only contains partial input. Read moreAuto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl !Send for Input
impl !Sync for Input
impl Unpin for Input
impl UnwindSafe for Input
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more