Marc
Marc boosted

Dear #Rust#RustLang folks doing #Axum

What's your preferred way of having a single handler for multiple form submission types?

That is, let's say I have a settings page, and there's different "sections" to the settings, which all get handled differently, but I want the Form to get deserialized per usual?

Unfortunately, serde_html_form doesn't support deserializing enums for something like this? At least not out of the box?

Dear #Rust#RustLang folks doing #Axum

What's your preferred way of having a single handler for multiple form submission types?

That is, let's say I have a settings page, and there's different "sections" to the settings, which all get handled differently, but I want the Form to get deserialized per usual?

Unfortunately, serde_html_form doesn't support deserializing enums for something like this? At least not out of the box?

Excellent. Got this working in the #ConjuredInk#Rust#RustLang #Axum server.

If you just wrap any plain

with , it’ll submit that form as a fetch instead. Server-side, a middleware checks for a header and sets a flag, and you can use that to only partially render the response.

Without JS, you get the some whole page back, just like normal. With working JS, you only get the "patch", and then overwrites the matching nodes.

This is a hybrid of htmx and htmz that uses a web component instead of a global thing with odd attribute annotations, and unlike htmz, lets you have programmatic lifecycle hooks, set that header so you can share the exact same endpoint, etc.

And it’s still just a tiny, plain, standalone Web Component with no deps. It's a couple of kb mingz, and I'll probably golf it around a bit to make it smaller.

#WebDev

Dear #rust#RustLang folks who use #axum

Do you have a nice router crate you recommend? My use case here is that I have a lot of situations where I want to actually resolve routes (to generate links and the like) and I really dislike how untyped/unverified those random strings are.

https://crates.io/crates/axum-routes seems good, but it's somewhat low usage. Still, it's pretty small and seems to do exactly what I need (lets me keep separating route definition from handler definition, lets me do reverse lookups, does static route typing, etc)

Hey rustaceans, I need to plug my #axum server which uses the tracing crate for logs to our elasticsearch logging service, which uses ESC I believe?
It seems there's no off the shelf tracing_layer to talk to elasticsearch , and trying to write my own I'm running in the issue of needing to use an async method to send the message from a sync context (on_event() of tracing::Layer). Anything I've missed to make my live easier? #rustlang #tokio #elasticsearch

Finally, I can chat with my rat friends over Bluetooth 🙏🔥

💬 bitchat-tui — Secure, anonymous, P2P Bluetooth chat in your terminal.

📡 Communicate off-grid with E2E encryption, public channels, and direct messaging.

🦀 Written in Rust & built with @ratatui_rs

⭐ GitHub: https://github.com/vaibhav-mattoo/bitchat-tui

#rustlang #ratatui #tui #bluetooth #ble #chat #p2p #encryption #terminal

Finally, I can chat with my rat friends over Bluetooth 🙏🔥

💬 bitchat-tui — Secure, anonymous, P2P Bluetooth chat in your terminal.

📡 Communicate off-grid with E2E encryption, public channels, and direct messaging.

🦀 Written in Rust & built with @ratatui_rs

⭐ GitHub: https://github.com/vaibhav-mattoo/bitchat-tui

#rustlang #ratatui #tui #bluetooth #ble #chat #p2p #encryption #terminal

Tachyonfx brings web-level animations to the command line..
Then Ratzilla puts it back in browsers where it belongs 🤷‍♂️

Witness this beautiful chaos: https://junkdog.github.io/exabind 🌀

🦀 Powered by Rust & @ratatui_rs ecosystem
⭐ GitHub: https://github.com/junkdog/exabind

#rustlang #ratatui #tui #animations #commandline #webgl2 #terminal

Tachyonfx brings web-level animations to the command line..
Then Ratzilla puts it back in browsers where it belongs 🤷‍♂️

Witness this beautiful chaos: https://junkdog.github.io/exabind 🌀

🦀 Powered by Rust & @ratatui_rs ecosystem
⭐ GitHub: https://github.com/junkdog/exabind

#rustlang #ratatui #tui #animations #commandline #webgl2 #terminal