24 releases
Uses new Rust 2024
| new 0.24.8 | Mar 6, 2026 |
|---|---|
| 0.24.7 | Mar 6, 2026 |
| 0.24.4 | Feb 25, 2026 |
| 0.23.8 | Feb 7, 2026 |
| 0.22.5 | Jan 20, 2026 |
#309 in Database interfaces
789 downloads per month
Used in s2-cli
565KB
14K
SLoC
The Rust SDK provides ergonomic interface and utilities to interact with the S2 API.
Getting started
-
Ensure you have added tokio and futures as dependencies.
cargo add tokio --features full cargo add futures -
Add the
s2-sdkdependency to your project:cargo add s2-sdk -
Generate an access token by logging into the web console at s2.dev.
-
Perform an operation.
use s2_sdk::{ S2, types::{ListBasinsInput, S2Config}, }; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let s2 = S2::new(S2Config::new("<YOUR_ACCESS_TOKEN>"))?; let page = s2.list_basins(ListBasinsInput::new()).await?; println!("My basins: {:?}", page.values); Ok(()) }
Examples
The examples directory in this repository contains a variety of
example use cases demonstrating how to use the SDK effectively.
You might have to set either one or all of these env vars based on the example you run.
export S2_ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export S2_BASIN="<YOUR_BASIN_NAME>"
export S2_STREAM="<YOUR_STREAM_NAME>"
cargo run --example <example_name>
SDK Docs and Reference
Head over to docs.rs for detailed documentation and crate reference.
Feedback
We use Github Issues to track feature requests and issues with the SDK. If you wish to provide feedback, report a bug or request a feature, feel free to open a Github issue.
Contributing
Developers are welcome to submit Pull Requests on the repository. If there is no tracking issue for the bug or feature request corresponding to the PR, we encourage you to open one for discussion before submitting the PR.
Reach out to us
Join our Discord server. We would love to hear from you.
You can also email us at hi@s2.dev.
License
This project is licensed under the MIT License.
Dependencies
~103MB
~2.5M SLoC