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
//! Sealed marker trait gating the no-args shortcut on `RuntimeBuilder::build()`.
//!
//! `OptionalArgs` is implemented only for `()`. When `App::Args = ()`, consumers
//! can call `.build()` without `.with_args(...)`. For any other Args type, the
//! compiler requires `.with_args` to be called.
pub
/// Marker trait gating the `Args = ()` shortcut on `RuntimeBuilder::build()`.
///
/// Sealed: consumers cannot extend it. Only `()` implements `OptionalArgs`.
/// Any consumer who wants the no-`with_args` shortcut on `RuntimeBuilder::build()`
/// must declare `type Args = ();` on their `App` impl.
///
/// # Sealed invariant
///
/// Only `()` implements `OptionalArgs`. Custom types cannot opt in:
///
/// ```compile_fail
/// use envision::OptionalArgs;
/// struct MyArgs;
/// impl OptionalArgs for MyArgs {} // Compile error: trait `Sealed` is private
/// ```