Struct combine::primitives::ReadStream [] [src]

pub struct ReadStream<R> { /* fields omitted */ }

Methods

impl<R> ReadStream<R> where
    R: Read
[src]

Creates a StreamOnce instance from a value implementing std::io::Read.

use combine::*;
use combine::byte::*;
use combine::primitives::{BufferedStream, ReadStream};
use std::io::Read;

let mut input: &[u8] = b"123,";
let stream = BufferedStream::new(ReadStream::new(&mut input), 1);
let result = (many(digit()), byte(b','))
    .parse(stream.as_stream())
    .map(|t| t.0);
assert_eq!(result, Ok((vec![b'1', b'2', b'3'], b',')));

Trait Implementations

impl<R: Read> StreamOnce for ReadStream<R>
[src]

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 the current position of the stream.

Auto Trait Implementations

impl<R> Send for ReadStream<R> where
    R: Send

impl<R> Sync for ReadStream<R> where
    R: Sync