Better HN
topnewbestaskshowjobs
Log inSign up

davidpdrsn

7 karma · joined Dec 21, 2015 (10y ago) · 6 submissions

Submissions

comment 4y ago · link · parent

Use https://docs.rs/axum/latest/axum/response/type.Response.html

This is also whats shown in the "Implementing IntoResponse" examples https://docs.rs/axum/latest/axum/response/trait.IntoResponse...

comment 4y ago · link · parent

> This one is annoying, but easily solvable by making your own return type that implements IntoResponse

You can just call `.into_response()` like documented here https://docs.rs/axum/latest/axum/response/index.html#returni...

> I'm not sure what you're talking about? You just add `Cookies` extractor to your handler and use that. You don't need to add it to the return, middleware takes care of it.

I think you're thinking of tower-cookies which works the same way poem's CookieJarManager does.

axum-extra's cookies work differently in that you have to return the updated jar from handlers. We chose this design because it composes better when you have multiple libraries that all wanna set cookies. tower-cookies doesn't work if you accidentally add multiple cookie middleware, whereas axum-extra's approach does. So its a trade-off.

comment 5y ago · link · parent

It calls GitHubs api at compile time. You can do pretty much anything in a rust procedural macro, including IO.

comment 7y ago · link · parent

Crate: https://crates.io/crates/diesel-factories Code: https://github.com/davidpdrsn/diesel-factories

5.

Test Factories for Diesel (Rust)(docs.rs ↗)

1 points · by davidpdrsn · 7y ago · 1 comment

comment 10y ago · link · parent

I figure its because its quite annoying to pass arguments to rake tasks. So all the commands the required arguments lived in the rails command, the rest in rake.