sdk
All apps

Rust SDK

crates.io

High-performance async Rust client built on Tokio & Reqwest

Gallery

About

Async Rust crate supporting non-blocking HTTP requests via Tokio and Reqwest, featuring compile-time type safety, strong builder patterns, and robust error hierarchies.

Features

  • Non-blocking async runtime powered by Tokio & Reqwest
  • Ergonomic builder pattern for complex link configurations
  • Strong Rust Result-based typed error handling
  • Optional blocking mode feature flag for CLI and embedded tools

Code Quickstart

main.rsrust
use shaf::{ShafClient, CreateLinkRequest};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = ShafClient::new("your-api-key");
    
    let link = client.create_link(CreateLinkRequest::builder()
        .url("https://github.com/shaf-is")
        .alias("core-engine")
        .build()
    ).await?;

    println!("Shortened: {}", link.short_url);
    Ok(())
}