conjure_codegen/example_types/product/
boolean_alias_example.rs1#[derive(
2 Debug,
3 Clone,
4 conjure_object::serde::Deserialize,
5 conjure_object::serde::Serialize,
6 Copy,
7 PartialEq,
8 Eq,
9 PartialOrd,
10 Ord,
11 Hash,
12 Default
13)]
14#[serde(crate = "conjure_object::serde", transparent)]
15pub struct BooleanAliasExample(pub bool);
16impl std::fmt::Display for BooleanAliasExample {
17 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18 std::fmt::Display::fmt(&self.0, fmt)
19 }
20}
21impl conjure_object::Plain for BooleanAliasExample {
22 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23 conjure_object::Plain::fmt(&self.0, fmt)
24 }
25}
26impl conjure_object::FromPlain for BooleanAliasExample {
27 type Err = <bool as conjure_object::FromPlain>::Err;
28 #[inline]
29 fn from_plain(s: &str) -> Result<BooleanAliasExample, Self::Err> {
30 conjure_object::FromPlain::from_plain(s).map(BooleanAliasExample)
31 }
32}
33impl std::convert::From<bool> for BooleanAliasExample {
34 #[inline]
35 fn from(v: bool) -> Self {
36 BooleanAliasExample(std::convert::From::from(v))
37 }
38}
39impl std::ops::Deref for BooleanAliasExample {
40 type Target = bool;
41 #[inline]
42 fn deref(&self) -> &bool {
43 &self.0
44 }
45}
46impl std::ops::DerefMut for BooleanAliasExample {
47 #[inline]
48 fn deref_mut(&mut self) -> &mut bool {
49 &mut self.0
50 }
51}