proxer-rs
Access proxer.me with rust
Examples
You can find all examples in the ./examples
directory and run these with cargo run --example <example-name>
.
However, here is a small summary:
Making requests is fairly simple:
let prxr = new;
// ...or load the api-key from an environment variable
let prxr = with_env_key;
// everything is strong typed. You can't pass wrong parameters
let req = GetFullEntry ;
// execute the request
let res = prxr.execute.unwrap;
// check the response
match res
This example creates a api object and fetches the full data for an entry
The library is as strong typed as possible (which is a good thing for guaranteeing type safety).
It tries to be a 1:1 wrapper to the api while providing some nice tweaks like Iterator
s for pageable endpoints.
let prxr = with_env_key.unwrap;
let req = GetComments ;
// create a pager(`Iterator`) for the request
let pager = req.pager;
// iterate over the list
for comment in pager