pub struct SynthClient { /* private fields */ }Implementations§
Source§impl SynthClient
impl SynthClient
pub fn new(base_url: impl Into<String>, api_key: impl Into<String>) -> Self
pub fn from_env() -> Result<Self>
pub fn api_base(&self) -> String
pub fn base_url(&self) -> &str
pub fn api_key(&self) -> &str
pub fn http(&self) -> &Client
pub async fn get_json(&self, path: &str, auth: AuthStyle) -> Result<Value>
pub async fn post_json<T: Serialize + ?Sized>( &self, path: &str, body: &T, auth: AuthStyle, ) -> Result<Value>
pub async fn get_json_fallback( &self, paths: &[&str], auth: AuthStyle, ) -> Result<Value>
pub async fn post_json_fallback<T: Serialize + ?Sized>( &self, paths: &[&str], body: &T, auth: AuthStyle, ) -> Result<Value>
Trait Implementations§
Source§impl Clone for SynthClient
impl Clone for SynthClient
Source§fn clone(&self) -> SynthClient
fn clone(&self) -> SynthClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SynthClient
impl !RefUnwindSafe for SynthClient
impl Send for SynthClient
impl Sync for SynthClient
impl Unpin for SynthClient
impl !UnwindSafe for SynthClient
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