pub trait Input {
// Required method
fn next_line(&mut self, context: &Context) -> impl Future<Output = Result>;
}
Expand description
Line-oriented source code reader
An Input
implementor provides the parser with source code by reading from underlying source.
InputObject
is an object-safe version of this trait.
Required Methods§
Sourcefn next_line(&mut self, context: &Context) -> impl Future<Output = Result>
fn next_line(&mut self, context: &Context) -> impl Future<Output = Result>
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.