Skip to content

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
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MrVintage710
Comment options

Answer selected by MrVintage710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants