Debian Codegraph @

src/supported_traits.rs

raw symbols SCIP
1 #[cfg(not(any(
2 feature = "Debug",
3 feature = "Clone",
4 feature = "Copy",
5 feature = "PartialEq",
6 feature = "Eq",
7 feature = "PartialOrd",
8 feature = "Ord",
9 feature = "Hash",
10 feature = "Default",
11 feature = "Deref",
12 feature = "DerefMut",
13 feature = "Into",
14 )))]
15 compile_errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/compile_error!!("at least one of the trait features must be enabled");
16
17 use enum_ordinalizerust-analyzer cargo enum-ordinalize 4.4.2 crate/::Ordinalizerust-analyzer cargo enum-ordinalize-derive 4.4.2 Ordinalize:;
18 use synrust-analyzer cargo syn 2.0.119 crate/::Pathrust-analyzer cargo syn 2.0.119 path/Path#;
19
20 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, Ordinalizerust-analyzer cargo enum-ordinalize-derive 4.4.2 Ordinalize:)]
21 #[ordinalize(impl_trait = false)]
22 #[ordinalize(variants(pub(craterust-analyzer cargo educe 0.6.0 crate/) const VARIANTSrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]VARIANTS.))]
23 pub(craterust-analyzer cargo educe 0.6.0 crate/) enum Traitrust-analyzer cargo educe 0.6.0 supported_traits/Trait# {
24 #[cfg(feature = "Debug")]
25 Debugrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Debug#,
26 #[cfg(feature = "Clone")]
27 Clonerust-analyzer cargo educe 0.6.0 supported_traits/Trait#Clone#,
28 #[cfg(feature = "Copy")]
29 Copyrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Copy#,
30 #[cfg(feature = "PartialEq")]
31 PartialEqrust-analyzer cargo educe 0.6.0 supported_traits/Trait#PartialEq#,
32 #[cfg(feature = "Eq")]
33 Eqrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Eq#,
34 #[cfg(feature = "PartialOrd")]
35 PartialOrdrust-analyzer cargo educe 0.6.0 supported_traits/Trait#PartialOrd#,
36 #[cfg(feature = "Ord")]
37 Ordrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Ord#,
38 #[cfg(feature = "Hash")]
39 Hashrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Hash#,
40 #[cfg(feature = "Default")]
41 Defaultrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Default#,
42 #[cfg(feature = "Deref")]
43 Derefrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Deref#,
44 #[cfg(feature = "DerefMut")]
45 DerefMutrust-analyzer cargo educe 0.6.0 supported_traits/Trait#DerefMut#,
46 #[cfg(feature = "Into")]
47 Intorust-analyzer cargo educe 0.6.0 supported_traits/Trait#Into#,
48
49 _Nothingrust-analyzer cargo educe 0.6.0 supported_traits/Trait#_Nothing#,
50 }
51
52 impl Traitrust-analyzer cargo educe 0.6.0 supported_traits/Trait# {
53 #[inline]
54 pub(craterust-analyzer cargo educe 0.6.0 crate/) fn from_pathrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]from_path().(path: &Pathrust-analyzer cargo syn 2.0.119 path/Path#) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]> {
55 let ident_string = match path.get_identrust-analyzer cargo syn 2.0.119 path/impl#[Path]get_ident().() {
56 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ident) => ident.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
57 Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => return Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
58 };
59
60 match ident_string.as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().() {
61 #[cfg(feature = "Debug")]
62 "Debug" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::Debugrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Debug#),
63 #[cfg(feature = "Clone")]
64 "Clone" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::Clonerust-analyzer cargo educe 0.6.0 supported_traits/Trait#Clone#),
65 #[cfg(feature = "Copy")]
66 "Copy" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::Copyrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Copy#),
67 #[cfg(feature = "PartialEq")]
68 "PartialEq" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::PartialEqrust-analyzer cargo educe 0.6.0 supported_traits/Trait#PartialEq#),
69 #[cfg(feature = "Eq")]
70 "Eq" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::Eqrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Eq#),
71 #[cfg(feature = "PartialOrd")]
72 "PartialOrd" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::PartialOrdrust-analyzer cargo educe 0.6.0 supported_traits/Trait#PartialOrd#),
73 #[cfg(feature = "Ord")]
74 "Ord" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::Ordrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Ord#),
75 #[cfg(feature = "Hash")]
76 "Hash" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::Hashrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Hash#),
77 #[cfg(feature = "Default")]
78 "Default" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::Defaultrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Default#),
79 #[cfg(feature = "Deref")]
80 "Deref" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::Derefrust-analyzer cargo educe 0.6.0 supported_traits/Trait#Deref#),
81 #[cfg(feature = "DerefMut")]
82 "DerefMut" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::DerefMutrust-analyzer cargo educe 0.6.0 supported_traits/Trait#DerefMut#),
83 #[cfg(feature = "Into")]
84 "Into" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo educe 0.6.0 supported_traits/impl#[Trait]::Intorust-analyzer cargo educe 0.6.0 supported_traits/Trait#Into#),
85 _ => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
86 }
87 }
88 }