Skip to main content

gloss_error

Macro gloss_error 

Source
macro_rules! gloss_error {
    ( $type:ident $(,)? ) => { ... };
    ( $type:ident, $display_prefix:expr $(,)? ) => { ... };
}
Expand description

Define an error type with a String representation for Display.

The first argument is the type name. The second optional argument is a prefix for the Display representation.

Implemented as a trivial Option newtype with new(ToString) as well as as_problem(ToString) constructors.

Note that the inner string is intended to be only representational. It is not recommended to associate other meanings with it because string comparisons are inefficient.

When the inner value is None (as is constructed by default) it behaves like a tag_error! type.