Preciso construir um Axum Body a partir de um leitor OpenDAL, mas não consigo encontrar nenhuma maneira de fazer isso. Alguém sabe como fazer? Código de exemplo:
use axum::body::Body;
use opendal::{services, Operator};
use http_body_util::StreamBody;
async fn to_body() -> Body {
let op = Operator::new(services::Fs::default().root("./")).unwrap().finish();
let reader = op.reader("../Cargo.toml").await.unwrap();
let stream = reader.into_stream(..).await.unwrap();
// stream implements futures_core::stream::Stream so I expected this to work, but it doesn't:
// let body = Body::from_stream(stream);
// I can build a StreamBody but then I fail to create a Body from it
let stream_body = StreamBody::new(stream).into();
// Now I am not able to convert the stream_body to a Body
}