unifi/lib.rs
1// The README is this crate's entire rustdoc landing page — not just a
2// GitHub-facing summary. Every code block in it is a real doctest run by
3// `cargo test --doc`, and there is deliberately no separate, shorter `//!`
4// summary here to drift out of sync with it: one doc, one source of truth.
5#![doc = include_str!("../README.md")]
6#![deny(missing_docs)]
7#![forbid(unsafe_code)]
8// A library crate should never panic on data it doesn't control. Scoped to
9// non-test builds only — `.unwrap()`/`.expect()` in test code is normal,
10// idiomatic Rust, not a smell, and this crate's test suite uses both
11// extensively and correctly. The handful of non-test sites this denies by
12// default all have a documented, build-time-only justification (a bundled
13// data file that ships with the crate, not caller input) and are
14// explicitly `#[allow]`'d at that exact site — this exists so a *new*
15// unwrap/expect/panic in production code has to be a deliberate, reviewed
16// choice, not an accident.
17#![cfg_attr(
18 not(test),
19 deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)
20)]
21
22/// Dynamic action dispatch driven by the [`capabilities`] catalog.
23pub mod actions;
24/// Path/URL construction for the official and internal controller APIs.
25pub mod api;
26/// The action catalog, built from the JSON inventories in `data/`.
27pub mod capabilities;
28/// [`UnifiError`] and the crate's [`Result`] alias.
29pub mod error;
30/// The one place HTTP requests are made and errors mapped.
31pub mod http;
32
33mod client;
34mod config;
35mod service;
36mod util;
37
38pub use actions::{ActionDispatcher, ActionRequest};
39pub use client::UnifiClient;
40pub use config::{UnifiConfig, DEFAULT_REQUEST_TIMEOUT};
41pub use error::{Result, UnifiError};
42pub use service::UnifiService;