actix-webfinger/examples/fetch.rs

13 lines
348 B
Rust
Raw Normal View History

2020-03-16 01:03:35 +00:00
use actix_web::client::Client;
2019-01-27 20:45:44 +00:00
use actix_webfinger::Webfinger;
2019-05-12 17:19:49 +00:00
use std::error::Error;
2019-01-27 20:45:44 +00:00
2020-03-16 01:03:35 +00:00
#[actix_rt::main]
async fn main() -> Result<(), Box<dyn Error>> {
let client = Client::default();
2020-04-21 19:08:59 +00:00
let wf = Webfinger::fetch(&client, "asonix@localhost:8000", "localhost:8000", false).await?;
2019-01-27 20:45:44 +00:00
2020-03-16 01:03:35 +00:00
println!("asonix's webfinger:\n{:#?}", wf);
2019-05-12 17:19:49 +00:00
Ok(())
2019-01-27 20:45:44 +00:00
}