Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Rust client #312

Open
banool opened this issue Nov 7, 2024 · 1 comment
Open

Support for Rust client #312

banool opened this issue Nov 7, 2024 · 1 comment

Comments

@banool
Copy link

banool commented Nov 7, 2024

Hey hey, I'm wondering if there is a recommended way to call an RSPC API from Rust? As far as I can tell there is no way to generate a client automatically. I saw some issues about OpenAPI but it doesn't seem to be released yet. I don't think using something like utoipa would work, there is no way to derive the necessary traits.

I suppose the best thing we could manage is to put the Rust types for the requests and responses (which derived specta::Type) into their own crate and then write our own client based on those. Or idk, something insane where we run compile the client into JS and then run it via Deno or something 😅

Any ideas would be appreciated!

@oscartbeaumont
Copy link
Member

Sorry, completely missed this issue.

Right now we don't have an offcial way but I have started work on a prototype client for Rust previewed here (Note it's part of #326). I would be very open to contributions on it if you wanted to take it for a spin but be aware it's more a proof of concept at the moment as I wanted to iron out how the type exporter would work before we stablise the new API.

OpenAPI support is definitely a bit furthur away as it's much harder to integrate with.

(going to keep this issue open until it's stable so we have a place to track it's progress)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants