Module dangerous::error [−][src]
Expand description
Error support.
- If you want the fastest error which has no debugging information,
Fatal
orInvalid
(retryable) has you covered. - If you want an error that is still designed to be fast, but also includes
debugging information,
Expected
will meet your uh, expectations… If the featurefull-backtrace
is enabled,Expected
usesFullBacktrace
,RootBacktrace
if not. - If you require more verbosity, consider creating custom
Context
s before jumping to custom errors. If you do require a custom error, implementing it is easy enough. Just implementWithContext
andFrom
forExpectedValue
,ExpectedLength
andExpectedValid
and you’ll be on your merry way. Additionally implementDetails
to support lovely error printing andToRetryRequirement
for streaming protocols.
Most of what dangerous
supports out of the box is good to go. If you need
to stretch out performance more, or provide additional functionality on what
is provided, the error system should be flexible for those requirements. If
it’s not, consider opening an issue.
Structs
CoreContext | A |
Expected | An error that |
ExpectedLength | An error representing a failed requirement for a length of
|
ExpectedValid | An error representing a failed requirement for a valid
|
ExpectedValue | An error representing a failed exact value requirement of
|
ExternalContext | A |
Fatal | An error that has no details around what went wrong and cannot be retried. |
FullBacktrace | alloc
|
Invalid | An error that has no details around what went wrong other than a
|
RetryRequirement | An indicator of how many bytes are required to continue processing input. |
RootBacktrace | A |
Value | Value that was expected in an operation. |
WithChildContext | Wraps an error making all contexts added to it children of the last operation. |
Enums
CoreExpected | Core expectations used by |
CoreOperation | Core operations used by |
Length | Length that was expected in an operation. |
Traits
Backtrace | Implemented for walkable stacks of |
BacktraceBuilder | Implemented for |
Context | Information surrounding an error. |
Details | Required details around an error to produce a verbose report on what went wrong when processing input. |
Error | Auto-trait for |
External | Implemented for errors that aren’t a first-class citizen to |
Operation | Operation that failed within a context. |
ToRetryRequirement | Implemented for errors that return a |
WithContext | Implemented for errors that collect |
Type Definitions
BacktraceWalker | A dynamic function for walking a context backtrace. |