pub async fn events(&self) -> Result<impl Stream<Item = SessionEvent>> {
        let obj_events = self.inner.events(adapter::PATH.into(), true).await?;
        let events = obj_events.filter_map(|evt| async move {
            match evt {
                Event::ObjectAdded { object, interfaces }
                    if interfaces.iter().any(|i| i == adapter::INTERFACE) =>
                {
                    Adapter::parse_dbus_path(&object).map(|name| SessionEvent::AdapterAdded(name.to_string()))
                }
                Event::ObjectRemoved { object, interfaces }
                    if interfaces.iter().any(|i| i == adapter::INTERFACE) =>
                {
                    Adapter::parse_dbus_path(&object).map(|name| SessionEvent::AdapterRemoved(name.to_string()))
                }
                _ => None,
            }
        });
        Ok(events)
    }
/// Stream adapter added and removed events.
Stream adapter added and removed events.
Stream adapter added and removed events .
pub async fn events(&self) -> Result<impl Stream<Item = SessionEvent>> {
        let obj_events = self.inner.events(adapter::PATH.into(), true).await?;
        let events = obj_events.filter_map(|evt| async move {
            match evt {
                Event::ObjectAdded { object, interfaces }
                    if interfaces.iter().any(|i| i == adapter::INTERFACE) =>
                {
                    Adapter::parse_dbus_path(&object).map(|name| SessionEvent::AdapterAdded(name.to_string()))
                }
                Event::ObjectRemoved { object, interfaces }
                    if interfaces.iter().any(|i| i == adapter::INTERFACE) =>
                {
                    Adapter::parse_dbus_path(&object).map(|name| SessionEvent::AdapterRemoved(name.to_string()))
                }
                _ => None,
            }
        });
        Ok(events)
    }
pub async fn events ( & self ) -> Result < impl Stream < Item = SessionEvent > > { let obj_events = self . inner . events ( adapter :: PATH . into ( ) , true ) . await ? ; let events = obj_events . filter_map ( | evt | async move { match evt { Event :: ObjectAdded { object , interfaces } if interfaces . iter ( ) . any ( | i | i == adapter :: INTERFACE ) => { Adapter :: parse_dbus_path ( & object ) . map ( | name | SessionEvent :: AdapterAdded ( name . to_string ( ) ) ) } Event :: ObjectRemoved { object , interfaces } if interfaces . iter ( ) . any ( | i | i == adapter :: INTERFACE ) => { Adapter :: parse_dbus_path ( & object ) . map ( | name | SessionEvent :: AdapterRemoved ( name . to_string ( ) ) ) } _ => None , } } ) ; Ok ( events ) }
Stream adapter added and removed events.
Stream adapter added and removed events .
&self
&self