Struct chomp::buffer::InputBuf
[−]
[src]
#[must_use]pub struct InputBuf<'a, I: 'a>(_, _);
Input buffer type which contains a flag which tells if we might need to read more data.
Methods
impl<'a, I: 'a> InputBuf<'a, I>
[src]
fn new(buf: &'a [I]) -> Self
Creates a new input buffer with incomplete set to false.
fn is_incomplete(&self) -> bool
Returns true if parsers want to obtain more data.
The result of the parsing is only accurate if this is false after completed parsing.
fn len(&self) -> usize
Returns the length of the contained buffer, may be an incomplete buffer.
fn is_empty(&self) -> bool
Returns true if the contained buffer is empty, may return true even when incomplete.
Trait Implementations
impl<'a, I: Debug + 'a> Debug for InputBuf<'a, I>
[src]
impl<'a, I: Eq + 'a> Eq for InputBuf<'a, I>
[src]
impl<'a, I: PartialEq + 'a> PartialEq for InputBuf<'a, I>
[src]
fn eq(&self, __arg_0: &InputBuf<'a, I>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &InputBuf<'a, I>) -> bool
This method tests for !=
.
impl<'a, I: Ord + 'a> Ord for InputBuf<'a, I>
[src]
fn cmp(&self, __arg_0: &InputBuf<'a, I>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<'a, I: PartialOrd + 'a> PartialOrd for InputBuf<'a, I>
[src]
fn partial_cmp(&self, __arg_0: &InputBuf<'a, I>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &InputBuf<'a, I>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &InputBuf<'a, I>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &InputBuf<'a, I>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &InputBuf<'a, I>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, I: Hash + 'a> Hash for InputBuf<'a, I>
[src]
fn hash<__HI: Hasher>(&self, __arg_0: &mut __HI)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a, I: Copy + PartialEq> Input for InputBuf<'a, I>
[src]
type Token = I
The token type of the input.
type Marker = &'a [I]
type Buffer = &'a [I]
The buffer type yielded by this input when multiple tokens are consumed in sequence. Read more
fn _peek(&mut self, _g: Guard) -> Option<Self::Token>
fn _pop(&mut self, g: Guard) -> Option<Self::Token>
fn _consume(&mut self, _g: Guard, n: usize) -> Option<Self::Buffer>
fn _consume_while<F>(&mut self, g: Guard, f: F) -> Self::Buffer where
F: FnMut(Self::Token) -> bool,
F: FnMut(Self::Token) -> bool,
fn _consume_from(&mut self, _g: Guard, m: Self::Marker) -> Self::Buffer
fn _consume_remaining(&mut self, _g: Guard) -> Self::Buffer
fn _mark(&self, _g: Guard) -> Self::Marker
fn _restore(self, _g: Guard, m: Self::Marker) -> Self
fn ret<T, E>(self, t: T) -> ParseResult<Self, T, E>
Returns t
as a success value in the parsing context. Read more
fn err<T, E>(self, e: E) -> ParseResult<Self, T, E>
Returns e
as an error value in the parsing context. Read more
fn from_result<T, E>(self, r: Result<T, E>) -> ParseResult<Self, T, E>
Converts a Result
into a ParseResult
, preserving parser state. Read more