@@ -3,6 +3,7 @@ use std::fmt::Debug;
33
44use serde:: { de:: DeserializeOwned , Deserialize , Deserializer , Serialize } ;
55
6+ /// A wrapper around values where some values may be conditionally included (e.g. only on a certain platform), and others are unconditional.
67#[ derive( Debug , Clone , PartialEq , Eq , Serialize ) ]
78pub struct Select < T >
89where
@@ -78,19 +79,23 @@ where
7879 }
7980 }
8081
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 {
8284 T :: is_empty ( self )
8385 }
8486
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 > {
8689 self . selects . keys ( ) . cloned ( ) . collect ( )
8790 }
8891
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 ) > {
9094 T :: items ( self )
9195 }
9296
93- pub ( crate ) fn values ( & self ) -> Vec < T :: ItemType > {
97+ /// All values, whether common or configured.
98+ pub fn values ( & self ) -> Vec < T :: ItemType > {
9499 T :: values ( self )
95100 }
96101
0 commit comments