pub struct Client { /* private fields */ }
Expand description
Entrypoint for interacting with the API client.
Implementations§
Source§impl 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.
§Panics
This function will panic if the internal http client fails to create
Sourcepub fn with_host_override<H>(&mut self, host: H) -> &mut Selfwhere
H: ToString,
pub fn with_host_override<H>(&mut self, host: H) -> &mut Selfwhere
H: ToString,
Override the host for all endpoins in the client.
Sourcepub fn remove_host_override(&mut self) -> &mut Self
pub fn remove_host_override(&mut self) -> &mut Self
Disables the global host override for the client.
pub fn get_host_override(&self) -> Option<&str>
Sourcepub fn new_from_env() -> Self
pub fn new_from_env() -> Self
Create a new Client struct from environment variables.
The following environment variables are expected to be set:
GIPHY_API_KEY
§Panics
This function will panic if the expected environment variables can not be found
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe 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