[][src]Struct combine::stream::read::Stream

pub struct Stream<R> { /* fields omitted */ }
This is supported on crate feature std only.

Implementations

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

pub fn new(read: R) -> Stream<R>[src]

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::read;
use combine::stream::buffered;
use combine::stream::position;
use std::io::Read;

let input: &[u8] = b"123,";
let stream = buffered::Stream::new(position::Stream::new(read::Stream::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',')));

Trait Implementations

impl<R> DefaultPositioned for Stream<R>[src]

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

type Token = u8

The type of items which is yielded from this stream.

type Range = &'static [u8]

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::Token for this type. Read more

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. Read more

type Error = Error

Auto Trait Implementations

impl<R> RefUnwindSafe for Stream<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for Stream<R> where
    R: Send
[src]

impl<R> Sync for Stream<R> where
    R: Sync
[src]

impl<R> Unpin for Stream<R> where
    R: Unpin
[src]

impl<R> UnwindSafe for Stream<R> where
    R: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.