Crate simple_error
source ·Expand description
A simple error type backed by a string.
This crate provides a SimpleError
type, which implements std::error::Error
. The underlying
is a String
as the error message.
It should be used when all you care about is an error string.
It should not be used when you want to programmatically handle different kinds of an error.
Macros§
- Helper macro for returning a
SimpleError
constructed from either aInto<SimpleError>
, a string slice, or a formatted string. - Map a result type error to simple error with format
- Helper macro for unwrapping
Option
values while returning early with a newly constructedSimpleError
if the value of the expression isNone
. Can only be used in functions that returnResult<_, SimpleError>
. - Construct an ad-hoc
SimpleError
from a string. - Helper macro for unwrapping
Result
values while returning early with a newly constructedSimpleError
if the value of the expression isErr
. Can only be used in functions that returnResult<_, SimpleError>
.
Structs§
- A type that represents a simple error.
Type Aliases§
- Result type in which the error is a simple error