pub struct AnswerCollection {
pub answer_sets: Vec<AnswerSet>,
}Fields§
§answer_sets: Vec<AnswerSet>Implementations§
Source§impl AnswerCollection
impl AnswerCollection
Sourcepub fn get_first_answer(&mut self) -> Option<String>
pub fn get_first_answer(&mut self) -> Option<String>
Examples found in repository?
examples/confirm.rs (line 14)
5fn main() {
6 // let mut ask = ask::Ask::new();
7 // ask.question(OpenEnded::new( "question?".to_string()));
8 // ask.all();
9 let mut confirm = Confirm::new("with cheese?".to_string());
10
11 match confirm.send(){
12 Ok(mut answer_collections) => {
13 println!("");
14 println!("{}", answer_collections.get_first_answer().unwrap()); //should be safe to unwrap on confirm
15 },
16 Err(error_str) => {panic!(error_str)}
17 }
18
19
20}Auto Trait Implementations§
impl Freeze for AnswerCollection
impl RefUnwindSafe for AnswerCollection
impl Send for AnswerCollection
impl Sync for AnswerCollection
impl Unpin for AnswerCollection
impl UnsafeUnpin for AnswerCollection
impl UnwindSafe for AnswerCollection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more