Giter Club home page Giter Club logo

Comments (9)

fafhrd91 avatar fafhrd91 commented on May 4, 2024

Why do you want to use streams directly? Actix already uses streams and serde, req.json() just convinience helper with extra checks

https://github.com/actix/actix-web/blob/master/src/json.rs#L50

To fix your compilation bug, just add use futures::Stream to your code

from actix-web.

AlbanMinassian avatar AlbanMinassian commented on May 4, 2024

Hello (and merry Christmas)

with json-rust:

  1. I can use several useful functions (is_object, is_array... https://docs.rs/json/0.11.12/json/enum.JsonValue.html#method.is_object) that serde_json does not implement (or poorly documented)
  2. transforming into structure is not useful in many cases (therefore less code)
  3. faster than serde_json https://github.com/serde-rs/json-benchmark
  4. easy for beginners like me
  5. why not and for fun

Why do you want everyone to use serde_json? Why don't you implement a req. json_rust () (json-rust) and req. json_serde ().

Ami44

from actix-web.

fafhrd91 avatar fafhrd91 commented on May 4, 2024

I see, your reasons are valid. I’ll add example.

req.json() just a convince, I am still playing with api.

from actix-web.

fafhrd91 avatar fafhrd91 commented on May 4, 2024

I updated guide and example.

would you provide PR for json-rust crate integration?

from actix-web.

AlbanMinassian avatar AlbanMinassian commented on May 4, 2024

Thank you. I have been discovering rust for 2 weeks and I don't have the level to propose a PR

from actix-web.

AlbanMinassian avatar AlbanMinassian commented on May 4, 2024

but I proposed a PR flosse/rust-web-framework-comparison#36 to improve the visibility of actix-web :-)

from actix-web.

fafhrd91 avatar fafhrd91 commented on May 4, 2024

thanks.

btw adding json-rust is easy task, it should be mostly copy from exiting JsonBody implementation

from actix-web.

fafhrd91 avatar fafhrd91 commented on May 4, 2024

Could you update your PR and include yes for sessions. Actix has sessions now

from actix-web.

AlbanMinassian avatar AlbanMinassian commented on May 4, 2024

Done

from actix-web.

Related Issues (20)

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.