pub fn ask_user<'a, 'b, S, T>(
question: S,
answers: &'a [Answer<'b, T>],
) -> Result<&'a Answer<'b, T>>Expand description
ยงAsks user some question
Notes:
-
The question will be printed first. Then one line break. Then each answer will be printed on each line.
-
The user can enter either:
- An answer index.
- Or some part of an answer.
-
The function will start again if:
- The user enters a wrong index.
- The phrase entered is presented in more than one answer.
-
The function returns an error if you provide duplicate answers, or no answers at all.