|
1 | 1 | //! Safely and explicitly parse untrusted aka `dangerous` data. |
2 | 2 | //! |
3 | | -//! # Basic usage |
4 | | -//! |
5 | | -//! ``` |
6 | | -//! use dangerous::{Input, Invalid}; |
7 | | -//! |
8 | | -//! let input = dangerous::input(b"hello"); |
9 | | -//! let result: Result<_, Invalid> = input.read_partial(|r| { |
10 | | -//! r.read() |
11 | | -//! }); |
12 | | -//! |
13 | | -//! assert_eq!(result, Ok((b'h', dangerous::input(b"ello")))); |
14 | | -//! ``` |
15 | | -//! |
16 | | -//! # Feature flags |
17 | | -//! |
18 | | -//! | Feature | Default | Description |
19 | | -//! | ---------------- | ----------- | -------------------------------------------------- | |
20 | | -//! | `std` | **Enabled** | Enables `std::error::Error` support and `alloc` | |
21 | | -//! | `alloc` | **Enabled** | Enables allocations. | |
22 | | -//! | `simd` | **Enabled** | Enables all supported SIMD optimisations. | |
23 | | -//! | `unicode` | **Enabled** | Enables improved unicode printing support. | |
24 | | -//! | `full-backtrace` | **Enabled** | Enables collection of all contexts for `Expected`. | |
25 | | -//! | `zc` | _Disabled_ | Enables `zc` crate support. | |
26 | | -//! | `nom` | _Disabled_ | Enables `nom` crate error support. | |
27 | | -//! | `regex` | _Disabled_ | Enables `regex` pattern support. | |
| 3 | +//! See the [`guide`] module to see how to get started. |
28 | 4 |
|
29 | 5 | /////////////////////////////////////////////////////////////////////////////// |
30 | 6 | // Library quirks & hacks |
@@ -72,6 +48,8 @@ mod util; |
72 | 48 | pub mod display; |
73 | 49 | pub mod error; |
74 | 50 | pub mod input; |
| 51 | +#[cfg(feature = "guide")] |
| 52 | +pub mod guide; |
75 | 53 |
|
76 | 54 | pub use self::error::{Error, Expected, Fatal, Invalid, ToRetryRequirement}; |
77 | 55 | pub use self::input::{Bound, ByteArray, Bytes, Input, MaybeString, Span, String}; |
|
0 commit comments