Rust
Rust SDK
Install and start using the official asynchronous Insion Rust client
The official Insion Rust SDK lets Rust applications moderate content, ingest records, manage users, and submit appeals without constructing HTTP requests. This guide walks you through adding the crate, creating an authenticated client, and sending a record for immediate moderation.
Before you begin
You'll need:
- An Insion account.
- An API key from the Developer section of your dashboard.
- A Rust project with Cargo available.
Use immediate moderation when your application needs a decision in the current request. Use ingestion when moderation can happen asynchronously and your application receives the result through a webhook.
Install
cargo add insionMake your first request
use insion::{ApiClientBuilder, prelude::*};
let client = ApiClientBuilder::default().token("<token>").build()?;
let result = client.moderate_a_record(
&ModerateRequest::builder()
.client_id("post-123").name("Welcome post").entity("post")
.content(Content::String("Hello world".into())).build()?,
None,
).await?;Operations return Result<T, ApiError> and must be awaited.
Next steps
- Fine-tune client and request behavior in Configuration.
- Explore every supported request and response in Operations.
- Prepare production error handling with Errors.
Get Involved
How is this guide?