veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

295
active users

#axum

0 posts0 participants0 posts today

Does there already exist an Extractor for Axum that answers the question "what language(s) does the user prefer" in the form of a list made up of standardized language enums?

I couldn't find one, so I ended up writing one. I can see about publishing the crate if anyone's interested.

Published my first crate to crates.io recently. Nothing fancy, a simple #Axum layer for caching HTTP responses – with the option to reuse a stale response in case of failure to produce a new successful one – written for a project at work. Maybe someone else will find it useful. :)

crates.io/crates/axum-response

(I’ve been doing Rust for years, a bit ashamed I’d never published any open crate before; even if I’ve some small contributions to other projects)

crates.iocrates.io: Rust Package Registry

The more Rust I write, the more I like it. I just need more places to use it. I'm not going to introduce it at work (trust me) and I just don't do that many personal projects.

I wonder if people would like a set of tutorials on, like, "#Axum for #Django engineers" or "#Rocket for #Djangonauts" would be useful to folks?

Replied to silmeth 🇺🇦

UPDATE: I’ve just discovered that axum_extra (docs.rs/axum-extra/latest/axum) has its own `Form` type which does use serde_html_form underneath and supports optional values and sequences. So not all hope is lost! The fix is simple (change the Form type used), but for better discoverability #axum’s own type’s documentation could mention the limitations and link to the alternative.

docs.rsForm in axum_extra::extract - RustExtractor that deserializes `application/x-www-form-urlencoded` requests into some type.

Form data (x-www-form-urlencoded) support in #Axum is a bit disappointing. It uses #serde’s serde_urlencoded underneath, which in principle is fine. But the problem is that HTML forms don’t let you *not send* a value, which makes the whole thing useless with optional fields. You can set a field in a form to not be required and send an empty value (`?foo&bar=3&…` or `?foo=&bar=3&…` for empty `foo`) but then serde treats it as a present empty string and fails deserialization.

@mo8it I really enjoy using axum-ctx, thanks for the crate! :)

I’ve a thought though:

User-facing `Message` is always sent as text/plain.

I see the `RespErr` has support for custom Response variant, but there’s no way to provide one for an existing error: `.user_msg()` only accepts Into<Message>.

What’d’you think of adding eg. `.response(IntoResponse)`?

Would make it easier to provide custom HTML error views (old-school MPAs; #htmx based services; custom JSON error APIs, &c.)

Does anyone have experience using #RustLang and #axum for APIs? I wanted to make a little messenger API as my first lil rust project, I'm wondering if there's tips for improvements you might want to share :) I don't wanna get used to doing sub-optimal things from the start (⁠●⁠_⁠_⁠●⁠) It's in the early stages but the rough structure is pretty much clear.

That's the repo:
github.com/Zitronenjoghurt/lem

I'll appreciate any feedback c:

GitHubGitHub - Zitronenjoghurt/lemcom-api: A simple messenger API written in rust using axum.A simple messenger API written in rust using axum. - Zitronenjoghurt/lemcom-api
Replied to Mo Bitar :ferris:

➡️ What you want:
Reduce complexity for #RustLang backend development 🤔

➡️ What you actually do:
Let people write weird Rust code using macros generating more code in a crate that is fed to a custom transpiler that generates multiple Rust crates that you are supposed to then build and use in production 🫨

On top of that, you introduce weird licensing so that teams need an activation key with a MONTHLY FEE 🤢

Thanks #Pavex😐

Rustaceans, just use #Axum 😉

#OxiTraffic, a self-hosted, simple and privacy respecting website traffic tracker 🌐

➡️ Demo: oxitraffic.mo8it.com

I just published version 0.6 with a #Docker image! 📦
(You don't have to use Docker though)

Do you have a #blog?
I can host it for you if you want to test it with your website :blobcatheart:

Of course, it is written in #Rust 🦀
Check out the README, I spent a lot of time on it 😇
codeberg.org/mo8it/oxitraffic

Boost? 🔃🥰