What is the best way to send struct data from a rust backend to a ts frontend with types generated from this crate? #348
Answered
by
NyxCode
MrVintage710
asked this question in
Q&A
-
I know that there are many ways, but I am wondering if there is a way that is supported by this library. I am considering using this crate for an open source project I am starting. |
Beta Was this translation helpful? Give feedback.
Answered by
NyxCode
Aug 25, 2024
Replies: 1 comment 1 reply
-
The most common use-case is for REST APIs sending JSON. ts-rs is agnostic about this, though - it just matches the serde data model, so you can chose a different format if you wanted. Again, |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
MrVintage710
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The most common use-case is for REST APIs sending JSON.
ts-rs is agnostic about this, though - it just matches the serde data model, so you can chose a different format if you wanted.
You could, of course, also use WebSockets and send JSON (or anything else) over them as well.
Again,
ts-rs
just gives you TS bindings - that's it.