pub trait HttpClient: Send + Sync {
type Error: Send + Error;
// Required methods
fn get<T>(
&self,
url: Url,
credentials: &BmcCredentials,
etag: Option<ODataETag>,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<T, Self::Error>> + Send
where T: DeserializeOwned + Send + Sync;
fn post<B, T>(
&self,
url: Url,
body: &B,
credentials: &BmcCredentials,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<ModificationResponse<T>, Self::Error>> + Send
where B: Serialize + Send + Sync,
T: DeserializeOwned + Send + Sync;
fn patch<B, T>(
&self,
url: Url,
etag: ODataETag,
body: &B,
credentials: &BmcCredentials,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<ModificationResponse<T>, Self::Error>> + Send
where B: Serialize + Send + Sync,
T: DeserializeOwned + Send + Sync;
fn delete<T>(
&self,
url: Url,
credentials: &BmcCredentials,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<ModificationResponse<T>, Self::Error>> + Send
where T: DeserializeOwned + Send + Sync;
fn sse<T>(
&self,
url: Url,
credentials: &BmcCredentials,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<Pin<Box<dyn TryStream<Ok = T, Error = Self::Error, Item = Result<T, Self::Error>> + Send>>, Self::Error>> + Send
where T: for<'a> Deserialize<'a> + Send + 'static;
}Required Associated Types§
Required Methods§
Sourcefn get<T>(
&self,
url: Url,
credentials: &BmcCredentials,
etag: Option<ODataETag>,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<T, Self::Error>> + Send
fn get<T>( &self, url: Url, credentials: &BmcCredentials, etag: Option<ODataETag>, custom_headers: &HeaderMap, ) -> impl Future<Output = Result<T, Self::Error>> + Send
Perform an HTTP GET request with optional conditional headers.
Sourcefn post<B, T>(
&self,
url: Url,
body: &B,
credentials: &BmcCredentials,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<ModificationResponse<T>, Self::Error>> + Send
fn post<B, T>( &self, url: Url, body: &B, credentials: &BmcCredentials, custom_headers: &HeaderMap, ) -> impl Future<Output = Result<ModificationResponse<T>, Self::Error>> + Send
Perform an HTTP POST request.
Sourcefn patch<B, T>(
&self,
url: Url,
etag: ODataETag,
body: &B,
credentials: &BmcCredentials,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<ModificationResponse<T>, Self::Error>> + Send
fn patch<B, T>( &self, url: Url, etag: ODataETag, body: &B, credentials: &BmcCredentials, custom_headers: &HeaderMap, ) -> impl Future<Output = Result<ModificationResponse<T>, Self::Error>> + Send
Perform an HTTP PATCH request.
Sourcefn delete<T>(
&self,
url: Url,
credentials: &BmcCredentials,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<ModificationResponse<T>, Self::Error>> + Send
fn delete<T>( &self, url: Url, credentials: &BmcCredentials, custom_headers: &HeaderMap, ) -> impl Future<Output = Result<ModificationResponse<T>, Self::Error>> + Send
Perform an HTTP DELETE request.
Sourcefn sse<T>(
&self,
url: Url,
credentials: &BmcCredentials,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<Pin<Box<dyn TryStream<Ok = T, Error = Self::Error, Item = Result<T, Self::Error>> + Send>>, Self::Error>> + Sendwhere
T: for<'a> Deserialize<'a> + Send + 'static,
fn sse<T>(
&self,
url: Url,
credentials: &BmcCredentials,
custom_headers: &HeaderMap,
) -> impl Future<Output = Result<Pin<Box<dyn TryStream<Ok = T, Error = Self::Error, Item = Result<T, Self::Error>> + Send>>, Self::Error>> + Sendwhere
T: for<'a> Deserialize<'a> + Send + 'static,
Open an SSE stream
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.