Rust SDK for the mesa.dev API — manage repositories, branches, commits, content, diffs, and API keys programmatically.
cargo add mesa-devuse mesa_dev::{Mesa, MesaError, models::CreateRepoRequest};
#[tokio::main]
async fn main() -> Result<(), MesaError> {
let client = Mesa::new("my-api-key");
// Create a repository
let repo = client
.repos("my-org")
.create(&CreateRepoRequest {
name: "my-repo".to_owned(),
default_branch: None,
})
.await?;
println!("Created repo: {}", repo.name);
// List all branches (automatically paginates)
let branches = client
.branches("my-org", "my-repo")
.list_all()
.collect()
.await?;
println!("Found {} branches", branches.len());
Ok(())
}| Resource | Accessor | Operations |
|---|---|---|
| Repos | client.repos(org) |
create, list, get, rename, delete |
| Branches | client.branches(org, repo) |
create, list, delete |
| Commits | client.commits(org, repo) |
create, list, get |
| Content | client.content(org, repo) |
get (files and directories) |
| Diffs | client.diffs(org, repo) |
get |
| Admin | client.admin(org) |
API key management |
Paginated endpoints expose a list_all() method that returns a PageStream with lazy cursor-based iteration.
The SDK is generic over its HTTP transport via the HttpClient trait.
| Feature | Backend | Async | Default |
|---|---|---|---|
reqwest-client |
reqwest | yes | yes |
ureq-client |
ureq | no | no |
You can also bring your own backend by implementing HttpClient. See the trait documentation for a full guide.
All requests are retried with exponential backoff and jitter (up to 3 attempts by default). Retryable conditions: HTTP 429, 5xx responses, timeouts, and connection errors. Retry parameters are configurable via ClientBuilder.
Rust 1.85+ (edition 2024).
Note: A large part of this documentation was generated with the assistance of an LLM. If you spot inaccuracies, please open an issue.