adamchalmers / adamchalmers/axum-reqwest
Extract
- Linguagem predominante
- Rust
- Estrelas
- 6
- Forks
- 0
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Hello Adam, thank you for your great blog, it has been really useful.
As a follow-up, how do you think i can now extract from the MultipartStream
- file_name
- content_type
when i start extracting content before the stream macro i get an error of
`cannot return value referencing local data self.0 `
```
impl MultipartStream {
pub async fn into_stream(
mut self,
) -> impl Stream> {
let field = self.0.next_field().await.unwrap().unwrap();
let file_name = field.file_name().unwrap().to_string();
let content_type = field.content_type().unwrap().to_string();
async_stream::stream! {
for await value in field {
yield value;
}
}
}
}
```
the idea was to return those values as a struct or tuple.
What i can see is that the file_name needs to be retrieved outside of the async_stream::stream! as those attribute are needed before actually streaming.
Thank you!!
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Start with MultipartStream::into_stream and the shown async_stream::stream! block. Investigate how file_name and content_type can accompany the streamed Bytes without returning references to self; done means the requested metadata and content can be consumed together without the reported error.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- rust
- Domínio
- api, backend
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 25/100