Trait yash_syntax::input::Input
source · [−]pub trait Input {
fn next_line<'life0, 'life1, 'async_trait>(
&'life0 mut self,
context: &'life1 Context
) -> Pin<Box<dyn Future<Output = Result> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}
Expand description
Line-oriented source code reader.
An Input
object provides the parser with source code by reading from underlying source.
Required methods
Reads a next line of the source code.
The input function is line-oriented; that is, this function returns a string that is terminated by a newline unless the end of input (EOF) is reached, in which case the remaining characters up to the EOF must be returned without a trailing newline. If there are no more characters at all, the returned line is empty.
Errors returned from this function are considered unrecoverable. Once an error is returned, this function should not be called any more.
Because the current Rust compiler does not support async
functions in a trait, this
function is explicitly declared to return a Future
in a pinned box.