sharksforarms / deku

Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Apache License 2.0
1.15k stars 55 forks source link

Request for Enhancement: Availability as an extractor in Tokio's axum #250

Closed v1gnesh closed 2 years ago

v1gnesh commented 2 years ago

https://tokio.rs/blog/2021-07-announcing-axum#extractors

Requests can be parsed declaratively using "extractors". An extractor is a type that implements FromRequest. Extractors can be used as arguments to handlers and will run if the request URI matches.

Sounds like a perfect fit.

v1gnesh commented 2 years ago

Any thoughts, @sharksforarms @wcampbell0x2a ?

sharksforarms commented 2 years ago

I'm not sure how this is related to this library,

An extractor is a type that implements [FromRequest](https://docs.rs/axum/latest/axum/extract/trait.FromRequest.html)

Afaik, there isn't any blocker on implementing FromRequest on a type which derives DekuRead

Closing for now, feel free to reach out if I'm missing something.