Skip to content

Commit

Permalink
tighterror: add Variant Types documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
r-bk committed Aug 31, 2024
1 parent a1dc3ac commit 2327469
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,28 @@
//! errors in the category, or in [module object](#module-doc-from-display)
//! to affect all errors in the module.
//! Values defined on lower levels win.<br>
//! Default: `false`<br>
//! Default: `false`<br><br>
//!
//! * `variant_type` - bool|string (optional)<a name="err-obj-variant-type"></a>
//!
//! Enables creation of a Variant Type for this error.
//!
//! When specified as a boolean `true|false` it enables/disables creation
//! of a Variant Type for this error. When enabled the name of the Variant
//! Type is derived by converting the error name case from UPPER_SNAKE to
//! UpperCamel, e.g., `OPERATION_TIMEOUT` becomes `OperationTimeout`.
//!
//! To customize the Variant Type name it is possible to specify this
//! attribute as a string. In this case the value of the attribute becomes
//! the name of the Variant Type. It must be a valid Rust struct name
//! specified in UpperCamel case.
//!
//! This attribute can be enabled on a higher level in
//! [category object](#category-variant-type) or in
//! [module object](#module-variant-type).
//! Values defined on lower levels win.
//!
//! Default: `false`<br><br>
//!
//! ### Error Object Examples
//!
Expand Down Expand Up @@ -434,6 +455,18 @@
//! (see below) this attribute is forbidden, and the error list must be
//! defined as a root-level attribute.<br><br>
//!
//! * `variant_type` - bool (optional)<a name="category-variant-type"></a>
//!
//! Sets a default value for the [`variant_type`](#err-obj-variant-type)
//! *error object* attribute. This affects errors belonging to this category
//! only. The value is used for all errors that do not define this property
//! explicitly as part of *error object* specification.
//!
//! Customization of Variant Type name is possible only in the *error object*
//! specification.
//!
//! Default: `false`<br><br>
//!
//! ### Category Object Examples
//!
//! A specification with a single implicit category `General`. Note, the error
Expand Down Expand Up @@ -753,6 +786,20 @@
//! to create a `Result<T, Error>` from `ErrorKind`.<br>
//! Default: `true`<br><br>
//!
//! * `variant_type` - bool (optional)<a name="module-variant-type"></a>
//!
//! Sets a default value for the [`variant_type`](#err-obj-variant-type)
//! *error object* attribute. This affects errors belonging to all categories
//! in this module. The value is used for all categories and errors that do
//! not define this property explicitly as part of
//! [category object](#category-variant-type) or
//! [error object](#err-obj-variant-type) specification.
//!
//! Customization of Variant Type name is possible only in the *error object*
//! specification.
//!
//! Default: `false`<br><br>
//!
//! ### Module Object Examples
//!
//! YAML
Expand Down

0 comments on commit 2327469

Please sign in to comment.