Giter Club home page Giter Club logo

axum-reqwest's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

axum-reqwest's Issues

Extract

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<Item = Result<Bytes, MultipartError>> {
        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!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.