pub struct VerityClient { /* private fields */ }
Implementations§
Source§impl VerityClient
impl VerityClient
Sourcepub fn new(config: VerityClientConfig) -> Self
pub fn new(config: VerityClientConfig) -> Self
Creates a new VerityClient
with the given configuration.
Sourcepub fn get<U: IntoUrl>(&self, url: U) -> RequestBuilder
pub fn get<U: IntoUrl>(&self, url: U) -> RequestBuilder
Convenience method to make a GET
request to a URL.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub fn post<U: IntoUrl>(&self, url: U) -> RequestBuilder
pub fn post<U: IntoUrl>(&self, url: U) -> RequestBuilder
Convenience method to make a POST
request to a URL.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub fn request<U: IntoUrl>(&self, method: Method, url: U) -> RequestBuilder
pub fn request<U: IntoUrl>(&self, method: Method, url: U) -> RequestBuilder
Starts building a Request
with the specified Method
and Url
.
Returns a RequestBuilder
, which allows setting headers and
the request body before sending.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub async fn execute(&mut self, request: Request) -> Result<VerityResponse>
pub async fn execute(&mut self, request: Request) -> Result<VerityResponse>
Executes a Request
and returns a VerityResponse
.
A Request
can be built manually with Request::new()
or obtained
from a RequestBuilder with RequestBuilder::build()
.
You should prefer to use the RequestBuilder
and
RequestBuilder::send()
.
§Errors
This method fails if there was an error while sending the request, a redirect loop was detected, or the redirect limit was exhausted.
Sourcepub async fn execute_request(&mut self, req: Request) -> Result<VerityResponse>
pub async fn execute_request(&mut self, req: Request) -> Result<VerityResponse>
Executes the given request and awaits proof of execution.
§Errors
This method fails if the request cannot be sent or if proof cannot be obtained.
Sourcepub async fn get_notary_info(&self) -> Result<NotaryInformation>
pub async fn get_notary_info(&self) -> Result<NotaryInformation>
Get the information of the connected notary
Trait Implementations§
Source§impl Clone for VerityClient
impl Clone for VerityClient
Source§fn clone(&self) -> VerityClient
fn clone(&self) -> VerityClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more