Skip to main content

error_from

Macro error_from 

Source
macro_rules! error_from {
    ($ctx:literal, $($err_ty:ty),* $(,)?) => { ... };
}
Expand description

Create default From<T> for Error, with optional extra context.

ยงExample

use rustradio::error_from;
error_from!(
    "audio",
    cpal::PlayStreamError,
    cpal::BuildStreamError,
    cpal::DevicesError,
    cpal::DeviceNameError,
    cpal::SupportedStreamConfigsError,
    cpal::DefaultStreamConfigError,
);