fn check_fd_nums(&self, fd_nums: usize) -> Result<()> {
        match self.get_id()? {
            CRAS_CLIENT_CONNECTED => match fd_nums {
                1 => Ok(()),
                _ => Err(Error::MessageNumFdError),
            },
            CRAS_CLIENT_STREAM_CONNECTED => match fd_nums {
                // CRAS should return two shared memory areas the first which has
                // mem::size_of::<cras_audio_shm_header>() bytes, and the second which has
                // `samples_shm_size` bytes.
                2 => Ok(()),
                _ => Err(Error::MessageNumFdError),
            },
            CRAS_CLIENT_AUDIO_DEBUG_INFO_READY => match fd_nums {
                0 => Ok(()),
                _ => Err(Error::MessageNumFdError),
            },
            _ => Err(Error::MessageTypeError),
        }
    }
// Check if `fd nums` of a read result is valid
Check if `fd nums` of a read result is valid
Check if ` fd nums ` of a read result is valid
fn check_fd_nums(&self, fd_nums: usize) -> Result<()> {
        match self.get_id()? {
            CRAS_CLIENT_CONNECTED => match fd_nums {
                1 => Ok(()),
                _ => Err(Error::MessageNumFdError),
            },
            CRAS_CLIENT_STREAM_CONNECTED => match fd_nums {
                // CRAS should return two shared memory areas the first which has
                // mem::size_of::<cras_audio_shm_header>() bytes, and the second which has
                // `samples_shm_size` bytes.
                2 => Ok(()),
                _ => Err(Error::MessageNumFdError),
            },
            CRAS_CLIENT_AUDIO_DEBUG_INFO_READY => match fd_nums {
                0 => Ok(()),
                _ => Err(Error::MessageNumFdError),
            },
            _ => Err(Error::MessageTypeError),
        }
    }
fn check_fd_nums ( & self , fd_nums : usize ) -> Result < ( ) > { match self . get_id ( ) ? { CRAS_CLIENT_CONNECTED => match fd_nums { 1 => Ok ( ( ) ) , _ => Err ( Error :: MessageNumFdError ) , } , CRAS_CLIENT_STREAM_CONNECTED => match fd_nums { // CRAS should return two shared memory areas the first which has // mem::size_of::<cras_audio_shm_header>() bytes, and the second which has // `samples_shm_size` bytes. 2 => Ok ( ( ) ) , _ => Err ( Error :: MessageNumFdError ) , } , CRAS_CLIENT_AUDIO_DEBUG_INFO_READY => match fd_nums { 0 => Ok ( ( ) ) , _ => Err ( Error :: MessageNumFdError ) , } , _ => Err ( Error :: MessageTypeError ) , } }
Check if `fd nums` of a read result is valid
Check if ` fd nums ` of a read result is valid
&self
fd_nums
usize
&self
fd_nums
usize