Expand description
Rust SDK for S2.
The Rust SDK provides ergonomic wrappers and utilities to interact with the S2 API.
§Getting started
-
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 authentication token by logging onto the web console at s2.dev.
-
Make a request using SDK client.
let config = s2::ClientConfig::new("<YOUR AUTH TOKEN>"); let client = s2::Client::new(config); let basins = client.list_basins(Default::default()).await?; println!("My basins: {:?}", basins);
See documentation for the client
module for more information on how to
use the client, and what requests can be made.
§Examples
We have curated a bunch of examples in the SDK repository demonstrating how to use the SDK effectively:
- List all basins
- Explicit stream trimming
- Producer (with concurrency control)
- Consumer
- and many more…
This documentation is generated using
rustdoc-scrape-examples
,
so you will be able to see snippets from examples right here in the
documentation.
§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.
§Quick Links
Re-exports§
pub use client::BasinClient;
pub use client::Client;
pub use client::ClientConfig;
pub use client::StreamClient;
Modules§
- batching
- Append records batching stream.
- client
- SDK client implementation.
- types
- Types for interacting with S2 services.
Type Aliases§
- Streaming
- Generic type for streaming response.