Crate s2

Crate s2 

Source
Expand description

Rust SDK for S2.

The Rust SDK provides ergonomic wrappers and utilities to interact with the S2 API.

§Getting started

  1. Ensure you have tokio added as a dependency. The SDK relies on Tokio for executing async code.

    cargo add tokio --features full
  2. Add the streamstore dependency to your project:

    cargo add streamstore
  3. Generate an authentication token by logging onto the web console at s2.dev.

  4. 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:

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.

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.