pub struct HttpClient<'a, V: ApiVersion, H: HttpHandler> { /* private fields */ }
Expand description
Client wrapping a HttpHandler
structure to to perform requests with
the Fundamentum API for a specific version.
Implementations§
Source§impl<'a, H: HttpHandler> HttpClient<'a, V3, H>
impl<'a, H: HttpHandler> HttpClient<'a, V3, H>
Sourcepub fn new(config: HttpClientConfig<'a>, http_handler: H) -> Self
pub fn new(config: HttpClientConfig<'a>, http_handler: H) -> Self
Create a new HTTP client.
Sourcepub const fn config(&self) -> &HttpClientConfig<'_>
pub const fn config(&self) -> &HttpClientConfig<'_>
Get the current configuration of this client.
Sourcepub async fn send<'d, B, T>(
&'a self,
method: HttpMethod,
base_path: Option<&'a str>,
path: &'a str,
body: B,
out_buffer: &'d mut [u8],
) -> Result<T, HttpClientErrorWrapper<'d, H>>where
B: Serialize,
T: Deserialize<'d>,
pub async fn send<'d, B, T>(
&'a self,
method: HttpMethod,
base_path: Option<&'a str>,
path: &'a str,
body: B,
out_buffer: &'d mut [u8],
) -> Result<T, HttpClientErrorWrapper<'d, H>>where
B: Serialize,
T: Deserialize<'d>,
Send JSON request with the configuration and the handler.
§Errors
See HttpClientError
for the error type.
Auto Trait Implementations§
impl<'a, V, H> Freeze for HttpClient<'a, V, H>where
H: Freeze,
impl<'a, V, H> RefUnwindSafe for HttpClient<'a, V, H>where
H: RefUnwindSafe,
impl<'a, V, H> Send for HttpClient<'a, V, H>where
H: Send,
impl<'a, V, H> Sync for HttpClient<'a, V, H>where
H: Sync,
impl<'a, V, H> Unpin for HttpClient<'a, V, H>where
H: Unpin,
impl<'a, V, H> UnwindSafe for HttpClient<'a, V, H>where
H: UnwindSafe,
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