Struct RequestBuilder Copy item path Source pub struct RequestBuilder { }
Expand description A builder for a WebFinger request.
This is used to construct a Request
for a WebFinger query.
§ Examples
use webfinger_rs::WebFingerRequest;
let query = WebFingerRequest::builder("acct:carol@example.com" )?
.host("example.com" )
.rel("http://webfinger.net/rel/profile-page" )
.build();
Creates a new WebFinger request builder.
This will use the given URI as the resource for the query.
§ Errors
This will return an error if the URI is invalid.
Sets the host for the query.
4 async fn main() -> Result <(), Box<dyn std::error::Error>> {
5 let request = WebFingerRequest::builder("acct:carol@example.com" )?
6 .host ("example.com" )
7 .rel("http://webfinger.net/rel/profile-page" )
8 .build();
9 let response = request.execute_reqwest().await ? ;
10 dbg! (response);
11 Ok (())
12 }
Adds a link relation type to the query.
§ Examples
use webfinger_rs::WebFingerRequest;
let query = WebFingerRequest::builder("acct:carol@example.com" )?
.rel("http://webfinger.net/rel/profile-page" )
.build();
4 async fn main() -> Result <(), Box<dyn std::error::Error>> {
5 let request = WebFingerRequest::builder("acct:carol@example.com" )?
6 .host("example.com" )
7 .rel ("http://webfinger.net/rel/profile-page" )
8 .build();
9 let response = request.execute_reqwest().await ? ;
10 dbg! (response);
11 Ok (())
12 }
Builds the WebFinger request.
4 async fn main() -> Result <(), Box<dyn std::error::Error>> {
5 let request = WebFingerRequest::builder("acct:carol@example.com" )?
6 .host("example.com" )
7 .rel("http://webfinger.net/rel/profile-page" )
8 .build ();
9 let response = request.execute_reqwest().await ? ;
10 dbg! (response);
11 Ok (())
12 }
Formats the value using the given formatter.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more Returns the argument unchanged.
Instruments this type with the provided
Span
, returning an
Instrumented
wrapper.
Read more Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From <T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.