pub fn optional_select<R, W>(self, stream: &mut MenuStream<R, W>) -> MenuResult<Option<T>>
    where
        R: BufRead,
        W: Write,
    {
        // Uses the alternate form of selection field display
        // to display the "(optional)" string slice message.
        show(&format!("{:#}", self), stream)?;

        Ok(self.prompt_once(stream)?.map(|i| {
            // SAFETY: the `Selected::prompt_once` guarantees that the index is in bounds.
            unsafe { self.take(i) }
        }))
    }
/// Prompts the selectable fields and returns the value at the input index,
/// or `None` if the index is incorrect.
///
/// It prompts the selectable fields once, and if the user entered a correct index,
/// it returns `Some(value)` where `value` corresponds to the value mapped to this index,
/// otherwise, it attempts to return the value mapped by the default index
/// (see `Selected::default`), and if there is no default index, it returns `None`.
///
/// The output is wrapped in a [`MenuResult`] to prevent from any error (see [`MenuError`]).
Prompts the selectable fields and returns the value at the input index,
or `None` if the index is incorrect.



The output is wrapped in a [`MenuResult`] to prevent from any error .
Prompts the selectable fields and returns the value at the input index or ` None ` if the index is incorrect . The output is wrapped in a [ ` MenuResult ` ] to prevent from any error .
pub fn optional_select<R, W>(self, stream: &mut MenuStream<R, W>) -> MenuResult<Option<T>>
    where
        R: BufRead,
        W: Write,
    {
        // Uses the alternate form of selection field display
        // to display the "(optional)" string slice message.
        show(&format!("{:#}", self), stream)?;
        Ok(self.prompt_once(stream)?.map(|i| {
            // SAFETY: the `Selected::prompt_once` guarantees that the index is in bounds.
            unsafe { self.take(i) }
        }))
    }
pub fn optional_select < R , W > ( self , stream : & mut MenuStream < R , W > ) -> MenuResult < Option < T > > where R : BufRead , W : Write , { // Uses the alternate form of selection field display // to display the "(optional)" string slice message. show ( & format ! ( " " self ) , stream ) ? ; Ok ( self . prompt_once ( stream ) ? . map ( | i | { // SAFETY: the `Selected::prompt_once` guarantees that the index is in bounds. unsafe { self . take ( i ) } } ) ) }
Prompts the selectable fields and returns the value at the input index,
or `None` if the index is incorrect.
Prompts the selectable fields and returns the value at the input index or ` None ` if the index is incorrect .
self
stream
&mut MenuStream<R, W>