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
//! The [`Component`] type — registered via [`crate::Installer::component`]
//! for optional wizard/CLI-selectable install features.
/// An optional feature the user can select or deselect at install time.
///
/// Registered via [`crate::Installer::component`]. The component's progress weight
/// contributes to the installer's step total whenever the component is
/// selected; operations performed while the component is active each advance
/// the cursor by their own weight (default 1).
///
/// ```rust,ignore
/// i.component("docs", "Documentation", "User-facing docs", 3);
/// i.component("extras", "Extras", "Optional samples", 1).default_off();
/// i.component("core", "Core files", "Always installed", 10).required();
/// ```
///
/// Query with [`crate::Installer::is_component_selected`] inside the install
/// callback to branch on user choice.