@@ -3,6 +3,7 @@ use std::fmt::Debug;
3
3
4
4
use serde:: { de:: DeserializeOwned , Deserialize , Deserializer , Serialize } ;
5
5
6
+ /// A wrapper around values where some values may be conditionally included (e.g. only on a certain platform), and others are unconditional.
6
7
#[ derive( Debug , Clone , PartialEq , Eq , Serialize ) ]
7
8
pub struct Select < T >
8
9
where
@@ -78,19 +79,23 @@ where
78
79
}
79
80
}
80
81
81
- pub ( crate ) fn is_empty ( & self ) -> bool {
82
+ /// Whether there zero values in this collection, common or configuration-specific.
83
+ pub fn is_empty ( & self ) -> bool {
82
84
T :: is_empty ( self )
83
85
}
84
86
85
- pub ( crate ) fn configurations ( & self ) -> BTreeSet < String > {
87
+ /// A list of the configurations which have some configuration-specific value associated.
88
+ pub fn configurations ( & self ) -> BTreeSet < String > {
86
89
self . selects . keys ( ) . cloned ( ) . collect ( )
87
90
}
88
91
89
- pub ( crate ) fn items ( & self ) -> Vec < ( Option < String > , T :: ItemType ) > {
92
+ /// All values and their associated configurations, if any.
93
+ pub fn items ( & self ) -> Vec < ( Option < String > , T :: ItemType ) > {
90
94
T :: items ( self )
91
95
}
92
96
93
- pub ( crate ) fn values ( & self ) -> Vec < T :: ItemType > {
97
+ /// All values, whether common or configured.
98
+ pub fn values ( & self ) -> Vec < T :: ItemType > {
94
99
T :: values ( self )
95
100
}
96
101
0 commit comments