rust-magic-function-params
strata
rust-magic-function-params | strata | |
---|---|---|
10 | 2 | |
497 | 13 | |
- | - | |
10.0 | 10.0 | |
5 months ago | 10 months ago | |
Rust | Rust | |
- | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
rust-magic-function-params
- GitHub - alexpusch/rust-magic-function-params: Example for Axum style magic function parameter passing
-
What's the coolest Rust project you've seen that made you go, 'Wow, I didn't know Rust could do that!'?
Yes! https://github.com/alexpusch/rust-magic-function-params
-
Function that takes in any function as a parameter?
An approach similar to https://github.com/alexpusch/rust-magic-function-params can be used here. Basically, define a trait and implement it on FnOnce(A) -> R, then do function.trait_method(args).
- Axum-style magic function params demystified
- How does Bevy engine manage to be so "loose" with function signatures?
-
Parenthesis around argument name
I don't know what it is called but this helped me understand how they worked a little bit. https://github.com/alexpusch/rust-magic-function-params
- Rust state management pattern (like Tauri, Axum & Bevy)
-
Using Rust at a Startup: A Cautionary Tale
I've written a few backend APIs with rust and I have to disagree. Not only have the frameworks managed to get the ergonomics similar to your popular GC lang[0][1], the natural lack of shared mutable state of HTTP handlers means you very rarely have to encounter lifetimes and a lot of the language's advanced features. What's more, now when I go back to work with other languages, I can't help but notice the significant number of unit tests I'd not have had to write in Rust. It doesn't have a Rails and Django but it's an easy pick over anything at the language level.
A note on performance, Rust's the only langauge where I haven't had the need to update my unit test harnesses to `TRUNCATE` data base data instead of creating a separate db per test on PostgresSQL.
I'll also like to mention the gem that is SQLx[1]. As someone who's never been satisfied with ORMs, type checked SQL queries that auto-populate your custom types is revolutionary. With the error-prone langauge-SQL boundary covered, I was surprised just how good it can get making use of the builtin PostgreSQL features. Almost to the point that amount of effort the community's put to building great tools like Prisma.js and feel like a fool's errand (at least so for PosgreSQL).
[0]: https://github.com/alexpusch/rust-magic-function-params
[1]: https://github.com/juhaku/utoipa
[3]: lib.rs/crates/sqlx
-
better way to this `async fn get_blogs(Extension(pool): Extension<PgPool>` - Newbie Question
I saw this recently. Besides that, take a look at some Axum examples particularly at Extensions and Extractors.
- Axums magical handler methods amazed me when I first encountered them. I created a simple example for this pattern with detailed explanation
strata
-
What's the coolest Rust project you've seen that made you go, 'Wow, I didn't know Rust could do that!'?
Of course it's open source. You can find it here
-
What’s everyone working on this week (25/2023)?
I'm working on Strata, a tiling Wayland Compositor using Smithay and Rust, of course. I'm rewriting it for the 3rd time because every time I find that it is too bloated and doesn't work as expected. Its actually pretty easy if you learn Smithay
What are some alternatives?
bevy_aseprite
ring-wasi - Ring crate for WebAssembly wasm32-wasi.
structopt - Parse command line arguments by defining a struct.
hack_emu - Hack hardware simulator assembler, and compiler written in Rust
rust-gpu - 🐉 Making Rust a first-class language and ecosystem for GPU shaders 🚧
common-expression-language
utoipa - Simple, Fast, Code first and Compile time generated OpenAPI documentation for Rust
cachew-db - A light weight, typed, in-memory, ordered, key-value database.
go - The Go programming language
secm - secret manager
too-many-lists - Learn Rust by writing Entirely Too Many linked lists
cedar - In memory vector embeddings in Rust