pub fn watch_hosts() -> impl Stream<Item = Result<HostEvent, io::Error>> {
    async {
        let directory = open_directory_in_namespace(HOST_DEVICE_DIR, OPEN_RIGHT_READABLE).unwrap();
        let watcher = vfs_watcher::Watcher::new(directory)
            .await
            .expect("Cannot open vfs watcher for bt-host device path");
        watcher.try_filter_map(|msg| future::ok(as_host_event(msg)))
    }
    .flatten_stream()
}
/// Watch the VFS for host devices being added or removed, and produce a stream of HostEvent messages
Watch the VFS for host devices being added or removed, and produce a stream of HostEvent messages
Watch the VFS for host devices being added or removed and produce a stream of HostEvent messages
pub fn watch_hosts() -> impl Stream<Item = Result<HostEvent, io::Error>> {
    async {
        let directory = open_directory_in_namespace(HOST_DEVICE_DIR, OPEN_RIGHT_READABLE).unwrap();
        let watcher = vfs_watcher::Watcher::new(directory)
            .await
            .expect("Cannot open vfs watcher for bt-host device path");
        watcher.try_filter_map(|msg| future::ok(as_host_event(msg)))
    }
    .flatten_stream()
}
pub fn watch_hosts ( ) -> impl Stream < Item = Result < HostEvent , io :: Error > > { async { let directory = open_directory_in_namespace ( HOST_DEVICE_DIR , OPEN_RIGHT_READABLE ) . unwrap ( ) ; let watcher = vfs_watcher :: Watcher :: new ( directory ) . await . expect ( " " ) ; watcher . try_filter_map ( | msg | future :: ok ( as_host_event ( msg ) ) ) } . flatten_stream ( ) }
Watch the VFS for host devices being added or removed, and produce a stream of HostEvent messages
Watch the VFS for host devices being added or removed and produce a stream of HostEvent messages