[−][src]Module dangerous::error
Error support.
- If you want the fastest error which has no debugging information,
Invalid
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-context
is enabled,Expected
usesFullContextStack
,RootContextStack
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 implementFromContext
andFrom
forExpectedValue
,ExpectedLength
andExpectedValid
and you'll be on your merry way. Additionally implementDetails
to support lovely error printing andToRetryRequirement
andIntoFatal
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
Expected | A catch-all error for all expected errors supported in this crate. |
ExpectedContext | A sealed expected |
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 |
FullContextStack | full-context A |
Invalid |
|
RetryRequirement | An indicator of how many bytes are required to continue processing input. |
RootContextStack | A |
Traits
Context | The base context surrounding an error. |
ContextStack | A walkable stack of |
ContextStackBuilder | A |
Details | The required details around an error to produce a verbose report on what went wrong when processing input. |
Error | Convenience trait requiring both |
FromContext | Implemented for errors that collect |
FromExpected | Convenience trait requiring |
IntoFatal | Implemented for errors that can have their |
ToRetryRequirement | Implemented for errors that return a |
Type Definitions
ContextStackWalker | A dynamic function for walking a context stack. |