devintest_api

Crates.iodevintest_api
lib.rsdevintest_api
version0.0.2
created_at2025-12-02 20:01:52.339343+00
updated_at2025-12-02 20:11:40.893042+00
descriptionRust SDK for devintest_api generated by Fern
homepage
repositoryhttps://github.com/fern-api/fern
max_upload_size
id1962567
size103,566
Devin Logan (devalog)

documentation

https://docs.rs/devintest_api

README

Devintest Rust Library

fern shield crates.io shield

Welcome to my API

Table of Contents

Installation

Add this to your Cargo.toml:

[dependencies]
devintest_api = "0.0.2"

Or install via cargo:

cargo add devintest_api

Reference

A full reference for this library is available here.

Usage

Instantiate and use the client with the following:

use devintest_api::prelude::*;

#[tokio::main]
async fn main() {
    let config = ClientConfig {
        ..Default::default()
    };
    let client = ApiClient::new(config).expect("Failed to build client");
    client
        .imdb
        .create_movie(
            &CreateMovieRequest {
                title: "title".to_string(),
                rating: 1.1,
            },
            None,
        )
        .await;
}

Errors

When the API returns a non-success status code (4xx or 5xx response), an error will be returned.

match client.imdb.create_movie(None)?.await {
    Ok(response) => {
        println!("Success: {:?}", response);
    },
    Err(ApiError::HTTP { status, message }) => {
        println!("API Error {}: {:?}", status, message);
    },
    Err(e) => {
        println!("Other error: {:?}", e);
    }
}

Advanced

Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).

A request is deemed retryable when any of the following HTTP status codes is returned:

  • 408 (Timeout)
  • 429 (Too Many Requests)
  • 5XX (Internal Server Errors)

Use the max_retries method to configure this behavior.

let response = client.imdb.create_movie(
    Some(RequestOptions::new().max_retries(3))
)?.await;

Timeouts

The SDK defaults to a 30 second timeout. Use the timeout method to configure this behavior.

let response = client.imdb.create_movie(
    Some(RequestOptions::new().timeout_seconds(30))
)?.await;

Additional Headers

You can add custom headers to requests using RequestOptions.

let response = client.imdb.create_movie(
    Some(
        RequestOptions::new()
            .additional_header("X-Custom-Header", "custom-value")
            .additional_header("X-Another-Header", "another-value")
    )
)?
.await;

Additional Query String Parameters

You can add custom query parameters to requests using RequestOptions.

let response = client.imdb.create_movie(
    Some(
        RequestOptions::new()
            .additional_query_param("filter", "active")
            .additional_query_param("sort", "desc")
    )
)?
.await;
Commit count: 0

cargo fmt