pub async fn send_watch_notification(
        &self,
        event: NotificationEvent,
        current_value: Notification,
        pos_change_interval: u32,
    ) -> Result<Notification, TargetAvcError> {
        if event == NotificationEvent::VolumeChanged {
            let send_command_fut = {
                let inner_guard = self.inner.lock();
                match &inner_guard.absolute_volume_handler {
                    Some(absolute_volume_handler) => absolute_volume_handler.on_volume_changed(),
                    // we have don't have a target handler, return no players available
                    None => return Err(TargetAvcError::RejectedAddressedPlayerChanged),
                }
            };

            let volume = send_command_fut
                .await
                .map_err(|_| TargetAvcError::RejectedAddressedPlayerChanged)?;

            let mut notif = Notification::new_empty();
            notif.volume = Some(volume);
            Ok(notif)
        } else {
            let send_command_fut = {
                let inner_guard = self.inner.lock();
                match &inner_guard.target_handler {
                    Some(target_handler) => {
                        target_handler.watch_notification(event, current_value, pos_change_interval)
                    }
                    // we have don't have a target handler, return no players available
                    None => return Err(TargetAvcError::RejectedAddressedPlayerChanged),
                }
            };

            // if we have a FIDL error, that the players changed
            send_command_fut.await.map_err(|_| TargetAvcError::RejectedAddressedPlayerChanged)?
        }
    }
/// Watch for the change of the notification value
Watch for the change of the notification value
Watch for the change of the notification value
pub async fn send_watch_notification(
        &self,
        event: NotificationEvent,
        current_value: Notification,
        pos_change_interval: u32,
    ) -> Result<Notification, TargetAvcError> {
        if event == NotificationEvent::VolumeChanged {
            let send_command_fut = {
                let inner_guard = self.inner.lock();
                match &inner_guard.absolute_volume_handler {
                    Some(absolute_volume_handler) => absolute_volume_handler.on_volume_changed(),
                    // we have don't have a target handler, return no players available
                    None => return Err(TargetAvcError::RejectedAddressedPlayerChanged),
                }
            };
            let volume = send_command_fut
                .await
                .map_err(|_| TargetAvcError::RejectedAddressedPlayerChanged)?;
            let mut notif = Notification::new_empty();
            notif.volume = Some(volume);
            Ok(notif)
        } else {
            let send_command_fut = {
                let inner_guard = self.inner.lock();
                match &inner_guard.target_handler {
                    Some(target_handler) => {
                        target_handler.watch_notification(event, current_value, pos_change_interval)
                    }
                    // we have don't have a target handler, return no players available
                    None => return Err(TargetAvcError::RejectedAddressedPlayerChanged),
                }
            };
            // if we have a FIDL error, that the players changed
            send_command_fut.await.map_err(|_| TargetAvcError::RejectedAddressedPlayerChanged)?
        }
    }
pub async fn send_watch_notification ( & self , event : NotificationEvent , current_value : Notification , pos_change_interval : u32 , ) -> Result < Notification , TargetAvcError > { if event == NotificationEvent :: VolumeChanged { let send_command_fut = { let inner_guard = self . inner . lock ( ) ; match & inner_guard . absolute_volume_handler { Some ( absolute_volume_handler ) => absolute_volume_handler . on_volume_changed ( ) , // we have don't have a target handler, return no players available None => return Err ( TargetAvcError :: RejectedAddressedPlayerChanged ) , } } ; let volume = send_command_fut . await . map_err ( | _ | TargetAvcError :: RejectedAddressedPlayerChanged ) ? ; let mut notif = Notification :: new_empty ( ) ; notif . volume = Some ( volume ) ; Ok ( notif ) } else { let send_command_fut = { let inner_guard = self . inner . lock ( ) ; match & inner_guard . target_handler { Some ( target_handler ) => { target_handler . watch_notification ( event , current_value , pos_change_interval ) } // we have don't have a target handler, return no players available None => return Err ( TargetAvcError :: RejectedAddressedPlayerChanged ) , } } ; // if we have a FIDL error, that the players changed send_command_fut . await . map_err ( | _ | TargetAvcError :: RejectedAddressedPlayerChanged ) ? } }
Watch for the change of the notification value
Watch for the change of the notification value
&self
event
NotificationEvent
current_value
Notification
pos_change_interval
u32
&self
event
NotificationEvent
current_value
Notification
pos_change_interval
u32