pub fn from_os_status(os_status: OSStatus) -> Result<(), Error> {
        match os_status {
            0     => Ok(()),
            -1500 => Err(Error::Unspecified),
            -1501 => Err(Error::SystemSoundClientMessageTimedOut),
            _     => {
                match AudioError::from_os_status(os_status) {
                    Ok(())                   => return Ok(()),
                    Err(AudioError::Unknown) => (),
                    Err(err)                 => return Err(Error::Audio(err)),
                }
                match AudioCodecError::from_os_status(os_status) {
                    Ok(())                        => return Ok(()),
                    Err(AudioCodecError::Unknown) => (),
                    Err(err)                      => return Err(Error::AudioCodec(err)),
                }
                match AudioFormatError::from_os_status(os_status) {
                    Ok(()) => return Ok(()),
                    Err(AudioFormatError::Unknown) => (),
                    Err(err) => return Err(Error::AudioFormat(err)),
                }
                match AudioUnitError::from_os_status(os_status) {
                    Ok(())                       => return Ok(()),
                    Err(AudioUnitError::Unknown) => (),
                    Err(err)                     => return Err(Error::AudioUnit(err)),
                }
                Err(Error::Unknown(os_status))
            },
        }
    }
/// Convert an OSStatus to a std Rust Result.
Convert an OSStatus to a std Rust Result.
Convert an OSStatus to a std Rust Result .
pub fn from_os_status(os_status: OSStatus) -> Result<(), Error> {
        match os_status {
            0     => Ok(()),
            -1500 => Err(Error::Unspecified),
            -1501 => Err(Error::SystemSoundClientMessageTimedOut),
            _     => {
                match AudioError::from_os_status(os_status) {
                    Ok(())                   => return Ok(()),
                    Err(AudioError::Unknown) => (),
                    Err(err)                 => return Err(Error::Audio(err)),
                }
                match AudioCodecError::from_os_status(os_status) {
                    Ok(())                        => return Ok(()),
                    Err(AudioCodecError::Unknown) => (),
                    Err(err)                      => return Err(Error::AudioCodec(err)),
                }
                match AudioFormatError::from_os_status(os_status) {
                    Ok(()) => return Ok(()),
                    Err(AudioFormatError::Unknown) => (),
                    Err(err) => return Err(Error::AudioFormat(err)),
                }
                match AudioUnitError::from_os_status(os_status) {
                    Ok(())                       => return Ok(()),
                    Err(AudioUnitError::Unknown) => (),
                    Err(err)                     => return Err(Error::AudioUnit(err)),
                }
                Err(Error::Unknown(os_status))
            },
        }
    }
pub fn from_os_status ( os_status : OSStatus ) -> Result < ( ) , Error > { match os_status { 0 => Ok ( ( ) ) , - 1500 => Err ( Error :: Unspecified ) , - 1501 => Err ( Error :: SystemSoundClientMessageTimedOut ) , _ => { match AudioError :: from_os_status ( os_status ) { Ok ( ( ) ) => return Ok ( ( ) ) , Err ( AudioError :: Unknown ) => ( ) , Err ( err ) => return Err ( Error :: Audio ( err ) ) , } match AudioCodecError :: from_os_status ( os_status ) { Ok ( ( ) ) => return Ok ( ( ) ) , Err ( AudioCodecError :: Unknown ) => ( ) , Err ( err ) => return Err ( Error :: AudioCodec ( err ) ) , } match AudioFormatError :: from_os_status ( os_status ) { Ok ( ( ) ) => return Ok ( ( ) ) , Err ( AudioFormatError :: Unknown ) => ( ) , Err ( err ) => return Err ( Error :: AudioFormat ( err ) ) , } match AudioUnitError :: from_os_status ( os_status ) { Ok ( ( ) ) => return Ok ( ( ) ) , Err ( AudioUnitError :: Unknown ) => ( ) , Err ( err ) => return Err ( Error :: AudioUnit ( err ) ) , } Err ( Error :: Unknown ( os_status ) ) } , } }
Convert an OSStatus to a std Rust Result.
Convert an OSStatus to a std Rust Result .
os_status
OSStatus
os_status
OSStatus