Function hors::get_answers[][src]

pub async fn get_answers(links: &[String], conf: Config) -> Result<String>

Get answers from given links.

This function will go through network to find out answers.

Examples

use hors::{answer, Config, OutputOption};

let conf: Config = Config::new(OutputOption::All, 1, false);
let links: Vec<String> = vec![
    String::from("https://stackoverflow.com/questions/7771011/how-to-parse-data-in-json")
];
let answers: String = hors::get_answers(&links, conf).await.unwrap();
assert!(
    answers.contains(
        r#"data = json.loads('{"one" : "1", "two" : "2", "three" : "3"}')"#
    )
);

Returns

If search answers successfully, it will return the result string which can be print to terminal directly. Else return an Error.