pub fn select<R: BufRead, W: Write>(
    stream: &mut MenuStream<R, W>,
    suffix: &str,
    max: usize,
) -> MenuResult<Option<usize>> {
    let s = prompt(suffix, stream)?;
    Ok(match s.parse::<usize>() {
        Ok(i) if i >= 1 && i <= max => Some(i - 1),
        _ => None,
    })
}
/// Prompts the user to enter an index to select a value among the available values.
/// 
/// The available values are in theory printed before calling this function.
Prompts the user to enter an index to select a value among the available values.
The available values are in theory printed before calling this function.
Prompts the user to enter an index to select a value among the available values . The available values are in theory printed before calling this function .
pub fn select<R: BufRead, W: Write>(
    stream: &mut MenuStream<R, W>,
    suffix: &str,
    max: usize,
) -> MenuResult<Option<usize>> {
    let s = prompt(suffix, stream)?;
    Ok(match s.parse::<usize>() {
        Ok(i) if i >= 1 && i <= max => Some(i - 1),
        _ => None,
    })
}
pub fn select < R : BufRead , W : Write > ( stream : & mut MenuStream < R , W > , suffix : & str , max : usize , ) -> MenuResult < Option < usize > > { let s = prompt ( suffix , stream ) ? ; Ok ( match s . parse :: < usize > ( ) { Ok ( i ) if i >= 1 && i <= max => Some ( i - 1 ) , _ => None , } ) }
Prompts the user to enter an index to select a value among the available values.
Prompts the user to enter an index to select a value among the available values .
stream
&mut MenuStream<R, W>
suffix
&str
max
usize