Skip to main content

mesa_dev/
lib.rs

1//! Mesa's Rust SDK
2//!
3//! Provides both an ergonomic [`MesaClient`] and direct access to the
4//! lower-level modules generated from the `OpenAPI` spec.
5//!
6//! The [`low_level`] module contains the generated API functions and
7//! hand-written workarounds for endpoints where the code generator
8//! produces incorrect types.
9//!
10//! # Quick Start
11//!
12//! ```rust,no_run
13//! use mesa_dev::MesaClient;
14//! use futures::TryStreamExt;
15//!
16//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
17//! let client = MesaClient::builder().build();
18//!
19//! // List repositories
20//! let repos: Vec<_> = client.org("my-org").repos().list(None).try_collect().await?;
21//!
22//! // Get file content
23//! let content = client
24//!     .org("my-org")
25//!     .repos().at("my-repo")
26//!     .content()
27//!     .get(None, Some("README.md"), None)
28//!     .await?;
29//! # Ok(())
30//! # }
31//! ```
32
33pub mod client;
34pub mod low_level;
35
36pub use client::MesaClient;
37
38/// Re-export of [`futures_core::Stream`] for consuming paginated results.
39pub use futures_core::Stream;
40
41/// OpenAPI-generated request and response model types.
42///
43/// All structs implement `serde::Serialize` and `serde::Deserialize`.
44#[doc(inline)]
45pub use mesa_dev_oapi::models;