A better Rust ATProto crate

lifetime fixes

Orual 606fb185 e8718b7f

Changed files
+27 -58
crates
jacquard-lexicon
src
codegen
+23 -54
Cargo.lock
··· 1295 checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" 1296 dependencies = [ 1297 "libc", 1298 - "windows-sys 0.61.2", 1299 ] 1300 1301 [[package]] ··· 1913 "libc", 1914 "percent-encoding", 1915 "pin-project-lite", 1916 - "socket2 0.6.1", 1917 "system-configuration", 1918 "tokio", 1919 "tower-service", ··· 1933 "js-sys", 1934 "log", 1935 "wasm-bindgen", 1936 - "windows-core 0.62.2", 1937 ] 1938 1939 [[package]] ··· 2288 [[package]] 2289 name = "jacquard-api" 2290 version = "0.8.0" 2291 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#4eb26a04129dd5a71c7a2282d43bef50f713e335" 2292 dependencies = [ 2293 "bon", 2294 "bytes", ··· 2378 [[package]] 2379 name = "jacquard-common" 2380 version = "0.8.0" 2381 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#4eb26a04129dd5a71c7a2282d43bef50f713e335" 2382 dependencies = [ 2383 "base64 0.22.1", 2384 "bon", ··· 2431 [[package]] 2432 name = "jacquard-derive" 2433 version = "0.8.0" 2434 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#4eb26a04129dd5a71c7a2282d43bef50f713e335" 2435 dependencies = [ 2436 "heck 0.5.0", 2437 "jacquard-lexicon 0.8.0 (git+https://tangled.org/@nonbinary.computer/jacquard)", ··· 2468 [[package]] 2469 name = "jacquard-identity" 2470 version = "0.8.0" 2471 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#4eb26a04129dd5a71c7a2282d43bef50f713e335" 2472 dependencies = [ 2473 "bon", 2474 "bytes", ··· 2542 [[package]] 2543 name = "jacquard-lexicon" 2544 version = "0.8.0" 2545 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#4eb26a04129dd5a71c7a2282d43bef50f713e335" 2546 dependencies = [ 2547 "glob", 2548 "heck 0.5.0", ··· 3154 source = "registry+https://github.com/rust-lang/crates.io-index" 3155 checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" 3156 dependencies = [ 3157 - "windows-sys 0.61.2", 3158 ] 3159 3160 [[package]] ··· 3699 "quinn-udp", 3700 "rustc-hash", 3701 "rustls", 3702 - "socket2 0.6.1", 3703 "thiserror 2.0.17", 3704 "tokio", 3705 "tracing", ··· 3736 "cfg_aliases", 3737 "libc", 3738 "once_cell", 3739 - "socket2 0.6.1", 3740 "tracing", 3741 - "windows-sys 0.60.2", 3742 ] 3743 3744 [[package]] ··· 4157 "errno", 4158 "libc", 4159 "linux-raw-sys 0.11.0", 4160 - "windows-sys 0.61.2", 4161 ] 4162 4163 [[package]] ··· 4821 "getrandom 0.3.4", 4822 "once_cell", 4823 "rustix 1.1.2", 4824 - "windows-sys 0.61.2", 4825 ] 4826 4827 [[package]] ··· 5699 source = "registry+https://github.com/rust-lang/crates.io-index" 5700 checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" 5701 dependencies = [ 5702 - "windows-sys 0.61.2", 5703 ] 5704 5705 [[package]] ··· 5715 checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" 5716 dependencies = [ 5717 "windows-collections", 5718 - "windows-core 0.61.2", 5719 "windows-future", 5720 "windows-link 0.1.3", 5721 "windows-numerics", ··· 5727 source = "registry+https://github.com/rust-lang/crates.io-index" 5728 checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" 5729 dependencies = [ 5730 - "windows-core 0.61.2", 5731 ] 5732 5733 [[package]] ··· 5739 "windows-implement", 5740 "windows-interface", 5741 "windows-link 0.1.3", 5742 - "windows-result 0.3.4", 5743 - "windows-strings 0.4.2", 5744 - ] 5745 - 5746 - [[package]] 5747 - name = "windows-core" 5748 - version = "0.62.2" 5749 - source = "registry+https://github.com/rust-lang/crates.io-index" 5750 - checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" 5751 - dependencies = [ 5752 - "windows-implement", 5753 - "windows-interface", 5754 - "windows-link 0.2.1", 5755 - "windows-result 0.4.1", 5756 - "windows-strings 0.5.1", 5757 ] 5758 5759 [[package]] ··· 5762 source = "registry+https://github.com/rust-lang/crates.io-index" 5763 checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" 5764 dependencies = [ 5765 - "windows-core 0.61.2", 5766 "windows-link 0.1.3", 5767 "windows-threading", 5768 ] ··· 5807 source = "registry+https://github.com/rust-lang/crates.io-index" 5808 checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" 5809 dependencies = [ 5810 - "windows-core 0.61.2", 5811 "windows-link 0.1.3", 5812 ] 5813 ··· 5818 checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" 5819 dependencies = [ 5820 "windows-link 0.1.3", 5821 - "windows-result 0.3.4", 5822 - "windows-strings 0.4.2", 5823 ] 5824 5825 [[package]] ··· 5829 checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" 5830 dependencies = [ 5831 "windows-link 0.1.3", 5832 - ] 5833 - 5834 - [[package]] 5835 - name = "windows-result" 5836 - version = "0.4.1" 5837 - source = "registry+https://github.com/rust-lang/crates.io-index" 5838 - checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" 5839 - dependencies = [ 5840 - "windows-link 0.2.1", 5841 ] 5842 5843 [[package]] ··· 5847 checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" 5848 dependencies = [ 5849 "windows-link 0.1.3", 5850 - ] 5851 - 5852 - [[package]] 5853 - name = "windows-strings" 5854 - version = "0.5.1" 5855 - source = "registry+https://github.com/rust-lang/crates.io-index" 5856 - checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" 5857 - dependencies = [ 5858 - "windows-link 0.2.1", 5859 ] 5860 5861 [[package]]
··· 1295 checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" 1296 dependencies = [ 1297 "libc", 1298 + "windows-sys 0.59.0", 1299 ] 1300 1301 [[package]] ··· 1913 "libc", 1914 "percent-encoding", 1915 "pin-project-lite", 1916 + "socket2 0.5.10", 1917 "system-configuration", 1918 "tokio", 1919 "tower-service", ··· 1933 "js-sys", 1934 "log", 1935 "wasm-bindgen", 1936 + "windows-core", 1937 ] 1938 1939 [[package]] ··· 2288 [[package]] 2289 name = "jacquard-api" 2290 version = "0.8.0" 2291 + source = "git+https://tangled.org/@nonbinary.computer/jacquard#e8718b7feff97f4d488ed40ede1b52ed422fbe16" 2292 dependencies = [ 2293 "bon", 2294 "bytes", ··· 2378 [[package]] 2379 name = "jacquard-common" 2380 version = "0.8.0" 2381 + source = "git+https://tangled.org/@nonbinary.computer/jacquard#e8718b7feff97f4d488ed40ede1b52ed422fbe16" 2382 dependencies = [ 2383 "base64 0.22.1", 2384 "bon", ··· 2431 [[package]] 2432 name = "jacquard-derive" 2433 version = "0.8.0" 2434 + source = "git+https://tangled.org/@nonbinary.computer/jacquard#e8718b7feff97f4d488ed40ede1b52ed422fbe16" 2435 dependencies = [ 2436 "heck 0.5.0", 2437 "jacquard-lexicon 0.8.0 (git+https://tangled.org/@nonbinary.computer/jacquard)", ··· 2468 [[package]] 2469 name = "jacquard-identity" 2470 version = "0.8.0" 2471 + source = "git+https://tangled.org/@nonbinary.computer/jacquard#e8718b7feff97f4d488ed40ede1b52ed422fbe16" 2472 dependencies = [ 2473 "bon", 2474 "bytes", ··· 2542 [[package]] 2543 name = "jacquard-lexicon" 2544 version = "0.8.0" 2545 + source = "git+https://tangled.org/@nonbinary.computer/jacquard#e8718b7feff97f4d488ed40ede1b52ed422fbe16" 2546 dependencies = [ 2547 "glob", 2548 "heck 0.5.0", ··· 3154 source = "registry+https://github.com/rust-lang/crates.io-index" 3155 checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" 3156 dependencies = [ 3157 + "windows-sys 0.59.0", 3158 ] 3159 3160 [[package]] ··· 3699 "quinn-udp", 3700 "rustc-hash", 3701 "rustls", 3702 + "socket2 0.5.10", 3703 "thiserror 2.0.17", 3704 "tokio", 3705 "tracing", ··· 3736 "cfg_aliases", 3737 "libc", 3738 "once_cell", 3739 + "socket2 0.5.10", 3740 "tracing", 3741 + "windows-sys 0.59.0", 3742 ] 3743 3744 [[package]] ··· 4157 "errno", 4158 "libc", 4159 "linux-raw-sys 0.11.0", 4160 + "windows-sys 0.59.0", 4161 ] 4162 4163 [[package]] ··· 4821 "getrandom 0.3.4", 4822 "once_cell", 4823 "rustix 1.1.2", 4824 + "windows-sys 0.59.0", 4825 ] 4826 4827 [[package]] ··· 5699 source = "registry+https://github.com/rust-lang/crates.io-index" 5700 checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" 5701 dependencies = [ 5702 + "windows-sys 0.48.0", 5703 ] 5704 5705 [[package]] ··· 5715 checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" 5716 dependencies = [ 5717 "windows-collections", 5718 + "windows-core", 5719 "windows-future", 5720 "windows-link 0.1.3", 5721 "windows-numerics", ··· 5727 source = "registry+https://github.com/rust-lang/crates.io-index" 5728 checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" 5729 dependencies = [ 5730 + "windows-core", 5731 ] 5732 5733 [[package]] ··· 5739 "windows-implement", 5740 "windows-interface", 5741 "windows-link 0.1.3", 5742 + "windows-result", 5743 + "windows-strings", 5744 ] 5745 5746 [[package]] ··· 5749 source = "registry+https://github.com/rust-lang/crates.io-index" 5750 checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" 5751 dependencies = [ 5752 + "windows-core", 5753 "windows-link 0.1.3", 5754 "windows-threading", 5755 ] ··· 5794 source = "registry+https://github.com/rust-lang/crates.io-index" 5795 checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" 5796 dependencies = [ 5797 + "windows-core", 5798 "windows-link 0.1.3", 5799 ] 5800 ··· 5805 checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" 5806 dependencies = [ 5807 "windows-link 0.1.3", 5808 + "windows-result", 5809 + "windows-strings", 5810 ] 5811 5812 [[package]] ··· 5816 checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" 5817 dependencies = [ 5818 "windows-link 0.1.3", 5819 ] 5820 5821 [[package]] ··· 5825 checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" 5826 dependencies = [ 5827 "windows-link 0.1.3", 5828 ] 5829 5830 [[package]]
+4 -4
crates/jacquard-lexicon/src/codegen/schema_impl.rs
··· 17 let nsid = doc.id.as_ref(); 18 19 // Generate lifetime parameter 20 - let lifetime = if has_lifetime { 21 - quote! { <'_> } 22 } else { 23 - quote! {} 24 }; 25 26 // Generate the lexicon doc literal using existing doc_to_tokens ··· 35 let type_ident = syn::Ident::new(type_name, proc_macro2::Span::call_site()); 36 37 quote! { 38 - impl #lifetime ::jacquard_lexicon::schema::LexiconSchema for #type_ident #lifetime { 39 fn nsid() -> &'static str { 40 #nsid 41 }
··· 17 let nsid = doc.id.as_ref(); 18 19 // Generate lifetime parameter 20 + let (impl_generics, type_generics) = if has_lifetime { 21 + (quote! { <'a> }, quote! { <'a> }) 22 } else { 23 + (quote! {}, quote! {}) 24 }; 25 26 // Generate the lexicon doc literal using existing doc_to_tokens ··· 35 let type_ident = syn::Ident::new(type_name, proc_macro2::Span::call_site()); 36 37 quote! { 38 + impl #impl_generics ::jacquard_lexicon::schema::LexiconSchema for #type_ident #type_generics { 39 fn nsid() -> &'static str { 40 #nsid 41 }