//! Background thread that drives a [`DeviceTree`] and forwards its
//! [`TreeItem`]s onto a channel, for TUI hosts whose event loops cannot block
//! on `tree.next_item()`.
use ;
use ;
use RpcError;
/// Spawn a worker thread that owns the given [`DeviceTree`] and streams its
/// items through the returned [`Receiver`]. Each successful item arrives as
/// `Ok(item)`; if the tree errors (e.g. the proxy disconnects) the final
/// message is `Err(reason)` so the host can report why the stream ended,
/// rather than treating a dropped channel as a clean exit. The thread exits
/// when the tree errors or the receiver is dropped.