Trait Source

Source
pub trait Source<R>
where 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, S> Source<R> for &mut S
where R: BufRead, S: Source<R>,

Source§

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

Source§

fn is_empty(&mut self) -> bool

Implementors§

Source§

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

Source§

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

Source§

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