Crate dangerous[−][src]
Expand description
Safely and explicitly parse untrusted aka dangerous
data.
Basic usage
use dangerous::{Input, Invalid}; let input = dangerous::input(b"hello"); let result: Result<_, Invalid> = input.read_partial(|r| { r.read_u8() }); assert_eq!(result, Ok((b'h', dangerous::input(b"ello"))));
Feature flags
Feature | Default | Description |
---|---|---|
std | Enabled | Enables std::error::Error support and alloc |
alloc | Enabled | Enables allocations. |
simd | Enabled | Enables all supported SIMD optimisations. |
unicode | Enabled | Enables improved unicode printing support. |
full-backtrace | Enabled | Enables collection of all contexts for Expected . |
zc | Disabled | Enables zc crate support. |
nom | Disabled | Enables nom crate error support. |
regex | Disabled | Enables regex pattern support. |
Modules
display | Display support. |
error | Error support. |
Structs
Bytes | Raw |
Expected | An error that |
Fatal | An error that has no details around what went wrong and cannot be retried. |
Invalid | An error that has no details around what went wrong other than a
|
Peek | Peek of |
Reader | Created from and consumes an |
Span | Range of |
String | UTF-8 |
Enums
Bound | Indication of whether |
MaybeString |
Traits
Error | Auto-trait for |
Input | Implemented for immutable wrappers around bytes to be processed ( |
Pattern | Implemented for structures that can be found within an
|
ToRetryRequirement | Implemented for errors that return a |
Functions
input | Creates a new |
Type Definitions
BytesReader | |
StringReader |