pub fn many_values_until_with<R, W, T, S, F>(
        &self,
        stream: &mut MenuStream<R, W>,
        sep: S,
        til: F,
        fmt: &Format<'_>,
    ) -> MenuResult<Vec<T>>
    where
        R: BufRead,
        W: Write,
        T: FromStr,
        S: AsRef<str>,
        F: Fn(&T) -> bool,
    {
        fn inner_prompt_once<R: BufRead, W: Write, T: FromStr>(
            w: &Written<'_>,
            stream: &mut MenuStream<R, W>,
            sep: &str,
            fmt: &Format<'_>,
        ) -> MenuResult<Option<Vec<T>>> {
            let s = w.prompt_line(stream, fmt, false)?;
            let res: Result<Vec<T>, T::Err> = s.split(sep).map(T::from_str).collect();

            Ok(res.ok().or_else(|| {
                let default = w.default.as_ref()?;
                let res: Result<Vec<T>, T::Err> = default.split(sep).map(T::from_str).collect();
                Some(res.unwrap_or_else(|_| default_failed::<T>(default)))
            }))
        }

        let fmt = self.fmt.merged(fmt);
        self.first_line(stream, &fmt, false)?;
        let s = sep.as_ref();

        // Loops while incorrect input.
        loop {
            match inner_prompt_once(self, stream, s, &fmt)? {
                Some(v) if v.iter().all(&til) => return Ok(v),
                _ => continue,
            }
        }
    }
/// Prompts the field and returns the inputs as a `Vec<T>` until the given
/// constraint is applied to all the values, using `sep` to split the input
/// into the output values, and 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 values provided by the user, it calls the `til` function.
/// The output is wrapped in a [`MenuResult`] to prevent from any error (see [`MenuError`]);
///
/// # Panics
///
/// If the default value has an incorrect type, this function will panic.
Prompts the field and returns the inputs as a `Vec` until the given
constraint is applied to all the values, using `sep` to split the input
into the output values, and 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 values provided by the user, it calls the `til` function.
The output is wrapped in a [`MenuResult`] to prevent from any error .
Prompts the field and returns the inputs as a ` Vec ` until the given constraint is applied to all the values using ` sep ` to split the input into the output values and 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 values provided by the user it calls the ` til ` function . The output is wrapped in a [ ` MenuResult ` ] to prevent from any error .
pub fn many_values_until_with<R, W, T, S, F>(
        &self,
        stream: &mut MenuStream<R, W>,
        sep: S,
        til: F,
        fmt: &Format<'_>,
    ) -> MenuResult<Vec<T>>
    where
        R: BufRead,
        W: Write,
        T: FromStr,
        S: AsRef<str>,
        F: Fn(&T) -> bool,
    {
        fn inner_prompt_once<R: BufRead, W: Write, T: FromStr>(
            w: &Written<'_>,
            stream: &mut MenuStream<R, W>,
            sep: &str,
            fmt: &Format<'_>,
        ) -> MenuResult<Option<Vec<T>>> {
            let s = w.prompt_line(stream, fmt, false)?;
            let res: Result<Vec<T>, T::Err> = s.split(sep).map(T::from_str).collect();
            Ok(res.ok().or_else(|| {
                let default = w.default.as_ref()?;
                let res: Result<Vec<T>, T::Err> = default.split(sep).map(T::from_str).collect();
                Some(res.unwrap_or_else(|_| default_failed::<T>(default)))
            }))
        }
        let fmt = self.fmt.merged(fmt);
        self.first_line(stream, &fmt, false)?;
        let s = sep.as_ref();
        // Loops while incorrect input.
        loop {
            match inner_prompt_once(self, stream, s, &fmt)? {
                Some(v) if v.iter().all(&til) => return Ok(v),
                _ => continue,
            }
        }
    }
pub fn many_values_until_with < R , W , T , S , F > ( & self , stream : & mut MenuStream < R , W > , sep : S , til : F , fmt : & Format < ' _ > , ) -> MenuResult < Vec < T > > where R : BufRead , W : Write , T : FromStr , S : AsRef < str > , F : Fn ( & T ) -> bool , { fn inner_prompt_once < R : BufRead , W : Write , T : FromStr > ( w : & Written < ' _ > , stream : & mut MenuStream < R , W > , sep : & str , fmt : & Format < ' _ > , ) -> MenuResult < Option < Vec < T > > > { let s = w . prompt_line ( stream , fmt , false ) ? ; let res : Result < Vec < T > , T :: Err > = s . split ( sep ) . map ( T :: from_str ) . collect ( ) ; Ok ( res . ok ( ) . or_else ( | | { let default = w . default . as_ref ( ) ? ; let res : Result < Vec < T > , T :: Err > = default . split ( sep ) . map ( T :: from_str ) . collect ( ) ; Some ( res . unwrap_or_else ( | _ | default_failed :: < T > ( default ) ) ) } ) ) } let fmt = self . fmt . merged ( fmt ) ; self . first_line ( stream , & fmt , false ) ? ; let s = sep . as_ref ( ) ; // Loops while incorrect input. loop { match inner_prompt_once ( self , stream , s , & fmt ) ? { Some ( v ) if v . iter ( ) . all ( & til ) => return Ok ( v ) , _ => continue , } } }
Prompts the field and returns the inputs as a `Vec<T>` until the given
constraint is applied to all the values, using `sep` to split the input
into the output values, and using the given format.
Prompts the field and returns the inputs as a ` Vec<T > ` until the given constraint is applied to all the values using ` sep ` to split the input into the output values and using the given format .
&self
stream
&mut MenuStream<R, W>
sep
S
til
F
fmt
&Format<'_>
panics
If the default value has an incorrect type, this function will panic.
If the default value has an incorrect type this function will panic .