A better Rust ATProto crate
0

Configure Feed

Select the types of activity you want to include in your feed.

codegen test generation update

author nonbinary.computer date (Jun 5, 2026, 9:43 AM -0400) commit 244e53ee parent 5e4f4e4a change-id ozolpqwn
+236 -235
+1
.gitignore
··· 16 16 rustdoc-host.nix 17 17 **/**.car 18 18 result 19 + crates/jacquard-codegen-tests/src/generated/
+39 -39
crates/jacquard-codegen-tests/src/generated/macro_mode/app_bsky/embed/external.rs
··· 232 232 } 233 233 /// State trait tracking which required fields have been set 234 234 pub trait State: sealed::Sealed { 235 - type Description; 236 - type Uri; 237 235 type Title; 236 + type Uri; 237 + type Description; 238 238 } 239 239 /// Empty state - all required fields are unset 240 240 pub struct Empty(()); 241 241 impl sealed::Sealed for Empty {} 242 242 impl State for Empty { 243 + type Title = Unset; 244 + type Uri = Unset; 243 245 type Description = Unset; 244 - type Uri = Unset; 245 - type Title = Unset; 246 246 } 247 - ///State transition - sets the `description` field to Set 248 - pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 249 - impl<St: State> sealed::Sealed for SetDescription<St> {} 250 - impl<St: State> State for SetDescription<St> { 251 - type Description = Set<members::description>; 247 + ///State transition - sets the `title` field to Set 248 + pub struct SetTitle<St: State = Empty>(PhantomData<fn() -> St>); 249 + impl<St: State> sealed::Sealed for SetTitle<St> {} 250 + impl<St: State> State for SetTitle<St> { 251 + type Title = Set<members::title>; 252 252 type Uri = St::Uri; 253 - type Title = St::Title; 253 + type Description = St::Description; 254 254 } 255 255 ///State transition - sets the `uri` field to Set 256 256 pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>); 257 257 impl<St: State> sealed::Sealed for SetUri<St> {} 258 258 impl<St: State> State for SetUri<St> { 259 - type Description = St::Description; 260 - type Uri = Set<members::uri>; 261 259 type Title = St::Title; 260 + type Uri = Set<members::uri>; 261 + type Description = St::Description; 262 262 } 263 - ///State transition - sets the `title` field to Set 264 - pub struct SetTitle<St: State = Empty>(PhantomData<fn() -> St>); 265 - impl<St: State> sealed::Sealed for SetTitle<St> {} 266 - impl<St: State> State for SetTitle<St> { 267 - type Description = St::Description; 263 + ///State transition - sets the `description` field to Set 264 + pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 265 + impl<St: State> sealed::Sealed for SetDescription<St> {} 266 + impl<St: State> State for SetDescription<St> { 267 + type Title = St::Title; 268 268 type Uri = St::Uri; 269 - type Title = Set<members::title>; 269 + type Description = Set<members::description>; 270 270 } 271 271 /// Marker types for field names 272 272 #[allow(non_camel_case_types)] 273 273 pub mod members { 274 + ///Marker type for the `title` field 275 + pub struct title(()); 276 + ///Marker type for the `uri` field 277 + pub struct uri(()); 274 278 ///Marker type for the `description` field 275 279 pub struct description(()); 276 - ///Marker type for the `uri` field 277 - pub struct uri(()); 278 - ///Marker type for the `title` field 279 - pub struct title(()); 280 280 } 281 281 } 282 282 ··· 410 410 impl<St, S: jacquard_common::BosStr> ExternalBuilder<St, S> 411 411 where 412 412 St: external_state::State, 413 - St::Description: external_state::IsSet, 414 - St::Uri: external_state::IsSet, 415 413 St::Title: external_state::IsSet, 414 + St::Uri: external_state::IsSet, 415 + St::Description: external_state::IsSet, 416 416 { 417 417 /// Build the final struct. 418 418 pub fn build(self) -> External<S> { ··· 889 889 } 890 890 /// State trait tracking which required fields have been set 891 891 pub trait State: sealed::Sealed { 892 - type Description; 893 892 type Uri; 894 893 type Title; 894 + type Description; 895 895 } 896 896 /// Empty state - all required fields are unset 897 897 pub struct Empty(()); 898 898 impl sealed::Sealed for Empty {} 899 899 impl State for Empty { 900 - type Description = Unset; 901 900 type Uri = Unset; 902 901 type Title = Unset; 903 - } 904 - ///State transition - sets the `description` field to Set 905 - pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 906 - impl<St: State> sealed::Sealed for SetDescription<St> {} 907 - impl<St: State> State for SetDescription<St> { 908 - type Description = Set<members::description>; 909 - type Uri = St::Uri; 910 - type Title = St::Title; 902 + type Description = Unset; 911 903 } 912 904 ///State transition - sets the `uri` field to Set 913 905 pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>); 914 906 impl<St: State> sealed::Sealed for SetUri<St> {} 915 907 impl<St: State> State for SetUri<St> { 916 - type Description = St::Description; 917 908 type Uri = Set<members::uri>; 918 909 type Title = St::Title; 910 + type Description = St::Description; 919 911 } 920 912 ///State transition - sets the `title` field to Set 921 913 pub struct SetTitle<St: State = Empty>(PhantomData<fn() -> St>); 922 914 impl<St: State> sealed::Sealed for SetTitle<St> {} 923 915 impl<St: State> State for SetTitle<St> { 924 - type Description = St::Description; 925 916 type Uri = St::Uri; 926 917 type Title = Set<members::title>; 918 + type Description = St::Description; 919 + } 920 + ///State transition - sets the `description` field to Set 921 + pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 922 + impl<St: State> sealed::Sealed for SetDescription<St> {} 923 + impl<St: State> State for SetDescription<St> { 924 + type Uri = St::Uri; 925 + type Title = St::Title; 926 + type Description = Set<members::description>; 927 927 } 928 928 /// Marker types for field names 929 929 #[allow(non_camel_case_types)] 930 930 pub mod members { 931 - ///Marker type for the `description` field 932 - pub struct description(()); 933 931 ///Marker type for the `uri` field 934 932 pub struct uri(()); 935 933 ///Marker type for the `title` field 936 934 pub struct title(()); 935 + ///Marker type for the `description` field 936 + pub struct description(()); 937 937 } 938 938 } 939 939 ··· 1073 1073 impl<St, S: jacquard_common::BosStr> ViewExternalBuilder<St, S> 1074 1074 where 1075 1075 St: view_external_state::State, 1076 - St::Description: view_external_state::IsSet, 1077 1076 St::Uri: view_external_state::IsSet, 1078 1077 St::Title: view_external_state::IsSet, 1078 + St::Description: view_external_state::IsSet, 1079 1079 { 1080 1080 /// Build the final struct. 1081 1081 pub fn build(self) -> ViewExternal<S> {
+58 -58
crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/label.rs
··· 799 799 pub trait State: sealed::Sealed { 800 800 type Uri; 801 801 type Src; 802 - type Cts; 803 802 type Val; 803 + type Cts; 804 804 } 805 805 /// Empty state - all required fields are unset 806 806 pub struct Empty(()); ··· 808 808 impl State for Empty { 809 809 type Uri = Unset; 810 810 type Src = Unset; 811 - type Cts = Unset; 812 811 type Val = Unset; 812 + type Cts = Unset; 813 813 } 814 814 ///State transition - sets the `uri` field to Set 815 815 pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>); ··· 817 817 impl<St: State> State for SetUri<St> { 818 818 type Uri = Set<members::uri>; 819 819 type Src = St::Src; 820 - type Cts = St::Cts; 821 820 type Val = St::Val; 821 + type Cts = St::Cts; 822 822 } 823 823 ///State transition - sets the `src` field to Set 824 824 pub struct SetSrc<St: State = Empty>(PhantomData<fn() -> St>); ··· 826 826 impl<St: State> State for SetSrc<St> { 827 827 type Uri = St::Uri; 828 828 type Src = Set<members::src>; 829 - type Cts = St::Cts; 830 - type Val = St::Val; 831 - } 832 - ///State transition - sets the `cts` field to Set 833 - pub struct SetCts<St: State = Empty>(PhantomData<fn() -> St>); 834 - impl<St: State> sealed::Sealed for SetCts<St> {} 835 - impl<St: State> State for SetCts<St> { 836 - type Uri = St::Uri; 837 - type Src = St::Src; 838 - type Cts = Set<members::cts>; 839 829 type Val = St::Val; 830 + type Cts = St::Cts; 840 831 } 841 832 ///State transition - sets the `val` field to Set 842 833 pub struct SetVal<St: State = Empty>(PhantomData<fn() -> St>); ··· 844 835 impl<St: State> State for SetVal<St> { 845 836 type Uri = St::Uri; 846 837 type Src = St::Src; 847 - type Cts = St::Cts; 848 838 type Val = Set<members::val>; 839 + type Cts = St::Cts; 840 + } 841 + ///State transition - sets the `cts` field to Set 842 + pub struct SetCts<St: State = Empty>(PhantomData<fn() -> St>); 843 + impl<St: State> sealed::Sealed for SetCts<St> {} 844 + impl<St: State> State for SetCts<St> { 845 + type Uri = St::Uri; 846 + type Src = St::Src; 847 + type Val = St::Val; 848 + type Cts = Set<members::cts>; 849 849 } 850 850 /// Marker types for field names 851 851 #[allow(non_camel_case_types)] ··· 854 854 pub struct uri(()); 855 855 ///Marker type for the `src` field 856 856 pub struct src(()); 857 + ///Marker type for the `val` field 858 + pub struct val(()); 857 859 ///Marker type for the `cts` field 858 860 pub struct cts(()); 859 - ///Marker type for the `val` field 860 - pub struct val(()); 861 861 } 862 862 } 863 863 ··· 1081 1081 St: label_state::State, 1082 1082 St::Uri: label_state::IsSet, 1083 1083 St::Src: label_state::IsSet, 1084 - St::Cts: label_state::IsSet, 1085 1084 St::Val: label_state::IsSet, 1085 + St::Cts: label_state::IsSet, 1086 1086 { 1087 1087 /// Build the final struct. 1088 1088 pub fn build(self) -> Label<S> { ··· 1537 1537 /// State trait tracking which required fields have been set 1538 1538 pub trait State: sealed::Sealed { 1539 1539 type Locales; 1540 - type Severity; 1541 - type Identifier; 1542 1540 type Blurs; 1541 + type Identifier; 1542 + type Severity; 1543 1543 } 1544 1544 /// Empty state - all required fields are unset 1545 1545 pub struct Empty(()); 1546 1546 impl sealed::Sealed for Empty {} 1547 1547 impl State for Empty { 1548 1548 type Locales = Unset; 1549 - type Severity = Unset; 1550 - type Identifier = Unset; 1551 1549 type Blurs = Unset; 1550 + type Identifier = Unset; 1551 + type Severity = Unset; 1552 1552 } 1553 1553 ///State transition - sets the `locales` field to Set 1554 1554 pub struct SetLocales<St: State = Empty>(PhantomData<fn() -> St>); 1555 1555 impl<St: State> sealed::Sealed for SetLocales<St> {} 1556 1556 impl<St: State> State for SetLocales<St> { 1557 1557 type Locales = Set<members::locales>; 1558 - type Severity = St::Severity; 1559 - type Identifier = St::Identifier; 1560 1558 type Blurs = St::Blurs; 1559 + type Identifier = St::Identifier; 1560 + type Severity = St::Severity; 1561 1561 } 1562 - ///State transition - sets the `severity` field to Set 1563 - pub struct SetSeverity<St: State = Empty>(PhantomData<fn() -> St>); 1564 - impl<St: State> sealed::Sealed for SetSeverity<St> {} 1565 - impl<St: State> State for SetSeverity<St> { 1562 + ///State transition - sets the `blurs` field to Set 1563 + pub struct SetBlurs<St: State = Empty>(PhantomData<fn() -> St>); 1564 + impl<St: State> sealed::Sealed for SetBlurs<St> {} 1565 + impl<St: State> State for SetBlurs<St> { 1566 1566 type Locales = St::Locales; 1567 - type Severity = Set<members::severity>; 1567 + type Blurs = Set<members::blurs>; 1568 1568 type Identifier = St::Identifier; 1569 - type Blurs = St::Blurs; 1569 + type Severity = St::Severity; 1570 1570 } 1571 1571 ///State transition - sets the `identifier` field to Set 1572 1572 pub struct SetIdentifier<St: State = Empty>(PhantomData<fn() -> St>); 1573 1573 impl<St: State> sealed::Sealed for SetIdentifier<St> {} 1574 1574 impl<St: State> State for SetIdentifier<St> { 1575 1575 type Locales = St::Locales; 1576 - type Severity = St::Severity; 1576 + type Blurs = St::Blurs; 1577 1577 type Identifier = Set<members::identifier>; 1578 - type Blurs = St::Blurs; 1578 + type Severity = St::Severity; 1579 1579 } 1580 - ///State transition - sets the `blurs` field to Set 1581 - pub struct SetBlurs<St: State = Empty>(PhantomData<fn() -> St>); 1582 - impl<St: State> sealed::Sealed for SetBlurs<St> {} 1583 - impl<St: State> State for SetBlurs<St> { 1580 + ///State transition - sets the `severity` field to Set 1581 + pub struct SetSeverity<St: State = Empty>(PhantomData<fn() -> St>); 1582 + impl<St: State> sealed::Sealed for SetSeverity<St> {} 1583 + impl<St: State> State for SetSeverity<St> { 1584 1584 type Locales = St::Locales; 1585 - type Severity = St::Severity; 1585 + type Blurs = St::Blurs; 1586 1586 type Identifier = St::Identifier; 1587 - type Blurs = Set<members::blurs>; 1587 + type Severity = Set<members::severity>; 1588 1588 } 1589 1589 /// Marker types for field names 1590 1590 #[allow(non_camel_case_types)] 1591 1591 pub mod members { 1592 1592 ///Marker type for the `locales` field 1593 1593 pub struct locales(()); 1594 - ///Marker type for the `severity` field 1595 - pub struct severity(()); 1596 - ///Marker type for the `identifier` field 1597 - pub struct identifier(()); 1598 1594 ///Marker type for the `blurs` field 1599 1595 pub struct blurs(()); 1596 + ///Marker type for the `identifier` field 1597 + pub struct identifier(()); 1598 + ///Marker type for the `severity` field 1599 + pub struct severity(()); 1600 1600 } 1601 1601 } 1602 1602 ··· 1789 1789 where 1790 1790 St: label_value_definition_state::State, 1791 1791 St::Locales: label_value_definition_state::IsSet, 1792 - St::Severity: label_value_definition_state::IsSet, 1793 - St::Identifier: label_value_definition_state::IsSet, 1794 1792 St::Blurs: label_value_definition_state::IsSet, 1793 + St::Identifier: label_value_definition_state::IsSet, 1794 + St::Severity: label_value_definition_state::IsSet, 1795 1795 { 1796 1796 /// Build the final struct. 1797 1797 pub fn build(self) -> LabelValueDefinition<S> { ··· 1835 1835 } 1836 1836 /// State trait tracking which required fields have been set 1837 1837 pub trait State: sealed::Sealed { 1838 - type Description; 1839 1838 type Lang; 1840 1839 type Name; 1840 + type Description; 1841 1841 } 1842 1842 /// Empty state - all required fields are unset 1843 1843 pub struct Empty(()); 1844 1844 impl sealed::Sealed for Empty {} 1845 1845 impl State for Empty { 1846 - type Description = Unset; 1847 1846 type Lang = Unset; 1848 1847 type Name = Unset; 1849 - } 1850 - ///State transition - sets the `description` field to Set 1851 - pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 1852 - impl<St: State> sealed::Sealed for SetDescription<St> {} 1853 - impl<St: State> State for SetDescription<St> { 1854 - type Description = Set<members::description>; 1855 - type Lang = St::Lang; 1856 - type Name = St::Name; 1848 + type Description = Unset; 1857 1849 } 1858 1850 ///State transition - sets the `lang` field to Set 1859 1851 pub struct SetLang<St: State = Empty>(PhantomData<fn() -> St>); 1860 1852 impl<St: State> sealed::Sealed for SetLang<St> {} 1861 1853 impl<St: State> State for SetLang<St> { 1862 - type Description = St::Description; 1863 1854 type Lang = Set<members::lang>; 1864 1855 type Name = St::Name; 1856 + type Description = St::Description; 1865 1857 } 1866 1858 ///State transition - sets the `name` field to Set 1867 1859 pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>); 1868 1860 impl<St: State> sealed::Sealed for SetName<St> {} 1869 1861 impl<St: State> State for SetName<St> { 1862 + type Lang = St::Lang; 1863 + type Name = Set<members::name>; 1870 1864 type Description = St::Description; 1865 + } 1866 + ///State transition - sets the `description` field to Set 1867 + pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 1868 + impl<St: State> sealed::Sealed for SetDescription<St> {} 1869 + impl<St: State> State for SetDescription<St> { 1871 1870 type Lang = St::Lang; 1872 - type Name = Set<members::name>; 1871 + type Name = St::Name; 1872 + type Description = Set<members::description>; 1873 1873 } 1874 1874 /// Marker types for field names 1875 1875 #[allow(non_camel_case_types)] 1876 1876 pub mod members { 1877 - ///Marker type for the `description` field 1878 - pub struct description(()); 1879 1877 ///Marker type for the `lang` field 1880 1878 pub struct lang(()); 1881 1879 ///Marker type for the `name` field 1882 1880 pub struct name(()); 1881 + ///Marker type for the `description` field 1882 + pub struct description(()); 1883 1883 } 1884 1884 } 1885 1885 ··· 2013 2013 impl<St, S: jacquard_common::BosStr> LabelValueDefinitionStringsBuilder<St, S> 2014 2014 where 2015 2015 St: label_value_definition_strings_state::State, 2016 - St::Description: label_value_definition_strings_state::IsSet, 2017 2016 St::Lang: label_value_definition_strings_state::IsSet, 2018 2017 St::Name: label_value_definition_strings_state::IsSet, 2018 + St::Description: label_value_definition_strings_state::IsSet, 2019 2019 { 2020 2020 /// Build the final struct. 2021 2021 pub fn build(self) -> LabelValueDefinitionStrings<S> {
+13 -13
crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/repo/strong_ref.rs
··· 57 57 } 58 58 /// State trait tracking which required fields have been set 59 59 pub trait State: sealed::Sealed { 60 - type Uri; 61 60 type Cid; 61 + type Uri; 62 62 } 63 63 /// Empty state - all required fields are unset 64 64 pub struct Empty(()); 65 65 impl sealed::Sealed for Empty {} 66 66 impl State for Empty { 67 - type Uri = Unset; 68 67 type Cid = Unset; 69 - } 70 - ///State transition - sets the `uri` field to Set 71 - pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>); 72 - impl<St: State> sealed::Sealed for SetUri<St> {} 73 - impl<St: State> State for SetUri<St> { 74 - type Uri = Set<members::uri>; 75 - type Cid = St::Cid; 68 + type Uri = Unset; 76 69 } 77 70 ///State transition - sets the `cid` field to Set 78 71 pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>); 79 72 impl<St: State> sealed::Sealed for SetCid<St> {} 80 73 impl<St: State> State for SetCid<St> { 81 - type Uri = St::Uri; 82 74 type Cid = Set<members::cid>; 75 + type Uri = St::Uri; 76 + } 77 + ///State transition - sets the `uri` field to Set 78 + pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>); 79 + impl<St: State> sealed::Sealed for SetUri<St> {} 80 + impl<St: State> State for SetUri<St> { 81 + type Cid = St::Cid; 82 + type Uri = Set<members::uri>; 83 83 } 84 84 /// Marker types for field names 85 85 #[allow(non_camel_case_types)] 86 86 pub mod members { 87 - ///Marker type for the `uri` field 88 - pub struct uri(()); 89 87 ///Marker type for the `cid` field 90 88 pub struct cid(()); 89 + ///Marker type for the `uri` field 90 + pub struct uri(()); 91 91 } 92 92 } 93 93 ··· 184 184 impl<St, S: jacquard_common::BosStr> StrongRefBuilder<St, S> 185 185 where 186 186 St: strong_ref_state::State, 187 - St::Uri: strong_ref_state::IsSet, 188 187 St::Cid: strong_ref_state::IsSet, 188 + St::Uri: strong_ref_state::IsSet, 189 189 { 190 190 /// Build the final struct. 191 191 pub fn build(self) -> StrongRef<S> {
+13 -13
crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/collection.rs
··· 321 321 } 322 322 /// State trait tracking which required fields have been set 323 323 pub trait State: sealed::Sealed { 324 - type Items; 325 324 type Name; 325 + type Items; 326 326 } 327 327 /// Empty state - all required fields are unset 328 328 pub struct Empty(()); 329 329 impl sealed::Sealed for Empty {} 330 330 impl State for Empty { 331 - type Items = Unset; 332 331 type Name = Unset; 333 - } 334 - ///State transition - sets the `items` field to Set 335 - pub struct SetItems<St: State = Empty>(PhantomData<fn() -> St>); 336 - impl<St: State> sealed::Sealed for SetItems<St> {} 337 - impl<St: State> State for SetItems<St> { 338 - type Items = Set<members::items>; 339 - type Name = St::Name; 332 + type Items = Unset; 340 333 } 341 334 ///State transition - sets the `name` field to Set 342 335 pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>); 343 336 impl<St: State> sealed::Sealed for SetName<St> {} 344 337 impl<St: State> State for SetName<St> { 345 - type Items = St::Items; 346 338 type Name = Set<members::name>; 339 + type Items = St::Items; 340 + } 341 + ///State transition - sets the `items` field to Set 342 + pub struct SetItems<St: State = Empty>(PhantomData<fn() -> St>); 343 + impl<St: State> sealed::Sealed for SetItems<St> {} 344 + impl<St: State> State for SetItems<St> { 345 + type Name = St::Name; 346 + type Items = Set<members::items>; 347 347 } 348 348 /// Marker types for field names 349 349 #[allow(non_camel_case_types)] 350 350 pub mod members { 351 - ///Marker type for the `items` field 352 - pub struct items(()); 353 351 ///Marker type for the `name` field 354 352 pub struct name(()); 353 + ///Marker type for the `items` field 354 + pub struct items(()); 355 355 } 356 356 } 357 357 ··· 480 480 impl<St, S: jacquard_common::BosStr> CollectionRecordBuilder<St, S> 481 481 where 482 482 St: collection_record_state::State, 483 - St::Items: collection_record_state::IsSet, 484 483 St::Name: collection_record_state::IsSet, 484 + St::Items: collection_record_state::IsSet, 485 485 { 486 486 /// Build the final struct. 487 487 pub fn build(self) -> CollectionRecord<S> {
+13 -13
crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/did.rs
··· 264 264 } 265 265 /// State trait tracking which required fields have been set 266 266 pub trait State: sealed::Sealed { 267 - type Identifier; 268 267 type Owner; 268 + type Identifier; 269 269 } 270 270 /// Empty state - all required fields are unset 271 271 pub struct Empty(()); 272 272 impl sealed::Sealed for Empty {} 273 273 impl State for Empty { 274 - type Identifier = Unset; 275 274 type Owner = Unset; 276 - } 277 - ///State transition - sets the `identifier` field to Set 278 - pub struct SetIdentifier<St: State = Empty>(PhantomData<fn() -> St>); 279 - impl<St: State> sealed::Sealed for SetIdentifier<St> {} 280 - impl<St: State> State for SetIdentifier<St> { 281 - type Identifier = Set<members::identifier>; 282 - type Owner = St::Owner; 275 + type Identifier = Unset; 283 276 } 284 277 ///State transition - sets the `owner` field to Set 285 278 pub struct SetOwner<St: State = Empty>(PhantomData<fn() -> St>); 286 279 impl<St: State> sealed::Sealed for SetOwner<St> {} 287 280 impl<St: State> State for SetOwner<St> { 288 - type Identifier = St::Identifier; 289 281 type Owner = Set<members::owner>; 282 + type Identifier = St::Identifier; 283 + } 284 + ///State transition - sets the `identifier` field to Set 285 + pub struct SetIdentifier<St: State = Empty>(PhantomData<fn() -> St>); 286 + impl<St: State> sealed::Sealed for SetIdentifier<St> {} 287 + impl<St: State> State for SetIdentifier<St> { 288 + type Owner = St::Owner; 289 + type Identifier = Set<members::identifier>; 290 290 } 291 291 /// Marker types for field names 292 292 #[allow(non_camel_case_types)] 293 293 pub mod members { 294 - ///Marker type for the `identifier` field 295 - pub struct identifier(()); 296 294 ///Marker type for the `owner` field 297 295 pub struct owner(()); 296 + ///Marker type for the `identifier` field 297 + pub struct identifier(()); 298 298 } 299 299 } 300 300 ··· 405 405 impl<St, S: jacquard_common::BosStr> DidRecordBuilder<St, S> 406 406 where 407 407 St: did_record_state::State, 408 - St::Identifier: did_record_state::IsSet, 409 408 St::Owner: did_record_state::IsSet, 409 + St::Identifier: did_record_state::IsSet, 410 410 { 411 411 /// Build the final struct. 412 412 pub fn build(self) -> DidRecord<S> {
+30 -30
crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/embed/external.rs
··· 179 179 } 180 180 /// State trait tracking which required fields have been set 181 181 pub trait State: sealed::Sealed { 182 - type Description; 183 182 type Title; 183 + type Description; 184 184 type Uri; 185 185 } 186 186 /// Empty state - all required fields are unset 187 187 pub struct Empty(()); 188 188 impl sealed::Sealed for Empty {} 189 189 impl State for Empty { 190 - type Description = Unset; 191 190 type Title = Unset; 191 + type Description = Unset; 192 192 type Uri = Unset; 193 193 } 194 - ///State transition - sets the `description` field to Set 195 - pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 196 - impl<St: State> sealed::Sealed for SetDescription<St> {} 197 - impl<St: State> State for SetDescription<St> { 198 - type Description = Set<members::description>; 199 - type Title = St::Title; 200 - type Uri = St::Uri; 201 - } 202 194 ///State transition - sets the `title` field to Set 203 195 pub struct SetTitle<St: State = Empty>(PhantomData<fn() -> St>); 204 196 impl<St: State> sealed::Sealed for SetTitle<St> {} 205 197 impl<St: State> State for SetTitle<St> { 206 - type Description = St::Description; 207 198 type Title = Set<members::title>; 199 + type Description = St::Description; 200 + type Uri = St::Uri; 201 + } 202 + ///State transition - sets the `description` field to Set 203 + pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 204 + impl<St: State> sealed::Sealed for SetDescription<St> {} 205 + impl<St: State> State for SetDescription<St> { 206 + type Title = St::Title; 207 + type Description = Set<members::description>; 208 208 type Uri = St::Uri; 209 209 } 210 210 ///State transition - sets the `uri` field to Set 211 211 pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>); 212 212 impl<St: State> sealed::Sealed for SetUri<St> {} 213 213 impl<St: State> State for SetUri<St> { 214 - type Description = St::Description; 215 214 type Title = St::Title; 215 + type Description = St::Description; 216 216 type Uri = Set<members::uri>; 217 217 } 218 218 /// Marker types for field names 219 219 #[allow(non_camel_case_types)] 220 220 pub mod members { 221 + ///Marker type for the `title` field 222 + pub struct title(()); 221 223 ///Marker type for the `description` field 222 224 pub struct description(()); 223 - ///Marker type for the `title` field 224 - pub struct title(()); 225 225 ///Marker type for the `uri` field 226 226 pub struct uri(()); 227 227 } ··· 343 343 impl<St, S: BosStr> ExternalBuilder<St, S> 344 344 where 345 345 St: external_state::State, 346 - St::Description: external_state::IsSet, 347 346 St::Title: external_state::IsSet, 347 + St::Description: external_state::IsSet, 348 348 St::Uri: external_state::IsSet, 349 349 { 350 350 /// Build the final struct. ··· 749 749 } 750 750 /// State trait tracking which required fields have been set 751 751 pub trait State: sealed::Sealed { 752 - type Description; 753 752 type Uri; 753 + type Description; 754 754 type Title; 755 755 } 756 756 /// Empty state - all required fields are unset 757 757 pub struct Empty(()); 758 758 impl sealed::Sealed for Empty {} 759 759 impl State for Empty { 760 - type Description = Unset; 761 760 type Uri = Unset; 761 + type Description = Unset; 762 762 type Title = Unset; 763 763 } 764 - ///State transition - sets the `description` field to Set 765 - pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 766 - impl<St: State> sealed::Sealed for SetDescription<St> {} 767 - impl<St: State> State for SetDescription<St> { 768 - type Description = Set<members::description>; 769 - type Uri = St::Uri; 770 - type Title = St::Title; 771 - } 772 764 ///State transition - sets the `uri` field to Set 773 765 pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>); 774 766 impl<St: State> sealed::Sealed for SetUri<St> {} 775 767 impl<St: State> State for SetUri<St> { 776 - type Description = St::Description; 777 768 type Uri = Set<members::uri>; 769 + type Description = St::Description; 770 + type Title = St::Title; 771 + } 772 + ///State transition - sets the `description` field to Set 773 + pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>); 774 + impl<St: State> sealed::Sealed for SetDescription<St> {} 775 + impl<St: State> State for SetDescription<St> { 776 + type Uri = St::Uri; 777 + type Description = Set<members::description>; 778 778 type Title = St::Title; 779 779 } 780 780 ///State transition - sets the `title` field to Set 781 781 pub struct SetTitle<St: State = Empty>(PhantomData<fn() -> St>); 782 782 impl<St: State> sealed::Sealed for SetTitle<St> {} 783 783 impl<St: State> State for SetTitle<St> { 784 - type Description = St::Description; 785 784 type Uri = St::Uri; 785 + type Description = St::Description; 786 786 type Title = Set<members::title>; 787 787 } 788 788 /// Marker types for field names 789 789 #[allow(non_camel_case_types)] 790 790 pub mod members { 791 + ///Marker type for the `uri` field 792 + pub struct uri(()); 791 793 ///Marker type for the `description` field 792 794 pub struct description(()); 793 - ///Marker type for the `uri` field 794 - pub struct uri(()); 795 795 ///Marker type for the `title` field 796 796 pub struct title(()); 797 797 } ··· 913 913 impl<St, S: BosStr> ViewExternalBuilder<St, S> 914 914 where 915 915 St: view_external_state::State, 916 - St::Description: view_external_state::IsSet, 917 916 St::Uri: view_external_state::IsSet, 917 + St::Description: view_external_state::IsSet, 918 918 St::Title: view_external_state::IsSet, 919 919 { 920 920 /// Build the final struct.
+26 -26
crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/richtext/facet.rs
··· 219 219 } 220 220 /// State trait tracking which required fields have been set 221 221 pub trait State: sealed::Sealed { 222 - type ByteEnd; 223 222 type ByteStart; 223 + type ByteEnd; 224 224 } 225 225 /// Empty state - all required fields are unset 226 226 pub struct Empty(()); 227 227 impl sealed::Sealed for Empty {} 228 228 impl State for Empty { 229 - type ByteEnd = Unset; 230 229 type ByteStart = Unset; 231 - } 232 - ///State transition - sets the `byte_end` field to Set 233 - pub struct SetByteEnd<St: State = Empty>(PhantomData<fn() -> St>); 234 - impl<St: State> sealed::Sealed for SetByteEnd<St> {} 235 - impl<St: State> State for SetByteEnd<St> { 236 - type ByteEnd = Set<members::byte_end>; 237 - type ByteStart = St::ByteStart; 230 + type ByteEnd = Unset; 238 231 } 239 232 ///State transition - sets the `byte_start` field to Set 240 233 pub struct SetByteStart<St: State = Empty>(PhantomData<fn() -> St>); 241 234 impl<St: State> sealed::Sealed for SetByteStart<St> {} 242 235 impl<St: State> State for SetByteStart<St> { 243 - type ByteEnd = St::ByteEnd; 244 236 type ByteStart = Set<members::byte_start>; 237 + type ByteEnd = St::ByteEnd; 238 + } 239 + ///State transition - sets the `byte_end` field to Set 240 + pub struct SetByteEnd<St: State = Empty>(PhantomData<fn() -> St>); 241 + impl<St: State> sealed::Sealed for SetByteEnd<St> {} 242 + impl<St: State> State for SetByteEnd<St> { 243 + type ByteStart = St::ByteStart; 244 + type ByteEnd = Set<members::byte_end>; 245 245 } 246 246 /// Marker types for field names 247 247 #[allow(non_camel_case_types)] 248 248 pub mod members { 249 - ///Marker type for the `byte_end` field 250 - pub struct byte_end(()); 251 249 ///Marker type for the `byte_start` field 252 250 pub struct byte_start(()); 251 + ///Marker type for the `byte_end` field 252 + pub struct byte_end(()); 253 253 } 254 254 } 255 255 ··· 337 337 impl<St, S: BosStr> ByteSliceBuilder<St, S> 338 338 where 339 339 St: byte_slice_state::State, 340 - St::ByteEnd: byte_slice_state::IsSet, 341 340 St::ByteStart: byte_slice_state::IsSet, 341 + St::ByteEnd: byte_slice_state::IsSet, 342 342 { 343 343 /// Build the final struct. 344 344 pub fn build(self) -> ByteSlice<S> { ··· 652 652 } 653 653 /// State trait tracking which required fields have been set 654 654 pub trait State: sealed::Sealed { 655 - type Features; 656 655 type Index; 656 + type Features; 657 657 } 658 658 /// Empty state - all required fields are unset 659 659 pub struct Empty(()); 660 660 impl sealed::Sealed for Empty {} 661 661 impl State for Empty { 662 - type Features = Unset; 663 662 type Index = Unset; 664 - } 665 - ///State transition - sets the `features` field to Set 666 - pub struct SetFeatures<St: State = Empty>(PhantomData<fn() -> St>); 667 - impl<St: State> sealed::Sealed for SetFeatures<St> {} 668 - impl<St: State> State for SetFeatures<St> { 669 - type Features = Set<members::features>; 670 - type Index = St::Index; 663 + type Features = Unset; 671 664 } 672 665 ///State transition - sets the `index` field to Set 673 666 pub struct SetIndex<St: State = Empty>(PhantomData<fn() -> St>); 674 667 impl<St: State> sealed::Sealed for SetIndex<St> {} 675 668 impl<St: State> State for SetIndex<St> { 676 - type Features = St::Features; 677 669 type Index = Set<members::index>; 670 + type Features = St::Features; 671 + } 672 + ///State transition - sets the `features` field to Set 673 + pub struct SetFeatures<St: State = Empty>(PhantomData<fn() -> St>); 674 + impl<St: State> sealed::Sealed for SetFeatures<St> {} 675 + impl<St: State> State for SetFeatures<St> { 676 + type Index = St::Index; 677 + type Features = Set<members::features>; 678 678 } 679 679 /// Marker types for field names 680 680 #[allow(non_camel_case_types)] 681 681 pub mod members { 682 - ///Marker type for the `features` field 683 - pub struct features(()); 684 682 ///Marker type for the `index` field 685 683 pub struct index(()); 684 + ///Marker type for the `features` field 685 + pub struct features(()); 686 686 } 687 687 } 688 688 ··· 770 770 impl<St, S: BosStr> FacetBuilder<St, S> 771 771 where 772 772 St: facet_state::State, 773 - St::Features: facet_state::IsSet, 774 773 St::Index: facet_state::IsSet, 774 + St::Features: facet_state::IsSet, 775 775 { 776 776 /// Build the final struct. 777 777 pub fn build(self) -> Facet<S> {
+30 -30
crates/jacquard-codegen-tests/src/generated/pretty/com_atproto/label.rs
··· 679 679 } 680 680 /// State trait tracking which required fields have been set 681 681 pub trait State: sealed::Sealed { 682 - type Cts; 683 682 type Src; 684 - type Val; 685 683 type Uri; 684 + type Cts; 685 + type Val; 686 686 } 687 687 /// Empty state - all required fields are unset 688 688 pub struct Empty(()); 689 689 impl sealed::Sealed for Empty {} 690 690 impl State for Empty { 691 - type Cts = Unset; 692 691 type Src = Unset; 693 - type Val = Unset; 694 692 type Uri = Unset; 695 - } 696 - ///State transition - sets the `cts` field to Set 697 - pub struct SetCts<St: State = Empty>(PhantomData<fn() -> St>); 698 - impl<St: State> sealed::Sealed for SetCts<St> {} 699 - impl<St: State> State for SetCts<St> { 700 - type Cts = Set<members::cts>; 701 - type Src = St::Src; 702 - type Val = St::Val; 703 - type Uri = St::Uri; 693 + type Cts = Unset; 694 + type Val = Unset; 704 695 } 705 696 ///State transition - sets the `src` field to Set 706 697 pub struct SetSrc<St: State = Empty>(PhantomData<fn() -> St>); 707 698 impl<St: State> sealed::Sealed for SetSrc<St> {} 708 699 impl<St: State> State for SetSrc<St> { 709 - type Cts = St::Cts; 710 700 type Src = Set<members::src>; 711 - type Val = St::Val; 712 701 type Uri = St::Uri; 713 - } 714 - ///State transition - sets the `val` field to Set 715 - pub struct SetVal<St: State = Empty>(PhantomData<fn() -> St>); 716 - impl<St: State> sealed::Sealed for SetVal<St> {} 717 - impl<St: State> State for SetVal<St> { 718 702 type Cts = St::Cts; 719 - type Src = St::Src; 720 - type Val = Set<members::val>; 721 - type Uri = St::Uri; 703 + type Val = St::Val; 722 704 } 723 705 ///State transition - sets the `uri` field to Set 724 706 pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>); 725 707 impl<St: State> sealed::Sealed for SetUri<St> {} 726 708 impl<St: State> State for SetUri<St> { 709 + type Src = St::Src; 710 + type Uri = Set<members::uri>; 727 711 type Cts = St::Cts; 712 + type Val = St::Val; 713 + } 714 + ///State transition - sets the `cts` field to Set 715 + pub struct SetCts<St: State = Empty>(PhantomData<fn() -> St>); 716 + impl<St: State> sealed::Sealed for SetCts<St> {} 717 + impl<St: State> State for SetCts<St> { 728 718 type Src = St::Src; 719 + type Uri = St::Uri; 720 + type Cts = Set<members::cts>; 729 721 type Val = St::Val; 730 - type Uri = Set<members::uri>; 722 + } 723 + ///State transition - sets the `val` field to Set 724 + pub struct SetVal<St: State = Empty>(PhantomData<fn() -> St>); 725 + impl<St: State> sealed::Sealed for SetVal<St> {} 726 + impl<St: State> State for SetVal<St> { 727 + type Src = St::Src; 728 + type Uri = St::Uri; 729 + type Cts = St::Cts; 730 + type Val = Set<members::val>; 731 731 } 732 732 /// Marker types for field names 733 733 #[allow(non_camel_case_types)] 734 734 pub mod members { 735 - ///Marker type for the `cts` field 736 - pub struct cts(()); 737 735 ///Marker type for the `src` field 738 736 pub struct src(()); 737 + ///Marker type for the `uri` field 738 + pub struct uri(()); 739 + ///Marker type for the `cts` field 740 + pub struct cts(()); 739 741 ///Marker type for the `val` field 740 742 pub struct val(()); 741 - ///Marker type for the `uri` field 742 - pub struct uri(()); 743 743 } 744 744 } 745 745 ··· 940 940 impl<St, S: BosStr> LabelBuilder<St, S> 941 941 where 942 942 St: label_state::State, 943 - St::Cts: label_state::IsSet, 944 943 St::Src: label_state::IsSet, 945 - St::Val: label_state::IsSet, 946 944 St::Uri: label_state::IsSet, 945 + St::Cts: label_state::IsSet, 946 + St::Val: label_state::IsSet, 947 947 { 948 948 /// Build the final struct. 949 949 pub fn build(self) -> Label<S> {
+13 -13
crates/jacquard-codegen-tests/src/generated/pretty/test_collision/did.rs
··· 226 226 } 227 227 /// State trait tracking which required fields have been set 228 228 pub trait State: sealed::Sealed { 229 - type Identifier; 230 229 type Owner; 230 + type Identifier; 231 231 } 232 232 /// Empty state - all required fields are unset 233 233 pub struct Empty(()); 234 234 impl sealed::Sealed for Empty {} 235 235 impl State for Empty { 236 - type Identifier = Unset; 237 236 type Owner = Unset; 238 - } 239 - ///State transition - sets the `identifier` field to Set 240 - pub struct SetIdentifier<St: State = Empty>(PhantomData<fn() -> St>); 241 - impl<St: State> sealed::Sealed for SetIdentifier<St> {} 242 - impl<St: State> State for SetIdentifier<St> { 243 - type Identifier = Set<members::identifier>; 244 - type Owner = St::Owner; 237 + type Identifier = Unset; 245 238 } 246 239 ///State transition - sets the `owner` field to Set 247 240 pub struct SetOwner<St: State = Empty>(PhantomData<fn() -> St>); 248 241 impl<St: State> sealed::Sealed for SetOwner<St> {} 249 242 impl<St: State> State for SetOwner<St> { 250 - type Identifier = St::Identifier; 251 243 type Owner = Set<members::owner>; 244 + type Identifier = St::Identifier; 245 + } 246 + ///State transition - sets the `identifier` field to Set 247 + pub struct SetIdentifier<St: State = Empty>(PhantomData<fn() -> St>); 248 + impl<St: State> sealed::Sealed for SetIdentifier<St> {} 249 + impl<St: State> State for SetIdentifier<St> { 250 + type Owner = St::Owner; 251 + type Identifier = Set<members::identifier>; 252 252 } 253 253 /// Marker types for field names 254 254 #[allow(non_camel_case_types)] 255 255 pub mod members { 256 - ///Marker type for the `identifier` field 257 - pub struct identifier(()); 258 256 ///Marker type for the `owner` field 259 257 pub struct owner(()); 258 + ///Marker type for the `identifier` field 259 + pub struct identifier(()); 260 260 } 261 261 } 262 262 ··· 361 361 impl<St, S: BosStr> DidRecordBuilder<St, S> 362 362 where 363 363 St: did_record_state::State, 364 - St::Identifier: did_record_state::IsSet, 365 364 St::Owner: did_record_state::IsSet, 365 + St::Identifier: did_record_state::IsSet, 366 366 { 367 367 /// Build the final struct. 368 368 pub fn build(self) -> DidRecord<S> {