pub trait HttpClientCodec: CoolCodec {
// Required methods
fn accept_header_value(&self) -> &'static str;
fn sequence_accept_header_value(&self) -> &'static str;
fn decode_response<T>(
&self,
content_type: &str,
body: &[u8],
) -> Result<T, CoolError>
where T: DeserializeOwned;
fn decode_sequence_response<T>(
&self,
content_type: &str,
body: &[u8],
) -> Result<Vec<T>, CoolError>
where T: DeserializeOwned;
}Required Methods§
fn accept_header_value(&self) -> &'static str
fn sequence_accept_header_value(&self) -> &'static str
fn decode_response<T>(
&self,
content_type: &str,
body: &[u8],
) -> Result<T, CoolError>where
T: DeserializeOwned,
fn decode_sequence_response<T>(
&self,
content_type: &str,
body: &[u8],
) -> Result<Vec<T>, CoolError>where
T: DeserializeOwned,
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.
Implementors§
impl HttpClientCodec for CborCodec
impl HttpClientCodec for JsonCodec
Available on crate feature
codec-json only.