1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! This module defines the configuration options which a NDJSON-parser can be provided. The entry
//! point is the [NdjsonConfig] struct. Child data types are also defined in this module.
/// Controls how the parser deals with lines that contain no JSON values.
/// Configuration for the NDJSON-parser which controls the behavior in various situations.
///
/// By default, the parser will attempt to parse every line, i.e. every segment between `\n`
/// characters, even if it is empty. This will result in errors for empty lines.
///
/// You can construct a config by first calling [NdjsonConfig::default] and then using the
/// builder-style associated functions to configure it. See the example below.
///
/// ```
/// use ndjson_stream::config::{EmptyLineHandling, NdjsonConfig};
///
/// let config = NdjsonConfig::default()
/// .with_empty_line_handling(EmptyLineHandling::IgnoreBlank)
/// .with_parse_rest(true);
/// ```