polestar_api/lib.rs
1//! # polestar-api
2//!
3//! A lightweight, type-safe Rust wrapper for the Polestar vehicle GraphQL API.
4//!
5//! ## Quick Start
6//!
7//! ```no_run
8//! use polestar_api::PolestarClient;
9//!
10//! #[tokio::main]
11//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
12//! let client = PolestarClient::new("your_username", "your_password")?;
13//! let telemetry = client.get_telemetry("YOUR_VIN").await?;
14//! println!("Battery: {:.1}%",
15//! telemetry.battery.charge_level_percentage.unwrap_or(0.0));
16//! Ok(())
17//! }
18//! ```
19
20#![warn(missing_docs)]
21#![warn(rustdoc::missing_crate_level_docs)]
22
23pub mod auth;
24pub mod client;
25pub mod error;
26pub mod graphql;
27pub mod models;
28
29// Re-export main types for convenience
30pub use client::PolestarClient;
31pub use error::{PolestarError, Result};
32pub use models::{telemetry::Telemetry, vehicle::Vehicle};