melvin_ob/http_handler/http_response/
objective_image.rs

1use crate::http_handler::http_response::response_common::{
2    HTTPResponseType, JSONBodyHTTPResponseType, ResponseError,
3};
4
5/// Response type for the /objective endpoint -> POST
6pub(crate) struct ObjectiveImageResponse {}
7
8impl JSONBodyHTTPResponseType for ObjectiveImageResponse {}
9
10impl HTTPResponseType for ObjectiveImageResponse {
11    /// Type of the parsed response
12    type ParsedResponseType = String;
13
14    /// Reads and parses the response from the json body
15    async fn read_response(
16        response: reqwest::Response,
17    ) -> Result<Self::ParsedResponseType, ResponseError> {
18        let resp = Self::unwrap_return_code(response).await?;
19        Self::parse_json_body(resp).await
20    }
21}