pub struct HttpTransport {
client: Client,
config: TransportConfig,
}
Expand description
HTTP transport implementation
This struct handles all HTTP operations with automatic retry, error handling, and request/response logging.
Fields§
§client: Client
§config: TransportConfig
Implementations§
Source§impl HttpTransport
impl HttpTransport
Sourcepub fn with_config(config: TransportConfig) -> Result<Self>
pub fn with_config(config: TransportConfig) -> Result<Self>
Creates a new HTTP transport with custom configuration
Sourcepub async fn post_json<T: Serialize>(
&self,
url: &str,
api_key: &ApiKey,
body: &T,
) -> Result<Response>
pub async fn post_json<T: Serialize>( &self, url: &str, api_key: &ApiKey, body: &T, ) -> Result<Response>
Sourcepub async fn parse_json<T>(&self, response: Response) -> Result<T>where
T: DeserializeOwned,
pub async fn parse_json<T>(&self, response: Response) -> Result<T>where
T: DeserializeOwned,
Sourcepub fn config(&self) -> &TransportConfig
pub fn config(&self) -> &TransportConfig
Gets the current transport configuration
Trait Implementations§
Source§impl Debug for HttpTransport
impl Debug for HttpTransport
Auto Trait Implementations§
impl Freeze for HttpTransport
impl !RefUnwindSafe for HttpTransport
impl Send for HttpTransport
impl Sync for HttpTransport
impl Unpin for HttpTransport
impl !UnwindSafe for HttpTransport
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