serde_private_core/private/content.rs
1use crate::lib::*;
2
3// Used from generated code to buffer the contents of the Deserializer when
4// deserializing untagged enums and internally tagged enums.
5//
6// Not public API. Use serde-value instead.
7//
8// Obsoleted by format-specific buffer types (https://github.com/serde-rs/serde/pull/2912).
9pub enum Content<'de> {
10 Bool(bool),
11
12 U8(u8),
13 U16(u16),
14 U32(u32),
15 U64(u64),
16
17 I8(i8),
18 I16(i16),
19 I32(i32),
20 I64(i64),
21
22 F32(f32),
23 F64(f64),
24
25 Char(char),
26 String(String),
27 Str(&'de str),
28 ByteBuf(Vec<u8>),
29 Bytes(&'de [u8]),
30
31 None,
32 Some(Box<Content<'de>>),
33
34 Unit,
35 Newtype(Box<Content<'de>>),
36 Seq(Vec<Content<'de>>),
37 Map(Vec<(Content<'de>, Content<'de>)>),
38}