Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
solidiquis committed Nov 12, 2024
1 parent b76e4e1 commit 75962eb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rust/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# Sift Rust

[![Crates.io](https://img.shields.io/crates/v/sift_rs.svg)](https://crates.io/crates/sift_rs)

This library offers a Rust API on top of Sift's protocol buffers to ergonomically interface with the Sift gRPC API.

## Installation

```
$ cargo add sift_rs
```
20 changes: 20 additions & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
pub mod gen;

/// Preconfigured gRPC utilities to initialize client stubs from the `gen` package.
///
/// ```
/// use sift_rs::{
/// gen::sift::ping::v1::{ping_service_client::PingServiceClient, PingRequest},
/// grpc::{use_sift_channel, SiftChannelConfig},
/// };
/// use std::{env, error::Error};
///
/// #[tokio::main]
/// async fn main() -> Result<(), Box<dyn Error>> {
/// let uri = env::var("SIFT_URI")?;
/// let apikey = env::var("SIFT_API_KEY")?;
/// let grpc_channel = use_sift_channel(SiftChannelConfig { uri, apikey })?;
/// let response_from_sift = PingServiceClient::new(grpc_channel)
/// .ping(PingRequest {})
/// .await?;
/// println!("{}", response_from_sift.get_ref().response);
/// Ok(())
/// }
/// ```
pub mod grpc;

/// Error types specific for this library. Note that when using the `gen` module
Expand Down

0 comments on commit 75962eb

Please sign in to comment.