pub struct Client { /* private fields */ }Expand description
Entrypoint for interacting with the API client.
Implementations
sourceimpl Client
impl Client
sourcepub fn new<T>(token: T) -> Selfwhere
T: ToString,
pub fn new<T>(token: T) -> Selfwhere
T: ToString,
Create a new Client struct. It takes a type that can convert into
an &str (String or Vec<u8> for example). As long as the function is
given a valid API key your requests will work.
sourcepub fn with_host<H>(&self, host: H) -> Selfwhere
H: ToString,
pub fn with_host<H>(&self, host: H) -> Selfwhere
H: ToString,
Override the default host for the client.
sourcepub fn new_from_env() -> Self
pub fn new_from_env() -> Self
Create a new Client struct from environment variables. It
takes a type that can convert into
an &str (String or Vec<u8> for example). As long as the function is
given a valid API key and your requests will work.
We pass in the token and refresh token to the client so if you are storing
it in a database, you can get it first.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more