webbluetooth_windows/lib.rs
1//! Windows BLE from pure Rust, with no dependencies.
2//!
3//! WinRT is COM, and COM is a calling convention: an object is a pointer to a
4//! table of function pointers, and the runtime is a handful of exports from
5//! `combase.dll`. So this needs no bindings crate — only the right interface
6//! identifiers, which are vendored in [`iids`] from Windows metadata rather
7//! than transcribed, and the right vtable layouts.
8//!
9//! Callbacks work the way they do everywhere else here: Windows wants an object
10//! it can call into, so one is built — in this case a COM object, which is a
11//! struct whose first field is a vtable pointer.
12//!
13//! ## License
14//! MIT — Copyright © 2025 [Eugene Hauptmann](https://github.com/eugenehp)
15
16// The adapter: this platform expressed as the portable model.
17// Public so `webbluetooth` can reach it, and not an API anyone else
18// should call: the facade is what a caller holds. Hidden from the docs
19// for the same reason, which also keeps the same 38 adapter methods from
20// being documented six times over.
21#[doc(hidden)]
22pub mod backend;
23// The peripheral-role adapter: a GATT server expressed as the portable model.
24#[cfg(target_os = "windows")]
25pub mod peripheral_backend;
26
27pub mod ble;
28#[cfg(feature = "classic")]
29pub mod classic;
30#[cfg(feature = "classic")]
31pub mod classic_discovery;
32#[cfg(feature = "classic-l2cap")]
33pub mod classic_l2cap;
34pub mod com;
35pub mod guid;
36pub mod iids;
37pub mod winrt;