Trait proconio::source::Source

source ·
pub trait Source<R: BufRead> {
    // Required methods
    fn next_token(&mut self) -> Option<&str>;
    fn is_empty(&mut self) -> bool;

    // Provided method
    fn next_token_unwrap(&mut self) -> &str { ... }
}
Expand description

The main trait. Types implementing this trait can be used for source of input! macro.

Required Methods§

source

fn next_token(&mut self) -> Option<&str>

Gets a whitespace-splitted next token.

source

fn is_empty(&mut self) -> bool

Check if tokens are empty

Provided Methods§

source

fn next_token_unwrap(&mut self) -> &str

Force gets a whitespace-splitted next token.

Implementations on Foreign Types§

source§

impl<R: BufRead, S: Source<R>> Source<R> for &mut S

source§

fn next_token(&mut self) -> Option<&str>

source§

fn is_empty(&mut self) -> bool

Implementors§

source§

impl<R: BufRead> Source<R> for StdinSource<R>

source§

impl<R: BufRead> Source<R> for LineSource<R>

source§

impl<R: BufRead> Source<R> for OnceSource<R>