diff --git a/src/errors.rs b/src/errors.rs index 7786ea70..1c858844 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -10,6 +10,20 @@ use std::sync::Arc; /// Combines errors into one error enum where `Error::source`, `Display` and `From` is already defined /// +/// **Usage** +/// ```no_run +/// combined_error! { +/// /// ANY DOCS HERE +/// #[ANY_ATTRIBUTE] +/// NAME_OF_ERROR_TYPE ";" +/// ERROR_VARIANT "(" ERROR_TYPE ?STORED_TYPE ")" FORMAT_STRING "," +/// } +/// ``` +/// - Docs and attributes are optional and apply to the new error type +/// - FORMAT_STRING: Format string passed directly to `write!` (the error is the only parameter passed to `write!`) +/// - STORED_TYPE: Optional inner type (like Arc) +/// - where: ERROR_TYPE: Into +/// /// Additionally, all source errors are required to have a `Into` /// implementation so that all errors can be converted to `crate::Error` macro_rules! combined_error {