pub struct Client { /* private fields */ }Expand description
A client of one server, with one API key.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(config: &HttpsConfig, key: ApiKey) -> Result<Self, HttpsError>
pub fn new(config: &HttpsConfig, key: ApiKey) -> Result<Self, HttpsError>
A client for the server config names, authenticating with key.
§Errors
HttpsError::Transport when TLS cannot be set up.
Sourcepub async fn send<F>(
&self,
what: &str,
build: F,
) -> Result<Response, HttpsError>
pub async fn send<F>( &self, what: &str, build: F, ) -> Result<Response, HttpsError>
Sends the request build makes, with the API key, repeating it as
error::next says; build is called for every attempt. Returns
the answer when it is a success.
§Errors
The last attempt’s HttpsError.
Sourcepub async fn get_json<T: DeserializeOwned>(
&self,
path: &str,
) -> Result<T, HttpsError>
pub async fn get_json<T: DeserializeOwned>( &self, path: &str, ) -> Result<T, HttpsError>
GET of a JSON document.
§Errors
As Client::send, and HttpsError::Protocol for a document
that does not read.
Sourcepub async fn viewer(&self) -> Result<Viewer, HttpsError>
pub async fn viewer(&self) -> Result<Viewer, HttpsError>
Sourcepub async fn workspace(&self) -> Result<Workspace, HttpsError>
pub async fn workspace(&self) -> Result<Workspace, HttpsError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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
Mutably borrows from an owned value. Read more