pub fn read_input_from<R, T>(
reader: &mut R,
prompt: Option<Arguments<'_>>,
) -> Result<T, InputError<T::Err>>Expand description
A single function that:
- Optionally prints a prompt (and flushes).
- Reads one line from the provided
BufRead. - Returns
Err(InputError::Eof)if EOF is reached. - Parses into type
T, returningErr(InputError::Parse)on failure. - Returns
Err(InputError::Io)on I/O failure.