Trait 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>