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 moreAuto Trait Implementations§
impl Freeze for VerityClient
impl !RefUnwindSafe for VerityClient
impl Send for VerityClient
impl Sync for VerityClient
impl Unpin for VerityClient
impl !UnwindSafe for VerityClient
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)