Struct termimad::Question [−][src]
pub struct Question {
pub md: Option<String>,
pub answers: Vec<Answer>,
pub default_answer: Option<String>,
}
Expand description
a question that can be asked to the user, requiring him to type the key of the desired answer
A question can be built using Question::new or with the ask! macro
Fields
md: Option<String>
answers: Vec<Answer>
default_answer: Option<String>
Implementations
add a proposed answer, with a key
The user will have to type the result of calling to_string()
on
the key (numbers, chars, or strings are naturally good options for keys)
set the value which will be returned if the user only hits enter.
It does not have to be one of the answers’ key, except when you use the ask! macro.
has a default been defined which isn’t among the list of answers?