fn handle_command_internal(
        &self,
        command: impl IncomingTargetCommand,
    ) -> impl Future<Output = Result<(), Error>> {
        fx_vlog!(tag: "avrcp", 2, "handle_command {:#?}", command);
        let inner = self.inner.clone();

        async move {
            // Step 1. Decode the command
            let decoded_command = match Command::decode_command(
                command.body(),
                command.packet_type(),
                command.op_code(),
            ) {
                // Step 2. Handle any decoding errors. If we have a decoding error, send the correct
                // error response and early return.
                Err(decode_error) => return send_decode_error_response(decode_error, command),
                Ok(x) => x,
            };

            let delegate = inner.target_delegate.clone();
            // Step 3. Handle our current message depending on the type.
            match decoded_command {
                Command::Passthrough { command: avc_cmd, pressed } => {
                    handle_passthrough_command(delegate, command, avc_cmd, pressed).await
                }
                Command::VendorSpecific(cmd) => match cmd {
                    VendorSpecificCommand::Notify(cmd) => {
                        handle_notify_command(delegate, command, cmd).await
                    }
                    VendorSpecificCommand::Status(cmd) => {
                        handle_status_command(delegate, command, cmd).await
                    }
                    VendorSpecificCommand::Control(cmd) => {
                        handle_control_command(delegate, command, cmd).await
                    }
                },
            }
        }
    }
// we don't want to make IncomingTargetCommand trait pub.
we don't want to make IncomingTargetCommand trait pub.
we don ' t want to make IncomingTargetCommand trait pub .
fn handle_command_internal(
        &self,
        command: impl IncomingTargetCommand,
    ) -> impl Future<Output = Result<(), Error>> {
        fx_vlog!(tag: "avrcp", 2, "handle_command {:#?}", command);
        let inner = self.inner.clone();
        async move {
            // Step 1. Decode the command
            let decoded_command = match Command::decode_command(
                command.body(),
                command.packet_type(),
                command.op_code(),
            ) {
                // Step 2. Handle any decoding errors. If we have a decoding error, send the correct
                // error response and early return.
                Err(decode_error) => return send_decode_error_response(decode_error, command),
                Ok(x) => x,
            };
            let delegate = inner.target_delegate.clone();
            // Step 3. Handle our current message depending on the type.
            match decoded_command {
                Command::Passthrough { command: avc_cmd, pressed } => {
                    handle_passthrough_command(delegate, command, avc_cmd, pressed).await
                }
                Command::VendorSpecific(cmd) => match cmd {
                    VendorSpecificCommand::Notify(cmd) => {
                        handle_notify_command(delegate, command, cmd).await
                    }
                    VendorSpecificCommand::Status(cmd) => {
                        handle_status_command(delegate, command, cmd).await
                    }
                    VendorSpecificCommand::Control(cmd) => {
                        handle_control_command(delegate, command, cmd).await
                    }
                },
            }
        }
    }
fn handle_command_internal ( & self , command : impl IncomingTargetCommand , ) -> impl Future < Output = Result < ( ) , Error > > { fx_vlog ! ( tag " " 2 " " command ) ; let inner = self . inner . clone ( ) ; async move { // Step 1. Decode the command let decoded_command = match Command :: decode_command ( command . body ( ) , command . packet_type ( ) , command . op_code ( ) , ) { // Step 2. Handle any decoding errors. If we have a decoding error, send the correct // error response and early return. Err ( decode_error ) => return send_decode_error_response ( decode_error , command ) , Ok ( x ) => x , } ; let delegate = inner . target_delegate . clone ( ) ; // Step 3. Handle our current message depending on the type. match decoded_command { Command :: Passthrough { command : avc_cmd , pressed } => { handle_passthrough_command ( delegate , command , avc_cmd , pressed ) . await } Command :: VendorSpecific ( cmd ) => match cmd { VendorSpecificCommand :: Notify ( cmd ) => { handle_notify_command ( delegate , command , cmd ) . await } VendorSpecificCommand :: Status ( cmd ) => { handle_status_command ( delegate , command , cmd ) . await } VendorSpecificCommand :: Control ( cmd ) => { handle_control_command ( delegate , command , cmd ) . await } } , } } }
we don't want to make IncomingTargetCommand trait pub.
we don ' t want to make IncomingTargetCommand trait pub .
&self
command
impl IncomingTargetCommand
&self
command
impl IncomingTargetCommand