Laddro DocsLaddro Docs
SDKs

Rust SDK

Rust SDK

The official Rust SDK for the Laddro Career API.

Installation

[dependencies]
laddro-career = "0.1"
tokio = { version = "1", features = ["full"] }

Quick Start

use laddro_career::LaddroClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = LaddroClient::new("YOUR_API_KEY");

    // List templates
    let templates = client.templates().list().await?;

    // Parse a resume
    let file = tokio::fs::read("resume.pdf").await?;
    let resume = client.resumes().parse(&file, "resume.pdf").await?;

    // Tailor for a job
    let result = client.tailor()
        .resume_id(&resume.id)
        .position_name("Senior Engineer")
        .job_description("We are looking for...")
        .send()
        .await?;

    Ok(())
}

Streaming

use futures::StreamExt;

let mut stream = client.tailor()
    .resume_id("res_abc123")
    .position_name("Senior Engineer")
    .job_description("...")
    .stream()
    .await?;

while let Some(event) = stream.next().await {
    let event = event?;
    println!("{}: {}", event.section, event.content);
}

Error Handling

use laddro_career::LaddroError;

match client.resumes().get("nonexistent").await {
    Err(LaddroError::Api { status, message }) => {
        eprintln!("{status}: {message}");
    }
    Err(e) => eprintln!("Network error: {e}"),
    Ok(resume) => println!("{}", resume.title),
}

Source

github.com/laddro-app/laddro-career-sdk-rust

On this page