Debian Codegraph @

src/common/bound.rs

raw symbols SCIP
1 use synrust-analyzer cargo syn 2.0.119 crate/::{punctuatedrust-analyzer cargo syn 2.0.119 punctuated/::Punctuatedrust-analyzer cargo syn 2.0.119 punctuated/Punctuated#, tokenrust-analyzer cargo syn 2.0.119 token/::Commarust-analyzer cargo syn 2.0.119 token/Comma#, GenericParamrust-analyzer cargo syn 2.0.119 generics/GenericParam#, Metarust-analyzer cargo syn 2.0.119 attr/Meta#, Pathrust-analyzer cargo syn 2.0.119 path/Path#, Typerust-analyzer cargo syn 2.0.119 ty/Type#, WherePredicaterust-analyzer cargo syn 2.0.119 generics/WherePredicate#};
2
3 use craterust-analyzer cargo educe 0.6.0 crate/::commonrust-analyzer cargo educe 0.6.0 common/::where_predicates_boolrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/::{
4 create_where_predicates_from_all_generic_parametersrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/create_where_predicates_from_all_generic_parameters().,
5 create_where_predicates_from_generic_parameters_check_typesrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/create_where_predicates_from_generic_parameters_check_types()., meta_2_where_predicatesrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/meta_2_where_predicates().,
6 WherePredicatesrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/WherePredicates#, WherePredicatesOrBoolrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/WherePredicatesOrBool#,
7 };
8
9 pub(craterust-analyzer cargo educe 0.6.0 crate/) enum Boundrust-analyzer cargo educe 0.6.0 common/bound/Bound# {
10 Disabledrust-analyzer cargo educe 0.6.0 common/bound/Bound#Disabled#,
11 Autorust-analyzer cargo educe 0.6.0 common/bound/Bound#Auto#,
12 Customrust-analyzer cargo educe 0.6.0 common/bound/Bound#Custom#(WherePredicatesrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/WherePredicates#),
13 Allrust-analyzer cargo educe 0.6.0 common/bound/Bound#All#,
14 }
15
16 impl Boundrust-analyzer cargo educe 0.6.0 common/bound/Bound# {
17 #[inline]
18 pub(craterust-analyzer cargo educe 0.6.0 crate/) fn from_metarust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]from_meta().(meta: &Metarust-analyzer cargo syn 2.0.119 attr/Meta#) -> synrust-analyzer cargo syn 2.0.119 crate/::Resultrust-analyzer cargo syn 2.0.119 error/Result#<Selfrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]> {
19 debug_assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/debug_assert!!(meta.pathrust-analyzer cargo syn 2.0.119 attr/impl#[Meta]path().().is_identrust-analyzer cargo syn 2.0.119 path/impl#[Path]is_ident().("bound"));
20
21 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match meta_2_where_predicatesrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/meta_2_where_predicates().(meta)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). {
22 WherePredicatesOrBoolrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/WherePredicatesOrBool#::WherePredicatesrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/WherePredicatesOrBool#WherePredicates#(where_predicates) => {
23 Selfrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]::Customrust-analyzer cargo educe 0.6.0 common/bound/Bound#Custom#(where_predicates)
24 },
25 WherePredicatesOrBoolrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/WherePredicatesOrBool#::Boolrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/WherePredicatesOrBool#Bool#(b) => {
26 if b {
27 Selfrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]::Autorust-analyzer cargo educe 0.6.0 common/bound/Bound#Auto#
28 } else {
29 Selfrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]::Disabledrust-analyzer cargo educe 0.6.0 common/bound/Bound#Disabled#
30 }
31 },
32 WherePredicatesOrBoolrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/WherePredicatesOrBool#::Allrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/WherePredicatesOrBool#All# => Selfrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]::Allrust-analyzer cargo educe 0.6.0 common/bound/Bound#All#,
33 })
34 }
35 }
36
37 impl Boundrust-analyzer cargo educe 0.6.0 common/bound/Bound# {
38 #[inline]
39 pub(craterust-analyzer cargo educe 0.6.0 crate/) fn into_where_predicates_by_generic_parameters_check_typesrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]into_where_predicates_by_generic_parameters_check_types().(
40 self,
41 params: &Punctuatedrust-analyzer cargo syn 2.0.119 punctuated/Punctuated#<GenericParamrust-analyzer cargo syn 2.0.119 generics/GenericParam#, Commarust-analyzer cargo syn 2.0.119 token/Comma#>,
42 bound_trait: &Pathrust-analyzer cargo syn 2.0.119 path/Path#,
43 types: &[&Typerust-analyzer cargo syn 2.0.119 ty/Type#],
44 supertraits: &[proc_macro2rust-analyzer cargo proc-macro2 1.0.107 crate/::TokenStreamrust-analyzer cargo proc-macro2 1.0.107 TokenStream#],
45 ) -> Punctuatedrust-analyzer cargo syn 2.0.119 punctuated/Punctuated#<WherePredicaterust-analyzer cargo syn 2.0.119 generics/WherePredicate#, Commarust-analyzer cargo syn 2.0.119 token/Comma#> {
46 match self {
47 Selfrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]::Disabledrust-analyzer cargo educe 0.6.0 common/bound/Bound#Disabled# => Punctuatedrust-analyzer cargo syn 2.0.119 punctuated/Punctuated#::newrust-analyzer cargo syn 2.0.119 punctuated/impl#[`Punctuated<T, P>`]new().(),
48 Selfrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]::Autorust-analyzer cargo educe 0.6.0 common/bound/Bound#Auto# => create_where_predicates_from_generic_parameters_check_typesrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/create_where_predicates_from_generic_parameters_check_types().(
49 bound_trait,
50 types,
51 supertraits,
52 ),
53 Selfrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]::Customrust-analyzer cargo educe 0.6.0 common/bound/Bound#Custom#(where_predicates) => where_predicates,
54 Selfrust-analyzer cargo educe 0.6.0 common/bound/impl#[Bound]::Allrust-analyzer cargo educe 0.6.0 common/bound/Bound#All# => create_where_predicates_from_all_generic_parametersrust-analyzer cargo educe 0.6.0 common/where_predicates_bool/create_where_predicates_from_all_generic_parameters().(params, bound_trait),
55 }
56 }
57 }