Lucia

CI crates.io Documentation License Rustc

A flexible client API framework as well as a set of API collections written in Rust.

```rust,no_run async fn example() -> lucia::Result<()> { use lucia::{network::Transport, CommonParams, Pair, RequestManager};

let (mut rm, mut trans) = Pair::new( RequestManager::new( // Checkout the api's module to see different APIs. (), CommonParams::new( // Any transport parameter like HTTP headers (), // Any custom parameter like request thresholds. (), ), // Checkout the ds's module to see different Deserializers/Serializers. () ), // Checkout the network's module to see different transports. (), ) .into_parts();

// Checkout the RequestManager structure of any API to see different endpoints. let req = ();

// It is also possible to use send_retrieve_and_decode_many if a format data is able // to perform batch requests. let res = trans.sendretrieveanddecode_one(&mut rm, &req, ()).await?;

Ok(()) } ```

Each API's module has a documentation test for demonstration purposes.

API

| Category | Name | Compile Flag | Serialization
miniserde | Serialization
serde_json | Serialization
serde-xml-rs | Implementation | |---|---|---|:---:|:---:|:---:|:---:| | Art & Design | COLOURlovers | colour-lovers | ❌ | ❌ | ✅ |100% | | Blockchain | Ethereum | ethereum | ❌ | ✅ | ❌ | 3% | | Blockchain | Solana | solana | ❌ | ✅ | ❌ | 85% | | Calendar | Nager.Date | nager-date | ❌ | ✅ | ❌ | 100% | | Exchange | KuCoin | ku-coin | ❌| ✅ | ❌ | 5% | | Gaming | Age of Empires II | age-of-empires-ii | ❌ | ✅ | ❌ | 100% | | Health | M Media - Covid-19 | m-media-covid-19 | ❌ | ✅ | ❌ | 100% | | Test data | JSONPlaceholder | json-placeholder | ❌ | ✅ | ❌ | 100% |

Features

| Type | Name | URL | |---|---|---| | Data Format | JSON | https://www.json.org | | Data Format | JSON-RPC 2.0 | https://www.jsonrpc.org/specification | | Data Format | XML | https://www.w3.org/TR/xml | | Transport (HTTP) | reqwest | https://github.com/seanmonstar/reqwest | | Transport (HTTP) | surf | https://github.com/http-rs/surf | | Transport (WebSocket) | tokio-tungstenite | https://github.com/snapview/tokio-tungstenite |

Code