pub struct ReadStream<R> { /* fields omitted */ }
Creates a StreamOnce
instance from a value implementing std::io::Read
.
NOTE: This type do not implement Positioned
and Clone
and must be wrapped with types
such as BufferedStreamRef
and State
to become a Stream
which can be parsed
use combine::*;
use combine::parser::byte::*;
use combine::stream::ReadStream;
use combine::stream::buffered::BufferedStream;
use combine::stream::state::State;
use std::io::Read;
let input: &[u8] = b"123,";
let stream = BufferedStream::new(State::new(ReadStream::new(input)), 1);
let result = (many(digit()), byte(b','))
.parse(stream)
.map(|t| t.0);
assert_eq!(result, Ok((vec![b'1', b'2', b'3'], b',')));
The type of items which is yielded from this stream.
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. Read more
Type which represents the position in a stream. Ord
is required to allow parsers to determine which of two positions are further ahead. Read more
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. Read more
Returns true
if this stream only contains partial input. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)