deser_jsonc/trailing.rs
1// @generated from deser-template-json/src/trailing.rs by
2// deser-template-json/generate.py. Do not edit.
3//! What may follow a value.
4
5/// Controls what may follow a value.
6///
7/// See [`DeserializerConfig::set_trailing`](crate::DeserializerConfig::set_trailing).
8#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
9pub enum Trailing {
10 /// Only whitespace may follow the value.
11 ///
12 /// This is the default. Anything else after the value is an error.
13 #[default]
14 Strict,
15 /// Every value is on a line of its own ([JSON
16 /// Lines](https://jsonlines.org/), also known as NDJSON).
17 ///
18 /// Only whitespace may follow a value on its line, the next line holds
19 /// the next value. Lines that only contain whitespace are skipped.
20 /// Errors are contained to their line: if a line fails to deserialize
21 /// (even if it's malformed) the next call to
22 /// [`Deserializer::deserialize`](crate::Deserializer::deserialize) continues with the next line.
23 Newline,
24 /// Parsing stops after the value, regardless of what follows.
25 ///
26 /// The data after the value is not looked at. The next call to
27 /// [`Deserializer::deserialize`](crate::Deserializer::deserialize) continues after the value (see
28 /// [`Deserializer::offset`](crate::Deserializer::offset)), which also reads concatenated JSON.
29 Stop,
30}