Rust Documentation
The Aranet project provides comprehensive Rust API documentation generated from inline doc comments using rustdoc.
Viewing Documentation Locally
Section titled “Viewing Documentation Locally”-
Clone the repository
Terminal window git clone https://github.com/cameronrye/aranet.gitcd aranet -
Generate the documentation
Terminal window cargo doc --workspace --no-deps --open -
Browse the docs
Your browser will open automatically with the documentation for all crates.
Available Crates
Section titled “Available Crates”| Crate | Description |
|---|---|
aranet-types | Platform-agnostic types shared across all crates |
aranet-core | Core BLE library with device discovery, readings, and settings |
aranet-store | SQLite-based data persistence for readings and history |
aranet-service | Background collector and HTTP REST API server |
aranet-cli | Command-line interface for quick readings and data export |
aranet-tui | Terminal UI dashboard for real-time monitoring |
aranet-gui | Desktop GUI application |
Documentation Conventions
Section titled “Documentation Conventions”All public APIs are documented with:
- Function/method descriptions - What the function does
- Parameters - Description of each parameter
- Return values - What the function returns
- Examples - Usage examples where applicable
- Errors - Possible error conditions
Example: Reading from a Device
Section titled “Example: Reading from a Device”use aranet_core::{Device, scan};
#[tokio::main]async fn main() -> anyhow::Result<()> { // Scan for nearby Aranet devices let devices = scan::scan_for_devices().await?; println!("Found {} devices", devices.len());
// Connect to the first device found if let Some(info) = devices.first() { let device = Device::connect(&info.name).await?;
// Read current sensor values let reading = device.read_current().await?; println!("CO₂: {} ppm", reading.co2); println!("Temperature: {:.1}°C", reading.temperature); }
Ok(())}Made with ❤️ by Cameron Rye