[][src]Trait mini_haskell::utils::char::Stream

pub trait Stream {
    fn peek(&mut self) -> Option<char>;
fn next(&mut self) -> Option<char>; fn match<'a>(&mut self, s: &'a str) -> Option<&'a str> { ... }
fn span<T>(
        &mut self,
        f: impl FnMut(char) -> bool,
        init: T,
        join: impl FnMut(&mut T, char)
    ) -> T { ... }
fn span_collect(&mut self, f: impl FnMut(char) -> bool) -> Vec<char> { ... }
fn span_collect_string(&mut self, f: impl FnMut(char) -> bool) -> String { ... }
fn span_(&mut self, f: impl FnMut(char) -> bool) { ... } }

A character stream, common interface for macros here.

Required methods

fn peek(&mut self) -> Option<char>

Peek the next character without consuming it.

fn next(&mut self) -> Option<char>

Take the next character and consume it.

Loading content...

Provided methods

fn match<'a>(&mut self, s: &'a str) -> Option<&'a str>

Match a string against the input.

fn span<T>(
    &mut self,
    f: impl FnMut(char) -> bool,
    init: T,
    join: impl FnMut(&mut T, char)
) -> T

Pop many characters until the predicate fails.

fn span_collect(&mut self, f: impl FnMut(char) -> bool) -> Vec<char>

Pop many characters until the predicate fails, collect them into a Vec.

fn span_collect_string(&mut self, f: impl FnMut(char) -> bool) -> String

Pop many characters until the predicate fails, collect them into a String.

fn span_(&mut self, f: impl FnMut(char) -> bool)

Pop many characters until the predicate fails, ignore the characters.

Loading content...

Implementors

impl<I: Read> Stream for Scanner<I>[src]

Loading content...