Macro bitcoin_internals::parse_error_type
source · macro_rules! parse_error_type { ($vis:vis $name:ident, $source:ty, $subject:expr $(, $derive:path)* $(,)?) => { ... }; }
Expand description
Creates an error type intended for string parsing errors.
The resulting error type has two fields: input
and source
. The type of input
is
InputString
, the type of source
is specified as the second argument
to the macro.
The resulting type is public, conditionally implements [std::error::Error
] and has a private
new()
method for convenience.
§Parameters
name
- the name of the error typesource
- the type of the source typesubject
- English description of the type being parsed (e.g. “a bitcoin amount”)derive
- list of derives to add