Any hacks to get spans with serde?
⚓ Rust 📅 2026-05-04 👤 surdeus 👁️ 1Hello, I have a program that should get jsons (or yamls, it can be changed) and use them. But one of the requirements is to be very user friendly and tell where exactly an error occured, including the semantic errors, which are domain specific. So I would need line and column ranges for each node. Currently I use serde with serde_json to parse and it works, but there's no straightforward method to get this done.
What could you advise in this situation? I really like the serde way of having structs describe the structure, it would be a pity to write it all by hand, and there's a lot of things.
4 posts - 4 participants
🏷️ Rust_feed