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:
REVAI_API_KEY
Panics
This function will panic if the expected environment variables can not be found
pub fn account(&self) -> Account
pub fn jobs(&self) -> Jobs
pub fn transcript(&self) -> Transcript
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§
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