/// An enumeration of possible errors that can happen when working with cubeb. #[derive(PartialEq, Eq, Clone, Debug, Copy)] pubenum Error { /// GenericError
Error = ffi::CUBEB_ERROR as isize, /// Requested format is invalid
InvalidFormat = ffi::CUBEB_ERROR_INVALID_FORMAT as isize, /// Requested parameter is invalid
InvalidParameter = ffi::CUBEB_ERROR_INVALID_PARAMETER as isize, /// Requested operation is not supported
NotSupported = ffi::CUBEB_ERROR_NOT_SUPPORTED as isize, /// Requested device is unavailable
DeviceUnavailable = ffi::CUBEB_ERROR_DEVICE_UNAVAILABLE as isize,
}
impl Error { pubfn wrap(code: c_int) -> Result<()> { let inner = match code {
ffi::CUBEB_OK => return Ok(()),
ffi::CUBEB_ERROR_INVALID_FORMAT => Error::InvalidFormat,
ffi::CUBEB_ERROR_INVALID_PARAMETER => Error::InvalidParameter,
ffi::CUBEB_ERROR_NOT_SUPPORTED => Error::NotSupported,
ffi::CUBEB_ERROR_DEVICE_UNAVAILABLE => Error::DeviceUnavailable, // Everything else is just the generic error
_ => {
debug_assert!(code == Error::Error as c_int);
Error::Error
}
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.