melvin_ob/http_handler/http_response/
shoot_image.rs1use crate::http_handler::http_response::response_common::{
2 ByteStreamResponseType, HTTPResponseType, ResponseError,
3};
4use futures::StreamExt;
5use prost::bytes::Bytes;
6
7pub struct ShootImageResponse {}
9
10impl ByteStreamResponseType for ShootImageResponse {}
11
12impl HTTPResponseType for ShootImageResponse {
13 type ParsedResponseType = futures_core::stream::BoxStream<'static, reqwest::Result<Bytes>>;
15
16 async fn read_response(
18 response: reqwest::Response,
19 ) -> Result<Self::ParsedResponseType, ResponseError> {
20 let resp = Self::unwrap_return_code(response).await?;
21 let stream = resp.bytes_stream();
22 Ok(stream.boxed())
23 }
24}