arch_pkg_text/misc/
static_value.rs

1/// [Static boolean](StaticBool) which corresponds to `false`.
2pub struct False;
3impl sealed::Sealed for False {}
4impl StaticValue for False {
5    type CorrespondingRuntimeType = bool;
6    const VALUE: Self::CorrespondingRuntimeType = false;
7}
8
9/// [Static boolean](StaticBool) which corresponds to `true`.
10pub struct True;
11impl sealed::Sealed for True {}
12impl StaticValue for True {
13    type CorrespondingRuntimeType = bool;
14    const VALUE: Self::CorrespondingRuntimeType = true;
15}
16
17/// To be used as an associated type which is analogous to a `bool`.
18pub trait StaticBool: StaticValue<CorrespondingRuntimeType = bool> {}
19impl<X: StaticValue<CorrespondingRuntimeType = bool> + ?Sized> StaticBool for X {}
20
21pub trait StaticValue: sealed::Sealed {
22    type CorrespondingRuntimeType: ?Sized;
23    const VALUE: Self::CorrespondingRuntimeType;
24}
25
26mod sealed {
27    pub trait Sealed {}
28}