Crates.io | streamstore |
lib.rs | streamstore |
version | |
source | src |
created_at | 2024-12-10 19:52:29.53661+00 |
updated_at | 2025-05-10 00:41:14.469298+00 |
description | Rust SDK for S2 |
homepage | https://github.com/s2-streamstore/s2-sdk-rust |
repository | https://github.com/s2-streamstore/s2-sdk-rust |
max_upload_size | |
id | 1479006 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
The Rust SDK provides ergonomic wrappers and utilities to interact with the S2 API.
Ensure you have tokio
added as a dependency. The SDK relies on
Tokio for executing async code.
cargo add tokio --features full
Add the streamstore
dependency to your project:
cargo add streamstore
Generate an access token by logging onto the web console at s2.dev.
Make a request using SDK client.
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = s2::ClientConfig::new("<YOUR ACCESS TOKEN>");
let client = s2::Client::new(config);
let basins = client.list_basins(Default::default()).await?;
println!("My basins: {:?}", basins);
Ok(())
}
The examples
directory in this repository contains a variety of
example use cases demonstrating how to use the SDK effectively.
Run any example using the following command:
export S2_ACCESS_TOKEN="<YOUR ACCESS TOKEN>"
cargo run --example <example_name>
[!NOTE] You might want to update the basin name in the example before running since basin names are globally unique and each example uses the same basin name (
"my-favorite-basin"
).
Head over to docs.rs for detailed documentation and crate reference.
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.
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.
Join our Discord server. We would love to hear from you.
You can also email us at hi@s2.dev.
This project is licensed under the Apache-2.0 License.