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

Rust support/sdk #129

Open
feefladder opened this issue Aug 30, 2024 · 1 comment · May be fixed by #130
Open

Rust support/sdk #129

feefladder opened this issue Aug 30, 2024 · 1 comment · May be fixed by #130

Comments

@feefladder
Copy link

The readme said to make an issue requesting a language, so here it is.

Is this a maybe/yes/no?

@patrick-zippenfenig patrick-zippenfenig linked a pull request Sep 2, 2024 that will close this issue
@patrick-zippenfenig
Copy link
Member

patrick-zippenfenig commented Sep 2, 2024

I quickly added the compiled rust flatbuffer files: https://github.com/open-meteo/sdk/blob/781b2078cd0d1c79d14a10afb5951ae0140a54a8/rust/weather_api_generated.rs

The API returns multiple length-prefixed flat buffer messages. To decode a message, take the first 4 bytes to get the length of a message, then decode it using flatbuffers and repeat:

https://github.com/open-meteo/sdk/blob/main/swift/Sources/OpenMeteoSdk/OpenMeteoSdk.swift#L84-L94

Python example here: https://github.com/open-meteo/python-requests/blob/66a750440e22f08fe5396038fb0859f62ac8af1c/openmeteo_requests/Client.py#L25

Do you have experience in using HTTP clients in Rust and could give it a try? Afterwards this could be bundled into a crate.

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

Successfully merging a pull request may close this issue.

2 participants