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
use crate::;
/// A value type that can sit inside a [`Container`], an [`UnorderedContainer`] or an [`Optional`].
///
/// The format has no nested containers, so every value type implements this except the four that
/// are containers themselves: [`Container`], [`UnorderedContainer`], [`Optional`] and [`Map`].
/// Equivalently, [`Kind::is_container`] is false for every implementor's [`PropertyValueExt::KIND`].
///
/// It is a marker, so it adds nothing to [`PropertyValueExt`]. Its job is to let
/// [`Container::from_iter`] and the [`Optional`] conversions reject a nested container at compile
/// time; the constructors that take a [`Kind`] check the same rule at run time.
///
/// The trait is sealed. Those conversions are infallible, and they are only sound because every
/// implementor is a non-container kind, so allowing a downstream type to claim membership would
/// let it declare [`PropertyValueExt::KIND`] as a container and nest one through a safe
/// constructor.
///
/// [`Container`]: super::Container
/// [`Container::from_iter`]: super::Container::from_iter
/// [`UnorderedContainer`]: values::UnorderedContainer
/// [`Optional`]: values::Optional
/// [`Map`]: values::Map
/// [`Kind`]: crate::property::Kind
/// [`Kind::is_container`]: crate::property::Kind::is_container
impl_container_item!