1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Hardware driver traits for driver-layer plugins.
//!
//! Ports `ados.sdk.drivers`. A driver-plugin implements one of these traits and
//! registers the instance with the host's peripheral manager from its
//! `on_start` hook (via [`crate::context::PeripheralClient`]). The host owns
//! discovery and arbitration; the driver answers `discover` honestly, opens
//! sessions on demand, and yields samples until the session closes.
//!
//! Each trait mirrors the matching Python abstract base class method-for-method.
//! The Python `AsyncIterator` returns become a [`SampleStream`] (a boxed
//! [`futures_core::Stream`]); the `async def` methods use [`async_trait`] so the
//! traits stay object-safe behind a `Box<dyn ...>`. A `Session` associated type
//! replaces the Python opaque `*Session` base class: the host treats it as a
//! token and only hands it back to the driver's own methods.
use Pin;
use Stream;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// A driver sample stream: the Rust analogue of the Python `AsyncIterator` the
/// driver base classes return from `frame_iterator` / `fix_iterator` /
/// `state_iterator` / `telemetry_iterator`. Boxed so the trait is object-safe.
pub type SampleStream<T> = ;
/// A unique, short reference id for a driver instance the host records. The
/// peripheral manager never sees the live driver object; it routes by this id.
/// Mirrors `_driver_ref`: `driver_id` else the type name.
/// A bus a candidate device is attached to. Free-form to match the Python
/// `bus: str` field (`usb`, `csi`, `uart`, `i2c`, `spi`, `rtsp`, ...).
pub type Bus = String;