Handling variable length input

Hi
I am new to rust and came from java.

There is something about handling variable inputs as described HERE.

Consider we are writing a web server. The input data that our client sends to us is not constant, but can vary in its length. Handling such thing needs a dynamic buffer size and needs some implications.

I need to know if any crates implemented this kind of code in rust. Specially Tokio or Axum

Depends what you're doing with it! One of the best/worst things about Rust is that you decide exactly what's happening, so if you want to buffer everything you can ask for a String or Bytes or Json or any other implementation of FromRequest like in their docs, and axum will handle it, but if you want to handle the bytes as they arrive then you will need to drop down to the Request and either read the bytes in chunks as they arrive, or use stream helpers.

There's a lot you can get into here so I don't want to get too deep into any particular angle if it's not relevant to what you're after, if you have a more specific question people can give you much better answers!