Serde Vs TryFrom

⚓ Rust    📅 2025-05-02    👤 surdeus    👁️ 4      

surdeus

Warning

This post was published 111 days ago. The information described in this article may have changed.

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Serde Vs TryFrom

Hi all, I have been digging more and more about serde, I has been using more deserialize to read csvs, and I have ended with a big question.

From what I understand now (which could be wrong).

Deserialize: we use it to read from x thing to a format
Visitor: we transform from x type to y type (format)

Have you notice a visitor logic is just too similar to TryFrom/From? I can't actually distinguish them, and seems serde do not mix Visitors with TryFrom, I tried implement a TryFrom and do not works for deserialize.

So the question is... which is the fundamental difference between Visitor vs TryFrom?

1 post - 1 participant

Read full topic

🏷️ rust_feed