Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a Rust target using the reqwest library. I know there was another PR (#242) to add this a while back prior to the major refactor, this completes that work with an updated implementation.
For the time being it only supports an async client, but in future that can be updated to support the blocking client later on. It also requires a few additional crates to be added to a
Cargo.toml
dependency file when using the generated snippets. In particular:I wasn't sure how best to specify that when generating the snippets, that could be something that's passed in the the client as an option.
Most of this code was based on the Python requests library client, and I borrowed a helper implementation there. That could be generalised too for better use across the library but I just left it with the copied and modified version for now.
Either way it would be great to merge in some Rust client support. Let me know if there are any changes or refactors you'd like! I added a new helper util method to add to the last line edited, specifically so I could add semicolons.
Tested by adding fixtures and running
npm run test
, updated availability targets withnpm test -- -u
. All tests passing: