pub fn prompt_until_with<R, W, T, F>(
        &self,
        stream: &mut MenuStream<R, W>,
        til: F,
        fmt: &Format<'a>,
    ) -> MenuResult<T>
    where
        R: BufRead,
        W: Write,
        T: FromStr,
        F: Fn(&T) -> bool,
    {
        let fmt = self.fmt.merged(fmt);
        self.first_line(stream, &fmt, false)?;

        // Loops while incorrect input.
        loop {
            match self.prompt_once(stream, &fmt, false)? {
                Some(out) if til(&out) => return Ok(out),
                _ => continue,
            }
        }
    }
/// Prompts the field until the constraint is applied, using the given format.
///
/// It uses the merged version between the format of the written field and the given format.
/// After checking and parsing the value provided by the user, it calls the `til` function.
/// The output is wrapped in a [`MenuResult`] to prevent from any error (see [`MenuError`]);
///
/// # Panic
///
/// If the default value has an incorrect type, this function will panic.
Prompts the field until the constraint is applied, using the given format.
It uses the merged version between the format of the written field and the given format.
After checking and parsing the value provided by the user, it calls the `til` function.
The output is wrapped in a [`MenuResult`] to prevent from any error .
Prompts the field until the constraint is applied using the given format . It uses the merged version between the format of the written field and the given format . After checking and parsing the value provided by the user it calls the ` til ` function . The output is wrapped in a [ ` MenuResult ` ] to prevent from any error .
pub fn prompt_until_with<R, W, T, F>(
        &self,
        stream: &mut MenuStream<R, W>,
        til: F,
        fmt: &Format<'a>,
    ) -> MenuResult<T>
    where
        R: BufRead,
        W: Write,
        T: FromStr,
        F: Fn(&T) -> bool,
    {
        let fmt = self.fmt.merged(fmt);
        self.first_line(stream, &fmt, false)?;
        // Loops while incorrect input.
        loop {
            match self.prompt_once(stream, &fmt, false)? {
                Some(out) if til(&out) => return Ok(out),
                _ => continue,
            }
        }
    }
pub fn prompt_until_with < R , W , T , F > ( & self , stream : & mut MenuStream < R , W > , til : F , fmt : & Format < ' a > , ) -> MenuResult < T > where R : BufRead , W : Write , T : FromStr , F : Fn ( & T ) -> bool , { let fmt = self . fmt . merged ( fmt ) ; self . first_line ( stream , & fmt , false ) ? ; // Loops while incorrect input. loop { match self . prompt_once ( stream , & fmt , false ) ? { Some ( out ) if til ( & out ) => return Ok ( out ) , _ => continue , } } }
Prompts the field until the constraint is applied, using the given format.
Prompts the field until the constraint is applied using the given format .
&self
stream
&mut MenuStream<R, W>
til
F
fmt
&Format<'a>
panic
If the default value has an incorrect type, this function will panic.
If the default value has an incorrect type this function will panic .