actix-webfinger/examples/fetch.rs

20 lines
401 B
Rust
Raw Permalink Normal View History

2019-01-27 20:45:44 +00:00
use actix_webfinger::Webfinger;
2021-03-10 01:58:42 +00:00
use awc::Client;
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();
2021-11-18 16:18:06 +00:00
let wf = Webfinger::fetch(
&client,
Some("acct:"),
"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
}