atproto blogging

sketch of subdomain routing

Orual 6e274038 af0a6317

+7296 -5618
+80 -194
Cargo.lock
··· 3 3 version = 4 4 4 5 5 [[package]] 6 - name = "abnf" 7 - version = "0.13.0" 8 - source = "registry+https://github.com/rust-lang/crates.io-index" 9 - checksum = "087113bd50d9adce24850eed5d0476c7d199d532fce8fab5173650331e09033a" 10 - dependencies = [ 11 - "abnf-core", 12 - "nom", 13 - ] 14 - 15 - [[package]] 16 - name = "abnf-core" 17 - version = "0.5.0" 18 - source = "registry+https://github.com/rust-lang/crates.io-index" 19 - checksum = "c44e09c43ae1c368fb91a03a566472d0087c26cf7e1b9e8e289c14ede681dd7d" 20 - dependencies = [ 21 - "nom", 22 - ] 23 - 24 - [[package]] 25 6 name = "addr2line" 26 7 version = "0.25.1" 27 8 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 897 878 ] 898 879 899 880 [[package]] 900 - name = "btree-range-map" 901 - version = "0.7.2" 902 - source = "registry+https://github.com/rust-lang/crates.io-index" 903 - checksum = "1be5c9672446d3800bcbcaabaeba121fe22f1fb25700c4562b22faf76d377c33" 904 - dependencies = [ 905 - "btree-slab", 906 - "cc-traits", 907 - "range-traits", 908 - "serde", 909 - "slab", 910 - ] 911 - 912 - [[package]] 913 - name = "btree-slab" 914 - version = "0.6.1" 915 - source = "registry+https://github.com/rust-lang/crates.io-index" 916 - checksum = "7a2b56d3029f075c4fa892428a098425b86cef5c89ae54073137ece416aef13c" 917 - dependencies = [ 918 - "cc-traits", 919 - "slab", 920 - "smallvec", 921 - ] 922 - 923 - [[package]] 924 881 name = "buf_redux" 925 882 version = "0.8.4" 926 883 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1048 1005 "jobserver", 1049 1006 "libc", 1050 1007 "shlex", 1051 - ] 1052 - 1053 - [[package]] 1054 - name = "cc-traits" 1055 - version = "2.0.0" 1056 - source = "registry+https://github.com/rust-lang/crates.io-index" 1057 - checksum = "060303ef31ef4a522737e1b1ab68c67916f2a787bb2f4f54f383279adba962b5" 1058 - dependencies = [ 1059 - "slab", 1060 1008 ] 1061 1009 1062 1010 [[package]] ··· 2078 2026 checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" 2079 2027 dependencies = [ 2080 2028 "powerfmt", 2081 - "serde_core", 2082 2029 ] 2083 2030 2084 2031 [[package]] ··· 4526 4473 "futures-core", 4527 4474 "futures-sink", 4528 4475 "http", 4529 - "indexmap 2.12.1", 4476 + "indexmap", 4530 4477 "slab", 4531 4478 "tokio", 4532 4479 "tokio-util", ··· 4587 4534 source = "registry+https://github.com/rust-lang/crates.io-index" 4588 4535 checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" 4589 4536 dependencies = [ 4537 + "allocator-api2", 4538 + "equivalent", 4590 4539 "foldhash 0.1.5", 4591 4540 ] 4592 4541 ··· 4691 4640 version = "0.4.3" 4692 4641 source = "registry+https://github.com/rust-lang/crates.io-index" 4693 4642 checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 4694 - 4695 - [[package]] 4696 - name = "hex_fmt" 4697 - version = "0.3.0" 4698 - source = "registry+https://github.com/rust-lang/crates.io-index" 4699 - checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" 4700 4643 4701 4644 [[package]] 4702 4645 name = "hickory-proto" ··· 5230 5173 5231 5174 [[package]] 5232 5175 name = "indexmap" 5233 - version = "1.9.3" 5234 - source = "registry+https://github.com/rust-lang/crates.io-index" 5235 - checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 5236 - dependencies = [ 5237 - "autocfg", 5238 - "hashbrown 0.12.3", 5239 - "serde", 5240 - ] 5241 - 5242 - [[package]] 5243 - name = "indexmap" 5244 5176 version = "2.12.1" 5245 5177 source = "registry+https://github.com/rust-lang/crates.io-index" 5246 5178 checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" ··· 5249 5181 "hashbrown 0.16.1", 5250 5182 "serde", 5251 5183 "serde_core", 5252 - ] 5253 - 5254 - [[package]] 5255 - name = "indoc" 5256 - version = "2.0.7" 5257 - source = "registry+https://github.com/rust-lang/crates.io-index" 5258 - checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" 5259 - dependencies = [ 5260 - "rustversion", 5261 5184 ] 5262 5185 5263 5186 [[package]] ··· 5455 5378 "futures-lite", 5456 5379 "futures-util", 5457 5380 "hex", 5458 - "indexmap 2.12.1", 5381 + "indexmap", 5459 5382 "iroh", 5460 5383 "iroh-base", 5461 5384 "iroh-metrics", ··· 5708 5631 [[package]] 5709 5632 name = "jacquard" 5710 5633 version = "0.9.5" 5711 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 5634 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 5712 5635 dependencies = [ 5713 5636 "bytes", 5714 5637 "getrandom 0.2.16", ··· 5725 5648 "regex-lite", 5726 5649 "reqwest", 5727 5650 "serde", 5728 - "serde_html_form", 5651 + "serde_html_form 0.3.2", 5729 5652 "serde_json", 5730 5653 "smol_str", 5731 5654 "thiserror 2.0.17", ··· 5739 5662 [[package]] 5740 5663 name = "jacquard-api" 5741 5664 version = "0.9.5" 5742 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 5665 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 5743 5666 dependencies = [ 5744 5667 "bon", 5745 5668 "bytes", ··· 5758 5681 [[package]] 5759 5682 name = "jacquard-axum" 5760 5683 version = "0.9.6" 5761 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 5684 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 5762 5685 dependencies = [ 5763 5686 "axum", 5764 5687 "bytes", ··· 5769 5692 "miette 7.6.0", 5770 5693 "multibase", 5771 5694 "serde", 5772 - "serde_html_form", 5695 + "serde_html_form 0.3.2", 5773 5696 "serde_json", 5774 5697 "thiserror 2.0.17", 5775 5698 "tokio", ··· 5780 5703 [[package]] 5781 5704 name = "jacquard-common" 5782 5705 version = "0.9.5" 5783 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 5706 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 5784 5707 dependencies = [ 5785 5708 "base64 0.22.1", 5786 5709 "bon", 5787 5710 "bytes", 5788 5711 "chrono", 5789 5712 "ciborium", 5713 + "ciborium-io", 5790 5714 "cid", 5791 5715 "ed25519-dalek 2.2.0", 5792 5716 "futures", 5793 5717 "getrandom 0.2.16", 5794 5718 "getrandom 0.3.4", 5719 + "hashbrown 0.15.5", 5795 5720 "http", 5796 5721 "ipld-core", 5797 5722 "k256", 5798 - "langtag", 5723 + "maitake-sync", 5799 5724 "miette 7.6.0", 5800 5725 "multibase", 5801 5726 "multihash", 5802 5727 "n0-future 0.1.3", 5803 5728 "ouroboros", 5729 + "oxilangtag", 5804 5730 "p256", 5805 5731 "postcard", 5806 5732 "rand 0.9.2", 5807 5733 "regex", 5734 + "regex-automata", 5808 5735 "regex-lite", 5809 5736 "reqwest", 5810 5737 "serde", 5811 5738 "serde_bytes", 5812 - "serde_html_form", 5739 + "serde_html_form 0.3.2", 5813 5740 "serde_ipld_dagcbor", 5814 5741 "serde_json", 5815 5742 "signature 2.2.0", 5816 5743 "smol_str", 5744 + "spin 0.10.0", 5817 5745 "thiserror 2.0.17", 5818 5746 "tokio", 5819 5747 "tokio-tungstenite-wasm", ··· 5827 5755 [[package]] 5828 5756 name = "jacquard-derive" 5829 5757 version = "0.9.5" 5830 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 5758 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 5831 5759 dependencies = [ 5832 5760 "heck 0.5.0", 5833 5761 "jacquard-lexicon", ··· 5839 5767 [[package]] 5840 5768 name = "jacquard-identity" 5841 5769 version = "0.9.5" 5842 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 5770 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 5843 5771 dependencies = [ 5844 5772 "bon", 5845 5773 "bytes", ··· 5849 5777 "jacquard-common", 5850 5778 "jacquard-lexicon", 5851 5779 "miette 7.6.0", 5852 - "mini-moka-wasm 0.10.99 (git+https://tangled.org/@nonbinary.computer/jacquard)", 5780 + "mini-moka-wasm 0.10.99 (git+https://github.com/rsform/jacquard)", 5853 5781 "n0-future 0.1.3", 5854 5782 "percent-encoding", 5855 5783 "reqwest", 5856 5784 "serde", 5857 - "serde_html_form", 5785 + "serde_html_form 0.3.2", 5858 5786 "serde_json", 5859 5787 "thiserror 2.0.17", 5860 5788 "tokio", ··· 5867 5795 [[package]] 5868 5796 name = "jacquard-lexicon" 5869 5797 version = "0.9.5" 5870 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 5798 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 5871 5799 dependencies = [ 5872 5800 "cid", 5873 5801 "dashmap 6.1.0", ··· 5882 5810 "serde", 5883 5811 "serde_ipld_dagcbor", 5884 5812 "serde_json", 5813 + "serde_path_to_error", 5885 5814 "serde_repr", 5886 5815 "serde_with", 5887 5816 "sha2 0.10.9", ··· 5893 5822 [[package]] 5894 5823 name = "jacquard-oauth" 5895 5824 version = "0.9.6" 5896 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 5825 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 5897 5826 dependencies = [ 5898 5827 "base64 0.22.1", 5899 5828 "bytes", ··· 5910 5839 "rand 0.8.5", 5911 5840 "rouille", 5912 5841 "serde", 5913 - "serde_html_form", 5842 + "serde_html_form 0.3.2", 5914 5843 "serde_json", 5915 5844 "sha2 0.10.9", 5916 5845 "smol_str", ··· 5924 5853 5925 5854 [[package]] 5926 5855 name = "jacquard-repo" 5927 - version = "0.9.5" 5928 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 5856 + version = "0.9.6" 5857 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 5929 5858 dependencies = [ 5930 5859 "bytes", 5931 5860 "cid", ··· 6093 6022 dependencies = [ 6094 6023 "cssparser 0.29.6", 6095 6024 "html5ever 0.29.1", 6096 - "indexmap 2.12.1", 6025 + "indexmap", 6097 6026 "selectors", 6098 6027 ] 6099 6028 ··· 6109 6038 ] 6110 6039 6111 6040 [[package]] 6112 - name = "langtag" 6113 - version = "0.4.0" 6114 - source = "registry+https://github.com/rust-lang/crates.io-index" 6115 - checksum = "9ecb4c689a30e48ebeaa14237f34037e300dd072e6ad21a9ec72e810ff3c6600" 6116 - dependencies = [ 6117 - "serde", 6118 - "static-regular-grammar", 6119 - "thiserror 1.0.69", 6120 - ] 6121 - 6122 - [[package]] 6123 6041 name = "lazy-js-bundle" 6124 6042 version = "0.6.2" 6125 6043 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 6257 6175 "dashmap 5.5.3", 6258 6176 "data-encoding", 6259 6177 "getrandom 0.3.4", 6260 - "indexmap 2.12.1", 6178 + "indexmap", 6261 6179 "itertools 0.10.5", 6262 6180 "lazy_static", 6263 6181 "lightningcss-derive", ··· 6573 6491 checksum = "670fdfda89751bc4a84ac13eaa63e205cf0fd22b4c9a5fbfa085b63c1f1d3a30" 6574 6492 6575 6493 [[package]] 6494 + name = "maitake-sync" 6495 + version = "0.1.2" 6496 + source = "registry+https://github.com/rust-lang/crates.io-index" 6497 + checksum = "6816ab14147f80234c675b80ed6dc4f440d8a1cefc158e766067aedb84c0bcd5" 6498 + dependencies = [ 6499 + "cordyceps", 6500 + "loom", 6501 + "mycelium-bitfield", 6502 + "pin-project", 6503 + "portable-atomic", 6504 + ] 6505 + 6506 + [[package]] 6576 6507 name = "malloc_buf" 6577 6508 version = "0.0.6" 6578 6509 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 6815 6746 "hyper", 6816 6747 "hyper-rustls", 6817 6748 "hyper-util", 6818 - "indexmap 2.12.1", 6749 + "indexmap", 6819 6750 "ipnet", 6820 6751 "metrics", 6821 6752 "metrics-util", ··· 6950 6881 [[package]] 6951 6882 name = "mini-moka-wasm" 6952 6883 version = "0.10.99" 6953 - source = "git+https://tangled.org/@nonbinary.computer/jacquard#9021d423a2c199294a9206fa3ec2b8b2c261e117" 6884 + source = "git+https://github.com/rsform/jacquard#bfb72e29f20b0683e939db0140fa44cabde162d2" 6954 6885 dependencies = [ 6955 6886 "crossbeam-channel", 6956 6887 "crossbeam-utils", ··· 7094 7025 "tempfile", 7095 7026 "twoway", 7096 7027 ] 7028 + 7029 + [[package]] 7030 + name = "mycelium-bitfield" 7031 + version = "0.1.5" 7032 + source = "registry+https://github.com/rust-lang/crates.io-index" 7033 + checksum = "24e0cc5e2c585acbd15c5ce911dff71e1f4d5313f43345873311c4f5efd741cc" 7097 7034 7098 7035 [[package]] 7099 7036 name = "n0-error" ··· 7797 7734 version = "4.2.3" 7798 7735 source = "registry+https://github.com/rust-lang/crates.io-index" 7799 7736 checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" 7737 + 7738 + [[package]] 7739 + name = "oxilangtag" 7740 + version = "0.1.5" 7741 + source = "registry+https://github.com/rust-lang/crates.io-index" 7742 + checksum = "23f3f87617a86af77fa3691e6350483e7154c2ead9f1261b75130e21ca0f8acb" 7743 + dependencies = [ 7744 + "serde", 7745 + ] 7800 7746 7801 7747 [[package]] 7802 7748 name = "p256" ··· 8257 8203 checksum = "740ebea15c5d1428f910cd1a5f52cebf8d25006245ed8ade92702f4943d91e07" 8258 8204 dependencies = [ 8259 8205 "base64 0.22.1", 8260 - "indexmap 2.12.1", 8206 + "indexmap", 8261 8207 "quick-xml 0.38.4", 8262 8208 "serde", 8263 8209 "time", ··· 8852 8798 ] 8853 8799 8854 8800 [[package]] 8855 - name = "range-traits" 8856 - version = "0.3.2" 8857 - source = "registry+https://github.com/rust-lang/crates.io-index" 8858 - checksum = "d20581732dd76fa913c7dff1a2412b714afe3573e94d41c34719de73337cc8ab" 8859 - 8860 - [[package]] 8861 8801 name = "raw-cpuid" 8862 8802 version = "11.6.0" 8863 8803 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 8925 8865 "getrandom 0.2.16", 8926 8866 "libredox", 8927 8867 "thiserror 2.0.17", 8928 - ] 8929 - 8930 - [[package]] 8931 - name = "ref-cast" 8932 - version = "1.0.25" 8933 - source = "registry+https://github.com/rust-lang/crates.io-index" 8934 - checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" 8935 - dependencies = [ 8936 - "ref-cast-impl", 8937 - ] 8938 - 8939 - [[package]] 8940 - name = "ref-cast-impl" 8941 - version = "1.0.25" 8942 - source = "registry+https://github.com/rust-lang/crates.io-index" 8943 - checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" 8944 - dependencies = [ 8945 - "proc-macro2", 8946 - "quote", 8947 - "syn 2.0.111", 8948 8868 ] 8949 8869 8950 8870 [[package]] ··· 9417 9337 ] 9418 9338 9419 9339 [[package]] 9420 - name = "schemars" 9421 - version = "0.9.0" 9422 - source = "registry+https://github.com/rust-lang/crates.io-index" 9423 - checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" 9424 - dependencies = [ 9425 - "dyn-clone", 9426 - "ref-cast", 9427 - "serde", 9428 - "serde_json", 9429 - ] 9430 - 9431 - [[package]] 9432 - name = "schemars" 9433 - version = "1.1.0" 9434 - source = "registry+https://github.com/rust-lang/crates.io-index" 9435 - checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" 9436 - dependencies = [ 9437 - "dyn-clone", 9438 - "ref-cast", 9439 - "serde", 9440 - "serde_json", 9441 - ] 9442 - 9443 - [[package]] 9444 9340 name = "scoped-tls" 9445 9341 version = "1.0.1" 9446 9342 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 9678 9574 checksum = "b2f2d7ff8a2140333718bb329f5c40fc5f0865b84c426183ce14c97d2ab8154f" 9679 9575 dependencies = [ 9680 9576 "form_urlencoded", 9681 - "indexmap 2.12.1", 9577 + "indexmap", 9682 9578 "itoa", 9683 9579 "ryu", 9580 + "serde_core", 9581 + ] 9582 + 9583 + [[package]] 9584 + name = "serde_html_form" 9585 + version = "0.3.2" 9586 + source = "registry+https://github.com/rust-lang/crates.io-index" 9587 + checksum = "2acf96b1d9364968fce46ebb548f1c0e1d7eceae27bdff73865d42e6c7369d94" 9588 + dependencies = [ 9589 + "form_urlencoded", 9590 + "indexmap", 9591 + "itoa", 9684 9592 "serde_core", 9685 9593 ] 9686 9594 ··· 9702 9610 source = "registry+https://github.com/rust-lang/crates.io-index" 9703 9611 checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" 9704 9612 dependencies = [ 9705 - "indexmap 2.12.1", 9613 + "indexmap", 9706 9614 "itoa", 9707 9615 "memchr", 9708 9616 "ryu", ··· 9784 9692 "base64 0.22.1", 9785 9693 "chrono", 9786 9694 "hex", 9787 - "indexmap 1.9.3", 9788 - "indexmap 2.12.1", 9789 - "schemars 0.9.0", 9790 - "schemars 1.1.0", 9791 9695 "serde_core", 9792 9696 "serde_json", 9793 9697 "serde_with_macros", ··· 10250 10154 ] 10251 10155 10252 10156 [[package]] 10253 - name = "static-regular-grammar" 10254 - version = "2.0.2" 10255 - source = "registry+https://github.com/rust-lang/crates.io-index" 10256 - checksum = "4f4a6c40247579acfbb138c3cd7de3dab113ab4ac6227f1b7de7d626ee667957" 10257 - dependencies = [ 10258 - "abnf", 10259 - "btree-range-map", 10260 - "ciborium", 10261 - "hex_fmt", 10262 - "indoc", 10263 - "proc-macro-error", 10264 - "proc-macro2", 10265 - "quote", 10266 - "serde", 10267 - "sha2 0.10.9", 10268 - "syn 2.0.111", 10269 - "thiserror 1.0.69", 10270 - ] 10271 - 10272 - [[package]] 10273 10157 name = "static_assertions" 10274 10158 version = "1.1.0" 10275 10159 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 11162 11046 source = "registry+https://github.com/rust-lang/crates.io-index" 11163 11047 checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" 11164 11048 dependencies = [ 11165 - "indexmap 2.12.1", 11049 + "indexmap", 11166 11050 "toml_datetime 0.6.3", 11167 11051 "winnow 0.5.40", 11168 11052 ] ··· 11173 11057 source = "registry+https://github.com/rust-lang/crates.io-index" 11174 11058 checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" 11175 11059 dependencies = [ 11176 - "indexmap 2.12.1", 11060 + "indexmap", 11177 11061 "serde", 11178 11062 "serde_spanned", 11179 11063 "toml_datetime 0.6.3", ··· 11186 11070 source = "registry+https://github.com/rust-lang/crates.io-index" 11187 11071 checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" 11188 11072 dependencies = [ 11189 - "indexmap 2.12.1", 11073 + "indexmap", 11190 11074 "toml_datetime 0.7.5+spec-1.1.0", 11191 11075 "toml_parser", 11192 11076 "winnow 0.7.14", ··· 12118 12002 dependencies = [ 12119 12003 "askama", 12120 12004 "axum", 12005 + "axum-extra", 12121 12006 "base64 0.22.1", 12122 12007 "chrono", 12123 12008 "console_error_panic_hook", ··· 12155 12040 "resvg", 12156 12041 "ring", 12157 12042 "serde", 12158 - "serde_html_form", 12043 + "serde_html_form 0.2.8", 12159 12044 "serde_ipld_dagcbor", 12160 12045 "serde_json", 12161 12046 "syntect", ··· 12163 12048 "time", 12164 12049 "tiny-skia", 12165 12050 "tokio", 12051 + "tower", 12166 12052 "tracing", 12167 12053 "tracing-subscriber", 12168 12054 "tracing-wasm",
+15 -7
Cargo.toml
··· 33 33 # markdown-weaver = { path = "../markdown-weaver/markdown-weaver" } 34 34 # markdown-weaver-escape = { path = "../markdown-weaver/markdown-weaver-escape" } 35 35 36 - jacquard = { git = "https://tangled.org/@nonbinary.computer/jacquard", default-features = false, features = ["derive", "api_bluesky", "tracing"] } 37 - jacquard-identity = { git = "https://tangled.org/@nonbinary.computer/jacquard", features = ["cache"] } 38 - jacquard-common = { git = "https://tangled.org/@nonbinary.computer/jacquard" } 39 - jacquard-axum = { git = "https://tangled.org/@nonbinary.computer/jacquard" } 40 - jacquard-derive = { git = "https://tangled.org/@nonbinary.computer/jacquard" } 41 - jacquard-lexicon = { git = "https://tangled.org/@nonbinary.computer/jacquard", default-features = false } 42 - jacquard-repo = { git = "https://tangled.org/@nonbinary.computer/jacquard" } 36 + # jacquard = { git = "https://tangled.org/nonbinary.computer/jacquard", default-features = false, features = ["derive", "api_bluesky", "tracing"] } 37 + # jacquard-identity = { git = "https://tangled.org/nonbinary.computer/jacquard", features = ["cache"] } 38 + # jacquard-common = { git = "https://tangled.org/nonbinary.computer/jacquard" } 39 + # jacquard-axum = { git = "https://tangled.org/nonbinary.computer/jacquard" } 40 + # jacquard-derive = { git = "https://tangled.org/nonbinary.computer/jacquard" } 41 + # jacquard-lexicon = { git = "https://tangled.org/nonbinary.computer/jacquard", default-features = false } 42 + # jacquard-repo = { git = "https://tangled.org/nonbinary.computer/jacquard" } 43 + 44 + jacquard = { git = "https://github.com/rsform/jacquard", default-features = false, features = ["derive", "api_bluesky", "tracing"] } 45 + jacquard-identity = { git = "https://github.com/rsform/jacquard", features = ["cache"] } 46 + jacquard-common = { git = "https://github.com/rsform/jacquard" } 47 + jacquard-axum = { git = "https://github.com/rsform/jacquard" } 48 + jacquard-derive = { git = "https://github.com/rsform/jacquard" } 49 + jacquard-lexicon = { git = "https://github.com/rsform/jacquard", default-features = false } 50 + jacquard-repo = { git = "https://github.com/rsform/jacquard" } 43 51 44 52 # jacquard = { path = "../jacquard/crates/jacquard", default-features = false, features = ["derive", "api_bluesky", "tracing", "cache"] } 45 53 # jacquard-identity = { path = "../jacquard/crates/jacquard-identity", features = ["cache"] }
+42
crates/weaver-api/lexicons/sh_weaver_notebook_resolveGlobalNotebook.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.weaver.notebook.resolveGlobalNotebook", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Resolve a notebook by its global path. Only returns notebooks with publishGlobal enabled. Used for subdomain routing.", 8 + "parameters": { 9 + "type": "params", 10 + "required": [ 11 + "path" 12 + ], 13 + "properties": { 14 + "path": { 15 + "type": "string", 16 + "description": "The global path to resolve (e.g., 'cooking' for cooking.weaver.sh)" 17 + } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": [ 25 + "notebook" 26 + ], 27 + "properties": { 28 + "notebook": { 29 + "type": "ref", 30 + "ref": "sh.weaver.notebook.defs#notebookView" 31 + } 32 + } 33 + } 34 + }, 35 + "errors": [ 36 + { 37 + "name": "NotFound" 38 + } 39 + ] 40 + } 41 + } 42 + }
+136 -136
crates/weaver-api/src/app_bsky/actor.rs
··· 3137 3137 } 3138 3138 /// State trait tracking which required fields have been set 3139 3139 pub trait State: sealed::Sealed { 3140 - type Followers; 3141 3140 type Count; 3141 + type Followers; 3142 3142 } 3143 3143 /// Empty state - all required fields are unset 3144 3144 pub struct Empty(()); 3145 3145 impl sealed::Sealed for Empty {} 3146 3146 impl State for Empty { 3147 - type Followers = Unset; 3148 3147 type Count = Unset; 3149 - } 3150 - ///State transition - sets the `followers` field to Set 3151 - pub struct SetFollowers<S: State = Empty>(PhantomData<fn() -> S>); 3152 - impl<S: State> sealed::Sealed for SetFollowers<S> {} 3153 - impl<S: State> State for SetFollowers<S> { 3154 - type Followers = Set<members::followers>; 3155 - type Count = S::Count; 3148 + type Followers = Unset; 3156 3149 } 3157 3150 ///State transition - sets the `count` field to Set 3158 3151 pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 3159 3152 impl<S: State> sealed::Sealed for SetCount<S> {} 3160 3153 impl<S: State> State for SetCount<S> { 3161 - type Followers = S::Followers; 3162 3154 type Count = Set<members::count>; 3155 + type Followers = S::Followers; 3156 + } 3157 + ///State transition - sets the `followers` field to Set 3158 + pub struct SetFollowers<S: State = Empty>(PhantomData<fn() -> S>); 3159 + impl<S: State> sealed::Sealed for SetFollowers<S> {} 3160 + impl<S: State> State for SetFollowers<S> { 3161 + type Count = S::Count; 3162 + type Followers = Set<members::followers>; 3163 3163 } 3164 3164 /// Marker types for field names 3165 3165 #[allow(non_camel_case_types)] 3166 3166 pub mod members { 3167 - ///Marker type for the `followers` field 3168 - pub struct followers(()); 3169 3167 ///Marker type for the `count` field 3170 3168 pub struct count(()); 3169 + ///Marker type for the `followers` field 3170 + pub struct followers(()); 3171 3171 } 3172 3172 } 3173 3173 ··· 3240 3240 impl<'a, S> KnownFollowersBuilder<'a, S> 3241 3241 where 3242 3242 S: known_followers_state::State, 3243 - S::Followers: known_followers_state::IsSet, 3244 3243 S::Count: known_followers_state::IsSet, 3244 + S::Followers: known_followers_state::IsSet, 3245 3245 { 3246 3246 /// Build the final struct 3247 3247 pub fn build(self) -> KnownFollowers<'a> { ··· 4215 4215 } 4216 4216 /// State trait tracking which required fields have been set 4217 4217 pub trait State: sealed::Sealed { 4218 - type Completed; 4219 4218 type Id; 4219 + type Completed; 4220 4220 } 4221 4221 /// Empty state - all required fields are unset 4222 4222 pub struct Empty(()); 4223 4223 impl sealed::Sealed for Empty {} 4224 4224 impl State for Empty { 4225 - type Completed = Unset; 4226 4225 type Id = Unset; 4227 - } 4228 - ///State transition - sets the `completed` field to Set 4229 - pub struct SetCompleted<S: State = Empty>(PhantomData<fn() -> S>); 4230 - impl<S: State> sealed::Sealed for SetCompleted<S> {} 4231 - impl<S: State> State for SetCompleted<S> { 4232 - type Completed = Set<members::completed>; 4233 - type Id = S::Id; 4226 + type Completed = Unset; 4234 4227 } 4235 4228 ///State transition - sets the `id` field to Set 4236 4229 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 4237 4230 impl<S: State> sealed::Sealed for SetId<S> {} 4238 4231 impl<S: State> State for SetId<S> { 4239 - type Completed = S::Completed; 4240 4232 type Id = Set<members::id>; 4233 + type Completed = S::Completed; 4234 + } 4235 + ///State transition - sets the `completed` field to Set 4236 + pub struct SetCompleted<S: State = Empty>(PhantomData<fn() -> S>); 4237 + impl<S: State> sealed::Sealed for SetCompleted<S> {} 4238 + impl<S: State> State for SetCompleted<S> { 4239 + type Id = S::Id; 4240 + type Completed = Set<members::completed>; 4241 4241 } 4242 4242 /// Marker types for field names 4243 4243 #[allow(non_camel_case_types)] 4244 4244 pub mod members { 4245 - ///Marker type for the `completed` field 4246 - pub struct completed(()); 4247 4245 ///Marker type for the `id` field 4248 4246 pub struct id(()); 4247 + ///Marker type for the `completed` field 4248 + pub struct completed(()); 4249 4249 } 4250 4250 } 4251 4251 ··· 4355 4355 impl<'a, S> NuxBuilder<'a, S> 4356 4356 where 4357 4357 S: nux_state::State, 4358 - S::Completed: nux_state::IsSet, 4359 4358 S::Id: nux_state::IsSet, 4359 + S::Completed: nux_state::IsSet, 4360 4360 { 4361 4361 /// Build the final struct 4362 4362 pub fn build(self) -> Nux<'a> { ··· 5007 5007 } 5008 5008 /// State trait tracking which required fields have been set 5009 5009 pub trait State: sealed::Sealed { 5010 - type Did; 5011 5010 type Handle; 5011 + type Did; 5012 5012 } 5013 5013 /// Empty state - all required fields are unset 5014 5014 pub struct Empty(()); 5015 5015 impl sealed::Sealed for Empty {} 5016 5016 impl State for Empty { 5017 - type Did = Unset; 5018 5017 type Handle = Unset; 5019 - } 5020 - ///State transition - sets the `did` field to Set 5021 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 5022 - impl<S: State> sealed::Sealed for SetDid<S> {} 5023 - impl<S: State> State for SetDid<S> { 5024 - type Did = Set<members::did>; 5025 - type Handle = S::Handle; 5018 + type Did = Unset; 5026 5019 } 5027 5020 ///State transition - sets the `handle` field to Set 5028 5021 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 5029 5022 impl<S: State> sealed::Sealed for SetHandle<S> {} 5030 5023 impl<S: State> State for SetHandle<S> { 5031 - type Did = S::Did; 5032 5024 type Handle = Set<members::handle>; 5025 + type Did = S::Did; 5026 + } 5027 + ///State transition - sets the `did` field to Set 5028 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 5029 + impl<S: State> sealed::Sealed for SetDid<S> {} 5030 + impl<S: State> State for SetDid<S> { 5031 + type Handle = S::Handle; 5032 + type Did = Set<members::did>; 5033 5033 } 5034 5034 /// Marker types for field names 5035 5035 #[allow(non_camel_case_types)] 5036 5036 pub mod members { 5037 + ///Marker type for the `handle` field 5038 + pub struct handle(()); 5037 5039 ///Marker type for the `did` field 5038 5040 pub struct did(()); 5039 - ///Marker type for the `handle` field 5040 - pub struct handle(()); 5041 5041 } 5042 5042 } 5043 5043 ··· 5362 5362 impl<'a, S> ProfileViewBuilder<'a, S> 5363 5363 where 5364 5364 S: profile_view_state::State, 5365 - S::Did: profile_view_state::IsSet, 5366 5365 S::Handle: profile_view_state::IsSet, 5366 + S::Did: profile_view_state::IsSet, 5367 5367 { 5368 5368 /// Build the final struct 5369 5369 pub fn build(self) -> ProfileView<'a> { ··· 5548 5548 } 5549 5549 /// State trait tracking which required fields have been set 5550 5550 pub trait State: sealed::Sealed { 5551 - type Handle; 5552 5551 type Did; 5552 + type Handle; 5553 5553 } 5554 5554 /// Empty state - all required fields are unset 5555 5555 pub struct Empty(()); 5556 5556 impl sealed::Sealed for Empty {} 5557 5557 impl State for Empty { 5558 - type Handle = Unset; 5559 5558 type Did = Unset; 5560 - } 5561 - ///State transition - sets the `handle` field to Set 5562 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 5563 - impl<S: State> sealed::Sealed for SetHandle<S> {} 5564 - impl<S: State> State for SetHandle<S> { 5565 - type Handle = Set<members::handle>; 5566 - type Did = S::Did; 5559 + type Handle = Unset; 5567 5560 } 5568 5561 ///State transition - sets the `did` field to Set 5569 5562 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 5570 5563 impl<S: State> sealed::Sealed for SetDid<S> {} 5571 5564 impl<S: State> State for SetDid<S> { 5572 - type Handle = S::Handle; 5573 5565 type Did = Set<members::did>; 5566 + type Handle = S::Handle; 5567 + } 5568 + ///State transition - sets the `handle` field to Set 5569 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 5570 + impl<S: State> sealed::Sealed for SetHandle<S> {} 5571 + impl<S: State> State for SetHandle<S> { 5572 + type Did = S::Did; 5573 + type Handle = Set<members::handle>; 5574 5574 } 5575 5575 /// Marker types for field names 5576 5576 #[allow(non_camel_case_types)] 5577 5577 pub mod members { 5578 - ///Marker type for the `handle` field 5579 - pub struct handle(()); 5580 5578 ///Marker type for the `did` field 5581 5579 pub struct did(()); 5580 + ///Marker type for the `handle` field 5581 + pub struct handle(()); 5582 5582 } 5583 5583 } 5584 5584 ··· 5861 5861 impl<'a, S> ProfileViewBasicBuilder<'a, S> 5862 5862 where 5863 5863 S: profile_view_basic_state::State, 5864 - S::Handle: profile_view_basic_state::IsSet, 5865 5864 S::Did: profile_view_basic_state::IsSet, 5865 + S::Handle: profile_view_basic_state::IsSet, 5866 5866 { 5867 5867 /// Build the final struct 5868 5868 pub fn build(self) -> ProfileViewBasic<'a> { ··· 6040 6040 } 6041 6041 /// State trait tracking which required fields have been set 6042 6042 pub trait State: sealed::Sealed { 6043 - type Handle; 6044 6043 type Did; 6044 + type Handle; 6045 6045 } 6046 6046 /// Empty state - all required fields are unset 6047 6047 pub struct Empty(()); 6048 6048 impl sealed::Sealed for Empty {} 6049 6049 impl State for Empty { 6050 - type Handle = Unset; 6051 6050 type Did = Unset; 6052 - } 6053 - ///State transition - sets the `handle` field to Set 6054 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 6055 - impl<S: State> sealed::Sealed for SetHandle<S> {} 6056 - impl<S: State> State for SetHandle<S> { 6057 - type Handle = Set<members::handle>; 6058 - type Did = S::Did; 6051 + type Handle = Unset; 6059 6052 } 6060 6053 ///State transition - sets the `did` field to Set 6061 6054 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 6062 6055 impl<S: State> sealed::Sealed for SetDid<S> {} 6063 6056 impl<S: State> State for SetDid<S> { 6064 - type Handle = S::Handle; 6065 6057 type Did = Set<members::did>; 6058 + type Handle = S::Handle; 6059 + } 6060 + ///State transition - sets the `handle` field to Set 6061 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 6062 + impl<S: State> sealed::Sealed for SetHandle<S> {} 6063 + impl<S: State> State for SetHandle<S> { 6064 + type Did = S::Did; 6065 + type Handle = Set<members::handle>; 6066 6066 } 6067 6067 /// Marker types for field names 6068 6068 #[allow(non_camel_case_types)] 6069 6069 pub mod members { 6070 - ///Marker type for the `handle` field 6071 - pub struct handle(()); 6072 6070 ///Marker type for the `did` field 6073 6071 pub struct did(()); 6072 + ///Marker type for the `handle` field 6073 + pub struct handle(()); 6074 6074 } 6075 6075 } 6076 6076 ··· 6524 6524 impl<'a, S> ProfileViewDetailedBuilder<'a, S> 6525 6525 where 6526 6526 S: profile_view_detailed_state::State, 6527 - S::Handle: profile_view_detailed_state::IsSet, 6528 6527 S::Did: profile_view_detailed_state::IsSet, 6528 + S::Handle: profile_view_detailed_state::IsSet, 6529 6529 { 6530 6530 /// Build the final struct 6531 6531 pub fn build(self) -> ProfileViewDetailed<'a> { ··· 6697 6697 } 6698 6698 /// State trait tracking which required fields have been set 6699 6699 pub trait State: sealed::Sealed { 6700 - type Id; 6701 6700 type Type; 6702 6701 type Pinned; 6702 + type Id; 6703 6703 type Value; 6704 6704 } 6705 6705 /// Empty state - all required fields are unset 6706 6706 pub struct Empty(()); 6707 6707 impl sealed::Sealed for Empty {} 6708 6708 impl State for Empty { 6709 - type Id = Unset; 6710 6709 type Type = Unset; 6711 6710 type Pinned = Unset; 6711 + type Id = Unset; 6712 6712 type Value = Unset; 6713 6713 } 6714 - ///State transition - sets the `id` field to Set 6715 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 6716 - impl<S: State> sealed::Sealed for SetId<S> {} 6717 - impl<S: State> State for SetId<S> { 6718 - type Id = Set<members::id>; 6719 - type Type = S::Type; 6720 - type Pinned = S::Pinned; 6721 - type Value = S::Value; 6722 - } 6723 6714 ///State transition - sets the `type` field to Set 6724 6715 pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 6725 6716 impl<S: State> sealed::Sealed for SetType<S> {} 6726 6717 impl<S: State> State for SetType<S> { 6727 - type Id = S::Id; 6728 6718 type Type = Set<members::r#type>; 6729 6719 type Pinned = S::Pinned; 6720 + type Id = S::Id; 6730 6721 type Value = S::Value; 6731 6722 } 6732 6723 ///State transition - sets the `pinned` field to Set 6733 6724 pub struct SetPinned<S: State = Empty>(PhantomData<fn() -> S>); 6734 6725 impl<S: State> sealed::Sealed for SetPinned<S> {} 6735 6726 impl<S: State> State for SetPinned<S> { 6736 - type Id = S::Id; 6737 6727 type Type = S::Type; 6738 6728 type Pinned = Set<members::pinned>; 6729 + type Id = S::Id; 6730 + type Value = S::Value; 6731 + } 6732 + ///State transition - sets the `id` field to Set 6733 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 6734 + impl<S: State> sealed::Sealed for SetId<S> {} 6735 + impl<S: State> State for SetId<S> { 6736 + type Type = S::Type; 6737 + type Pinned = S::Pinned; 6738 + type Id = Set<members::id>; 6739 6739 type Value = S::Value; 6740 6740 } 6741 6741 ///State transition - sets the `value` field to Set 6742 6742 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 6743 6743 impl<S: State> sealed::Sealed for SetValue<S> {} 6744 6744 impl<S: State> State for SetValue<S> { 6745 - type Id = S::Id; 6746 6745 type Type = S::Type; 6747 6746 type Pinned = S::Pinned; 6747 + type Id = S::Id; 6748 6748 type Value = Set<members::value>; 6749 6749 } 6750 6750 /// Marker types for field names 6751 6751 #[allow(non_camel_case_types)] 6752 6752 pub mod members { 6753 - ///Marker type for the `id` field 6754 - pub struct id(()); 6755 6753 ///Marker type for the `type` field 6756 6754 pub struct r#type(()); 6757 6755 ///Marker type for the `pinned` field 6758 6756 pub struct pinned(()); 6757 + ///Marker type for the `id` field 6758 + pub struct id(()); 6759 6759 ///Marker type for the `value` field 6760 6760 pub struct value(()); 6761 6761 } ··· 6870 6870 impl<'a, S> SavedFeedBuilder<'a, S> 6871 6871 where 6872 6872 S: saved_feed_state::State, 6873 - S::Id: saved_feed_state::IsSet, 6874 6873 S::Type: saved_feed_state::IsSet, 6875 6874 S::Pinned: saved_feed_state::IsSet, 6875 + S::Id: saved_feed_state::IsSet, 6876 6876 S::Value: saved_feed_state::IsSet, 6877 6877 { 6878 6878 /// Build the final struct ··· 7043 7043 } 7044 7044 /// State trait tracking which required fields have been set 7045 7045 pub trait State: sealed::Sealed { 7046 - type Saved; 7047 7046 type Pinned; 7047 + type Saved; 7048 7048 } 7049 7049 /// Empty state - all required fields are unset 7050 7050 pub struct Empty(()); 7051 7051 impl sealed::Sealed for Empty {} 7052 7052 impl State for Empty { 7053 - type Saved = Unset; 7054 7053 type Pinned = Unset; 7055 - } 7056 - ///State transition - sets the `saved` field to Set 7057 - pub struct SetSaved<S: State = Empty>(PhantomData<fn() -> S>); 7058 - impl<S: State> sealed::Sealed for SetSaved<S> {} 7059 - impl<S: State> State for SetSaved<S> { 7060 - type Saved = Set<members::saved>; 7061 - type Pinned = S::Pinned; 7054 + type Saved = Unset; 7062 7055 } 7063 7056 ///State transition - sets the `pinned` field to Set 7064 7057 pub struct SetPinned<S: State = Empty>(PhantomData<fn() -> S>); 7065 7058 impl<S: State> sealed::Sealed for SetPinned<S> {} 7066 7059 impl<S: State> State for SetPinned<S> { 7067 - type Saved = S::Saved; 7068 7060 type Pinned = Set<members::pinned>; 7061 + type Saved = S::Saved; 7062 + } 7063 + ///State transition - sets the `saved` field to Set 7064 + pub struct SetSaved<S: State = Empty>(PhantomData<fn() -> S>); 7065 + impl<S: State> sealed::Sealed for SetSaved<S> {} 7066 + impl<S: State> State for SetSaved<S> { 7067 + type Pinned = S::Pinned; 7068 + type Saved = Set<members::saved>; 7069 7069 } 7070 7070 /// Marker types for field names 7071 7071 #[allow(non_camel_case_types)] 7072 7072 pub mod members { 7073 + ///Marker type for the `pinned` field 7074 + pub struct pinned(()); 7073 7075 ///Marker type for the `saved` field 7074 7076 pub struct saved(()); 7075 - ///Marker type for the `pinned` field 7076 - pub struct pinned(()); 7077 7077 } 7078 7078 } 7079 7079 ··· 7160 7160 impl<'a, S> SavedFeedsPrefBuilder<'a, S> 7161 7161 where 7162 7162 S: saved_feeds_pref_state::State, 7163 - S::Saved: saved_feeds_pref_state::IsSet, 7164 7163 S::Pinned: saved_feeds_pref_state::IsSet, 7164 + S::Saved: saved_feeds_pref_state::IsSet, 7165 7165 { 7166 7166 /// Build the final struct 7167 7167 pub fn build(self) -> SavedFeedsPref<'a> { ··· 7383 7383 } 7384 7384 /// State trait tracking which required fields have been set 7385 7385 pub trait State: sealed::Sealed { 7386 - type Status; 7387 7386 type Record; 7387 + type Status; 7388 7388 } 7389 7389 /// Empty state - all required fields are unset 7390 7390 pub struct Empty(()); 7391 7391 impl sealed::Sealed for Empty {} 7392 7392 impl State for Empty { 7393 - type Status = Unset; 7394 7393 type Record = Unset; 7395 - } 7396 - ///State transition - sets the `status` field to Set 7397 - pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 7398 - impl<S: State> sealed::Sealed for SetStatus<S> {} 7399 - impl<S: State> State for SetStatus<S> { 7400 - type Status = Set<members::status>; 7401 - type Record = S::Record; 7394 + type Status = Unset; 7402 7395 } 7403 7396 ///State transition - sets the `record` field to Set 7404 7397 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 7405 7398 impl<S: State> sealed::Sealed for SetRecord<S> {} 7406 7399 impl<S: State> State for SetRecord<S> { 7407 - type Status = S::Status; 7408 7400 type Record = Set<members::record>; 7401 + type Status = S::Status; 7402 + } 7403 + ///State transition - sets the `status` field to Set 7404 + pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 7405 + impl<S: State> sealed::Sealed for SetStatus<S> {} 7406 + impl<S: State> State for SetStatus<S> { 7407 + type Record = S::Record; 7408 + type Status = Set<members::status>; 7409 7409 } 7410 7410 /// Marker types for field names 7411 7411 #[allow(non_camel_case_types)] 7412 7412 pub mod members { 7413 + ///Marker type for the `record` field 7414 + pub struct record(()); 7413 7415 ///Marker type for the `status` field 7414 7416 pub struct status(()); 7415 - ///Marker type for the `record` field 7416 - pub struct record(()); 7417 7417 } 7418 7418 } 7419 7419 ··· 7540 7540 impl<'a, S> StatusViewBuilder<'a, S> 7541 7541 where 7542 7542 S: status_view_state::State, 7543 - S::Status: status_view_state::IsSet, 7544 7543 S::Record: status_view_state::IsSet, 7544 + S::Status: status_view_state::IsSet, 7545 7545 { 7546 7546 /// Build the final struct 7547 7547 pub fn build(self) -> StatusView<'a> { ··· 8310 8310 } 8311 8311 /// State trait tracking which required fields have been set 8312 8312 pub trait State: sealed::Sealed { 8313 - type Issuer; 8313 + type IsValid; 8314 8314 type CreatedAt; 8315 + type Issuer; 8315 8316 type Uri; 8316 - type IsValid; 8317 8317 } 8318 8318 /// Empty state - all required fields are unset 8319 8319 pub struct Empty(()); 8320 8320 impl sealed::Sealed for Empty {} 8321 8321 impl State for Empty { 8322 + type IsValid = Unset; 8323 + type CreatedAt = Unset; 8322 8324 type Issuer = Unset; 8323 - type CreatedAt = Unset; 8324 8325 type Uri = Unset; 8325 - type IsValid = Unset; 8326 8326 } 8327 - ///State transition - sets the `issuer` field to Set 8328 - pub struct SetIssuer<S: State = Empty>(PhantomData<fn() -> S>); 8329 - impl<S: State> sealed::Sealed for SetIssuer<S> {} 8330 - impl<S: State> State for SetIssuer<S> { 8331 - type Issuer = Set<members::issuer>; 8327 + ///State transition - sets the `is_valid` field to Set 8328 + pub struct SetIsValid<S: State = Empty>(PhantomData<fn() -> S>); 8329 + impl<S: State> sealed::Sealed for SetIsValid<S> {} 8330 + impl<S: State> State for SetIsValid<S> { 8331 + type IsValid = Set<members::is_valid>; 8332 8332 type CreatedAt = S::CreatedAt; 8333 + type Issuer = S::Issuer; 8333 8334 type Uri = S::Uri; 8334 - type IsValid = S::IsValid; 8335 8335 } 8336 8336 ///State transition - sets the `created_at` field to Set 8337 8337 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 8338 8338 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 8339 8339 impl<S: State> State for SetCreatedAt<S> { 8340 + type IsValid = S::IsValid; 8341 + type CreatedAt = Set<members::created_at>; 8340 8342 type Issuer = S::Issuer; 8341 - type CreatedAt = Set<members::created_at>; 8342 8343 type Uri = S::Uri; 8344 + } 8345 + ///State transition - sets the `issuer` field to Set 8346 + pub struct SetIssuer<S: State = Empty>(PhantomData<fn() -> S>); 8347 + impl<S: State> sealed::Sealed for SetIssuer<S> {} 8348 + impl<S: State> State for SetIssuer<S> { 8343 8349 type IsValid = S::IsValid; 8350 + type CreatedAt = S::CreatedAt; 8351 + type Issuer = Set<members::issuer>; 8352 + type Uri = S::Uri; 8344 8353 } 8345 8354 ///State transition - sets the `uri` field to Set 8346 8355 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 8347 8356 impl<S: State> sealed::Sealed for SetUri<S> {} 8348 8357 impl<S: State> State for SetUri<S> { 8349 - type Issuer = S::Issuer; 8350 - type CreatedAt = S::CreatedAt; 8351 - type Uri = Set<members::uri>; 8352 8358 type IsValid = S::IsValid; 8353 - } 8354 - ///State transition - sets the `is_valid` field to Set 8355 - pub struct SetIsValid<S: State = Empty>(PhantomData<fn() -> S>); 8356 - impl<S: State> sealed::Sealed for SetIsValid<S> {} 8357 - impl<S: State> State for SetIsValid<S> { 8358 - type Issuer = S::Issuer; 8359 8359 type CreatedAt = S::CreatedAt; 8360 - type Uri = S::Uri; 8361 - type IsValid = Set<members::is_valid>; 8360 + type Issuer = S::Issuer; 8361 + type Uri = Set<members::uri>; 8362 8362 } 8363 8363 /// Marker types for field names 8364 8364 #[allow(non_camel_case_types)] 8365 8365 pub mod members { 8366 - ///Marker type for the `issuer` field 8367 - pub struct issuer(()); 8366 + ///Marker type for the `is_valid` field 8367 + pub struct is_valid(()); 8368 8368 ///Marker type for the `created_at` field 8369 8369 pub struct created_at(()); 8370 + ///Marker type for the `issuer` field 8371 + pub struct issuer(()); 8370 8372 ///Marker type for the `uri` field 8371 8373 pub struct uri(()); 8372 - ///Marker type for the `is_valid` field 8373 - pub struct is_valid(()); 8374 8374 } 8375 8375 } 8376 8376 ··· 8483 8483 impl<'a, S> VerificationViewBuilder<'a, S> 8484 8484 where 8485 8485 S: verification_view_state::State, 8486 - S::Issuer: verification_view_state::IsSet, 8486 + S::IsValid: verification_view_state::IsSet, 8487 8487 S::CreatedAt: verification_view_state::IsSet, 8488 + S::Issuer: verification_view_state::IsSet, 8488 8489 S::Uri: verification_view_state::IsSet, 8489 - S::IsValid: verification_view_state::IsSet, 8490 8490 { 8491 8491 /// Build the final struct 8492 8492 pub fn build(self) -> VerificationView<'a> {
+58 -58
crates/weaver-api/src/app_bsky/ageassurance.rs
··· 1700 1700 } 1701 1701 /// State trait tracking which required fields have been set 1702 1702 pub trait State: sealed::Sealed { 1703 - type Access; 1704 1703 type Date; 1704 + type Access; 1705 1705 } 1706 1706 /// Empty state - all required fields are unset 1707 1707 pub struct Empty(()); 1708 1708 impl sealed::Sealed for Empty {} 1709 1709 impl State for Empty { 1710 - type Access = Unset; 1711 1710 type Date = Unset; 1712 - } 1713 - ///State transition - sets the `access` field to Set 1714 - pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 1715 - impl<S: State> sealed::Sealed for SetAccess<S> {} 1716 - impl<S: State> State for SetAccess<S> { 1717 - type Access = Set<members::access>; 1718 - type Date = S::Date; 1711 + type Access = Unset; 1719 1712 } 1720 1713 ///State transition - sets the `date` field to Set 1721 1714 pub struct SetDate<S: State = Empty>(PhantomData<fn() -> S>); 1722 1715 impl<S: State> sealed::Sealed for SetDate<S> {} 1723 1716 impl<S: State> State for SetDate<S> { 1724 - type Access = S::Access; 1725 1717 type Date = Set<members::date>; 1718 + type Access = S::Access; 1719 + } 1720 + ///State transition - sets the `access` field to Set 1721 + pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 1722 + impl<S: State> sealed::Sealed for SetAccess<S> {} 1723 + impl<S: State> State for SetAccess<S> { 1724 + type Date = S::Date; 1725 + type Access = Set<members::access>; 1726 1726 } 1727 1727 /// Marker types for field names 1728 1728 #[allow(non_camel_case_types)] 1729 1729 pub mod members { 1730 - ///Marker type for the `access` field 1731 - pub struct access(()); 1732 1730 ///Marker type for the `date` field 1733 1731 pub struct date(()); 1732 + ///Marker type for the `access` field 1733 + pub struct access(()); 1734 1734 } 1735 1735 } 1736 1736 ··· 1820 1820 impl<'a, S> ConfigRegionRuleIfAccountOlderThanBuilder<'a, S> 1821 1821 where 1822 1822 S: config_region_rule_if_account_older_than_state::State, 1823 - S::Access: config_region_rule_if_account_older_than_state::IsSet, 1824 1823 S::Date: config_region_rule_if_account_older_than_state::IsSet, 1824 + S::Access: config_region_rule_if_account_older_than_state::IsSet, 1825 1825 { 1826 1826 /// Build the final struct 1827 1827 pub fn build(self) -> ConfigRegionRuleIfAccountOlderThan<'a> { ··· 2476 2476 } 2477 2477 /// State trait tracking which required fields have been set 2478 2478 pub trait State: sealed::Sealed { 2479 - type Access; 2480 2479 type Age; 2480 + type Access; 2481 2481 } 2482 2482 /// Empty state - all required fields are unset 2483 2483 pub struct Empty(()); 2484 2484 impl sealed::Sealed for Empty {} 2485 2485 impl State for Empty { 2486 - type Access = Unset; 2487 2486 type Age = Unset; 2488 - } 2489 - ///State transition - sets the `access` field to Set 2490 - pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2491 - impl<S: State> sealed::Sealed for SetAccess<S> {} 2492 - impl<S: State> State for SetAccess<S> { 2493 - type Access = Set<members::access>; 2494 - type Age = S::Age; 2487 + type Access = Unset; 2495 2488 } 2496 2489 ///State transition - sets the `age` field to Set 2497 2490 pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2498 2491 impl<S: State> sealed::Sealed for SetAge<S> {} 2499 2492 impl<S: State> State for SetAge<S> { 2500 - type Access = S::Access; 2501 2493 type Age = Set<members::age>; 2494 + type Access = S::Access; 2495 + } 2496 + ///State transition - sets the `access` field to Set 2497 + pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2498 + impl<S: State> sealed::Sealed for SetAccess<S> {} 2499 + impl<S: State> State for SetAccess<S> { 2500 + type Age = S::Age; 2501 + type Access = Set<members::access>; 2502 2502 } 2503 2503 /// Marker types for field names 2504 2504 #[allow(non_camel_case_types)] 2505 2505 pub mod members { 2506 + ///Marker type for the `age` field 2507 + pub struct age(()); 2506 2508 ///Marker type for the `access` field 2507 2509 pub struct access(()); 2508 - ///Marker type for the `age` field 2509 - pub struct age(()); 2510 2510 } 2511 2511 } 2512 2512 ··· 2596 2596 impl<'a, S> ConfigRegionRuleIfDeclaredUnderAgeBuilder<'a, S> 2597 2597 where 2598 2598 S: config_region_rule_if_declared_under_age_state::State, 2599 - S::Access: config_region_rule_if_declared_under_age_state::IsSet, 2600 2599 S::Age: config_region_rule_if_declared_under_age_state::IsSet, 2600 + S::Access: config_region_rule_if_declared_under_age_state::IsSet, 2601 2601 { 2602 2602 /// Build the final struct 2603 2603 pub fn build(self) -> ConfigRegionRuleIfDeclaredUnderAge<'a> { ··· 2704 2704 } 2705 2705 /// State trait tracking which required fields have been set 2706 2706 pub trait State: sealed::Sealed { 2707 + type CreatedAt; 2707 2708 type Access; 2708 2709 type Status; 2709 2710 type AttemptId; 2710 2711 type CountryCode; 2711 - type CreatedAt; 2712 2712 } 2713 2713 /// Empty state - all required fields are unset 2714 2714 pub struct Empty(()); 2715 2715 impl sealed::Sealed for Empty {} 2716 2716 impl State for Empty { 2717 + type CreatedAt = Unset; 2717 2718 type Access = Unset; 2718 2719 type Status = Unset; 2719 2720 type AttemptId = Unset; 2720 2721 type CountryCode = Unset; 2721 - type CreatedAt = Unset; 2722 + } 2723 + ///State transition - sets the `created_at` field to Set 2724 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 2725 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 2726 + impl<S: State> State for SetCreatedAt<S> { 2727 + type CreatedAt = Set<members::created_at>; 2728 + type Access = S::Access; 2729 + type Status = S::Status; 2730 + type AttemptId = S::AttemptId; 2731 + type CountryCode = S::CountryCode; 2722 2732 } 2723 2733 ///State transition - sets the `access` field to Set 2724 2734 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2725 2735 impl<S: State> sealed::Sealed for SetAccess<S> {} 2726 2736 impl<S: State> State for SetAccess<S> { 2737 + type CreatedAt = S::CreatedAt; 2727 2738 type Access = Set<members::access>; 2728 2739 type Status = S::Status; 2729 2740 type AttemptId = S::AttemptId; 2730 2741 type CountryCode = S::CountryCode; 2731 - type CreatedAt = S::CreatedAt; 2732 2742 } 2733 2743 ///State transition - sets the `status` field to Set 2734 2744 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 2735 2745 impl<S: State> sealed::Sealed for SetStatus<S> {} 2736 2746 impl<S: State> State for SetStatus<S> { 2747 + type CreatedAt = S::CreatedAt; 2737 2748 type Access = S::Access; 2738 2749 type Status = Set<members::status>; 2739 2750 type AttemptId = S::AttemptId; 2740 2751 type CountryCode = S::CountryCode; 2741 - type CreatedAt = S::CreatedAt; 2742 2752 } 2743 2753 ///State transition - sets the `attempt_id` field to Set 2744 2754 pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 2745 2755 impl<S: State> sealed::Sealed for SetAttemptId<S> {} 2746 2756 impl<S: State> State for SetAttemptId<S> { 2757 + type CreatedAt = S::CreatedAt; 2747 2758 type Access = S::Access; 2748 2759 type Status = S::Status; 2749 2760 type AttemptId = Set<members::attempt_id>; 2750 2761 type CountryCode = S::CountryCode; 2751 - type CreatedAt = S::CreatedAt; 2752 2762 } 2753 2763 ///State transition - sets the `country_code` field to Set 2754 2764 pub struct SetCountryCode<S: State = Empty>(PhantomData<fn() -> S>); 2755 2765 impl<S: State> sealed::Sealed for SetCountryCode<S> {} 2756 2766 impl<S: State> State for SetCountryCode<S> { 2767 + type CreatedAt = S::CreatedAt; 2757 2768 type Access = S::Access; 2758 2769 type Status = S::Status; 2759 2770 type AttemptId = S::AttemptId; 2760 2771 type CountryCode = Set<members::country_code>; 2761 - type CreatedAt = S::CreatedAt; 2762 - } 2763 - ///State transition - sets the `created_at` field to Set 2764 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 2765 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 2766 - impl<S: State> State for SetCreatedAt<S> { 2767 - type Access = S::Access; 2768 - type Status = S::Status; 2769 - type AttemptId = S::AttemptId; 2770 - type CountryCode = S::CountryCode; 2771 - type CreatedAt = Set<members::created_at>; 2772 2772 } 2773 2773 /// Marker types for field names 2774 2774 #[allow(non_camel_case_types)] 2775 2775 pub mod members { 2776 + ///Marker type for the `created_at` field 2777 + pub struct created_at(()); 2776 2778 ///Marker type for the `access` field 2777 2779 pub struct access(()); 2778 2780 ///Marker type for the `status` field ··· 2781 2783 pub struct attempt_id(()); 2782 2784 ///Marker type for the `country_code` field 2783 2785 pub struct country_code(()); 2784 - ///Marker type for the `created_at` field 2785 - pub struct created_at(()); 2786 2786 } 2787 2787 } 2788 2788 ··· 3038 3038 impl<'a, S> EventBuilder<'a, S> 3039 3039 where 3040 3040 S: event_state::State, 3041 + S::CreatedAt: event_state::IsSet, 3041 3042 S::Access: event_state::IsSet, 3042 3043 S::Status: event_state::IsSet, 3043 3044 S::AttemptId: event_state::IsSet, 3044 3045 S::CountryCode: event_state::IsSet, 3045 - S::CreatedAt: event_state::IsSet, 3046 3046 { 3047 3047 /// Build the final struct 3048 3048 pub fn build(self) -> Event<'a> { ··· 3333 3333 } 3334 3334 /// State trait tracking which required fields have been set 3335 3335 pub trait State: sealed::Sealed { 3336 - type Access; 3337 3336 type Status; 3337 + type Access; 3338 3338 } 3339 3339 /// Empty state - all required fields are unset 3340 3340 pub struct Empty(()); 3341 3341 impl sealed::Sealed for Empty {} 3342 3342 impl State for Empty { 3343 - type Access = Unset; 3344 3343 type Status = Unset; 3344 + type Access = Unset; 3345 + } 3346 + ///State transition - sets the `status` field to Set 3347 + pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 3348 + impl<S: State> sealed::Sealed for SetStatus<S> {} 3349 + impl<S: State> State for SetStatus<S> { 3350 + type Status = Set<members::status>; 3351 + type Access = S::Access; 3345 3352 } 3346 3353 ///State transition - sets the `access` field to Set 3347 3354 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 3348 3355 impl<S: State> sealed::Sealed for SetAccess<S> {} 3349 3356 impl<S: State> State for SetAccess<S> { 3357 + type Status = S::Status; 3350 3358 type Access = Set<members::access>; 3351 - type Status = S::Status; 3352 - } 3353 - ///State transition - sets the `status` field to Set 3354 - pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 3355 - impl<S: State> sealed::Sealed for SetStatus<S> {} 3356 - impl<S: State> State for SetStatus<S> { 3357 - type Access = S::Access; 3358 - type Status = Set<members::status>; 3359 3359 } 3360 3360 /// Marker types for field names 3361 3361 #[allow(non_camel_case_types)] 3362 3362 pub mod members { 3363 - ///Marker type for the `access` field 3364 - pub struct access(()); 3365 3363 ///Marker type for the `status` field 3366 3364 pub struct status(()); 3365 + ///Marker type for the `access` field 3366 + pub struct access(()); 3367 3367 } 3368 3368 } 3369 3369 ··· 3456 3456 impl<'a, S> StateBuilder<'a, S> 3457 3457 where 3458 3458 S: state_state::State, 3459 - S::Access: state_state::IsSet, 3460 3459 S::Status: state_state::IsSet, 3460 + S::Access: state_state::IsSet, 3461 3461 { 3462 3462 /// Build the final struct 3463 3463 pub fn build(self) -> State<'a> {
+13 -13
crates/weaver-api/src/app_bsky/bookmark.rs
··· 281 281 } 282 282 /// State trait tracking which required fields have been set 283 283 pub trait State: sealed::Sealed { 284 - type Subject; 285 284 type Item; 285 + type Subject; 286 286 } 287 287 /// Empty state - all required fields are unset 288 288 pub struct Empty(()); 289 289 impl sealed::Sealed for Empty {} 290 290 impl State for Empty { 291 - type Subject = Unset; 292 291 type Item = Unset; 293 - } 294 - ///State transition - sets the `subject` field to Set 295 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 296 - impl<S: State> sealed::Sealed for SetSubject<S> {} 297 - impl<S: State> State for SetSubject<S> { 298 - type Subject = Set<members::subject>; 299 - type Item = S::Item; 292 + type Subject = Unset; 300 293 } 301 294 ///State transition - sets the `item` field to Set 302 295 pub struct SetItem<S: State = Empty>(PhantomData<fn() -> S>); 303 296 impl<S: State> sealed::Sealed for SetItem<S> {} 304 297 impl<S: State> State for SetItem<S> { 305 - type Subject = S::Subject; 306 298 type Item = Set<members::item>; 299 + type Subject = S::Subject; 300 + } 301 + ///State transition - sets the `subject` field to Set 302 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 303 + impl<S: State> sealed::Sealed for SetSubject<S> {} 304 + impl<S: State> State for SetSubject<S> { 305 + type Item = S::Item; 306 + type Subject = Set<members::subject>; 307 307 } 308 308 /// Marker types for field names 309 309 #[allow(non_camel_case_types)] 310 310 pub mod members { 311 - ///Marker type for the `subject` field 312 - pub struct subject(()); 313 311 ///Marker type for the `item` field 314 312 pub struct item(()); 313 + ///Marker type for the `subject` field 314 + pub struct subject(()); 315 315 } 316 316 } 317 317 ··· 404 404 impl<'a, S> BookmarkViewBuilder<'a, S> 405 405 where 406 406 S: bookmark_view_state::State, 407 - S::Subject: bookmark_view_state::IsSet, 408 407 S::Item: bookmark_view_state::IsSet, 408 + S::Subject: bookmark_view_state::IsSet, 409 409 { 410 410 /// Build the final struct 411 411 pub fn build(self) -> BookmarkView<'a> {
+13 -13
crates/weaver-api/src/app_bsky/bookmark/create_bookmark.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Cid; 37 36 type Uri; 37 + type Cid; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Cid = Unset; 44 43 type Uri = Unset; 45 - } 46 - ///State transition - sets the `cid` field to Set 47 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetCid<S> {} 49 - impl<S: State> State for SetCid<S> { 50 - type Cid = Set<members::cid>; 51 - type Uri = S::Uri; 44 + type Cid = Unset; 52 45 } 53 46 ///State transition - sets the `uri` field to Set 54 47 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetUri<S> {} 56 49 impl<S: State> State for SetUri<S> { 57 - type Cid = S::Cid; 58 50 type Uri = Set<members::uri>; 51 + type Cid = S::Cid; 52 + } 53 + ///State transition - sets the `cid` field to Set 54 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetCid<S> {} 56 + impl<S: State> State for SetCid<S> { 57 + type Uri = S::Uri; 58 + type Cid = Set<members::cid>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `cid` field 64 - pub struct cid(()); 65 63 ///Marker type for the `uri` field 66 64 pub struct uri(()); 65 + ///Marker type for the `cid` field 66 + pub struct cid(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> CreateBookmarkBuilder<'a, S> 137 137 where 138 138 S: create_bookmark_state::State, 139 - S::Cid: create_bookmark_state::IsSet, 140 139 S::Uri: create_bookmark_state::IsSet, 140 + S::Cid: create_bookmark_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> CreateBookmark<'a> {
+13 -13
crates/weaver-api/src/app_bsky/embed.rs
··· 38 38 } 39 39 /// State trait tracking which required fields have been set 40 40 pub trait State: sealed::Sealed { 41 - type Height; 42 41 type Width; 42 + type Height; 43 43 } 44 44 /// Empty state - all required fields are unset 45 45 pub struct Empty(()); 46 46 impl sealed::Sealed for Empty {} 47 47 impl State for Empty { 48 - type Height = Unset; 49 48 type Width = Unset; 50 - } 51 - ///State transition - sets the `height` field to Set 52 - pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetHeight<S> {} 54 - impl<S: State> State for SetHeight<S> { 55 - type Height = Set<members::height>; 56 - type Width = S::Width; 49 + type Height = Unset; 57 50 } 58 51 ///State transition - sets the `width` field to Set 59 52 pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 60 53 impl<S: State> sealed::Sealed for SetWidth<S> {} 61 54 impl<S: State> State for SetWidth<S> { 62 - type Height = S::Height; 63 55 type Width = Set<members::width>; 56 + type Height = S::Height; 57 + } 58 + ///State transition - sets the `height` field to Set 59 + pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 60 + impl<S: State> sealed::Sealed for SetHeight<S> {} 61 + impl<S: State> State for SetHeight<S> { 62 + type Width = S::Width; 63 + type Height = Set<members::height>; 64 64 } 65 65 /// Marker types for field names 66 66 #[allow(non_camel_case_types)] 67 67 pub mod members { 68 - ///Marker type for the `height` field 69 - pub struct height(()); 70 68 ///Marker type for the `width` field 71 69 pub struct width(()); 70 + ///Marker type for the `height` field 71 + pub struct height(()); 72 72 } 73 73 } 74 74 ··· 138 138 impl<'a, S> AspectRatioBuilder<'a, S> 139 139 where 140 140 S: aspect_ratio_state::State, 141 - S::Height: aspect_ratio_state::IsSet, 142 141 S::Width: aspect_ratio_state::IsSet, 142 + S::Height: aspect_ratio_state::IsSet, 143 143 { 144 144 /// Build the final struct 145 145 pub fn build(self) -> AspectRatio<'a> {
+39 -39
crates/weaver-api/src/app_bsky/embed/external.rs
··· 39 39 /// State trait tracking which required fields have been set 40 40 pub trait State: sealed::Sealed { 41 41 type Title; 42 - type Uri; 43 42 type Description; 43 + type Uri; 44 44 } 45 45 /// Empty state - all required fields are unset 46 46 pub struct Empty(()); 47 47 impl sealed::Sealed for Empty {} 48 48 impl State for Empty { 49 49 type Title = Unset; 50 - type Uri = Unset; 51 50 type Description = Unset; 51 + type Uri = Unset; 52 52 } 53 53 ///State transition - sets the `title` field to Set 54 54 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 55 55 impl<S: State> sealed::Sealed for SetTitle<S> {} 56 56 impl<S: State> State for SetTitle<S> { 57 57 type Title = Set<members::title>; 58 - type Uri = S::Uri; 59 58 type Description = S::Description; 60 - } 61 - ///State transition - sets the `uri` field to Set 62 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 63 - impl<S: State> sealed::Sealed for SetUri<S> {} 64 - impl<S: State> State for SetUri<S> { 65 - type Title = S::Title; 66 - type Uri = Set<members::uri>; 67 - type Description = S::Description; 59 + type Uri = S::Uri; 68 60 } 69 61 ///State transition - sets the `description` field to Set 70 62 pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 71 63 impl<S: State> sealed::Sealed for SetDescription<S> {} 72 64 impl<S: State> State for SetDescription<S> { 73 65 type Title = S::Title; 74 - type Uri = S::Uri; 75 66 type Description = Set<members::description>; 67 + type Uri = S::Uri; 68 + } 69 + ///State transition - sets the `uri` field to Set 70 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 71 + impl<S: State> sealed::Sealed for SetUri<S> {} 72 + impl<S: State> State for SetUri<S> { 73 + type Title = S::Title; 74 + type Description = S::Description; 75 + type Uri = Set<members::uri>; 76 76 } 77 77 /// Marker types for field names 78 78 #[allow(non_camel_case_types)] 79 79 pub mod members { 80 80 ///Marker type for the `title` field 81 81 pub struct title(()); 82 + ///Marker type for the `description` field 83 + pub struct description(()); 82 84 ///Marker type for the `uri` field 83 85 pub struct uri(()); 84 - ///Marker type for the `description` field 85 - pub struct description(()); 86 86 } 87 87 } 88 88 ··· 196 196 where 197 197 S: external_state::State, 198 198 S::Title: external_state::IsSet, 199 - S::Uri: external_state::IsSet, 200 199 S::Description: external_state::IsSet, 200 + S::Uri: external_state::IsSet, 201 201 { 202 202 /// Build the final struct 203 203 pub fn build(self) -> External<'a> { ··· 784 784 } 785 785 /// State trait tracking which required fields have been set 786 786 pub trait State: sealed::Sealed { 787 - type Description; 788 - type Uri; 789 787 type Title; 788 + type Uri; 789 + type Description; 790 790 } 791 791 /// Empty state - all required fields are unset 792 792 pub struct Empty(()); 793 793 impl sealed::Sealed for Empty {} 794 794 impl State for Empty { 795 + type Title = Unset; 796 + type Uri = Unset; 795 797 type Description = Unset; 796 - type Uri = Unset; 797 - type Title = Unset; 798 798 } 799 - ///State transition - sets the `description` field to Set 800 - pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 801 - impl<S: State> sealed::Sealed for SetDescription<S> {} 802 - impl<S: State> State for SetDescription<S> { 803 - type Description = Set<members::description>; 799 + ///State transition - sets the `title` field to Set 800 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 801 + impl<S: State> sealed::Sealed for SetTitle<S> {} 802 + impl<S: State> State for SetTitle<S> { 803 + type Title = Set<members::title>; 804 804 type Uri = S::Uri; 805 - type Title = S::Title; 805 + type Description = S::Description; 806 806 } 807 807 ///State transition - sets the `uri` field to Set 808 808 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 809 809 impl<S: State> sealed::Sealed for SetUri<S> {} 810 810 impl<S: State> State for SetUri<S> { 811 - type Description = S::Description; 812 - type Uri = Set<members::uri>; 813 811 type Title = S::Title; 812 + type Uri = Set<members::uri>; 813 + type Description = S::Description; 814 814 } 815 - ///State transition - sets the `title` field to Set 816 - pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 817 - impl<S: State> sealed::Sealed for SetTitle<S> {} 818 - impl<S: State> State for SetTitle<S> { 819 - type Description = S::Description; 815 + ///State transition - sets the `description` field to Set 816 + pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 817 + impl<S: State> sealed::Sealed for SetDescription<S> {} 818 + impl<S: State> State for SetDescription<S> { 819 + type Title = S::Title; 820 820 type Uri = S::Uri; 821 - type Title = Set<members::title>; 821 + type Description = Set<members::description>; 822 822 } 823 823 /// Marker types for field names 824 824 #[allow(non_camel_case_types)] 825 825 pub mod members { 826 + ///Marker type for the `title` field 827 + pub struct title(()); 828 + ///Marker type for the `uri` field 829 + pub struct uri(()); 826 830 ///Marker type for the `description` field 827 831 pub struct description(()); 828 - ///Marker type for the `uri` field 829 - pub struct uri(()); 830 - ///Marker type for the `title` field 831 - pub struct title(()); 832 832 } 833 833 } 834 834 ··· 941 941 impl<'a, S> ViewExternalBuilder<'a, S> 942 942 where 943 943 S: view_external_state::State, 944 - S::Description: view_external_state::IsSet, 945 - S::Uri: view_external_state::IsSet, 946 944 S::Title: view_external_state::IsSet, 945 + S::Uri: view_external_state::IsSet, 946 + S::Description: view_external_state::IsSet, 947 947 { 948 948 /// Build the final struct 949 949 pub fn build(self) -> ViewExternal<'a> {
+13 -13
crates/weaver-api/src/app_bsky/embed/images.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 - type Alt; 41 40 type Image; 41 + type Alt; 42 42 } 43 43 /// Empty state - all required fields are unset 44 44 pub struct Empty(()); 45 45 impl sealed::Sealed for Empty {} 46 46 impl State for Empty { 47 - type Alt = Unset; 48 47 type Image = Unset; 49 - } 50 - ///State transition - sets the `alt` field to Set 51 - pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 52 - impl<S: State> sealed::Sealed for SetAlt<S> {} 53 - impl<S: State> State for SetAlt<S> { 54 - type Alt = Set<members::alt>; 55 - type Image = S::Image; 48 + type Alt = Unset; 56 49 } 57 50 ///State transition - sets the `image` field to Set 58 51 pub struct SetImage<S: State = Empty>(PhantomData<fn() -> S>); 59 52 impl<S: State> sealed::Sealed for SetImage<S> {} 60 53 impl<S: State> State for SetImage<S> { 61 - type Alt = S::Alt; 62 54 type Image = Set<members::image>; 55 + type Alt = S::Alt; 56 + } 57 + ///State transition - sets the `alt` field to Set 58 + pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 59 + impl<S: State> sealed::Sealed for SetAlt<S> {} 60 + impl<S: State> State for SetAlt<S> { 61 + type Image = S::Image; 62 + type Alt = Set<members::alt>; 63 63 } 64 64 /// Marker types for field names 65 65 #[allow(non_camel_case_types)] 66 66 pub mod members { 67 - ///Marker type for the `alt` field 68 - pub struct alt(()); 69 67 ///Marker type for the `image` field 70 68 pub struct image(()); 69 + ///Marker type for the `alt` field 70 + pub struct alt(()); 71 71 } 72 72 } 73 73 ··· 160 160 impl<'a, S> ImageBuilder<'a, S> 161 161 where 162 162 S: image_state::State, 163 - S::Alt: image_state::IsSet, 164 163 S::Image: image_state::IsSet, 164 + S::Alt: image_state::IsSet, 165 165 { 166 166 /// Build the final struct 167 167 pub fn build(self) -> Image<'a> {
+73 -73
crates/weaver-api/src/app_bsky/embed/record.rs
··· 723 723 } 724 724 /// State trait tracking which required fields have been set 725 725 pub trait State: sealed::Sealed { 726 - type Author; 727 726 type Uri; 728 727 type Blocked; 728 + type Author; 729 729 } 730 730 /// Empty state - all required fields are unset 731 731 pub struct Empty(()); 732 732 impl sealed::Sealed for Empty {} 733 733 impl State for Empty { 734 - type Author = Unset; 735 734 type Uri = Unset; 736 735 type Blocked = Unset; 737 - } 738 - ///State transition - sets the `author` field to Set 739 - pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 740 - impl<S: State> sealed::Sealed for SetAuthor<S> {} 741 - impl<S: State> State for SetAuthor<S> { 742 - type Author = Set<members::author>; 743 - type Uri = S::Uri; 744 - type Blocked = S::Blocked; 736 + type Author = Unset; 745 737 } 746 738 ///State transition - sets the `uri` field to Set 747 739 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 748 740 impl<S: State> sealed::Sealed for SetUri<S> {} 749 741 impl<S: State> State for SetUri<S> { 750 - type Author = S::Author; 751 742 type Uri = Set<members::uri>; 752 743 type Blocked = S::Blocked; 744 + type Author = S::Author; 753 745 } 754 746 ///State transition - sets the `blocked` field to Set 755 747 pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 756 748 impl<S: State> sealed::Sealed for SetBlocked<S> {} 757 749 impl<S: State> State for SetBlocked<S> { 750 + type Uri = S::Uri; 751 + type Blocked = Set<members::blocked>; 758 752 type Author = S::Author; 753 + } 754 + ///State transition - sets the `author` field to Set 755 + pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 756 + impl<S: State> sealed::Sealed for SetAuthor<S> {} 757 + impl<S: State> State for SetAuthor<S> { 759 758 type Uri = S::Uri; 760 - type Blocked = Set<members::blocked>; 759 + type Blocked = S::Blocked; 760 + type Author = Set<members::author>; 761 761 } 762 762 /// Marker types for field names 763 763 #[allow(non_camel_case_types)] 764 764 pub mod members { 765 - ///Marker type for the `author` field 766 - pub struct author(()); 767 765 ///Marker type for the `uri` field 768 766 pub struct uri(()); 769 767 ///Marker type for the `blocked` field 770 768 pub struct blocked(()); 769 + ///Marker type for the `author` field 770 + pub struct author(()); 771 771 } 772 772 } 773 773 ··· 860 860 impl<'a, S> ViewBlockedBuilder<'a, S> 861 861 where 862 862 S: view_blocked_state::State, 863 - S::Author: view_blocked_state::IsSet, 864 863 S::Uri: view_blocked_state::IsSet, 865 864 S::Blocked: view_blocked_state::IsSet, 865 + S::Author: view_blocked_state::IsSet, 866 866 { 867 867 /// Build the final struct 868 868 pub fn build(self) -> ViewBlocked<'a> { ··· 934 934 } 935 935 /// State trait tracking which required fields have been set 936 936 pub trait State: sealed::Sealed { 937 - type Uri; 938 937 type Detached; 938 + type Uri; 939 939 } 940 940 /// Empty state - all required fields are unset 941 941 pub struct Empty(()); 942 942 impl sealed::Sealed for Empty {} 943 943 impl State for Empty { 944 + type Detached = Unset; 944 945 type Uri = Unset; 945 - type Detached = Unset; 946 + } 947 + ///State transition - sets the `detached` field to Set 948 + pub struct SetDetached<S: State = Empty>(PhantomData<fn() -> S>); 949 + impl<S: State> sealed::Sealed for SetDetached<S> {} 950 + impl<S: State> State for SetDetached<S> { 951 + type Detached = Set<members::detached>; 952 + type Uri = S::Uri; 946 953 } 947 954 ///State transition - sets the `uri` field to Set 948 955 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 949 956 impl<S: State> sealed::Sealed for SetUri<S> {} 950 957 impl<S: State> State for SetUri<S> { 958 + type Detached = S::Detached; 951 959 type Uri = Set<members::uri>; 952 - type Detached = S::Detached; 953 - } 954 - ///State transition - sets the `detached` field to Set 955 - pub struct SetDetached<S: State = Empty>(PhantomData<fn() -> S>); 956 - impl<S: State> sealed::Sealed for SetDetached<S> {} 957 - impl<S: State> State for SetDetached<S> { 958 - type Uri = S::Uri; 959 - type Detached = Set<members::detached>; 960 960 } 961 961 /// Marker types for field names 962 962 #[allow(non_camel_case_types)] 963 963 pub mod members { 964 + ///Marker type for the `detached` field 965 + pub struct detached(()); 964 966 ///Marker type for the `uri` field 965 967 pub struct uri(()); 966 - ///Marker type for the `detached` field 967 - pub struct detached(()); 968 968 } 969 969 } 970 970 ··· 1037 1037 impl<'a, S> ViewDetachedBuilder<'a, S> 1038 1038 where 1039 1039 S: view_detached_state::State, 1040 - S::Uri: view_detached_state::IsSet, 1041 1040 S::Detached: view_detached_state::IsSet, 1041 + S::Uri: view_detached_state::IsSet, 1042 1042 { 1043 1043 /// Build the final struct 1044 1044 pub fn build(self) -> ViewDetached<'a> { ··· 1108 1108 } 1109 1109 /// State trait tracking which required fields have been set 1110 1110 pub trait State: sealed::Sealed { 1111 - type Uri; 1112 1111 type NotFound; 1112 + type Uri; 1113 1113 } 1114 1114 /// Empty state - all required fields are unset 1115 1115 pub struct Empty(()); 1116 1116 impl sealed::Sealed for Empty {} 1117 1117 impl State for Empty { 1118 + type NotFound = Unset; 1118 1119 type Uri = Unset; 1119 - type NotFound = Unset; 1120 - } 1121 - ///State transition - sets the `uri` field to Set 1122 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1123 - impl<S: State> sealed::Sealed for SetUri<S> {} 1124 - impl<S: State> State for SetUri<S> { 1125 - type Uri = Set<members::uri>; 1126 - type NotFound = S::NotFound; 1127 1120 } 1128 1121 ///State transition - sets the `not_found` field to Set 1129 1122 pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>); 1130 1123 impl<S: State> sealed::Sealed for SetNotFound<S> {} 1131 1124 impl<S: State> State for SetNotFound<S> { 1132 - type Uri = S::Uri; 1133 1125 type NotFound = Set<members::not_found>; 1126 + type Uri = S::Uri; 1127 + } 1128 + ///State transition - sets the `uri` field to Set 1129 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1130 + impl<S: State> sealed::Sealed for SetUri<S> {} 1131 + impl<S: State> State for SetUri<S> { 1132 + type NotFound = S::NotFound; 1133 + type Uri = Set<members::uri>; 1134 1134 } 1135 1135 /// Marker types for field names 1136 1136 #[allow(non_camel_case_types)] 1137 1137 pub mod members { 1138 + ///Marker type for the `not_found` field 1139 + pub struct not_found(()); 1138 1140 ///Marker type for the `uri` field 1139 1141 pub struct uri(()); 1140 - ///Marker type for the `not_found` field 1141 - pub struct not_found(()); 1142 1142 } 1143 1143 } 1144 1144 ··· 1211 1211 impl<'a, S> ViewNotFoundBuilder<'a, S> 1212 1212 where 1213 1213 S: view_not_found_state::State, 1214 - S::Uri: view_not_found_state::IsSet, 1215 1214 S::NotFound: view_not_found_state::IsSet, 1215 + S::Uri: view_not_found_state::IsSet, 1216 1216 { 1217 1217 /// Build the final struct 1218 1218 pub fn build(self) -> ViewNotFound<'a> { ··· 1303 1303 } 1304 1304 /// State trait tracking which required fields have been set 1305 1305 pub trait State: sealed::Sealed { 1306 - type Uri; 1307 1306 type Cid; 1307 + type Author; 1308 1308 type Value; 1309 1309 type IndexedAt; 1310 - type Author; 1310 + type Uri; 1311 1311 } 1312 1312 /// Empty state - all required fields are unset 1313 1313 pub struct Empty(()); 1314 1314 impl sealed::Sealed for Empty {} 1315 1315 impl State for Empty { 1316 - type Uri = Unset; 1317 1316 type Cid = Unset; 1317 + type Author = Unset; 1318 1318 type Value = Unset; 1319 1319 type IndexedAt = Unset; 1320 - type Author = Unset; 1321 - } 1322 - ///State transition - sets the `uri` field to Set 1323 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1324 - impl<S: State> sealed::Sealed for SetUri<S> {} 1325 - impl<S: State> State for SetUri<S> { 1326 - type Uri = Set<members::uri>; 1327 - type Cid = S::Cid; 1328 - type Value = S::Value; 1329 - type IndexedAt = S::IndexedAt; 1330 - type Author = S::Author; 1320 + type Uri = Unset; 1331 1321 } 1332 1322 ///State transition - sets the `cid` field to Set 1333 1323 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1334 1324 impl<S: State> sealed::Sealed for SetCid<S> {} 1335 1325 impl<S: State> State for SetCid<S> { 1326 + type Cid = Set<members::cid>; 1327 + type Author = S::Author; 1328 + type Value = S::Value; 1329 + type IndexedAt = S::IndexedAt; 1336 1330 type Uri = S::Uri; 1337 - type Cid = Set<members::cid>; 1331 + } 1332 + ///State transition - sets the `author` field to Set 1333 + pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1334 + impl<S: State> sealed::Sealed for SetAuthor<S> {} 1335 + impl<S: State> State for SetAuthor<S> { 1336 + type Cid = S::Cid; 1337 + type Author = Set<members::author>; 1338 1338 type Value = S::Value; 1339 1339 type IndexedAt = S::IndexedAt; 1340 - type Author = S::Author; 1340 + type Uri = S::Uri; 1341 1341 } 1342 1342 ///State transition - sets the `value` field to Set 1343 1343 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1344 1344 impl<S: State> sealed::Sealed for SetValue<S> {} 1345 1345 impl<S: State> State for SetValue<S> { 1346 - type Uri = S::Uri; 1347 1346 type Cid = S::Cid; 1347 + type Author = S::Author; 1348 1348 type Value = Set<members::value>; 1349 1349 type IndexedAt = S::IndexedAt; 1350 - type Author = S::Author; 1350 + type Uri = S::Uri; 1351 1351 } 1352 1352 ///State transition - sets the `indexed_at` field to Set 1353 1353 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1354 1354 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1355 1355 impl<S: State> State for SetIndexedAt<S> { 1356 - type Uri = S::Uri; 1357 1356 type Cid = S::Cid; 1357 + type Author = S::Author; 1358 1358 type Value = S::Value; 1359 1359 type IndexedAt = Set<members::indexed_at>; 1360 - type Author = S::Author; 1361 - } 1362 - ///State transition - sets the `author` field to Set 1363 - pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1364 - impl<S: State> sealed::Sealed for SetAuthor<S> {} 1365 - impl<S: State> State for SetAuthor<S> { 1366 1360 type Uri = S::Uri; 1361 + } 1362 + ///State transition - sets the `uri` field to Set 1363 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1364 + impl<S: State> sealed::Sealed for SetUri<S> {} 1365 + impl<S: State> State for SetUri<S> { 1367 1366 type Cid = S::Cid; 1367 + type Author = S::Author; 1368 1368 type Value = S::Value; 1369 1369 type IndexedAt = S::IndexedAt; 1370 - type Author = Set<members::author>; 1370 + type Uri = Set<members::uri>; 1371 1371 } 1372 1372 /// Marker types for field names 1373 1373 #[allow(non_camel_case_types)] 1374 1374 pub mod members { 1375 - ///Marker type for the `uri` field 1376 - pub struct uri(()); 1377 1375 ///Marker type for the `cid` field 1378 1376 pub struct cid(()); 1377 + ///Marker type for the `author` field 1378 + pub struct author(()); 1379 1379 ///Marker type for the `value` field 1380 1380 pub struct value(()); 1381 1381 ///Marker type for the `indexed_at` field 1382 1382 pub struct indexed_at(()); 1383 - ///Marker type for the `author` field 1384 - pub struct author(()); 1383 + ///Marker type for the `uri` field 1384 + pub struct uri(()); 1385 1385 } 1386 1386 } 1387 1387 ··· 1619 1619 impl<'a, S> ViewRecordBuilder<'a, S> 1620 1620 where 1621 1621 S: view_record_state::State, 1622 - S::Uri: view_record_state::IsSet, 1623 1622 S::Cid: view_record_state::IsSet, 1623 + S::Author: view_record_state::IsSet, 1624 1624 S::Value: view_record_state::IsSet, 1625 1625 S::IndexedAt: view_record_state::IsSet, 1626 - S::Author: view_record_state::IsSet, 1626 + S::Uri: view_record_state::IsSet, 1627 1627 { 1628 1628 /// Build the final struct 1629 1629 pub fn build(self) -> ViewRecord<'a> {
+13 -13
crates/weaver-api/src/app_bsky/embed/record_with_media.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Record; 37 36 type Media; 37 + type Record; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Record = Unset; 44 43 type Media = Unset; 45 - } 46 - ///State transition - sets the `record` field to Set 47 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetRecord<S> {} 49 - impl<S: State> State for SetRecord<S> { 50 - type Record = Set<members::record>; 51 - type Media = S::Media; 44 + type Record = Unset; 52 45 } 53 46 ///State transition - sets the `media` field to Set 54 47 pub struct SetMedia<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetMedia<S> {} 56 49 impl<S: State> State for SetMedia<S> { 57 - type Record = S::Record; 58 50 type Media = Set<members::media>; 51 + type Record = S::Record; 52 + } 53 + ///State transition - sets the `record` field to Set 54 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetRecord<S> {} 56 + impl<S: State> State for SetRecord<S> { 57 + type Media = S::Media; 58 + type Record = Set<members::record>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `record` field 64 - pub struct record(()); 65 63 ///Marker type for the `media` field 66 64 pub struct media(()); 65 + ///Marker type for the `record` field 66 + pub struct record(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> RecordWithMediaBuilder<'a, S> 137 137 where 138 138 S: record_with_media_state::State, 139 - S::Record: record_with_media_state::IsSet, 140 139 S::Media: record_with_media_state::IsSet, 140 + S::Record: record_with_media_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> RecordWithMedia<'a> {
+13 -13
crates/weaver-api/src/app_bsky/embed/video.rs
··· 687 687 } 688 688 /// State trait tracking which required fields have been set 689 689 pub trait State: sealed::Sealed { 690 - type Cid; 691 690 type Playlist; 691 + type Cid; 692 692 } 693 693 /// Empty state - all required fields are unset 694 694 pub struct Empty(()); 695 695 impl sealed::Sealed for Empty {} 696 696 impl State for Empty { 697 - type Cid = Unset; 698 697 type Playlist = Unset; 699 - } 700 - ///State transition - sets the `cid` field to Set 701 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 702 - impl<S: State> sealed::Sealed for SetCid<S> {} 703 - impl<S: State> State for SetCid<S> { 704 - type Cid = Set<members::cid>; 705 - type Playlist = S::Playlist; 698 + type Cid = Unset; 706 699 } 707 700 ///State transition - sets the `playlist` field to Set 708 701 pub struct SetPlaylist<S: State = Empty>(PhantomData<fn() -> S>); 709 702 impl<S: State> sealed::Sealed for SetPlaylist<S> {} 710 703 impl<S: State> State for SetPlaylist<S> { 711 - type Cid = S::Cid; 712 704 type Playlist = Set<members::playlist>; 705 + type Cid = S::Cid; 706 + } 707 + ///State transition - sets the `cid` field to Set 708 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 709 + impl<S: State> sealed::Sealed for SetCid<S> {} 710 + impl<S: State> State for SetCid<S> { 711 + type Playlist = S::Playlist; 712 + type Cid = Set<members::cid>; 713 713 } 714 714 /// Marker types for field names 715 715 #[allow(non_camel_case_types)] 716 716 pub mod members { 717 - ///Marker type for the `cid` field 718 - pub struct cid(()); 719 717 ///Marker type for the `playlist` field 720 718 pub struct playlist(()); 719 + ///Marker type for the `cid` field 720 + pub struct cid(()); 721 721 } 722 722 } 723 723 ··· 844 844 impl<'a, S> ViewBuilder<'a, S> 845 845 where 846 846 S: view_state::State, 847 - S::Cid: view_state::IsSet, 848 847 S::Playlist: view_state::IsSet, 848 + S::Cid: view_state::IsSet, 849 849 { 850 850 /// Build the final struct 851 851 pub fn build(self) -> View<'a> {
+89 -89
crates/weaver-api/src/app_bsky/feed.rs
··· 1609 1609 } 1610 1610 /// State trait tracking which required fields have been set 1611 1611 pub trait State: sealed::Sealed { 1612 - type Blocked; 1613 1612 type Author; 1613 + type Blocked; 1614 1614 type Uri; 1615 1615 } 1616 1616 /// Empty state - all required fields are unset 1617 1617 pub struct Empty(()); 1618 1618 impl sealed::Sealed for Empty {} 1619 1619 impl State for Empty { 1620 - type Blocked = Unset; 1621 1620 type Author = Unset; 1621 + type Blocked = Unset; 1622 1622 type Uri = Unset; 1623 1623 } 1624 - ///State transition - sets the `blocked` field to Set 1625 - pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 1626 - impl<S: State> sealed::Sealed for SetBlocked<S> {} 1627 - impl<S: State> State for SetBlocked<S> { 1628 - type Blocked = Set<members::blocked>; 1629 - type Author = S::Author; 1630 - type Uri = S::Uri; 1631 - } 1632 1624 ///State transition - sets the `author` field to Set 1633 1625 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1634 1626 impl<S: State> sealed::Sealed for SetAuthor<S> {} 1635 1627 impl<S: State> State for SetAuthor<S> { 1636 - type Blocked = S::Blocked; 1637 1628 type Author = Set<members::author>; 1629 + type Blocked = S::Blocked; 1630 + type Uri = S::Uri; 1631 + } 1632 + ///State transition - sets the `blocked` field to Set 1633 + pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 1634 + impl<S: State> sealed::Sealed for SetBlocked<S> {} 1635 + impl<S: State> State for SetBlocked<S> { 1636 + type Author = S::Author; 1637 + type Blocked = Set<members::blocked>; 1638 1638 type Uri = S::Uri; 1639 1639 } 1640 1640 ///State transition - sets the `uri` field to Set 1641 1641 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1642 1642 impl<S: State> sealed::Sealed for SetUri<S> {} 1643 1643 impl<S: State> State for SetUri<S> { 1644 - type Blocked = S::Blocked; 1645 1644 type Author = S::Author; 1645 + type Blocked = S::Blocked; 1646 1646 type Uri = Set<members::uri>; 1647 1647 } 1648 1648 /// Marker types for field names 1649 1649 #[allow(non_camel_case_types)] 1650 1650 pub mod members { 1651 + ///Marker type for the `author` field 1652 + pub struct author(()); 1651 1653 ///Marker type for the `blocked` field 1652 1654 pub struct blocked(()); 1653 - ///Marker type for the `author` field 1654 - pub struct author(()); 1655 1655 ///Marker type for the `uri` field 1656 1656 pub struct uri(()); 1657 1657 } ··· 1746 1746 impl<'a, S> BlockedPostBuilder<'a, S> 1747 1747 where 1748 1748 S: blocked_post_state::State, 1749 - S::Blocked: blocked_post_state::IsSet, 1750 1749 S::Author: blocked_post_state::IsSet, 1750 + S::Blocked: blocked_post_state::IsSet, 1751 1751 S::Uri: blocked_post_state::IsSet, 1752 1752 { 1753 1753 /// Build the final struct ··· 2234 2234 } 2235 2235 /// State trait tracking which required fields have been set 2236 2236 pub trait State: sealed::Sealed { 2237 - type Creator; 2237 + type Uri; 2238 2238 type Cid; 2239 2239 type Did; 2240 2240 type IndexedAt; 2241 - type Uri; 2241 + type Creator; 2242 2242 type DisplayName; 2243 2243 } 2244 2244 /// Empty state - all required fields are unset 2245 2245 pub struct Empty(()); 2246 2246 impl sealed::Sealed for Empty {} 2247 2247 impl State for Empty { 2248 - type Creator = Unset; 2248 + type Uri = Unset; 2249 2249 type Cid = Unset; 2250 2250 type Did = Unset; 2251 2251 type IndexedAt = Unset; 2252 - type Uri = Unset; 2252 + type Creator = Unset; 2253 2253 type DisplayName = Unset; 2254 2254 } 2255 - ///State transition - sets the `creator` field to Set 2256 - pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 2257 - impl<S: State> sealed::Sealed for SetCreator<S> {} 2258 - impl<S: State> State for SetCreator<S> { 2259 - type Creator = Set<members::creator>; 2255 + ///State transition - sets the `uri` field to Set 2256 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2257 + impl<S: State> sealed::Sealed for SetUri<S> {} 2258 + impl<S: State> State for SetUri<S> { 2259 + type Uri = Set<members::uri>; 2260 2260 type Cid = S::Cid; 2261 2261 type Did = S::Did; 2262 2262 type IndexedAt = S::IndexedAt; 2263 - type Uri = S::Uri; 2263 + type Creator = S::Creator; 2264 2264 type DisplayName = S::DisplayName; 2265 2265 } 2266 2266 ///State transition - sets the `cid` field to Set 2267 2267 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2268 2268 impl<S: State> sealed::Sealed for SetCid<S> {} 2269 2269 impl<S: State> State for SetCid<S> { 2270 - type Creator = S::Creator; 2270 + type Uri = S::Uri; 2271 2271 type Cid = Set<members::cid>; 2272 2272 type Did = S::Did; 2273 2273 type IndexedAt = S::IndexedAt; 2274 - type Uri = S::Uri; 2274 + type Creator = S::Creator; 2275 2275 type DisplayName = S::DisplayName; 2276 2276 } 2277 2277 ///State transition - sets the `did` field to Set 2278 2278 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2279 2279 impl<S: State> sealed::Sealed for SetDid<S> {} 2280 2280 impl<S: State> State for SetDid<S> { 2281 - type Creator = S::Creator; 2281 + type Uri = S::Uri; 2282 2282 type Cid = S::Cid; 2283 2283 type Did = Set<members::did>; 2284 2284 type IndexedAt = S::IndexedAt; 2285 - type Uri = S::Uri; 2285 + type Creator = S::Creator; 2286 2286 type DisplayName = S::DisplayName; 2287 2287 } 2288 2288 ///State transition - sets the `indexed_at` field to Set 2289 2289 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2290 2290 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2291 2291 impl<S: State> State for SetIndexedAt<S> { 2292 - type Creator = S::Creator; 2292 + type Uri = S::Uri; 2293 2293 type Cid = S::Cid; 2294 2294 type Did = S::Did; 2295 2295 type IndexedAt = Set<members::indexed_at>; 2296 - type Uri = S::Uri; 2296 + type Creator = S::Creator; 2297 2297 type DisplayName = S::DisplayName; 2298 2298 } 2299 - ///State transition - sets the `uri` field to Set 2300 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2301 - impl<S: State> sealed::Sealed for SetUri<S> {} 2302 - impl<S: State> State for SetUri<S> { 2303 - type Creator = S::Creator; 2299 + ///State transition - sets the `creator` field to Set 2300 + pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 2301 + impl<S: State> sealed::Sealed for SetCreator<S> {} 2302 + impl<S: State> State for SetCreator<S> { 2303 + type Uri = S::Uri; 2304 2304 type Cid = S::Cid; 2305 2305 type Did = S::Did; 2306 2306 type IndexedAt = S::IndexedAt; 2307 - type Uri = Set<members::uri>; 2307 + type Creator = Set<members::creator>; 2308 2308 type DisplayName = S::DisplayName; 2309 2309 } 2310 2310 ///State transition - sets the `display_name` field to Set 2311 2311 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 2312 2312 impl<S: State> sealed::Sealed for SetDisplayName<S> {} 2313 2313 impl<S: State> State for SetDisplayName<S> { 2314 - type Creator = S::Creator; 2314 + type Uri = S::Uri; 2315 2315 type Cid = S::Cid; 2316 2316 type Did = S::Did; 2317 2317 type IndexedAt = S::IndexedAt; 2318 - type Uri = S::Uri; 2318 + type Creator = S::Creator; 2319 2319 type DisplayName = Set<members::display_name>; 2320 2320 } 2321 2321 /// Marker types for field names 2322 2322 #[allow(non_camel_case_types)] 2323 2323 pub mod members { 2324 - ///Marker type for the `creator` field 2325 - pub struct creator(()); 2324 + ///Marker type for the `uri` field 2325 + pub struct uri(()); 2326 2326 ///Marker type for the `cid` field 2327 2327 pub struct cid(()); 2328 2328 ///Marker type for the `did` field 2329 2329 pub struct did(()); 2330 2330 ///Marker type for the `indexed_at` field 2331 2331 pub struct indexed_at(()); 2332 - ///Marker type for the `uri` field 2333 - pub struct uri(()); 2332 + ///Marker type for the `creator` field 2333 + pub struct creator(()); 2334 2334 ///Marker type for the `display_name` field 2335 2335 pub struct display_name(()); 2336 2336 } ··· 2648 2648 impl<'a, S> GeneratorViewBuilder<'a, S> 2649 2649 where 2650 2650 S: generator_view_state::State, 2651 - S::Creator: generator_view_state::IsSet, 2651 + S::Uri: generator_view_state::IsSet, 2652 2652 S::Cid: generator_view_state::IsSet, 2653 2653 S::Did: generator_view_state::IsSet, 2654 2654 S::IndexedAt: generator_view_state::IsSet, 2655 - S::Uri: generator_view_state::IsSet, 2655 + S::Creator: generator_view_state::IsSet, 2656 2656 S::DisplayName: generator_view_state::IsSet, 2657 2657 { 2658 2658 /// Build the final struct ··· 3441 3441 } 3442 3442 /// State trait tracking which required fields have been set 3443 3443 pub trait State: sealed::Sealed { 3444 - type Cid; 3444 + type Record; 3445 3445 type Author; 3446 3446 type IndexedAt; 3447 + type Cid; 3447 3448 type Uri; 3448 - type Record; 3449 3449 } 3450 3450 /// Empty state - all required fields are unset 3451 3451 pub struct Empty(()); 3452 3452 impl sealed::Sealed for Empty {} 3453 3453 impl State for Empty { 3454 - type Cid = Unset; 3454 + type Record = Unset; 3455 3455 type Author = Unset; 3456 3456 type IndexedAt = Unset; 3457 + type Cid = Unset; 3457 3458 type Uri = Unset; 3458 - type Record = Unset; 3459 3459 } 3460 - ///State transition - sets the `cid` field to Set 3461 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3462 - impl<S: State> sealed::Sealed for SetCid<S> {} 3463 - impl<S: State> State for SetCid<S> { 3464 - type Cid = Set<members::cid>; 3460 + ///State transition - sets the `record` field to Set 3461 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3462 + impl<S: State> sealed::Sealed for SetRecord<S> {} 3463 + impl<S: State> State for SetRecord<S> { 3464 + type Record = Set<members::record>; 3465 3465 type Author = S::Author; 3466 3466 type IndexedAt = S::IndexedAt; 3467 + type Cid = S::Cid; 3467 3468 type Uri = S::Uri; 3468 - type Record = S::Record; 3469 3469 } 3470 3470 ///State transition - sets the `author` field to Set 3471 3471 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 3472 3472 impl<S: State> sealed::Sealed for SetAuthor<S> {} 3473 3473 impl<S: State> State for SetAuthor<S> { 3474 - type Cid = S::Cid; 3474 + type Record = S::Record; 3475 3475 type Author = Set<members::author>; 3476 3476 type IndexedAt = S::IndexedAt; 3477 + type Cid = S::Cid; 3477 3478 type Uri = S::Uri; 3478 - type Record = S::Record; 3479 3479 } 3480 3480 ///State transition - sets the `indexed_at` field to Set 3481 3481 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3482 3482 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3483 3483 impl<S: State> State for SetIndexedAt<S> { 3484 - type Cid = S::Cid; 3484 + type Record = S::Record; 3485 3485 type Author = S::Author; 3486 3486 type IndexedAt = Set<members::indexed_at>; 3487 + type Cid = S::Cid; 3487 3488 type Uri = S::Uri; 3489 + } 3490 + ///State transition - sets the `cid` field to Set 3491 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3492 + impl<S: State> sealed::Sealed for SetCid<S> {} 3493 + impl<S: State> State for SetCid<S> { 3488 3494 type Record = S::Record; 3495 + type Author = S::Author; 3496 + type IndexedAt = S::IndexedAt; 3497 + type Cid = Set<members::cid>; 3498 + type Uri = S::Uri; 3489 3499 } 3490 3500 ///State transition - sets the `uri` field to Set 3491 3501 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3492 3502 impl<S: State> sealed::Sealed for SetUri<S> {} 3493 3503 impl<S: State> State for SetUri<S> { 3494 - type Cid = S::Cid; 3504 + type Record = S::Record; 3495 3505 type Author = S::Author; 3496 3506 type IndexedAt = S::IndexedAt; 3507 + type Cid = S::Cid; 3497 3508 type Uri = Set<members::uri>; 3498 - type Record = S::Record; 3499 - } 3500 - ///State transition - sets the `record` field to Set 3501 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3502 - impl<S: State> sealed::Sealed for SetRecord<S> {} 3503 - impl<S: State> State for SetRecord<S> { 3504 - type Cid = S::Cid; 3505 - type Author = S::Author; 3506 - type IndexedAt = S::IndexedAt; 3507 - type Uri = S::Uri; 3508 - type Record = Set<members::record>; 3509 3509 } 3510 3510 /// Marker types for field names 3511 3511 #[allow(non_camel_case_types)] 3512 3512 pub mod members { 3513 - ///Marker type for the `cid` field 3514 - pub struct cid(()); 3513 + ///Marker type for the `record` field 3514 + pub struct record(()); 3515 3515 ///Marker type for the `author` field 3516 3516 pub struct author(()); 3517 3517 ///Marker type for the `indexed_at` field 3518 3518 pub struct indexed_at(()); 3519 + ///Marker type for the `cid` field 3520 + pub struct cid(()); 3519 3521 ///Marker type for the `uri` field 3520 3522 pub struct uri(()); 3521 - ///Marker type for the `record` field 3522 - pub struct record(()); 3523 3523 } 3524 3524 } 3525 3525 ··· 3832 3832 impl<'a, S> PostViewBuilder<'a, S> 3833 3833 where 3834 3834 S: post_view_state::State, 3835 - S::Cid: post_view_state::IsSet, 3835 + S::Record: post_view_state::IsSet, 3836 3836 S::Author: post_view_state::IsSet, 3837 3837 S::IndexedAt: post_view_state::IsSet, 3838 + S::Cid: post_view_state::IsSet, 3838 3839 S::Uri: post_view_state::IsSet, 3839 - S::Record: post_view_state::IsSet, 3840 3840 { 3841 3841 /// Build the final struct 3842 3842 pub fn build(self) -> PostView<'a> { ··· 4218 4218 } 4219 4219 /// State trait tracking which required fields have been set 4220 4220 pub trait State: sealed::Sealed { 4221 - type Root; 4222 4221 type Parent; 4222 + type Root; 4223 4223 } 4224 4224 /// Empty state - all required fields are unset 4225 4225 pub struct Empty(()); 4226 4226 impl sealed::Sealed for Empty {} 4227 4227 impl State for Empty { 4228 - type Root = Unset; 4229 4228 type Parent = Unset; 4230 - } 4231 - ///State transition - sets the `root` field to Set 4232 - pub struct SetRoot<S: State = Empty>(PhantomData<fn() -> S>); 4233 - impl<S: State> sealed::Sealed for SetRoot<S> {} 4234 - impl<S: State> State for SetRoot<S> { 4235 - type Root = Set<members::root>; 4236 - type Parent = S::Parent; 4229 + type Root = Unset; 4237 4230 } 4238 4231 ///State transition - sets the `parent` field to Set 4239 4232 pub struct SetParent<S: State = Empty>(PhantomData<fn() -> S>); 4240 4233 impl<S: State> sealed::Sealed for SetParent<S> {} 4241 4234 impl<S: State> State for SetParent<S> { 4242 - type Root = S::Root; 4243 4235 type Parent = Set<members::parent>; 4236 + type Root = S::Root; 4237 + } 4238 + ///State transition - sets the `root` field to Set 4239 + pub struct SetRoot<S: State = Empty>(PhantomData<fn() -> S>); 4240 + impl<S: State> sealed::Sealed for SetRoot<S> {} 4241 + impl<S: State> State for SetRoot<S> { 4242 + type Parent = S::Parent; 4243 + type Root = Set<members::root>; 4244 4244 } 4245 4245 /// Marker types for field names 4246 4246 #[allow(non_camel_case_types)] 4247 4247 pub mod members { 4248 + ///Marker type for the `parent` field 4249 + pub struct parent(()); 4248 4250 ///Marker type for the `root` field 4249 4251 pub struct root(()); 4250 - ///Marker type for the `parent` field 4251 - pub struct parent(()); 4252 4252 } 4253 4253 } 4254 4254 ··· 4341 4341 impl<'a, S> ReplyRefBuilder<'a, S> 4342 4342 where 4343 4343 S: reply_ref_state::State, 4344 - S::Root: reply_ref_state::IsSet, 4345 4344 S::Parent: reply_ref_state::IsSet, 4345 + S::Root: reply_ref_state::IsSet, 4346 4346 { 4347 4347 /// Build the final struct 4348 4348 pub fn build(self) -> ReplyRef<'a> {
+15 -15
crates/weaver-api/src/app_bsky/feed/generator.rs
··· 56 56 } 57 57 /// State trait tracking which required fields have been set 58 58 pub trait State: sealed::Sealed { 59 - type CreatedAt; 60 59 type Did; 60 + type CreatedAt; 61 61 type DisplayName; 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 CreatedAt = Unset; 68 67 type Did = Unset; 68 + type CreatedAt = Unset; 69 69 type DisplayName = Unset; 70 70 } 71 - ///State transition - sets the `created_at` field to Set 72 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 73 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 74 - impl<S: State> State for SetCreatedAt<S> { 75 - type CreatedAt = Set<members::created_at>; 76 - type Did = S::Did; 77 - type DisplayName = S::DisplayName; 78 - } 79 71 ///State transition - sets the `did` field to Set 80 72 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 81 73 impl<S: State> sealed::Sealed for SetDid<S> {} 82 74 impl<S: State> State for SetDid<S> { 83 - type CreatedAt = S::CreatedAt; 84 75 type Did = Set<members::did>; 76 + type CreatedAt = S::CreatedAt; 77 + type DisplayName = S::DisplayName; 78 + } 79 + ///State transition - sets the `created_at` field to Set 80 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 81 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 82 + impl<S: State> State for SetCreatedAt<S> { 83 + type Did = S::Did; 84 + type CreatedAt = Set<members::created_at>; 85 85 type DisplayName = S::DisplayName; 86 86 } 87 87 ///State transition - sets the `display_name` field to Set 88 88 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 89 89 impl<S: State> sealed::Sealed for SetDisplayName<S> {} 90 90 impl<S: State> State for SetDisplayName<S> { 91 - type CreatedAt = S::CreatedAt; 92 91 type Did = S::Did; 92 + type CreatedAt = S::CreatedAt; 93 93 type DisplayName = Set<members::display_name>; 94 94 } 95 95 /// Marker types for field names 96 96 #[allow(non_camel_case_types)] 97 97 pub mod members { 98 + ///Marker type for the `did` field 99 + pub struct did(()); 98 100 ///Marker type for the `created_at` field 99 101 pub struct created_at(()); 100 - ///Marker type for the `did` field 101 - pub struct did(()); 102 102 ///Marker type for the `display_name` field 103 103 pub struct display_name(()); 104 104 } ··· 317 317 impl<'a, S> GeneratorBuilder<'a, S> 318 318 where 319 319 S: generator_state::State, 320 - S::CreatedAt: generator_state::IsSet, 321 320 S::Did: generator_state::IsSet, 321 + S::CreatedAt: generator_state::IsSet, 322 322 S::DisplayName: generator_state::IsSet, 323 323 { 324 324 /// Build the final struct
+15 -15
crates/weaver-api/src/app_bsky/feed/get_likes.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type CreatedAt; 37 36 type IndexedAt; 38 37 type Actor; 38 + type CreatedAt; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type CreatedAt = Unset; 45 44 type IndexedAt = Unset; 46 45 type Actor = Unset; 47 - } 48 - ///State transition - sets the `created_at` field to Set 49 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 51 - impl<S: State> State for SetCreatedAt<S> { 52 - type CreatedAt = Set<members::created_at>; 53 - type IndexedAt = S::IndexedAt; 54 - type Actor = S::Actor; 46 + type CreatedAt = Unset; 55 47 } 56 48 ///State transition - sets the `indexed_at` field to Set 57 49 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 58 50 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 59 51 impl<S: State> State for SetIndexedAt<S> { 60 - type CreatedAt = S::CreatedAt; 61 52 type IndexedAt = Set<members::indexed_at>; 62 53 type Actor = S::Actor; 54 + type CreatedAt = S::CreatedAt; 63 55 } 64 56 ///State transition - sets the `actor` field to Set 65 57 pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 66 58 impl<S: State> sealed::Sealed for SetActor<S> {} 67 59 impl<S: State> State for SetActor<S> { 68 - type CreatedAt = S::CreatedAt; 69 60 type IndexedAt = S::IndexedAt; 70 61 type Actor = Set<members::actor>; 62 + type CreatedAt = S::CreatedAt; 63 + } 64 + ///State transition - sets the `created_at` field to Set 65 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 66 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 67 + impl<S: State> State for SetCreatedAt<S> { 68 + type IndexedAt = S::IndexedAt; 69 + type Actor = S::Actor; 70 + type CreatedAt = Set<members::created_at>; 71 71 } 72 72 /// Marker types for field names 73 73 #[allow(non_camel_case_types)] 74 74 pub mod members { 75 - ///Marker type for the `created_at` field 76 - pub struct created_at(()); 77 75 ///Marker type for the `indexed_at` field 78 76 pub struct indexed_at(()); 79 77 ///Marker type for the `actor` field 80 78 pub struct actor(()); 79 + ///Marker type for the `created_at` field 80 + pub struct created_at(()); 81 81 } 82 82 } 83 83 ··· 170 170 impl<'a, S> LikeBuilder<'a, S> 171 171 where 172 172 S: like_state::State, 173 - S::CreatedAt: like_state::IsSet, 174 173 S::IndexedAt: like_state::IsSet, 175 174 S::Actor: like_state::IsSet, 175 + S::CreatedAt: like_state::IsSet, 176 176 { 177 177 /// Build the final struct 178 178 pub fn build(self) -> Like<'a> {
+28 -28
crates/weaver-api/src/app_bsky/feed/post.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 + type Index; 40 41 type Type; 41 42 type Value; 42 - type Index; 43 43 } 44 44 /// Empty state - all required fields are unset 45 45 pub struct Empty(()); 46 46 impl sealed::Sealed for Empty {} 47 47 impl State for Empty { 48 + type Index = Unset; 48 49 type Type = Unset; 49 50 type Value = Unset; 50 - type Index = Unset; 51 + } 52 + ///State transition - sets the `index` field to Set 53 + pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetIndex<S> {} 55 + impl<S: State> State for SetIndex<S> { 56 + type Index = Set<members::index>; 57 + type Type = S::Type; 58 + type Value = S::Value; 51 59 } 52 60 ///State transition - sets the `type` field to Set 53 61 pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 54 62 impl<S: State> sealed::Sealed for SetType<S> {} 55 63 impl<S: State> State for SetType<S> { 64 + type Index = S::Index; 56 65 type Type = Set<members::r#type>; 57 66 type Value = S::Value; 58 - type Index = S::Index; 59 67 } 60 68 ///State transition - sets the `value` field to Set 61 69 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 62 70 impl<S: State> sealed::Sealed for SetValue<S> {} 63 71 impl<S: State> State for SetValue<S> { 64 - type Type = S::Type; 65 - type Value = Set<members::value>; 66 72 type Index = S::Index; 67 - } 68 - ///State transition - sets the `index` field to Set 69 - pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 70 - impl<S: State> sealed::Sealed for SetIndex<S> {} 71 - impl<S: State> State for SetIndex<S> { 72 73 type Type = S::Type; 73 - type Value = S::Value; 74 - type Index = Set<members::index>; 74 + type Value = Set<members::value>; 75 75 } 76 76 /// Marker types for field names 77 77 #[allow(non_camel_case_types)] 78 78 pub mod members { 79 + ///Marker type for the `index` field 80 + pub struct index(()); 79 81 ///Marker type for the `type` field 80 82 pub struct r#type(()); 81 83 ///Marker type for the `value` field 82 84 pub struct value(()); 83 - ///Marker type for the `index` field 84 - pub struct index(()); 85 85 } 86 86 } 87 87 ··· 174 174 impl<'a, S> EntityBuilder<'a, S> 175 175 where 176 176 S: entity_state::State, 177 + S::Index: entity_state::IsSet, 177 178 S::Type: entity_state::IsSet, 178 179 S::Value: entity_state::IsSet, 179 - S::Index: entity_state::IsSet, 180 180 { 181 181 /// Build the final struct 182 182 pub fn build(self) -> Entity<'a> { ··· 622 622 } 623 623 /// State trait tracking which required fields have been set 624 624 pub trait State: sealed::Sealed { 625 - type Text; 626 625 type CreatedAt; 626 + type Text; 627 627 } 628 628 /// Empty state - all required fields are unset 629 629 pub struct Empty(()); 630 630 impl sealed::Sealed for Empty {} 631 631 impl State for Empty { 632 - type Text = Unset; 633 632 type CreatedAt = Unset; 634 - } 635 - ///State transition - sets the `text` field to Set 636 - pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>); 637 - impl<S: State> sealed::Sealed for SetText<S> {} 638 - impl<S: State> State for SetText<S> { 639 - type Text = Set<members::text>; 640 - type CreatedAt = S::CreatedAt; 633 + type Text = Unset; 641 634 } 642 635 ///State transition - sets the `created_at` field to Set 643 636 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 644 637 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 645 638 impl<S: State> State for SetCreatedAt<S> { 646 - type Text = S::Text; 647 639 type CreatedAt = Set<members::created_at>; 640 + type Text = S::Text; 641 + } 642 + ///State transition - sets the `text` field to Set 643 + pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>); 644 + impl<S: State> sealed::Sealed for SetText<S> {} 645 + impl<S: State> State for SetText<S> { 646 + type CreatedAt = S::CreatedAt; 647 + type Text = Set<members::text>; 648 648 } 649 649 /// Marker types for field names 650 650 #[allow(non_camel_case_types)] 651 651 pub mod members { 652 - ///Marker type for the `text` field 653 - pub struct text(()); 654 652 ///Marker type for the `created_at` field 655 653 pub struct created_at(()); 654 + ///Marker type for the `text` field 655 + pub struct text(()); 656 656 } 657 657 } 658 658 ··· 869 869 impl<'a, S> PostBuilder<'a, S> 870 870 where 871 871 S: post_state::State, 872 - S::Text: post_state::IsSet, 873 872 S::CreatedAt: post_state::IsSet, 873 + S::Text: post_state::IsSet, 874 874 { 875 875 /// Build the final struct 876 876 pub fn build(self) -> Post<'a> {
+13 -13
crates/weaver-api/src/app_bsky/feed/postgate.rs
··· 224 224 } 225 225 /// State trait tracking which required fields have been set 226 226 pub trait State: sealed::Sealed { 227 - type CreatedAt; 228 227 type Post; 228 + type CreatedAt; 229 229 } 230 230 /// Empty state - all required fields are unset 231 231 pub struct Empty(()); 232 232 impl sealed::Sealed for Empty {} 233 233 impl State for Empty { 234 - type CreatedAt = Unset; 235 234 type Post = Unset; 236 - } 237 - ///State transition - sets the `created_at` field to Set 238 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 239 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 240 - impl<S: State> State for SetCreatedAt<S> { 241 - type CreatedAt = Set<members::created_at>; 242 - type Post = S::Post; 235 + type CreatedAt = Unset; 243 236 } 244 237 ///State transition - sets the `post` field to Set 245 238 pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 246 239 impl<S: State> sealed::Sealed for SetPost<S> {} 247 240 impl<S: State> State for SetPost<S> { 248 - type CreatedAt = S::CreatedAt; 249 241 type Post = Set<members::post>; 242 + type CreatedAt = S::CreatedAt; 243 + } 244 + ///State transition - sets the `created_at` field to Set 245 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 246 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 247 + impl<S: State> State for SetCreatedAt<S> { 248 + type Post = S::Post; 249 + type CreatedAt = Set<members::created_at>; 250 250 } 251 251 /// Marker types for field names 252 252 #[allow(non_camel_case_types)] 253 253 pub mod members { 254 - ///Marker type for the `created_at` field 255 - pub struct created_at(()); 256 254 ///Marker type for the `post` field 257 255 pub struct post(()); 256 + ///Marker type for the `created_at` field 257 + pub struct created_at(()); 258 258 } 259 259 } 260 260 ··· 367 367 impl<'a, S> PostgateBuilder<'a, S> 368 368 where 369 369 S: postgate_state::State, 370 - S::CreatedAt: postgate_state::IsSet, 371 370 S::Post: postgate_state::IsSet, 371 + S::CreatedAt: postgate_state::IsSet, 372 372 { 373 373 /// Build the final struct 374 374 pub fn build(self) -> Postgate<'a> {
+13 -13
crates/weaver-api/src/app_bsky/feed/repost.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type CreatedAt; 40 39 type Subject; 40 + type CreatedAt; 41 41 } 42 42 /// Empty state - all required fields are unset 43 43 pub struct Empty(()); 44 44 impl sealed::Sealed for Empty {} 45 45 impl State for Empty { 46 - type CreatedAt = Unset; 47 46 type Subject = Unset; 48 - } 49 - ///State transition - sets the `created_at` field to Set 50 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 51 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 52 - impl<S: State> State for SetCreatedAt<S> { 53 - type CreatedAt = Set<members::created_at>; 54 - type Subject = S::Subject; 47 + type CreatedAt = Unset; 55 48 } 56 49 ///State transition - sets the `subject` field to Set 57 50 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 58 51 impl<S: State> sealed::Sealed for SetSubject<S> {} 59 52 impl<S: State> State for SetSubject<S> { 60 - type CreatedAt = S::CreatedAt; 61 53 type Subject = Set<members::subject>; 54 + type CreatedAt = S::CreatedAt; 55 + } 56 + ///State transition - sets the `created_at` field to Set 57 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 59 + impl<S: State> State for SetCreatedAt<S> { 60 + type Subject = S::Subject; 61 + type CreatedAt = Set<members::created_at>; 62 62 } 63 63 /// Marker types for field names 64 64 #[allow(non_camel_case_types)] 65 65 pub mod members { 66 - ///Marker type for the `created_at` field 67 - pub struct created_at(()); 68 66 ///Marker type for the `subject` field 69 67 pub struct subject(()); 68 + ///Marker type for the `created_at` field 69 + pub struct created_at(()); 70 70 } 71 71 } 72 72 ··· 159 159 impl<'a, S> RepostBuilder<'a, S> 160 160 where 161 161 S: repost_state::State, 162 - S::CreatedAt: repost_state::IsSet, 163 162 S::Subject: repost_state::IsSet, 163 + S::CreatedAt: repost_state::IsSet, 164 164 { 165 165 /// Build the final struct 166 166 pub fn build(self) -> Repost<'a> {
+13 -13
crates/weaver-api/src/app_bsky/feed/threadgate.rs
··· 463 463 } 464 464 /// State trait tracking which required fields have been set 465 465 pub trait State: sealed::Sealed { 466 - type Post; 467 466 type CreatedAt; 467 + type Post; 468 468 } 469 469 /// Empty state - all required fields are unset 470 470 pub struct Empty(()); 471 471 impl sealed::Sealed for Empty {} 472 472 impl State for Empty { 473 - type Post = Unset; 474 473 type CreatedAt = Unset; 475 - } 476 - ///State transition - sets the `post` field to Set 477 - pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 478 - impl<S: State> sealed::Sealed for SetPost<S> {} 479 - impl<S: State> State for SetPost<S> { 480 - type Post = Set<members::post>; 481 - type CreatedAt = S::CreatedAt; 474 + type Post = Unset; 482 475 } 483 476 ///State transition - sets the `created_at` field to Set 484 477 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 485 478 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 486 479 impl<S: State> State for SetCreatedAt<S> { 487 - type Post = S::Post; 488 480 type CreatedAt = Set<members::created_at>; 481 + type Post = S::Post; 482 + } 483 + ///State transition - sets the `post` field to Set 484 + pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 485 + impl<S: State> sealed::Sealed for SetPost<S> {} 486 + impl<S: State> State for SetPost<S> { 487 + type CreatedAt = S::CreatedAt; 488 + type Post = Set<members::post>; 489 489 } 490 490 /// Marker types for field names 491 491 #[allow(non_camel_case_types)] 492 492 pub mod members { 493 - ///Marker type for the `post` field 494 - pub struct post(()); 495 493 ///Marker type for the `created_at` field 496 494 pub struct created_at(()); 495 + ///Marker type for the `post` field 496 + pub struct post(()); 497 497 } 498 498 } 499 499 ··· 603 603 impl<'a, S> ThreadgateBuilder<'a, S> 604 604 where 605 605 S: threadgate_state::State, 606 - S::Post: threadgate_state::IsSet, 607 606 S::CreatedAt: threadgate_state::IsSet, 607 + S::Post: threadgate_state::IsSet, 608 608 { 609 609 /// Build the final struct 610 610 pub fn build(self) -> Threadgate<'a> {
+144 -144
crates/weaver-api/src/app_bsky/graph.rs
··· 1284 1284 /// State trait tracking which required fields have been set 1285 1285 pub trait State: sealed::Sealed { 1286 1286 type Purpose; 1287 + type Name; 1287 1288 type Cid; 1289 + type Creator; 1290 + type IndexedAt; 1288 1291 type Uri; 1289 - type IndexedAt; 1290 - type Name; 1291 - type Creator; 1292 1292 } 1293 1293 /// Empty state - all required fields are unset 1294 1294 pub struct Empty(()); 1295 1295 impl sealed::Sealed for Empty {} 1296 1296 impl State for Empty { 1297 1297 type Purpose = Unset; 1298 - type Cid = Unset; 1299 - type Uri = Unset; 1300 - type IndexedAt = Unset; 1301 1298 type Name = Unset; 1299 + type Cid = Unset; 1302 1300 type Creator = Unset; 1301 + type IndexedAt = Unset; 1302 + type Uri = Unset; 1303 1303 } 1304 1304 ///State transition - sets the `purpose` field to Set 1305 1305 pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1306 1306 impl<S: State> sealed::Sealed for SetPurpose<S> {} 1307 1307 impl<S: State> State for SetPurpose<S> { 1308 1308 type Purpose = Set<members::purpose>; 1309 + type Name = S::Name; 1309 1310 type Cid = S::Cid; 1310 - type Uri = S::Uri; 1311 + type Creator = S::Creator; 1311 1312 type IndexedAt = S::IndexedAt; 1312 - type Name = S::Name; 1313 + type Uri = S::Uri; 1314 + } 1315 + ///State transition - sets the `name` field to Set 1316 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1317 + impl<S: State> sealed::Sealed for SetName<S> {} 1318 + impl<S: State> State for SetName<S> { 1319 + type Purpose = S::Purpose; 1320 + type Name = Set<members::name>; 1321 + type Cid = S::Cid; 1313 1322 type Creator = S::Creator; 1323 + type IndexedAt = S::IndexedAt; 1324 + type Uri = S::Uri; 1314 1325 } 1315 1326 ///State transition - sets the `cid` field to Set 1316 1327 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1317 1328 impl<S: State> sealed::Sealed for SetCid<S> {} 1318 1329 impl<S: State> State for SetCid<S> { 1319 1330 type Purpose = S::Purpose; 1331 + type Name = S::Name; 1320 1332 type Cid = Set<members::cid>; 1333 + type Creator = S::Creator; 1334 + type IndexedAt = S::IndexedAt; 1321 1335 type Uri = S::Uri; 1322 - type IndexedAt = S::IndexedAt; 1323 - type Name = S::Name; 1324 - type Creator = S::Creator; 1325 1336 } 1326 - ///State transition - sets the `uri` field to Set 1327 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1328 - impl<S: State> sealed::Sealed for SetUri<S> {} 1329 - impl<S: State> State for SetUri<S> { 1337 + ///State transition - sets the `creator` field to Set 1338 + pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1339 + impl<S: State> sealed::Sealed for SetCreator<S> {} 1340 + impl<S: State> State for SetCreator<S> { 1330 1341 type Purpose = S::Purpose; 1342 + type Name = S::Name; 1331 1343 type Cid = S::Cid; 1332 - type Uri = Set<members::uri>; 1344 + type Creator = Set<members::creator>; 1333 1345 type IndexedAt = S::IndexedAt; 1334 - type Name = S::Name; 1335 - type Creator = S::Creator; 1346 + type Uri = S::Uri; 1336 1347 } 1337 1348 ///State transition - sets the `indexed_at` field to Set 1338 1349 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1339 1350 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1340 1351 impl<S: State> State for SetIndexedAt<S> { 1341 1352 type Purpose = S::Purpose; 1342 - type Cid = S::Cid; 1343 - type Uri = S::Uri; 1344 - type IndexedAt = Set<members::indexed_at>; 1345 1353 type Name = S::Name; 1346 - type Creator = S::Creator; 1347 - } 1348 - ///State transition - sets the `name` field to Set 1349 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1350 - impl<S: State> sealed::Sealed for SetName<S> {} 1351 - impl<S: State> State for SetName<S> { 1352 - type Purpose = S::Purpose; 1353 1354 type Cid = S::Cid; 1355 + type Creator = S::Creator; 1356 + type IndexedAt = Set<members::indexed_at>; 1354 1357 type Uri = S::Uri; 1355 - type IndexedAt = S::IndexedAt; 1356 - type Name = Set<members::name>; 1357 - type Creator = S::Creator; 1358 1358 } 1359 - ///State transition - sets the `creator` field to Set 1360 - pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1361 - impl<S: State> sealed::Sealed for SetCreator<S> {} 1362 - impl<S: State> State for SetCreator<S> { 1359 + ///State transition - sets the `uri` field to Set 1360 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1361 + impl<S: State> sealed::Sealed for SetUri<S> {} 1362 + impl<S: State> State for SetUri<S> { 1363 1363 type Purpose = S::Purpose; 1364 + type Name = S::Name; 1364 1365 type Cid = S::Cid; 1365 - type Uri = S::Uri; 1366 + type Creator = S::Creator; 1366 1367 type IndexedAt = S::IndexedAt; 1367 - type Name = S::Name; 1368 - type Creator = Set<members::creator>; 1368 + type Uri = Set<members::uri>; 1369 1369 } 1370 1370 /// Marker types for field names 1371 1371 #[allow(non_camel_case_types)] 1372 1372 pub mod members { 1373 1373 ///Marker type for the `purpose` field 1374 1374 pub struct purpose(()); 1375 - ///Marker type for the `cid` field 1376 - pub struct cid(()); 1377 - ///Marker type for the `uri` field 1378 - pub struct uri(()); 1379 - ///Marker type for the `indexed_at` field 1380 - pub struct indexed_at(()); 1381 1375 ///Marker type for the `name` field 1382 1376 pub struct name(()); 1377 + ///Marker type for the `cid` field 1378 + pub struct cid(()); 1383 1379 ///Marker type for the `creator` field 1384 1380 pub struct creator(()); 1381 + ///Marker type for the `indexed_at` field 1382 + pub struct indexed_at(()); 1383 + ///Marker type for the `uri` field 1384 + pub struct uri(()); 1385 1385 } 1386 1386 } 1387 1387 ··· 1662 1662 where 1663 1663 S: list_view_state::State, 1664 1664 S::Purpose: list_view_state::IsSet, 1665 - S::Cid: list_view_state::IsSet, 1666 - S::Uri: list_view_state::IsSet, 1667 - S::IndexedAt: list_view_state::IsSet, 1668 1665 S::Name: list_view_state::IsSet, 1666 + S::Cid: list_view_state::IsSet, 1669 1667 S::Creator: list_view_state::IsSet, 1668 + S::IndexedAt: list_view_state::IsSet, 1669 + S::Uri: list_view_state::IsSet, 1670 1670 { 1671 1671 /// Build the final struct 1672 1672 pub fn build(self) -> ListView<'a> { ··· 1841 1841 } 1842 1842 /// State trait tracking which required fields have been set 1843 1843 pub trait State: sealed::Sealed { 1844 - type Cid; 1844 + type Name; 1845 1845 type Purpose; 1846 1846 type Uri; 1847 - type Name; 1847 + type Cid; 1848 1848 } 1849 1849 /// Empty state - all required fields are unset 1850 1850 pub struct Empty(()); 1851 1851 impl sealed::Sealed for Empty {} 1852 1852 impl State for Empty { 1853 - type Cid = Unset; 1853 + type Name = Unset; 1854 1854 type Purpose = Unset; 1855 1855 type Uri = Unset; 1856 - type Name = Unset; 1856 + type Cid = Unset; 1857 1857 } 1858 - ///State transition - sets the `cid` field to Set 1859 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1860 - impl<S: State> sealed::Sealed for SetCid<S> {} 1861 - impl<S: State> State for SetCid<S> { 1862 - type Cid = Set<members::cid>; 1858 + ///State transition - sets the `name` field to Set 1859 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1860 + impl<S: State> sealed::Sealed for SetName<S> {} 1861 + impl<S: State> State for SetName<S> { 1862 + type Name = Set<members::name>; 1863 1863 type Purpose = S::Purpose; 1864 1864 type Uri = S::Uri; 1865 - type Name = S::Name; 1865 + type Cid = S::Cid; 1866 1866 } 1867 1867 ///State transition - sets the `purpose` field to Set 1868 1868 pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1869 1869 impl<S: State> sealed::Sealed for SetPurpose<S> {} 1870 1870 impl<S: State> State for SetPurpose<S> { 1871 - type Cid = S::Cid; 1871 + type Name = S::Name; 1872 1872 type Purpose = Set<members::purpose>; 1873 1873 type Uri = S::Uri; 1874 - type Name = S::Name; 1874 + type Cid = S::Cid; 1875 1875 } 1876 1876 ///State transition - sets the `uri` field to Set 1877 1877 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1878 1878 impl<S: State> sealed::Sealed for SetUri<S> {} 1879 1879 impl<S: State> State for SetUri<S> { 1880 - type Cid = S::Cid; 1880 + type Name = S::Name; 1881 1881 type Purpose = S::Purpose; 1882 1882 type Uri = Set<members::uri>; 1883 - type Name = S::Name; 1884 - } 1885 - ///State transition - sets the `name` field to Set 1886 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1887 - impl<S: State> sealed::Sealed for SetName<S> {} 1888 - impl<S: State> State for SetName<S> { 1889 1883 type Cid = S::Cid; 1884 + } 1885 + ///State transition - sets the `cid` field to Set 1886 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1887 + impl<S: State> sealed::Sealed for SetCid<S> {} 1888 + impl<S: State> State for SetCid<S> { 1889 + type Name = S::Name; 1890 1890 type Purpose = S::Purpose; 1891 1891 type Uri = S::Uri; 1892 - type Name = Set<members::name>; 1892 + type Cid = Set<members::cid>; 1893 1893 } 1894 1894 /// Marker types for field names 1895 1895 #[allow(non_camel_case_types)] 1896 1896 pub mod members { 1897 - ///Marker type for the `cid` field 1898 - pub struct cid(()); 1897 + ///Marker type for the `name` field 1898 + pub struct name(()); 1899 1899 ///Marker type for the `purpose` field 1900 1900 pub struct purpose(()); 1901 1901 ///Marker type for the `uri` field 1902 1902 pub struct uri(()); 1903 - ///Marker type for the `name` field 1904 - pub struct name(()); 1903 + ///Marker type for the `cid` field 1904 + pub struct cid(()); 1905 1905 } 1906 1906 } 1907 1907 ··· 2118 2118 impl<'a, S> ListViewBasicBuilder<'a, S> 2119 2119 where 2120 2120 S: list_view_basic_state::State, 2121 - S::Cid: list_view_basic_state::IsSet, 2121 + S::Name: list_view_basic_state::IsSet, 2122 2122 S::Purpose: list_view_basic_state::IsSet, 2123 2123 S::Uri: list_view_basic_state::IsSet, 2124 - S::Name: list_view_basic_state::IsSet, 2124 + S::Cid: list_view_basic_state::IsSet, 2125 2125 { 2126 2126 /// Build the final struct 2127 2127 pub fn build(self) -> ListViewBasic<'a> { ··· 2705 2705 } 2706 2706 /// State trait tracking which required fields have been set 2707 2707 pub trait State: sealed::Sealed { 2708 + type Creator; 2709 + type Uri; 2710 + type Record; 2708 2711 type IndexedAt; 2709 - type Record; 2710 2712 type Cid; 2711 - type Creator; 2712 - type Uri; 2713 2713 } 2714 2714 /// Empty state - all required fields are unset 2715 2715 pub struct Empty(()); 2716 2716 impl sealed::Sealed for Empty {} 2717 2717 impl State for Empty { 2718 - type IndexedAt = Unset; 2719 - type Record = Unset; 2720 - type Cid = Unset; 2721 2718 type Creator = Unset; 2722 2719 type Uri = Unset; 2720 + type Record = Unset; 2721 + type IndexedAt = Unset; 2722 + type Cid = Unset; 2723 2723 } 2724 - ///State transition - sets the `indexed_at` field to Set 2725 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2726 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2727 - impl<S: State> State for SetIndexedAt<S> { 2728 - type IndexedAt = Set<members::indexed_at>; 2724 + ///State transition - sets the `creator` field to Set 2725 + pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 2726 + impl<S: State> sealed::Sealed for SetCreator<S> {} 2727 + impl<S: State> State for SetCreator<S> { 2728 + type Creator = Set<members::creator>; 2729 + type Uri = S::Uri; 2729 2730 type Record = S::Record; 2731 + type IndexedAt = S::IndexedAt; 2730 2732 type Cid = S::Cid; 2733 + } 2734 + ///State transition - sets the `uri` field to Set 2735 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2736 + impl<S: State> sealed::Sealed for SetUri<S> {} 2737 + impl<S: State> State for SetUri<S> { 2731 2738 type Creator = S::Creator; 2732 - type Uri = S::Uri; 2739 + type Uri = Set<members::uri>; 2740 + type Record = S::Record; 2741 + type IndexedAt = S::IndexedAt; 2742 + type Cid = S::Cid; 2733 2743 } 2734 2744 ///State transition - sets the `record` field to Set 2735 2745 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 2736 2746 impl<S: State> sealed::Sealed for SetRecord<S> {} 2737 2747 impl<S: State> State for SetRecord<S> { 2738 - type IndexedAt = S::IndexedAt; 2748 + type Creator = S::Creator; 2749 + type Uri = S::Uri; 2739 2750 type Record = Set<members::record>; 2751 + type IndexedAt = S::IndexedAt; 2740 2752 type Cid = S::Cid; 2753 + } 2754 + ///State transition - sets the `indexed_at` field to Set 2755 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2756 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2757 + impl<S: State> State for SetIndexedAt<S> { 2741 2758 type Creator = S::Creator; 2742 2759 type Uri = S::Uri; 2760 + type Record = S::Record; 2761 + type IndexedAt = Set<members::indexed_at>; 2762 + type Cid = S::Cid; 2743 2763 } 2744 2764 ///State transition - sets the `cid` field to Set 2745 2765 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2746 2766 impl<S: State> sealed::Sealed for SetCid<S> {} 2747 2767 impl<S: State> State for SetCid<S> { 2748 - type IndexedAt = S::IndexedAt; 2749 - type Record = S::Record; 2750 - type Cid = Set<members::cid>; 2751 2768 type Creator = S::Creator; 2752 2769 type Uri = S::Uri; 2753 - } 2754 - ///State transition - sets the `creator` field to Set 2755 - pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 2756 - impl<S: State> sealed::Sealed for SetCreator<S> {} 2757 - impl<S: State> State for SetCreator<S> { 2758 - type IndexedAt = S::IndexedAt; 2759 2770 type Record = S::Record; 2760 - type Cid = S::Cid; 2761 - type Creator = Set<members::creator>; 2762 - type Uri = S::Uri; 2763 - } 2764 - ///State transition - sets the `uri` field to Set 2765 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2766 - impl<S: State> sealed::Sealed for SetUri<S> {} 2767 - impl<S: State> State for SetUri<S> { 2768 2771 type IndexedAt = S::IndexedAt; 2769 - type Record = S::Record; 2770 - type Cid = S::Cid; 2771 - type Creator = S::Creator; 2772 - type Uri = Set<members::uri>; 2772 + type Cid = Set<members::cid>; 2773 2773 } 2774 2774 /// Marker types for field names 2775 2775 #[allow(non_camel_case_types)] 2776 2776 pub mod members { 2777 - ///Marker type for the `indexed_at` field 2778 - pub struct indexed_at(()); 2779 - ///Marker type for the `record` field 2780 - pub struct record(()); 2781 - ///Marker type for the `cid` field 2782 - pub struct cid(()); 2783 2777 ///Marker type for the `creator` field 2784 2778 pub struct creator(()); 2785 2779 ///Marker type for the `uri` field 2786 2780 pub struct uri(()); 2781 + ///Marker type for the `record` field 2782 + pub struct record(()); 2783 + ///Marker type for the `indexed_at` field 2784 + pub struct indexed_at(()); 2785 + ///Marker type for the `cid` field 2786 + pub struct cid(()); 2787 2787 } 2788 2788 } 2789 2789 ··· 3036 3036 impl<'a, S> StarterPackViewBuilder<'a, S> 3037 3037 where 3038 3038 S: starter_pack_view_state::State, 3039 - S::IndexedAt: starter_pack_view_state::IsSet, 3040 - S::Record: starter_pack_view_state::IsSet, 3041 - S::Cid: starter_pack_view_state::IsSet, 3042 3039 S::Creator: starter_pack_view_state::IsSet, 3043 3040 S::Uri: starter_pack_view_state::IsSet, 3041 + S::Record: starter_pack_view_state::IsSet, 3042 + S::IndexedAt: starter_pack_view_state::IsSet, 3043 + S::Cid: starter_pack_view_state::IsSet, 3044 3044 { 3045 3045 /// Build the final struct 3046 3046 pub fn build(self) -> StarterPackView<'a> { ··· 3189 3189 } 3190 3190 /// State trait tracking which required fields have been set 3191 3191 pub trait State: sealed::Sealed { 3192 - type IndexedAt; 3193 - type Creator; 3194 3192 type Cid; 3193 + type Creator; 3194 + type IndexedAt; 3195 3195 type Uri; 3196 3196 type Record; 3197 3197 } ··· 3199 3199 pub struct Empty(()); 3200 3200 impl sealed::Sealed for Empty {} 3201 3201 impl State for Empty { 3202 - type IndexedAt = Unset; 3202 + type Cid = Unset; 3203 3203 type Creator = Unset; 3204 - type Cid = Unset; 3204 + type IndexedAt = Unset; 3205 3205 type Uri = Unset; 3206 3206 type Record = Unset; 3207 3207 } 3208 - ///State transition - sets the `indexed_at` field to Set 3209 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3210 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3211 - impl<S: State> State for SetIndexedAt<S> { 3212 - type IndexedAt = Set<members::indexed_at>; 3208 + ///State transition - sets the `cid` field to Set 3209 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3210 + impl<S: State> sealed::Sealed for SetCid<S> {} 3211 + impl<S: State> State for SetCid<S> { 3212 + type Cid = Set<members::cid>; 3213 3213 type Creator = S::Creator; 3214 - type Cid = S::Cid; 3214 + type IndexedAt = S::IndexedAt; 3215 3215 type Uri = S::Uri; 3216 3216 type Record = S::Record; 3217 3217 } ··· 3219 3219 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 3220 3220 impl<S: State> sealed::Sealed for SetCreator<S> {} 3221 3221 impl<S: State> State for SetCreator<S> { 3222 - type IndexedAt = S::IndexedAt; 3223 - type Creator = Set<members::creator>; 3224 3222 type Cid = S::Cid; 3223 + type Creator = Set<members::creator>; 3224 + type IndexedAt = S::IndexedAt; 3225 3225 type Uri = S::Uri; 3226 3226 type Record = S::Record; 3227 3227 } 3228 - ///State transition - sets the `cid` field to Set 3229 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3230 - impl<S: State> sealed::Sealed for SetCid<S> {} 3231 - impl<S: State> State for SetCid<S> { 3232 - type IndexedAt = S::IndexedAt; 3228 + ///State transition - sets the `indexed_at` field to Set 3229 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3230 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3231 + impl<S: State> State for SetIndexedAt<S> { 3232 + type Cid = S::Cid; 3233 3233 type Creator = S::Creator; 3234 - type Cid = Set<members::cid>; 3234 + type IndexedAt = Set<members::indexed_at>; 3235 3235 type Uri = S::Uri; 3236 3236 type Record = S::Record; 3237 3237 } ··· 3239 3239 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3240 3240 impl<S: State> sealed::Sealed for SetUri<S> {} 3241 3241 impl<S: State> State for SetUri<S> { 3242 - type IndexedAt = S::IndexedAt; 3243 - type Creator = S::Creator; 3244 3242 type Cid = S::Cid; 3243 + type Creator = S::Creator; 3244 + type IndexedAt = S::IndexedAt; 3245 3245 type Uri = Set<members::uri>; 3246 3246 type Record = S::Record; 3247 3247 } ··· 3249 3249 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3250 3250 impl<S: State> sealed::Sealed for SetRecord<S> {} 3251 3251 impl<S: State> State for SetRecord<S> { 3252 - type IndexedAt = S::IndexedAt; 3253 - type Creator = S::Creator; 3254 3252 type Cid = S::Cid; 3253 + type Creator = S::Creator; 3254 + type IndexedAt = S::IndexedAt; 3255 3255 type Uri = S::Uri; 3256 3256 type Record = Set<members::record>; 3257 3257 } 3258 3258 /// Marker types for field names 3259 3259 #[allow(non_camel_case_types)] 3260 3260 pub mod members { 3261 - ///Marker type for the `indexed_at` field 3262 - pub struct indexed_at(()); 3263 - ///Marker type for the `creator` field 3264 - pub struct creator(()); 3265 3261 ///Marker type for the `cid` field 3266 3262 pub struct cid(()); 3263 + ///Marker type for the `creator` field 3264 + pub struct creator(()); 3265 + ///Marker type for the `indexed_at` field 3266 + pub struct indexed_at(()); 3267 3267 ///Marker type for the `uri` field 3268 3268 pub struct uri(()); 3269 3269 ///Marker type for the `record` field ··· 3478 3478 impl<'a, S> StarterPackViewBasicBuilder<'a, S> 3479 3479 where 3480 3480 S: starter_pack_view_basic_state::State, 3481 - S::IndexedAt: starter_pack_view_basic_state::IsSet, 3482 - S::Creator: starter_pack_view_basic_state::IsSet, 3483 3481 S::Cid: starter_pack_view_basic_state::IsSet, 3482 + S::Creator: starter_pack_view_basic_state::IsSet, 3483 + S::IndexedAt: starter_pack_view_basic_state::IsSet, 3484 3484 S::Uri: starter_pack_view_basic_state::IsSet, 3485 3485 S::Record: starter_pack_view_basic_state::IsSet, 3486 3486 {
+15 -15
crates/weaver-api/src/app_bsky/graph/list.rs
··· 52 52 /// State trait tracking which required fields have been set 53 53 pub trait State: sealed::Sealed { 54 54 type Name; 55 - type Purpose; 56 55 type CreatedAt; 56 + type Purpose; 57 57 } 58 58 /// Empty state - all required fields are unset 59 59 pub struct Empty(()); 60 60 impl sealed::Sealed for Empty {} 61 61 impl State for Empty { 62 62 type Name = Unset; 63 - type Purpose = Unset; 64 63 type CreatedAt = Unset; 64 + type Purpose = Unset; 65 65 } 66 66 ///State transition - sets the `name` field to Set 67 67 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 68 68 impl<S: State> sealed::Sealed for SetName<S> {} 69 69 impl<S: State> State for SetName<S> { 70 70 type Name = Set<members::name>; 71 - type Purpose = S::Purpose; 72 71 type CreatedAt = S::CreatedAt; 73 - } 74 - ///State transition - sets the `purpose` field to Set 75 - pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 76 - impl<S: State> sealed::Sealed for SetPurpose<S> {} 77 - impl<S: State> State for SetPurpose<S> { 78 - type Name = S::Name; 79 - type Purpose = Set<members::purpose>; 80 - type CreatedAt = S::CreatedAt; 72 + type Purpose = S::Purpose; 81 73 } 82 74 ///State transition - sets the `created_at` field to Set 83 75 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 84 76 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 85 77 impl<S: State> State for SetCreatedAt<S> { 86 78 type Name = S::Name; 87 - type Purpose = S::Purpose; 88 79 type CreatedAt = Set<members::created_at>; 80 + type Purpose = S::Purpose; 81 + } 82 + ///State transition - sets the `purpose` field to Set 83 + pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 84 + impl<S: State> sealed::Sealed for SetPurpose<S> {} 85 + impl<S: State> State for SetPurpose<S> { 86 + type Name = S::Name; 87 + type CreatedAt = S::CreatedAt; 88 + type Purpose = Set<members::purpose>; 89 89 } 90 90 /// Marker types for field names 91 91 #[allow(non_camel_case_types)] 92 92 pub mod members { 93 93 ///Marker type for the `name` field 94 94 pub struct name(()); 95 + ///Marker type for the `created_at` field 96 + pub struct created_at(()); 95 97 ///Marker type for the `purpose` field 96 98 pub struct purpose(()); 97 - ///Marker type for the `created_at` field 98 - pub struct created_at(()); 99 99 } 100 100 } 101 101 ··· 269 269 where 270 270 S: list_state::State, 271 271 S::Name: list_state::IsSet, 272 - S::Purpose: list_state::IsSet, 273 272 S::CreatedAt: list_state::IsSet, 273 + S::Purpose: list_state::IsSet, 274 274 { 275 275 /// Build the final struct 276 276 pub fn build(self) -> List<'a> {
+13 -13
crates/weaver-api/src/app_bsky/graph/listblock.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type CreatedAt; 38 37 type Subject; 38 + type CreatedAt; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type CreatedAt = Unset; 45 44 type Subject = Unset; 46 - } 47 - ///State transition - sets the `created_at` field to Set 48 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 50 - impl<S: State> State for SetCreatedAt<S> { 51 - type CreatedAt = Set<members::created_at>; 52 - type Subject = S::Subject; 45 + type CreatedAt = Unset; 53 46 } 54 47 ///State transition - sets the `subject` field to Set 55 48 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetSubject<S> {} 57 50 impl<S: State> State for SetSubject<S> { 58 - type CreatedAt = S::CreatedAt; 59 51 type Subject = Set<members::subject>; 52 + type CreatedAt = S::CreatedAt; 53 + } 54 + ///State transition - sets the `created_at` field to Set 55 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 57 + impl<S: State> State for SetCreatedAt<S> { 58 + type Subject = S::Subject; 59 + type CreatedAt = Set<members::created_at>; 60 60 } 61 61 /// Marker types for field names 62 62 #[allow(non_camel_case_types)] 63 63 pub mod members { 64 - ///Marker type for the `created_at` field 65 - pub struct created_at(()); 66 64 ///Marker type for the `subject` field 67 65 pub struct subject(()); 66 + ///Marker type for the `created_at` field 67 + pub struct created_at(()); 68 68 } 69 69 } 70 70 ··· 137 137 impl<'a, S> ListblockBuilder<'a, S> 138 138 where 139 139 S: listblock_state::State, 140 - S::CreatedAt: listblock_state::IsSet, 141 140 S::Subject: listblock_state::IsSet, 141 + S::CreatedAt: listblock_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> Listblock<'a> {
+15 -15
crates/weaver-api/src/app_bsky/graph/starterpack.rs
··· 366 366 } 367 367 /// State trait tracking which required fields have been set 368 368 pub trait State: sealed::Sealed { 369 - type CreatedAt; 370 369 type Name; 371 370 type List; 371 + type CreatedAt; 372 372 } 373 373 /// Empty state - all required fields are unset 374 374 pub struct Empty(()); 375 375 impl sealed::Sealed for Empty {} 376 376 impl State for Empty { 377 - type CreatedAt = Unset; 378 377 type Name = Unset; 379 378 type List = Unset; 380 - } 381 - ///State transition - sets the `created_at` field to Set 382 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 383 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 384 - impl<S: State> State for SetCreatedAt<S> { 385 - type CreatedAt = Set<members::created_at>; 386 - type Name = S::Name; 387 - type List = S::List; 379 + type CreatedAt = Unset; 388 380 } 389 381 ///State transition - sets the `name` field to Set 390 382 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 391 383 impl<S: State> sealed::Sealed for SetName<S> {} 392 384 impl<S: State> State for SetName<S> { 393 - type CreatedAt = S::CreatedAt; 394 385 type Name = Set<members::name>; 395 386 type List = S::List; 387 + type CreatedAt = S::CreatedAt; 396 388 } 397 389 ///State transition - sets the `list` field to Set 398 390 pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 399 391 impl<S: State> sealed::Sealed for SetList<S> {} 400 392 impl<S: State> State for SetList<S> { 401 - type CreatedAt = S::CreatedAt; 402 393 type Name = S::Name; 403 394 type List = Set<members::list>; 395 + type CreatedAt = S::CreatedAt; 396 + } 397 + ///State transition - sets the `created_at` field to Set 398 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 399 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 400 + impl<S: State> State for SetCreatedAt<S> { 401 + type Name = S::Name; 402 + type List = S::List; 403 + type CreatedAt = Set<members::created_at>; 404 404 } 405 405 /// Marker types for field names 406 406 #[allow(non_camel_case_types)] 407 407 pub mod members { 408 - ///Marker type for the `created_at` field 409 - pub struct created_at(()); 410 408 ///Marker type for the `name` field 411 409 pub struct name(()); 412 410 ///Marker type for the `list` field 413 411 pub struct list(()); 412 + ///Marker type for the `created_at` field 413 + pub struct created_at(()); 414 414 } 415 415 } 416 416 ··· 563 563 impl<'a, S> StarterpackBuilder<'a, S> 564 564 where 565 565 S: starterpack_state::State, 566 - S::CreatedAt: starterpack_state::IsSet, 567 566 S::Name: starterpack_state::IsSet, 568 567 S::List: starterpack_state::IsSet, 568 + S::CreatedAt: starterpack_state::IsSet, 569 569 { 570 570 /// Build the final struct 571 571 pub fn build(self) -> Starterpack<'a> {
+26 -26
crates/weaver-api/src/app_bsky/graph/verification.rs
··· 41 41 } 42 42 /// State trait tracking which required fields have been set 43 43 pub trait State: sealed::Sealed { 44 - type Subject; 45 - type DisplayName; 46 44 type Handle; 45 + type DisplayName; 46 + type Subject; 47 47 type CreatedAt; 48 48 } 49 49 /// Empty state - all required fields are unset 50 50 pub struct Empty(()); 51 51 impl sealed::Sealed for Empty {} 52 52 impl State for Empty { 53 - type Subject = Unset; 54 - type DisplayName = Unset; 55 53 type Handle = Unset; 54 + type DisplayName = Unset; 55 + type Subject = Unset; 56 56 type CreatedAt = Unset; 57 57 } 58 - ///State transition - sets the `subject` field to Set 59 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 60 - impl<S: State> sealed::Sealed for SetSubject<S> {} 61 - impl<S: State> State for SetSubject<S> { 62 - type Subject = Set<members::subject>; 58 + ///State transition - sets the `handle` field to Set 59 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 60 + impl<S: State> sealed::Sealed for SetHandle<S> {} 61 + impl<S: State> State for SetHandle<S> { 62 + type Handle = Set<members::handle>; 63 63 type DisplayName = S::DisplayName; 64 - type Handle = S::Handle; 64 + type Subject = S::Subject; 65 65 type CreatedAt = S::CreatedAt; 66 66 } 67 67 ///State transition - sets the `display_name` field to Set 68 68 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 69 69 impl<S: State> sealed::Sealed for SetDisplayName<S> {} 70 70 impl<S: State> State for SetDisplayName<S> { 71 - type Subject = S::Subject; 72 - type DisplayName = Set<members::display_name>; 73 71 type Handle = S::Handle; 72 + type DisplayName = Set<members::display_name>; 73 + type Subject = S::Subject; 74 74 type CreatedAt = S::CreatedAt; 75 75 } 76 - ///State transition - sets the `handle` field to Set 77 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 78 - impl<S: State> sealed::Sealed for SetHandle<S> {} 79 - impl<S: State> State for SetHandle<S> { 80 - type Subject = S::Subject; 76 + ///State transition - sets the `subject` field to Set 77 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 78 + impl<S: State> sealed::Sealed for SetSubject<S> {} 79 + impl<S: State> State for SetSubject<S> { 80 + type Handle = S::Handle; 81 81 type DisplayName = S::DisplayName; 82 - type Handle = Set<members::handle>; 82 + type Subject = Set<members::subject>; 83 83 type CreatedAt = S::CreatedAt; 84 84 } 85 85 ///State transition - sets the `created_at` field to Set 86 86 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 87 87 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 88 88 impl<S: State> State for SetCreatedAt<S> { 89 - type Subject = S::Subject; 90 - type DisplayName = S::DisplayName; 91 89 type Handle = S::Handle; 90 + type DisplayName = S::DisplayName; 91 + type Subject = S::Subject; 92 92 type CreatedAt = Set<members::created_at>; 93 93 } 94 94 /// Marker types for field names 95 95 #[allow(non_camel_case_types)] 96 96 pub mod members { 97 - ///Marker type for the `subject` field 98 - pub struct subject(()); 99 - ///Marker type for the `display_name` field 100 - pub struct display_name(()); 101 97 ///Marker type for the `handle` field 102 98 pub struct handle(()); 99 + ///Marker type for the `display_name` field 100 + pub struct display_name(()); 101 + ///Marker type for the `subject` field 102 + pub struct subject(()); 103 103 ///Marker type for the `created_at` field 104 104 pub struct created_at(()); 105 105 } ··· 214 214 impl<'a, S> VerificationBuilder<'a, S> 215 215 where 216 216 S: verification_state::State, 217 - S::Subject: verification_state::IsSet, 218 - S::DisplayName: verification_state::IsSet, 219 217 S::Handle: verification_state::IsSet, 218 + S::DisplayName: verification_state::IsSet, 219 + S::Subject: verification_state::IsSet, 220 220 S::CreatedAt: verification_state::IsSet, 221 221 { 222 222 /// Build the final struct
+71 -71
crates/weaver-api/src/app_bsky/labeler.rs
··· 632 632 } 633 633 /// State trait tracking which required fields have been set 634 634 pub trait State: sealed::Sealed { 635 + type Creator; 636 + type Uri; 637 + type Cid; 635 638 type IndexedAt; 636 - type Cid; 637 - type Uri; 638 - type Creator; 639 639 } 640 640 /// Empty state - all required fields are unset 641 641 pub struct Empty(()); 642 642 impl sealed::Sealed for Empty {} 643 643 impl State for Empty { 644 - type IndexedAt = Unset; 645 - type Cid = Unset; 646 - type Uri = Unset; 647 644 type Creator = Unset; 645 + type Uri = Unset; 646 + type Cid = Unset; 647 + type IndexedAt = Unset; 648 648 } 649 - ///State transition - sets the `indexed_at` field to Set 650 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 651 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 652 - impl<S: State> State for SetIndexedAt<S> { 653 - type IndexedAt = Set<members::indexed_at>; 654 - type Cid = S::Cid; 649 + ///State transition - sets the `creator` field to Set 650 + pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 651 + impl<S: State> sealed::Sealed for SetCreator<S> {} 652 + impl<S: State> State for SetCreator<S> { 653 + type Creator = Set<members::creator>; 655 654 type Uri = S::Uri; 655 + type Cid = S::Cid; 656 + type IndexedAt = S::IndexedAt; 657 + } 658 + ///State transition - sets the `uri` field to Set 659 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 660 + impl<S: State> sealed::Sealed for SetUri<S> {} 661 + impl<S: State> State for SetUri<S> { 656 662 type Creator = S::Creator; 663 + type Uri = Set<members::uri>; 664 + type Cid = S::Cid; 665 + type IndexedAt = S::IndexedAt; 657 666 } 658 667 ///State transition - sets the `cid` field to Set 659 668 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 660 669 impl<S: State> sealed::Sealed for SetCid<S> {} 661 670 impl<S: State> State for SetCid<S> { 671 + type Creator = S::Creator; 672 + type Uri = S::Uri; 673 + type Cid = Set<members::cid>; 662 674 type IndexedAt = S::IndexedAt; 663 - type Cid = Set<members::cid>; 664 - type Uri = S::Uri; 665 - type Creator = S::Creator; 666 675 } 667 - ///State transition - sets the `uri` field to Set 668 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 669 - impl<S: State> sealed::Sealed for SetUri<S> {} 670 - impl<S: State> State for SetUri<S> { 671 - type IndexedAt = S::IndexedAt; 672 - type Cid = S::Cid; 673 - type Uri = Set<members::uri>; 676 + ///State transition - sets the `indexed_at` field to Set 677 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 678 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 679 + impl<S: State> State for SetIndexedAt<S> { 674 680 type Creator = S::Creator; 675 - } 676 - ///State transition - sets the `creator` field to Set 677 - pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 678 - impl<S: State> sealed::Sealed for SetCreator<S> {} 679 - impl<S: State> State for SetCreator<S> { 680 - type IndexedAt = S::IndexedAt; 681 + type Uri = S::Uri; 681 682 type Cid = S::Cid; 682 - type Uri = S::Uri; 683 - type Creator = Set<members::creator>; 683 + type IndexedAt = Set<members::indexed_at>; 684 684 } 685 685 /// Marker types for field names 686 686 #[allow(non_camel_case_types)] 687 687 pub mod members { 688 - ///Marker type for the `indexed_at` field 689 - pub struct indexed_at(()); 688 + ///Marker type for the `creator` field 689 + pub struct creator(()); 690 + ///Marker type for the `uri` field 691 + pub struct uri(()); 690 692 ///Marker type for the `cid` field 691 693 pub struct cid(()); 692 - ///Marker type for the `uri` field 693 - pub struct uri(()); 694 - ///Marker type for the `creator` field 695 - pub struct creator(()); 694 + ///Marker type for the `indexed_at` field 695 + pub struct indexed_at(()); 696 696 } 697 697 } 698 698 ··· 859 859 impl<'a, S> LabelerViewBuilder<'a, S> 860 860 where 861 861 S: labeler_view_state::State, 862 - S::IndexedAt: labeler_view_state::IsSet, 863 - S::Cid: labeler_view_state::IsSet, 864 - S::Uri: labeler_view_state::IsSet, 865 862 S::Creator: labeler_view_state::IsSet, 863 + S::Uri: labeler_view_state::IsSet, 864 + S::Cid: labeler_view_state::IsSet, 865 + S::IndexedAt: labeler_view_state::IsSet, 866 866 { 867 867 /// Build the final struct 868 868 pub fn build(self) -> LabelerView<'a> { ··· 985 985 } 986 986 /// State trait tracking which required fields have been set 987 987 pub trait State: sealed::Sealed { 988 + type Uri; 988 989 type Policies; 989 - type Cid; 990 990 type IndexedAt; 991 991 type Creator; 992 - type Uri; 992 + type Cid; 993 993 } 994 994 /// Empty state - all required fields are unset 995 995 pub struct Empty(()); 996 996 impl sealed::Sealed for Empty {} 997 997 impl State for Empty { 998 + type Uri = Unset; 998 999 type Policies = Unset; 999 - type Cid = Unset; 1000 1000 type IndexedAt = Unset; 1001 1001 type Creator = Unset; 1002 - type Uri = Unset; 1002 + type Cid = Unset; 1003 + } 1004 + ///State transition - sets the `uri` field to Set 1005 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1006 + impl<S: State> sealed::Sealed for SetUri<S> {} 1007 + impl<S: State> State for SetUri<S> { 1008 + type Uri = Set<members::uri>; 1009 + type Policies = S::Policies; 1010 + type IndexedAt = S::IndexedAt; 1011 + type Creator = S::Creator; 1012 + type Cid = S::Cid; 1003 1013 } 1004 1014 ///State transition - sets the `policies` field to Set 1005 1015 pub struct SetPolicies<S: State = Empty>(PhantomData<fn() -> S>); 1006 1016 impl<S: State> sealed::Sealed for SetPolicies<S> {} 1007 1017 impl<S: State> State for SetPolicies<S> { 1018 + type Uri = S::Uri; 1008 1019 type Policies = Set<members::policies>; 1009 - type Cid = S::Cid; 1010 1020 type IndexedAt = S::IndexedAt; 1011 1021 type Creator = S::Creator; 1012 - type Uri = S::Uri; 1013 - } 1014 - ///State transition - sets the `cid` field to Set 1015 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1016 - impl<S: State> sealed::Sealed for SetCid<S> {} 1017 - impl<S: State> State for SetCid<S> { 1018 - type Policies = S::Policies; 1019 - type Cid = Set<members::cid>; 1020 - type IndexedAt = S::IndexedAt; 1021 - type Creator = S::Creator; 1022 - type Uri = S::Uri; 1022 + type Cid = S::Cid; 1023 1023 } 1024 1024 ///State transition - sets the `indexed_at` field to Set 1025 1025 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1026 1026 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1027 1027 impl<S: State> State for SetIndexedAt<S> { 1028 + type Uri = S::Uri; 1028 1029 type Policies = S::Policies; 1029 - type Cid = S::Cid; 1030 1030 type IndexedAt = Set<members::indexed_at>; 1031 1031 type Creator = S::Creator; 1032 - type Uri = S::Uri; 1032 + type Cid = S::Cid; 1033 1033 } 1034 1034 ///State transition - sets the `creator` field to Set 1035 1035 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1036 1036 impl<S: State> sealed::Sealed for SetCreator<S> {} 1037 1037 impl<S: State> State for SetCreator<S> { 1038 + type Uri = S::Uri; 1038 1039 type Policies = S::Policies; 1039 - type Cid = S::Cid; 1040 1040 type IndexedAt = S::IndexedAt; 1041 1041 type Creator = Set<members::creator>; 1042 - type Uri = S::Uri; 1042 + type Cid = S::Cid; 1043 1043 } 1044 - ///State transition - sets the `uri` field to Set 1045 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1046 - impl<S: State> sealed::Sealed for SetUri<S> {} 1047 - impl<S: State> State for SetUri<S> { 1044 + ///State transition - sets the `cid` field to Set 1045 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1046 + impl<S: State> sealed::Sealed for SetCid<S> {} 1047 + impl<S: State> State for SetCid<S> { 1048 + type Uri = S::Uri; 1048 1049 type Policies = S::Policies; 1049 - type Cid = S::Cid; 1050 1050 type IndexedAt = S::IndexedAt; 1051 1051 type Creator = S::Creator; 1052 - type Uri = Set<members::uri>; 1052 + type Cid = Set<members::cid>; 1053 1053 } 1054 1054 /// Marker types for field names 1055 1055 #[allow(non_camel_case_types)] 1056 1056 pub mod members { 1057 + ///Marker type for the `uri` field 1058 + pub struct uri(()); 1057 1059 ///Marker type for the `policies` field 1058 1060 pub struct policies(()); 1059 - ///Marker type for the `cid` field 1060 - pub struct cid(()); 1061 1061 ///Marker type for the `indexed_at` field 1062 1062 pub struct indexed_at(()); 1063 1063 ///Marker type for the `creator` field 1064 1064 pub struct creator(()); 1065 - ///Marker type for the `uri` field 1066 - pub struct uri(()); 1065 + ///Marker type for the `cid` field 1066 + pub struct cid(()); 1067 1067 } 1068 1068 } 1069 1069 ··· 1322 1322 impl<'a, S> LabelerViewDetailedBuilder<'a, S> 1323 1323 where 1324 1324 S: labeler_view_detailed_state::State, 1325 + S::Uri: labeler_view_detailed_state::IsSet, 1325 1326 S::Policies: labeler_view_detailed_state::IsSet, 1326 - S::Cid: labeler_view_detailed_state::IsSet, 1327 1327 S::IndexedAt: labeler_view_detailed_state::IsSet, 1328 1328 S::Creator: labeler_view_detailed_state::IsSet, 1329 - S::Uri: labeler_view_detailed_state::IsSet, 1329 + S::Cid: labeler_view_detailed_state::IsSet, 1330 1330 { 1331 1331 /// Build the final struct 1332 1332 pub fn build(self) -> LabelerViewDetailed<'a> {
+260 -260
crates/weaver-api/src/app_bsky/notification.rs
··· 43 43 } 44 44 /// State trait tracking which required fields have been set 45 45 pub trait State: sealed::Sealed { 46 - type Post; 47 46 type Reply; 47 + type Post; 48 48 } 49 49 /// Empty state - all required fields are unset 50 50 pub struct Empty(()); 51 51 impl sealed::Sealed for Empty {} 52 52 impl State for Empty { 53 - type Post = Unset; 54 53 type Reply = Unset; 55 - } 56 - ///State transition - sets the `post` field to Set 57 - pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 58 - impl<S: State> sealed::Sealed for SetPost<S> {} 59 - impl<S: State> State for SetPost<S> { 60 - type Post = Set<members::post>; 61 - type Reply = S::Reply; 54 + type Post = Unset; 62 55 } 63 56 ///State transition - sets the `reply` field to Set 64 57 pub struct SetReply<S: State = Empty>(PhantomData<fn() -> S>); 65 58 impl<S: State> sealed::Sealed for SetReply<S> {} 66 59 impl<S: State> State for SetReply<S> { 67 - type Post = S::Post; 68 60 type Reply = Set<members::reply>; 61 + type Post = S::Post; 62 + } 63 + ///State transition - sets the `post` field to Set 64 + pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetPost<S> {} 66 + impl<S: State> State for SetPost<S> { 67 + type Reply = S::Reply; 68 + type Post = Set<members::post>; 69 69 } 70 70 /// Marker types for field names 71 71 #[allow(non_camel_case_types)] 72 72 pub mod members { 73 - ///Marker type for the `post` field 74 - pub struct post(()); 75 73 ///Marker type for the `reply` field 76 74 pub struct reply(()); 75 + ///Marker type for the `post` field 76 + pub struct post(()); 77 77 } 78 78 } 79 79 ··· 143 143 impl<'a, S> ActivitySubscriptionBuilder<'a, S> 144 144 where 145 145 S: activity_subscription_state::State, 146 - S::Post: activity_subscription_state::IsSet, 147 146 S::Reply: activity_subscription_state::IsSet, 147 + S::Post: activity_subscription_state::IsSet, 148 148 { 149 149 /// Build the final struct 150 150 pub fn build(self) -> ActivitySubscription<'a> { ··· 601 601 } 602 602 /// State trait tracking which required fields have been set 603 603 pub trait State: sealed::Sealed { 604 - type Include; 605 604 type Push; 605 + type Include; 606 606 } 607 607 /// Empty state - all required fields are unset 608 608 pub struct Empty(()); 609 609 impl sealed::Sealed for Empty {} 610 610 impl State for Empty { 611 - type Include = Unset; 612 611 type Push = Unset; 613 - } 614 - ///State transition - sets the `include` field to Set 615 - pub struct SetInclude<S: State = Empty>(PhantomData<fn() -> S>); 616 - impl<S: State> sealed::Sealed for SetInclude<S> {} 617 - impl<S: State> State for SetInclude<S> { 618 - type Include = Set<members::include>; 619 - type Push = S::Push; 612 + type Include = Unset; 620 613 } 621 614 ///State transition - sets the `push` field to Set 622 615 pub struct SetPush<S: State = Empty>(PhantomData<fn() -> S>); 623 616 impl<S: State> sealed::Sealed for SetPush<S> {} 624 617 impl<S: State> State for SetPush<S> { 625 - type Include = S::Include; 626 618 type Push = Set<members::push>; 619 + type Include = S::Include; 620 + } 621 + ///State transition - sets the `include` field to Set 622 + pub struct SetInclude<S: State = Empty>(PhantomData<fn() -> S>); 623 + impl<S: State> sealed::Sealed for SetInclude<S> {} 624 + impl<S: State> State for SetInclude<S> { 625 + type Push = S::Push; 626 + type Include = Set<members::include>; 627 627 } 628 628 /// Marker types for field names 629 629 #[allow(non_camel_case_types)] 630 630 pub mod members { 631 - ///Marker type for the `include` field 632 - pub struct include(()); 633 631 ///Marker type for the `push` field 634 632 pub struct push(()); 633 + ///Marker type for the `include` field 634 + pub struct include(()); 635 635 } 636 636 } 637 637 ··· 704 704 impl<'a, S> ChatPreferenceBuilder<'a, S> 705 705 where 706 706 S: chat_preference_state::State, 707 - S::Include: chat_preference_state::IsSet, 708 707 S::Push: chat_preference_state::IsSet, 708 + S::Include: chat_preference_state::IsSet, 709 709 { 710 710 /// Build the final struct 711 711 pub fn build(self) -> ChatPreference<'a> { ··· 867 867 /// State trait tracking which required fields have been set 868 868 pub trait State: sealed::Sealed { 869 869 type Push; 870 - type List; 871 870 type Include; 871 + type List; 872 872 } 873 873 /// Empty state - all required fields are unset 874 874 pub struct Empty(()); 875 875 impl sealed::Sealed for Empty {} 876 876 impl State for Empty { 877 877 type Push = Unset; 878 - type List = Unset; 879 878 type Include = Unset; 879 + type List = Unset; 880 880 } 881 881 ///State transition - sets the `push` field to Set 882 882 pub struct SetPush<S: State = Empty>(PhantomData<fn() -> S>); 883 883 impl<S: State> sealed::Sealed for SetPush<S> {} 884 884 impl<S: State> State for SetPush<S> { 885 885 type Push = Set<members::push>; 886 - type List = S::List; 887 - type Include = S::Include; 888 - } 889 - ///State transition - sets the `list` field to Set 890 - pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 891 - impl<S: State> sealed::Sealed for SetList<S> {} 892 - impl<S: State> State for SetList<S> { 893 - type Push = S::Push; 894 - type List = Set<members::list>; 895 886 type Include = S::Include; 887 + type List = S::List; 896 888 } 897 889 ///State transition - sets the `include` field to Set 898 890 pub struct SetInclude<S: State = Empty>(PhantomData<fn() -> S>); 899 891 impl<S: State> sealed::Sealed for SetInclude<S> {} 900 892 impl<S: State> State for SetInclude<S> { 901 893 type Push = S::Push; 894 + type Include = Set<members::include>; 902 895 type List = S::List; 903 - type Include = Set<members::include>; 896 + } 897 + ///State transition - sets the `list` field to Set 898 + pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 899 + impl<S: State> sealed::Sealed for SetList<S> {} 900 + impl<S: State> State for SetList<S> { 901 + type Push = S::Push; 902 + type Include = S::Include; 903 + type List = Set<members::list>; 904 904 } 905 905 /// Marker types for field names 906 906 #[allow(non_camel_case_types)] 907 907 pub mod members { 908 908 ///Marker type for the `push` field 909 909 pub struct push(()); 910 + ///Marker type for the `include` field 911 + pub struct include(()); 910 912 ///Marker type for the `list` field 911 913 pub struct list(()); 912 - ///Marker type for the `include` field 913 - pub struct include(()); 914 914 } 915 915 } 916 916 ··· 1004 1004 where 1005 1005 S: filterable_preference_state::State, 1006 1006 S::Push: filterable_preference_state::IsSet, 1007 - S::List: filterable_preference_state::IsSet, 1008 1007 S::Include: filterable_preference_state::IsSet, 1008 + S::List: filterable_preference_state::IsSet, 1009 1009 { 1010 1010 /// Build the final struct 1011 1011 pub fn build(self) -> FilterablePreference<'a> { ··· 1360 1360 } 1361 1361 /// State trait tracking which required fields have been set 1362 1362 pub trait State: sealed::Sealed { 1363 - type Mention; 1364 - type LikeViaRepost; 1365 - type Reply; 1366 - type Quote; 1367 - type Repost; 1368 - type Follow; 1363 + type SubscribedPost; 1369 1364 type RepostViaRepost; 1370 1365 type Unverified; 1366 + type Verified; 1367 + type Like; 1368 + type Repost; 1369 + type Quote; 1370 + type Mention; 1371 1371 type StarterpackJoined; 1372 + type Follow; 1373 + type Reply; 1372 1374 type Chat; 1373 - type Like; 1374 - type SubscribedPost; 1375 - type Verified; 1375 + type LikeViaRepost; 1376 1376 } 1377 1377 /// Empty state - all required fields are unset 1378 1378 pub struct Empty(()); 1379 1379 impl sealed::Sealed for Empty {} 1380 1380 impl State for Empty { 1381 - type Mention = Unset; 1382 - type LikeViaRepost = Unset; 1383 - type Reply = Unset; 1384 - type Quote = Unset; 1385 - type Repost = Unset; 1386 - type Follow = Unset; 1381 + type SubscribedPost = Unset; 1387 1382 type RepostViaRepost = Unset; 1388 1383 type Unverified = Unset; 1384 + type Verified = Unset; 1385 + type Like = Unset; 1386 + type Repost = Unset; 1387 + type Quote = Unset; 1388 + type Mention = Unset; 1389 1389 type StarterpackJoined = Unset; 1390 + type Follow = Unset; 1391 + type Reply = Unset; 1390 1392 type Chat = Unset; 1391 - type Like = Unset; 1392 - type SubscribedPost = Unset; 1393 - type Verified = Unset; 1393 + type LikeViaRepost = Unset; 1394 1394 } 1395 - ///State transition - sets the `mention` field to Set 1396 - pub struct SetMention<S: State = Empty>(PhantomData<fn() -> S>); 1397 - impl<S: State> sealed::Sealed for SetMention<S> {} 1398 - impl<S: State> State for SetMention<S> { 1399 - type Mention = Set<members::mention>; 1400 - type LikeViaRepost = S::LikeViaRepost; 1401 - type Reply = S::Reply; 1402 - type Quote = S::Quote; 1403 - type Repost = S::Repost; 1404 - type Follow = S::Follow; 1395 + ///State transition - sets the `subscribed_post` field to Set 1396 + pub struct SetSubscribedPost<S: State = Empty>(PhantomData<fn() -> S>); 1397 + impl<S: State> sealed::Sealed for SetSubscribedPost<S> {} 1398 + impl<S: State> State for SetSubscribedPost<S> { 1399 + type SubscribedPost = Set<members::subscribed_post>; 1405 1400 type RepostViaRepost = S::RepostViaRepost; 1406 1401 type Unverified = S::Unverified; 1402 + type Verified = S::Verified; 1403 + type Like = S::Like; 1404 + type Repost = S::Repost; 1405 + type Quote = S::Quote; 1406 + type Mention = S::Mention; 1407 1407 type StarterpackJoined = S::StarterpackJoined; 1408 + type Follow = S::Follow; 1409 + type Reply = S::Reply; 1408 1410 type Chat = S::Chat; 1409 - type Like = S::Like; 1411 + type LikeViaRepost = S::LikeViaRepost; 1412 + } 1413 + ///State transition - sets the `repost_via_repost` field to Set 1414 + pub struct SetRepostViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1415 + impl<S: State> sealed::Sealed for SetRepostViaRepost<S> {} 1416 + impl<S: State> State for SetRepostViaRepost<S> { 1410 1417 type SubscribedPost = S::SubscribedPost; 1418 + type RepostViaRepost = Set<members::repost_via_repost>; 1419 + type Unverified = S::Unverified; 1411 1420 type Verified = S::Verified; 1412 - } 1413 - ///State transition - sets the `like_via_repost` field to Set 1414 - pub struct SetLikeViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1415 - impl<S: State> sealed::Sealed for SetLikeViaRepost<S> {} 1416 - impl<S: State> State for SetLikeViaRepost<S> { 1417 - type Mention = S::Mention; 1418 - type LikeViaRepost = Set<members::like_via_repost>; 1419 - type Reply = S::Reply; 1420 - type Quote = S::Quote; 1421 + type Like = S::Like; 1421 1422 type Repost = S::Repost; 1423 + type Quote = S::Quote; 1424 + type Mention = S::Mention; 1425 + type StarterpackJoined = S::StarterpackJoined; 1422 1426 type Follow = S::Follow; 1423 - type RepostViaRepost = S::RepostViaRepost; 1424 - type Unverified = S::Unverified; 1425 - type StarterpackJoined = S::StarterpackJoined; 1427 + type Reply = S::Reply; 1426 1428 type Chat = S::Chat; 1427 - type Like = S::Like; 1429 + type LikeViaRepost = S::LikeViaRepost; 1430 + } 1431 + ///State transition - sets the `unverified` field to Set 1432 + pub struct SetUnverified<S: State = Empty>(PhantomData<fn() -> S>); 1433 + impl<S: State> sealed::Sealed for SetUnverified<S> {} 1434 + impl<S: State> State for SetUnverified<S> { 1428 1435 type SubscribedPost = S::SubscribedPost; 1436 + type RepostViaRepost = S::RepostViaRepost; 1437 + type Unverified = Set<members::unverified>; 1429 1438 type Verified = S::Verified; 1430 - } 1431 - ///State transition - sets the `reply` field to Set 1432 - pub struct SetReply<S: State = Empty>(PhantomData<fn() -> S>); 1433 - impl<S: State> sealed::Sealed for SetReply<S> {} 1434 - impl<S: State> State for SetReply<S> { 1435 - type Mention = S::Mention; 1436 - type LikeViaRepost = S::LikeViaRepost; 1437 - type Reply = Set<members::reply>; 1438 - type Quote = S::Quote; 1439 + type Like = S::Like; 1439 1440 type Repost = S::Repost; 1441 + type Quote = S::Quote; 1442 + type Mention = S::Mention; 1443 + type StarterpackJoined = S::StarterpackJoined; 1440 1444 type Follow = S::Follow; 1445 + type Reply = S::Reply; 1446 + type Chat = S::Chat; 1447 + type LikeViaRepost = S::LikeViaRepost; 1448 + } 1449 + ///State transition - sets the `verified` field to Set 1450 + pub struct SetVerified<S: State = Empty>(PhantomData<fn() -> S>); 1451 + impl<S: State> sealed::Sealed for SetVerified<S> {} 1452 + impl<S: State> State for SetVerified<S> { 1453 + type SubscribedPost = S::SubscribedPost; 1441 1454 type RepostViaRepost = S::RepostViaRepost; 1442 1455 type Unverified = S::Unverified; 1456 + type Verified = Set<members::verified>; 1457 + type Like = S::Like; 1458 + type Repost = S::Repost; 1459 + type Quote = S::Quote; 1460 + type Mention = S::Mention; 1443 1461 type StarterpackJoined = S::StarterpackJoined; 1462 + type Follow = S::Follow; 1463 + type Reply = S::Reply; 1444 1464 type Chat = S::Chat; 1445 - type Like = S::Like; 1465 + type LikeViaRepost = S::LikeViaRepost; 1466 + } 1467 + ///State transition - sets the `like` field to Set 1468 + pub struct SetLike<S: State = Empty>(PhantomData<fn() -> S>); 1469 + impl<S: State> sealed::Sealed for SetLike<S> {} 1470 + impl<S: State> State for SetLike<S> { 1446 1471 type SubscribedPost = S::SubscribedPost; 1472 + type RepostViaRepost = S::RepostViaRepost; 1473 + type Unverified = S::Unverified; 1447 1474 type Verified = S::Verified; 1448 - } 1449 - ///State transition - sets the `quote` field to Set 1450 - pub struct SetQuote<S: State = Empty>(PhantomData<fn() -> S>); 1451 - impl<S: State> sealed::Sealed for SetQuote<S> {} 1452 - impl<S: State> State for SetQuote<S> { 1453 - type Mention = S::Mention; 1454 - type LikeViaRepost = S::LikeViaRepost; 1455 - type Reply = S::Reply; 1456 - type Quote = Set<members::quote>; 1475 + type Like = Set<members::like>; 1457 1476 type Repost = S::Repost; 1477 + type Quote = S::Quote; 1478 + type Mention = S::Mention; 1479 + type StarterpackJoined = S::StarterpackJoined; 1458 1480 type Follow = S::Follow; 1459 - type RepostViaRepost = S::RepostViaRepost; 1460 - type Unverified = S::Unverified; 1461 - type StarterpackJoined = S::StarterpackJoined; 1481 + type Reply = S::Reply; 1462 1482 type Chat = S::Chat; 1463 - type Like = S::Like; 1464 - type SubscribedPost = S::SubscribedPost; 1465 - type Verified = S::Verified; 1483 + type LikeViaRepost = S::LikeViaRepost; 1466 1484 } 1467 1485 ///State transition - sets the `repost` field to Set 1468 1486 pub struct SetRepost<S: State = Empty>(PhantomData<fn() -> S>); 1469 1487 impl<S: State> sealed::Sealed for SetRepost<S> {} 1470 1488 impl<S: State> State for SetRepost<S> { 1471 - type Mention = S::Mention; 1472 - type LikeViaRepost = S::LikeViaRepost; 1473 - type Reply = S::Reply; 1474 - type Quote = S::Quote; 1475 - type Repost = Set<members::repost>; 1476 - type Follow = S::Follow; 1489 + type SubscribedPost = S::SubscribedPost; 1477 1490 type RepostViaRepost = S::RepostViaRepost; 1478 1491 type Unverified = S::Unverified; 1479 - type StarterpackJoined = S::StarterpackJoined; 1480 - type Chat = S::Chat; 1481 - type Like = S::Like; 1482 - type SubscribedPost = S::SubscribedPost; 1483 1492 type Verified = S::Verified; 1484 - } 1485 - ///State transition - sets the `follow` field to Set 1486 - pub struct SetFollow<S: State = Empty>(PhantomData<fn() -> S>); 1487 - impl<S: State> sealed::Sealed for SetFollow<S> {} 1488 - impl<S: State> State for SetFollow<S> { 1489 - type Mention = S::Mention; 1490 - type LikeViaRepost = S::LikeViaRepost; 1491 - type Reply = S::Reply; 1493 + type Like = S::Like; 1494 + type Repost = Set<members::repost>; 1492 1495 type Quote = S::Quote; 1493 - type Repost = S::Repost; 1494 - type Follow = Set<members::follow>; 1495 - type RepostViaRepost = S::RepostViaRepost; 1496 - type Unverified = S::Unverified; 1496 + type Mention = S::Mention; 1497 1497 type StarterpackJoined = S::StarterpackJoined; 1498 + type Follow = S::Follow; 1499 + type Reply = S::Reply; 1498 1500 type Chat = S::Chat; 1499 - type Like = S::Like; 1501 + type LikeViaRepost = S::LikeViaRepost; 1502 + } 1503 + ///State transition - sets the `quote` field to Set 1504 + pub struct SetQuote<S: State = Empty>(PhantomData<fn() -> S>); 1505 + impl<S: State> sealed::Sealed for SetQuote<S> {} 1506 + impl<S: State> State for SetQuote<S> { 1500 1507 type SubscribedPost = S::SubscribedPost; 1508 + type RepostViaRepost = S::RepostViaRepost; 1509 + type Unverified = S::Unverified; 1501 1510 type Verified = S::Verified; 1502 - } 1503 - ///State transition - sets the `repost_via_repost` field to Set 1504 - pub struct SetRepostViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1505 - impl<S: State> sealed::Sealed for SetRepostViaRepost<S> {} 1506 - impl<S: State> State for SetRepostViaRepost<S> { 1511 + type Like = S::Like; 1512 + type Repost = S::Repost; 1513 + type Quote = Set<members::quote>; 1507 1514 type Mention = S::Mention; 1508 - type LikeViaRepost = S::LikeViaRepost; 1509 - type Reply = S::Reply; 1510 - type Quote = S::Quote; 1511 - type Repost = S::Repost; 1512 - type Follow = S::Follow; 1513 - type RepostViaRepost = Set<members::repost_via_repost>; 1514 - type Unverified = S::Unverified; 1515 1515 type StarterpackJoined = S::StarterpackJoined; 1516 + type Follow = S::Follow; 1517 + type Reply = S::Reply; 1516 1518 type Chat = S::Chat; 1517 - type Like = S::Like; 1519 + type LikeViaRepost = S::LikeViaRepost; 1520 + } 1521 + ///State transition - sets the `mention` field to Set 1522 + pub struct SetMention<S: State = Empty>(PhantomData<fn() -> S>); 1523 + impl<S: State> sealed::Sealed for SetMention<S> {} 1524 + impl<S: State> State for SetMention<S> { 1518 1525 type SubscribedPost = S::SubscribedPost; 1526 + type RepostViaRepost = S::RepostViaRepost; 1527 + type Unverified = S::Unverified; 1519 1528 type Verified = S::Verified; 1520 - } 1521 - ///State transition - sets the `unverified` field to Set 1522 - pub struct SetUnverified<S: State = Empty>(PhantomData<fn() -> S>); 1523 - impl<S: State> sealed::Sealed for SetUnverified<S> {} 1524 - impl<S: State> State for SetUnverified<S> { 1525 - type Mention = S::Mention; 1526 - type LikeViaRepost = S::LikeViaRepost; 1527 - type Reply = S::Reply; 1528 - type Quote = S::Quote; 1529 + type Like = S::Like; 1529 1530 type Repost = S::Repost; 1530 - type Follow = S::Follow; 1531 - type RepostViaRepost = S::RepostViaRepost; 1532 - type Unverified = Set<members::unverified>; 1531 + type Quote = S::Quote; 1532 + type Mention = Set<members::mention>; 1533 1533 type StarterpackJoined = S::StarterpackJoined; 1534 + type Follow = S::Follow; 1535 + type Reply = S::Reply; 1534 1536 type Chat = S::Chat; 1535 - type Like = S::Like; 1536 - type SubscribedPost = S::SubscribedPost; 1537 - type Verified = S::Verified; 1537 + type LikeViaRepost = S::LikeViaRepost; 1538 1538 } 1539 1539 ///State transition - sets the `starterpack_joined` field to Set 1540 1540 pub struct SetStarterpackJoined<S: State = Empty>(PhantomData<fn() -> S>); 1541 1541 impl<S: State> sealed::Sealed for SetStarterpackJoined<S> {} 1542 1542 impl<S: State> State for SetStarterpackJoined<S> { 1543 - type Mention = S::Mention; 1544 - type LikeViaRepost = S::LikeViaRepost; 1545 - type Reply = S::Reply; 1546 - type Quote = S::Quote; 1547 - type Repost = S::Repost; 1548 - type Follow = S::Follow; 1543 + type SubscribedPost = S::SubscribedPost; 1549 1544 type RepostViaRepost = S::RepostViaRepost; 1550 1545 type Unverified = S::Unverified; 1546 + type Verified = S::Verified; 1547 + type Like = S::Like; 1548 + type Repost = S::Repost; 1549 + type Quote = S::Quote; 1550 + type Mention = S::Mention; 1551 1551 type StarterpackJoined = Set<members::starterpack_joined>; 1552 + type Follow = S::Follow; 1553 + type Reply = S::Reply; 1552 1554 type Chat = S::Chat; 1553 - type Like = S::Like; 1555 + type LikeViaRepost = S::LikeViaRepost; 1556 + } 1557 + ///State transition - sets the `follow` field to Set 1558 + pub struct SetFollow<S: State = Empty>(PhantomData<fn() -> S>); 1559 + impl<S: State> sealed::Sealed for SetFollow<S> {} 1560 + impl<S: State> State for SetFollow<S> { 1554 1561 type SubscribedPost = S::SubscribedPost; 1555 - type Verified = S::Verified; 1556 - } 1557 - ///State transition - sets the `chat` field to Set 1558 - pub struct SetChat<S: State = Empty>(PhantomData<fn() -> S>); 1559 - impl<S: State> sealed::Sealed for SetChat<S> {} 1560 - impl<S: State> State for SetChat<S> { 1561 - type Mention = S::Mention; 1562 - type LikeViaRepost = S::LikeViaRepost; 1563 - type Reply = S::Reply; 1564 - type Quote = S::Quote; 1565 - type Repost = S::Repost; 1566 - type Follow = S::Follow; 1567 1562 type RepostViaRepost = S::RepostViaRepost; 1568 1563 type Unverified = S::Unverified; 1569 - type StarterpackJoined = S::StarterpackJoined; 1570 - type Chat = Set<members::chat>; 1571 - type Like = S::Like; 1572 - type SubscribedPost = S::SubscribedPost; 1573 1564 type Verified = S::Verified; 1574 - } 1575 - ///State transition - sets the `like` field to Set 1576 - pub struct SetLike<S: State = Empty>(PhantomData<fn() -> S>); 1577 - impl<S: State> sealed::Sealed for SetLike<S> {} 1578 - impl<S: State> State for SetLike<S> { 1565 + type Like = S::Like; 1566 + type Repost = S::Repost; 1567 + type Quote = S::Quote; 1579 1568 type Mention = S::Mention; 1580 - type LikeViaRepost = S::LikeViaRepost; 1581 - type Reply = S::Reply; 1582 - type Quote = S::Quote; 1583 - type Repost = S::Repost; 1584 - type Follow = S::Follow; 1585 - type RepostViaRepost = S::RepostViaRepost; 1586 - type Unverified = S::Unverified; 1587 1569 type StarterpackJoined = S::StarterpackJoined; 1570 + type Follow = Set<members::follow>; 1571 + type Reply = S::Reply; 1588 1572 type Chat = S::Chat; 1589 - type Like = Set<members::like>; 1573 + type LikeViaRepost = S::LikeViaRepost; 1574 + } 1575 + ///State transition - sets the `reply` field to Set 1576 + pub struct SetReply<S: State = Empty>(PhantomData<fn() -> S>); 1577 + impl<S: State> sealed::Sealed for SetReply<S> {} 1578 + impl<S: State> State for SetReply<S> { 1590 1579 type SubscribedPost = S::SubscribedPost; 1580 + type RepostViaRepost = S::RepostViaRepost; 1581 + type Unverified = S::Unverified; 1591 1582 type Verified = S::Verified; 1592 - } 1593 - ///State transition - sets the `subscribed_post` field to Set 1594 - pub struct SetSubscribedPost<S: State = Empty>(PhantomData<fn() -> S>); 1595 - impl<S: State> sealed::Sealed for SetSubscribedPost<S> {} 1596 - impl<S: State> State for SetSubscribedPost<S> { 1597 - type Mention = S::Mention; 1598 - type LikeViaRepost = S::LikeViaRepost; 1599 - type Reply = S::Reply; 1600 - type Quote = S::Quote; 1583 + type Like = S::Like; 1601 1584 type Repost = S::Repost; 1585 + type Quote = S::Quote; 1586 + type Mention = S::Mention; 1587 + type StarterpackJoined = S::StarterpackJoined; 1602 1588 type Follow = S::Follow; 1589 + type Reply = Set<members::reply>; 1590 + type Chat = S::Chat; 1591 + type LikeViaRepost = S::LikeViaRepost; 1592 + } 1593 + ///State transition - sets the `chat` field to Set 1594 + pub struct SetChat<S: State = Empty>(PhantomData<fn() -> S>); 1595 + impl<S: State> sealed::Sealed for SetChat<S> {} 1596 + impl<S: State> State for SetChat<S> { 1597 + type SubscribedPost = S::SubscribedPost; 1603 1598 type RepostViaRepost = S::RepostViaRepost; 1604 1599 type Unverified = S::Unverified; 1605 - type StarterpackJoined = S::StarterpackJoined; 1606 - type Chat = S::Chat; 1600 + type Verified = S::Verified; 1607 1601 type Like = S::Like; 1608 - type SubscribedPost = Set<members::subscribed_post>; 1609 - type Verified = S::Verified; 1610 - } 1611 - ///State transition - sets the `verified` field to Set 1612 - pub struct SetVerified<S: State = Empty>(PhantomData<fn() -> S>); 1613 - impl<S: State> sealed::Sealed for SetVerified<S> {} 1614 - impl<S: State> State for SetVerified<S> { 1602 + type Repost = S::Repost; 1603 + type Quote = S::Quote; 1615 1604 type Mention = S::Mention; 1605 + type StarterpackJoined = S::StarterpackJoined; 1606 + type Follow = S::Follow; 1607 + type Reply = S::Reply; 1608 + type Chat = Set<members::chat>; 1616 1609 type LikeViaRepost = S::LikeViaRepost; 1617 - type Reply = S::Reply; 1618 - type Quote = S::Quote; 1619 - type Repost = S::Repost; 1620 - type Follow = S::Follow; 1610 + } 1611 + ///State transition - sets the `like_via_repost` field to Set 1612 + pub struct SetLikeViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1613 + impl<S: State> sealed::Sealed for SetLikeViaRepost<S> {} 1614 + impl<S: State> State for SetLikeViaRepost<S> { 1615 + type SubscribedPost = S::SubscribedPost; 1621 1616 type RepostViaRepost = S::RepostViaRepost; 1622 1617 type Unverified = S::Unverified; 1618 + type Verified = S::Verified; 1619 + type Like = S::Like; 1620 + type Repost = S::Repost; 1621 + type Quote = S::Quote; 1622 + type Mention = S::Mention; 1623 1623 type StarterpackJoined = S::StarterpackJoined; 1624 + type Follow = S::Follow; 1625 + type Reply = S::Reply; 1624 1626 type Chat = S::Chat; 1625 - type Like = S::Like; 1626 - type SubscribedPost = S::SubscribedPost; 1627 - type Verified = Set<members::verified>; 1627 + type LikeViaRepost = Set<members::like_via_repost>; 1628 1628 } 1629 1629 /// Marker types for field names 1630 1630 #[allow(non_camel_case_types)] 1631 1631 pub mod members { 1632 - ///Marker type for the `mention` field 1633 - pub struct mention(()); 1634 - ///Marker type for the `like_via_repost` field 1635 - pub struct like_via_repost(()); 1636 - ///Marker type for the `reply` field 1637 - pub struct reply(()); 1638 - ///Marker type for the `quote` field 1639 - pub struct quote(()); 1640 - ///Marker type for the `repost` field 1641 - pub struct repost(()); 1642 - ///Marker type for the `follow` field 1643 - pub struct follow(()); 1632 + ///Marker type for the `subscribed_post` field 1633 + pub struct subscribed_post(()); 1644 1634 ///Marker type for the `repost_via_repost` field 1645 1635 pub struct repost_via_repost(()); 1646 1636 ///Marker type for the `unverified` field 1647 1637 pub struct unverified(()); 1638 + ///Marker type for the `verified` field 1639 + pub struct verified(()); 1640 + ///Marker type for the `like` field 1641 + pub struct like(()); 1642 + ///Marker type for the `repost` field 1643 + pub struct repost(()); 1644 + ///Marker type for the `quote` field 1645 + pub struct quote(()); 1646 + ///Marker type for the `mention` field 1647 + pub struct mention(()); 1648 1648 ///Marker type for the `starterpack_joined` field 1649 1649 pub struct starterpack_joined(()); 1650 + ///Marker type for the `follow` field 1651 + pub struct follow(()); 1652 + ///Marker type for the `reply` field 1653 + pub struct reply(()); 1650 1654 ///Marker type for the `chat` field 1651 1655 pub struct chat(()); 1652 - ///Marker type for the `like` field 1653 - pub struct like(()); 1654 - ///Marker type for the `subscribed_post` field 1655 - pub struct subscribed_post(()); 1656 - ///Marker type for the `verified` field 1657 - pub struct verified(()); 1656 + ///Marker type for the `like_via_repost` field 1657 + pub struct like_via_repost(()); 1658 1658 } 1659 1659 } 1660 1660 ··· 1961 1961 impl<'a, S> PreferencesBuilder<'a, S> 1962 1962 where 1963 1963 S: preferences_state::State, 1964 - S::Mention: preferences_state::IsSet, 1965 - S::LikeViaRepost: preferences_state::IsSet, 1966 - S::Reply: preferences_state::IsSet, 1967 - S::Quote: preferences_state::IsSet, 1968 - S::Repost: preferences_state::IsSet, 1969 - S::Follow: preferences_state::IsSet, 1964 + S::SubscribedPost: preferences_state::IsSet, 1970 1965 S::RepostViaRepost: preferences_state::IsSet, 1971 1966 S::Unverified: preferences_state::IsSet, 1967 + S::Verified: preferences_state::IsSet, 1968 + S::Like: preferences_state::IsSet, 1969 + S::Repost: preferences_state::IsSet, 1970 + S::Quote: preferences_state::IsSet, 1971 + S::Mention: preferences_state::IsSet, 1972 1972 S::StarterpackJoined: preferences_state::IsSet, 1973 + S::Follow: preferences_state::IsSet, 1974 + S::Reply: preferences_state::IsSet, 1973 1975 S::Chat: preferences_state::IsSet, 1974 - S::Like: preferences_state::IsSet, 1975 - S::SubscribedPost: preferences_state::IsSet, 1976 - S::Verified: preferences_state::IsSet, 1976 + S::LikeViaRepost: preferences_state::IsSet, 1977 1977 { 1978 1978 /// Build the final struct 1979 1979 pub fn build(self) -> Preferences<'a> { ··· 2097 2097 } 2098 2098 /// State trait tracking which required fields have been set 2099 2099 pub trait State: sealed::Sealed { 2100 - type ActivitySubscription; 2101 2100 type Subject; 2101 + type ActivitySubscription; 2102 2102 } 2103 2103 /// Empty state - all required fields are unset 2104 2104 pub struct Empty(()); 2105 2105 impl sealed::Sealed for Empty {} 2106 2106 impl State for Empty { 2107 - type ActivitySubscription = Unset; 2108 2107 type Subject = Unset; 2109 - } 2110 - ///State transition - sets the `activity_subscription` field to Set 2111 - pub struct SetActivitySubscription<S: State = Empty>(PhantomData<fn() -> S>); 2112 - impl<S: State> sealed::Sealed for SetActivitySubscription<S> {} 2113 - impl<S: State> State for SetActivitySubscription<S> { 2114 - type ActivitySubscription = Set<members::activity_subscription>; 2115 - type Subject = S::Subject; 2108 + type ActivitySubscription = Unset; 2116 2109 } 2117 2110 ///State transition - sets the `subject` field to Set 2118 2111 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 2119 2112 impl<S: State> sealed::Sealed for SetSubject<S> {} 2120 2113 impl<S: State> State for SetSubject<S> { 2121 - type ActivitySubscription = S::ActivitySubscription; 2122 2114 type Subject = Set<members::subject>; 2115 + type ActivitySubscription = S::ActivitySubscription; 2116 + } 2117 + ///State transition - sets the `activity_subscription` field to Set 2118 + pub struct SetActivitySubscription<S: State = Empty>(PhantomData<fn() -> S>); 2119 + impl<S: State> sealed::Sealed for SetActivitySubscription<S> {} 2120 + impl<S: State> State for SetActivitySubscription<S> { 2121 + type Subject = S::Subject; 2122 + type ActivitySubscription = Set<members::activity_subscription>; 2123 2123 } 2124 2124 /// Marker types for field names 2125 2125 #[allow(non_camel_case_types)] 2126 2126 pub mod members { 2127 + ///Marker type for the `subject` field 2128 + pub struct subject(()); 2127 2129 ///Marker type for the `activity_subscription` field 2128 2130 pub struct activity_subscription(()); 2129 - ///Marker type for the `subject` field 2130 - pub struct subject(()); 2131 2131 } 2132 2132 } 2133 2133 ··· 2214 2214 impl<'a, S> SubjectActivitySubscriptionBuilder<'a, S> 2215 2215 where 2216 2216 S: subject_activity_subscription_state::State, 2217 - S::ActivitySubscription: subject_activity_subscription_state::IsSet, 2218 2217 S::Subject: subject_activity_subscription_state::IsSet, 2218 + S::ActivitySubscription: subject_activity_subscription_state::IsSet, 2219 2219 { 2220 2220 /// Build the final struct 2221 2221 pub fn build(self) -> SubjectActivitySubscription<'a> {
+52 -52
crates/weaver-api/src/app_bsky/notification/list_notifications.rs
··· 271 271 } 272 272 /// State trait tracking which required fields have been set 273 273 pub trait State: sealed::Sealed { 274 - type Uri; 275 274 type Cid; 276 - type Record; 277 275 type Author; 276 + type Record; 277 + type IsRead; 278 278 type Reason; 279 - type IsRead; 279 + type Uri; 280 280 type IndexedAt; 281 281 } 282 282 /// Empty state - all required fields are unset 283 283 pub struct Empty(()); 284 284 impl sealed::Sealed for Empty {} 285 285 impl State for Empty { 286 - type Uri = Unset; 287 286 type Cid = Unset; 288 - type Record = Unset; 289 287 type Author = Unset; 290 - type Reason = Unset; 288 + type Record = Unset; 291 289 type IsRead = Unset; 290 + type Reason = Unset; 291 + type Uri = Unset; 292 292 type IndexedAt = Unset; 293 293 } 294 - ///State transition - sets the `uri` field to Set 295 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 296 - impl<S: State> sealed::Sealed for SetUri<S> {} 297 - impl<S: State> State for SetUri<S> { 298 - type Uri = Set<members::uri>; 299 - type Cid = S::Cid; 300 - type Record = S::Record; 301 - type Author = S::Author; 302 - type Reason = S::Reason; 303 - type IsRead = S::IsRead; 304 - type IndexedAt = S::IndexedAt; 305 - } 306 294 ///State transition - sets the `cid` field to Set 307 295 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 308 296 impl<S: State> sealed::Sealed for SetCid<S> {} 309 297 impl<S: State> State for SetCid<S> { 310 - type Uri = S::Uri; 311 298 type Cid = Set<members::cid>; 299 + type Author = S::Author; 312 300 type Record = S::Record; 313 - type Author = S::Author; 301 + type IsRead = S::IsRead; 314 302 type Reason = S::Reason; 303 + type Uri = S::Uri; 304 + type IndexedAt = S::IndexedAt; 305 + } 306 + ///State transition - sets the `author` field to Set 307 + pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 308 + impl<S: State> sealed::Sealed for SetAuthor<S> {} 309 + impl<S: State> State for SetAuthor<S> { 310 + type Cid = S::Cid; 311 + type Author = Set<members::author>; 312 + type Record = S::Record; 315 313 type IsRead = S::IsRead; 314 + type Reason = S::Reason; 315 + type Uri = S::Uri; 316 316 type IndexedAt = S::IndexedAt; 317 317 } 318 318 ///State transition - sets the `record` field to Set 319 319 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 320 320 impl<S: State> sealed::Sealed for SetRecord<S> {} 321 321 impl<S: State> State for SetRecord<S> { 322 - type Uri = S::Uri; 323 322 type Cid = S::Cid; 324 - type Record = Set<members::record>; 325 323 type Author = S::Author; 326 - type Reason = S::Reason; 324 + type Record = Set<members::record>; 327 325 type IsRead = S::IsRead; 326 + type Reason = S::Reason; 327 + type Uri = S::Uri; 328 328 type IndexedAt = S::IndexedAt; 329 329 } 330 - ///State transition - sets the `author` field to Set 331 - pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 332 - impl<S: State> sealed::Sealed for SetAuthor<S> {} 333 - impl<S: State> State for SetAuthor<S> { 334 - type Uri = S::Uri; 330 + ///State transition - sets the `is_read` field to Set 331 + pub struct SetIsRead<S: State = Empty>(PhantomData<fn() -> S>); 332 + impl<S: State> sealed::Sealed for SetIsRead<S> {} 333 + impl<S: State> State for SetIsRead<S> { 335 334 type Cid = S::Cid; 335 + type Author = S::Author; 336 336 type Record = S::Record; 337 - type Author = Set<members::author>; 337 + type IsRead = Set<members::is_read>; 338 338 type Reason = S::Reason; 339 - type IsRead = S::IsRead; 339 + type Uri = S::Uri; 340 340 type IndexedAt = S::IndexedAt; 341 341 } 342 342 ///State transition - sets the `reason` field to Set 343 343 pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 344 344 impl<S: State> sealed::Sealed for SetReason<S> {} 345 345 impl<S: State> State for SetReason<S> { 346 - type Uri = S::Uri; 347 346 type Cid = S::Cid; 347 + type Author = S::Author; 348 348 type Record = S::Record; 349 - type Author = S::Author; 349 + type IsRead = S::IsRead; 350 350 type Reason = Set<members::reason>; 351 - type IsRead = S::IsRead; 351 + type Uri = S::Uri; 352 352 type IndexedAt = S::IndexedAt; 353 353 } 354 - ///State transition - sets the `is_read` field to Set 355 - pub struct SetIsRead<S: State = Empty>(PhantomData<fn() -> S>); 356 - impl<S: State> sealed::Sealed for SetIsRead<S> {} 357 - impl<S: State> State for SetIsRead<S> { 358 - type Uri = S::Uri; 354 + ///State transition - sets the `uri` field to Set 355 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 356 + impl<S: State> sealed::Sealed for SetUri<S> {} 357 + impl<S: State> State for SetUri<S> { 359 358 type Cid = S::Cid; 359 + type Author = S::Author; 360 360 type Record = S::Record; 361 - type Author = S::Author; 361 + type IsRead = S::IsRead; 362 362 type Reason = S::Reason; 363 - type IsRead = Set<members::is_read>; 363 + type Uri = Set<members::uri>; 364 364 type IndexedAt = S::IndexedAt; 365 365 } 366 366 ///State transition - sets the `indexed_at` field to Set 367 367 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 368 368 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 369 369 impl<S: State> State for SetIndexedAt<S> { 370 - type Uri = S::Uri; 371 370 type Cid = S::Cid; 372 - type Record = S::Record; 373 371 type Author = S::Author; 374 - type Reason = S::Reason; 372 + type Record = S::Record; 375 373 type IsRead = S::IsRead; 374 + type Reason = S::Reason; 375 + type Uri = S::Uri; 376 376 type IndexedAt = Set<members::indexed_at>; 377 377 } 378 378 /// Marker types for field names 379 379 #[allow(non_camel_case_types)] 380 380 pub mod members { 381 - ///Marker type for the `uri` field 382 - pub struct uri(()); 383 381 ///Marker type for the `cid` field 384 382 pub struct cid(()); 385 - ///Marker type for the `record` field 386 - pub struct record(()); 387 383 ///Marker type for the `author` field 388 384 pub struct author(()); 389 - ///Marker type for the `reason` field 390 - pub struct reason(()); 385 + ///Marker type for the `record` field 386 + pub struct record(()); 391 387 ///Marker type for the `is_read` field 392 388 pub struct is_read(()); 389 + ///Marker type for the `reason` field 390 + pub struct reason(()); 391 + ///Marker type for the `uri` field 392 + pub struct uri(()); 393 393 ///Marker type for the `indexed_at` field 394 394 pub struct indexed_at(()); 395 395 } ··· 614 614 impl<'a, S> NotificationBuilder<'a, S> 615 615 where 616 616 S: notification_state::State, 617 - S::Uri: notification_state::IsSet, 618 617 S::Cid: notification_state::IsSet, 619 - S::Record: notification_state::IsSet, 620 618 S::Author: notification_state::IsSet, 621 - S::Reason: notification_state::IsSet, 619 + S::Record: notification_state::IsSet, 622 620 S::IsRead: notification_state::IsSet, 621 + S::Reason: notification_state::IsSet, 622 + S::Uri: notification_state::IsSet, 623 623 S::IndexedAt: notification_state::IsSet, 624 624 { 625 625 /// Build the final struct
+13 -13
crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Subject; 37 36 type ActivitySubscription; 37 + type Subject; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Subject = Unset; 44 43 type ActivitySubscription = Unset; 45 - } 46 - ///State transition - sets the `subject` field to Set 47 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetSubject<S> {} 49 - impl<S: State> State for SetSubject<S> { 50 - type Subject = Set<members::subject>; 51 - type ActivitySubscription = S::ActivitySubscription; 44 + type Subject = Unset; 52 45 } 53 46 ///State transition - sets the `activity_subscription` field to Set 54 47 pub struct SetActivitySubscription<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetActivitySubscription<S> {} 56 49 impl<S: State> State for SetActivitySubscription<S> { 57 - type Subject = S::Subject; 58 50 type ActivitySubscription = Set<members::activity_subscription>; 51 + type Subject = S::Subject; 52 + } 53 + ///State transition - sets the `subject` field to Set 54 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetSubject<S> {} 56 + impl<S: State> State for SetSubject<S> { 57 + type ActivitySubscription = S::ActivitySubscription; 58 + type Subject = Set<members::subject>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `subject` field 64 - pub struct subject(()); 65 63 ///Marker type for the `activity_subscription` field 66 64 pub struct activity_subscription(()); 65 + ///Marker type for the `subject` field 66 + pub struct subject(()); 67 67 } 68 68 } 69 69 ··· 148 148 impl<'a, S> PutActivitySubscriptionBuilder<'a, S> 149 149 where 150 150 S: put_activity_subscription_state::State, 151 - S::Subject: put_activity_subscription_state::IsSet, 152 151 S::ActivitySubscription: put_activity_subscription_state::IsSet, 152 + S::Subject: put_activity_subscription_state::IsSet, 153 153 { 154 154 /// Build the final struct 155 155 pub fn build(self) -> PutActivitySubscription<'a> {
+32 -32
crates/weaver-api/src/app_bsky/notification/register_push.rs
··· 40 40 } 41 41 /// State trait tracking which required fields have been set 42 42 pub trait State: sealed::Sealed { 43 - type Token; 44 - type ServiceDid; 45 43 type Platform; 46 44 type AppId; 45 + type ServiceDid; 46 + type Token; 47 47 } 48 48 /// Empty state - all required fields are unset 49 49 pub struct Empty(()); 50 50 impl sealed::Sealed for Empty {} 51 51 impl State for Empty { 52 - type Token = Unset; 53 - type ServiceDid = Unset; 54 52 type Platform = Unset; 55 53 type AppId = Unset; 56 - } 57 - ///State transition - sets the `token` field to Set 58 - pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 59 - impl<S: State> sealed::Sealed for SetToken<S> {} 60 - impl<S: State> State for SetToken<S> { 61 - type Token = Set<members::token>; 62 - type ServiceDid = S::ServiceDid; 63 - type Platform = S::Platform; 64 - type AppId = S::AppId; 65 - } 66 - ///State transition - sets the `service_did` field to Set 67 - pub struct SetServiceDid<S: State = Empty>(PhantomData<fn() -> S>); 68 - impl<S: State> sealed::Sealed for SetServiceDid<S> {} 69 - impl<S: State> State for SetServiceDid<S> { 70 - type Token = S::Token; 71 - type ServiceDid = Set<members::service_did>; 72 - type Platform = S::Platform; 73 - type AppId = S::AppId; 54 + type ServiceDid = Unset; 55 + type Token = Unset; 74 56 } 75 57 ///State transition - sets the `platform` field to Set 76 58 pub struct SetPlatform<S: State = Empty>(PhantomData<fn() -> S>); 77 59 impl<S: State> sealed::Sealed for SetPlatform<S> {} 78 60 impl<S: State> State for SetPlatform<S> { 79 - type Token = S::Token; 80 - type ServiceDid = S::ServiceDid; 81 61 type Platform = Set<members::platform>; 82 62 type AppId = S::AppId; 63 + type ServiceDid = S::ServiceDid; 64 + type Token = S::Token; 83 65 } 84 66 ///State transition - sets the `app_id` field to Set 85 67 pub struct SetAppId<S: State = Empty>(PhantomData<fn() -> S>); 86 68 impl<S: State> sealed::Sealed for SetAppId<S> {} 87 69 impl<S: State> State for SetAppId<S> { 70 + type Platform = S::Platform; 71 + type AppId = Set<members::app_id>; 72 + type ServiceDid = S::ServiceDid; 88 73 type Token = S::Token; 89 - type ServiceDid = S::ServiceDid; 74 + } 75 + ///State transition - sets the `service_did` field to Set 76 + pub struct SetServiceDid<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetServiceDid<S> {} 78 + impl<S: State> State for SetServiceDid<S> { 90 79 type Platform = S::Platform; 91 - type AppId = Set<members::app_id>; 80 + type AppId = S::AppId; 81 + type ServiceDid = Set<members::service_did>; 82 + type Token = S::Token; 83 + } 84 + ///State transition - sets the `token` field to Set 85 + pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 86 + impl<S: State> sealed::Sealed for SetToken<S> {} 87 + impl<S: State> State for SetToken<S> { 88 + type Platform = S::Platform; 89 + type AppId = S::AppId; 90 + type ServiceDid = S::ServiceDid; 91 + type Token = Set<members::token>; 92 92 } 93 93 /// Marker types for field names 94 94 #[allow(non_camel_case_types)] 95 95 pub mod members { 96 - ///Marker type for the `token` field 97 - pub struct token(()); 98 - ///Marker type for the `service_did` field 99 - pub struct service_did(()); 100 96 ///Marker type for the `platform` field 101 97 pub struct platform(()); 102 98 ///Marker type for the `app_id` field 103 99 pub struct app_id(()); 100 + ///Marker type for the `service_did` field 101 + pub struct service_did(()); 102 + ///Marker type for the `token` field 103 + pub struct token(()); 104 104 } 105 105 } 106 106 ··· 227 227 impl<'a, S> RegisterPushBuilder<'a, S> 228 228 where 229 229 S: register_push_state::State, 230 - S::Token: register_push_state::IsSet, 231 - S::ServiceDid: register_push_state::IsSet, 232 230 S::Platform: register_push_state::IsSet, 233 231 S::AppId: register_push_state::IsSet, 232 + S::ServiceDid: register_push_state::IsSet, 233 + S::Token: register_push_state::IsSet, 234 234 { 235 235 /// Build the final struct 236 236 pub fn build(self) -> RegisterPush<'a> {
+30 -30
crates/weaver-api/src/app_bsky/notification/unregister_push.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 - type ServiceDid; 41 - type Platform; 42 40 type AppId; 41 + type ServiceDid; 43 42 type Token; 43 + type Platform; 44 44 } 45 45 /// Empty state - all required fields are unset 46 46 pub struct Empty(()); 47 47 impl sealed::Sealed for Empty {} 48 48 impl State for Empty { 49 + type AppId = Unset; 49 50 type ServiceDid = Unset; 50 - type Platform = Unset; 51 - type AppId = Unset; 52 51 type Token = Unset; 53 - } 54 - ///State transition - sets the `service_did` field to Set 55 - pub struct SetServiceDid<S: State = Empty>(PhantomData<fn() -> S>); 56 - impl<S: State> sealed::Sealed for SetServiceDid<S> {} 57 - impl<S: State> State for SetServiceDid<S> { 58 - type ServiceDid = Set<members::service_did>; 59 - type Platform = S::Platform; 60 - type AppId = S::AppId; 61 - type Token = S::Token; 62 - } 63 - ///State transition - sets the `platform` field to Set 64 - pub struct SetPlatform<S: State = Empty>(PhantomData<fn() -> S>); 65 - impl<S: State> sealed::Sealed for SetPlatform<S> {} 66 - impl<S: State> State for SetPlatform<S> { 67 - type ServiceDid = S::ServiceDid; 68 - type Platform = Set<members::platform>; 69 - type AppId = S::AppId; 70 - type Token = S::Token; 52 + type Platform = Unset; 71 53 } 72 54 ///State transition - sets the `app_id` field to Set 73 55 pub struct SetAppId<S: State = Empty>(PhantomData<fn() -> S>); 74 56 impl<S: State> sealed::Sealed for SetAppId<S> {} 75 57 impl<S: State> State for SetAppId<S> { 58 + type AppId = Set<members::app_id>; 76 59 type ServiceDid = S::ServiceDid; 60 + type Token = S::Token; 77 61 type Platform = S::Platform; 78 - type AppId = Set<members::app_id>; 62 + } 63 + ///State transition - sets the `service_did` field to Set 64 + pub struct SetServiceDid<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetServiceDid<S> {} 66 + impl<S: State> State for SetServiceDid<S> { 67 + type AppId = S::AppId; 68 + type ServiceDid = Set<members::service_did>; 79 69 type Token = S::Token; 70 + type Platform = S::Platform; 80 71 } 81 72 ///State transition - sets the `token` field to Set 82 73 pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 83 74 impl<S: State> sealed::Sealed for SetToken<S> {} 84 75 impl<S: State> State for SetToken<S> { 76 + type AppId = S::AppId; 85 77 type ServiceDid = S::ServiceDid; 78 + type Token = Set<members::token>; 86 79 type Platform = S::Platform; 80 + } 81 + ///State transition - sets the `platform` field to Set 82 + pub struct SetPlatform<S: State = Empty>(PhantomData<fn() -> S>); 83 + impl<S: State> sealed::Sealed for SetPlatform<S> {} 84 + impl<S: State> State for SetPlatform<S> { 87 85 type AppId = S::AppId; 88 - type Token = Set<members::token>; 86 + type ServiceDid = S::ServiceDid; 87 + type Token = S::Token; 88 + type Platform = Set<members::platform>; 89 89 } 90 90 /// Marker types for field names 91 91 #[allow(non_camel_case_types)] 92 92 pub mod members { 93 - ///Marker type for the `service_did` field 94 - pub struct service_did(()); 95 - ///Marker type for the `platform` field 96 - pub struct platform(()); 97 93 ///Marker type for the `app_id` field 98 94 pub struct app_id(()); 95 + ///Marker type for the `service_did` field 96 + pub struct service_did(()); 99 97 ///Marker type for the `token` field 100 98 pub struct token(()); 99 + ///Marker type for the `platform` field 100 + pub struct platform(()); 101 101 } 102 102 } 103 103 ··· 210 210 impl<'a, S> UnregisterPushBuilder<'a, S> 211 211 where 212 212 S: unregister_push_state::State, 213 - S::ServiceDid: unregister_push_state::IsSet, 214 - S::Platform: unregister_push_state::IsSet, 215 213 S::AppId: unregister_push_state::IsSet, 214 + S::ServiceDid: unregister_push_state::IsSet, 216 215 S::Token: unregister_push_state::IsSet, 216 + S::Platform: unregister_push_state::IsSet, 217 217 { 218 218 /// Build the final struct 219 219 pub fn build(self) -> UnregisterPush<'a> {
+13 -13
crates/weaver-api/src/app_bsky/richtext/facet.rs
··· 581 581 } 582 582 /// State trait tracking which required fields have been set 583 583 pub trait State: sealed::Sealed { 584 - type Features; 585 584 type Index; 585 + type Features; 586 586 } 587 587 /// Empty state - all required fields are unset 588 588 pub struct Empty(()); 589 589 impl sealed::Sealed for Empty {} 590 590 impl State for Empty { 591 - type Features = Unset; 592 591 type Index = Unset; 593 - } 594 - ///State transition - sets the `features` field to Set 595 - pub struct SetFeatures<S: State = Empty>(PhantomData<fn() -> S>); 596 - impl<S: State> sealed::Sealed for SetFeatures<S> {} 597 - impl<S: State> State for SetFeatures<S> { 598 - type Features = Set<members::features>; 599 - type Index = S::Index; 592 + type Features = Unset; 600 593 } 601 594 ///State transition - sets the `index` field to Set 602 595 pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 603 596 impl<S: State> sealed::Sealed for SetIndex<S> {} 604 597 impl<S: State> State for SetIndex<S> { 605 - type Features = S::Features; 606 598 type Index = Set<members::index>; 599 + type Features = S::Features; 600 + } 601 + ///State transition - sets the `features` field to Set 602 + pub struct SetFeatures<S: State = Empty>(PhantomData<fn() -> S>); 603 + impl<S: State> sealed::Sealed for SetFeatures<S> {} 604 + impl<S: State> State for SetFeatures<S> { 605 + type Index = S::Index; 606 + type Features = Set<members::features>; 607 607 } 608 608 /// Marker types for field names 609 609 #[allow(non_camel_case_types)] 610 610 pub mod members { 611 - ///Marker type for the `features` field 612 - pub struct features(()); 613 611 ///Marker type for the `index` field 614 612 pub struct index(()); 613 + ///Marker type for the `features` field 614 + pub struct features(()); 615 615 } 616 616 } 617 617 ··· 684 684 impl<'a, S> FacetBuilder<'a, S> 685 685 where 686 686 S: facet_state::State, 687 - S::Features: facet_state::IsSet, 688 687 S::Index: facet_state::IsSet, 688 + S::Features: facet_state::IsSet, 689 689 { 690 690 /// Build the final struct 691 691 pub fn build(self) -> Facet<'a> {
+147 -147
crates/weaver-api/src/app_bsky/unspecced.rs
··· 81 81 } 82 82 /// State trait tracking which required fields have been set 83 83 pub trait State: sealed::Sealed { 84 - type AttemptId; 85 84 type Status; 86 85 type CreatedAt; 86 + type AttemptId; 87 87 } 88 88 /// Empty state - all required fields are unset 89 89 pub struct Empty(()); 90 90 impl sealed::Sealed for Empty {} 91 91 impl State for Empty { 92 - type AttemptId = Unset; 93 92 type Status = Unset; 94 93 type CreatedAt = Unset; 95 - } 96 - ///State transition - sets the `attempt_id` field to Set 97 - pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 98 - impl<S: State> sealed::Sealed for SetAttemptId<S> {} 99 - impl<S: State> State for SetAttemptId<S> { 100 - type AttemptId = Set<members::attempt_id>; 101 - type Status = S::Status; 102 - type CreatedAt = S::CreatedAt; 94 + type AttemptId = Unset; 103 95 } 104 96 ///State transition - sets the `status` field to Set 105 97 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 106 98 impl<S: State> sealed::Sealed for SetStatus<S> {} 107 99 impl<S: State> State for SetStatus<S> { 108 - type AttemptId = S::AttemptId; 109 100 type Status = Set<members::status>; 110 101 type CreatedAt = S::CreatedAt; 102 + type AttemptId = S::AttemptId; 111 103 } 112 104 ///State transition - sets the `created_at` field to Set 113 105 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 114 106 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 115 107 impl<S: State> State for SetCreatedAt<S> { 116 - type AttemptId = S::AttemptId; 117 108 type Status = S::Status; 118 109 type CreatedAt = Set<members::created_at>; 110 + type AttemptId = S::AttemptId; 111 + } 112 + ///State transition - sets the `attempt_id` field to Set 113 + pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 114 + impl<S: State> sealed::Sealed for SetAttemptId<S> {} 115 + impl<S: State> State for SetAttemptId<S> { 116 + type Status = S::Status; 117 + type CreatedAt = S::CreatedAt; 118 + type AttemptId = Set<members::attempt_id>; 119 119 } 120 120 /// Marker types for field names 121 121 #[allow(non_camel_case_types)] 122 122 pub mod members { 123 - ///Marker type for the `attempt_id` field 124 - pub struct attempt_id(()); 125 123 ///Marker type for the `status` field 126 124 pub struct status(()); 127 125 ///Marker type for the `created_at` field 128 126 pub struct created_at(()); 127 + ///Marker type for the `attempt_id` field 128 + pub struct attempt_id(()); 129 129 } 130 130 } 131 131 ··· 309 309 impl<'a, S> AgeAssuranceEventBuilder<'a, S> 310 310 where 311 311 S: age_assurance_event_state::State, 312 - S::AttemptId: age_assurance_event_state::IsSet, 313 312 S::Status: age_assurance_event_state::IsSet, 314 313 S::CreatedAt: age_assurance_event_state::IsSet, 314 + S::AttemptId: age_assurance_event_state::IsSet, 315 315 { 316 316 /// Build the final struct 317 317 pub fn build(self) -> AgeAssuranceEvent<'a> { ··· 1940 1940 } 1941 1941 /// State trait tracking which required fields have been set 1942 1942 pub trait State: sealed::Sealed { 1943 - type DisplayName; 1943 + type Dids; 1944 1944 type Link; 1945 1945 type Topic; 1946 - type Dids; 1946 + type StartedAt; 1947 1947 type PostCount; 1948 - type StartedAt; 1948 + type DisplayName; 1949 1949 } 1950 1950 /// Empty state - all required fields are unset 1951 1951 pub struct Empty(()); 1952 1952 impl sealed::Sealed for Empty {} 1953 1953 impl State for Empty { 1954 - type DisplayName = Unset; 1954 + type Dids = Unset; 1955 1955 type Link = Unset; 1956 1956 type Topic = Unset; 1957 - type Dids = Unset; 1957 + type StartedAt = Unset; 1958 1958 type PostCount = Unset; 1959 - type StartedAt = Unset; 1959 + type DisplayName = Unset; 1960 1960 } 1961 - ///State transition - sets the `display_name` field to Set 1962 - pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 1963 - impl<S: State> sealed::Sealed for SetDisplayName<S> {} 1964 - impl<S: State> State for SetDisplayName<S> { 1965 - type DisplayName = Set<members::display_name>; 1961 + ///State transition - sets the `dids` field to Set 1962 + pub struct SetDids<S: State = Empty>(PhantomData<fn() -> S>); 1963 + impl<S: State> sealed::Sealed for SetDids<S> {} 1964 + impl<S: State> State for SetDids<S> { 1965 + type Dids = Set<members::dids>; 1966 1966 type Link = S::Link; 1967 1967 type Topic = S::Topic; 1968 - type Dids = S::Dids; 1969 - type PostCount = S::PostCount; 1970 1968 type StartedAt = S::StartedAt; 1969 + type PostCount = S::PostCount; 1970 + type DisplayName = S::DisplayName; 1971 1971 } 1972 1972 ///State transition - sets the `link` field to Set 1973 1973 pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 1974 1974 impl<S: State> sealed::Sealed for SetLink<S> {} 1975 1975 impl<S: State> State for SetLink<S> { 1976 - type DisplayName = S::DisplayName; 1976 + type Dids = S::Dids; 1977 1977 type Link = Set<members::link>; 1978 1978 type Topic = S::Topic; 1979 - type Dids = S::Dids; 1979 + type StartedAt = S::StartedAt; 1980 1980 type PostCount = S::PostCount; 1981 - type StartedAt = S::StartedAt; 1981 + type DisplayName = S::DisplayName; 1982 1982 } 1983 1983 ///State transition - sets the `topic` field to Set 1984 1984 pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>); 1985 1985 impl<S: State> sealed::Sealed for SetTopic<S> {} 1986 1986 impl<S: State> State for SetTopic<S> { 1987 - type DisplayName = S::DisplayName; 1987 + type Dids = S::Dids; 1988 1988 type Link = S::Link; 1989 1989 type Topic = Set<members::topic>; 1990 - type Dids = S::Dids; 1991 - type PostCount = S::PostCount; 1992 1990 type StartedAt = S::StartedAt; 1993 - } 1994 - ///State transition - sets the `dids` field to Set 1995 - pub struct SetDids<S: State = Empty>(PhantomData<fn() -> S>); 1996 - impl<S: State> sealed::Sealed for SetDids<S> {} 1997 - impl<S: State> State for SetDids<S> { 1991 + type PostCount = S::PostCount; 1998 1992 type DisplayName = S::DisplayName; 1993 + } 1994 + ///State transition - sets the `started_at` field to Set 1995 + pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>); 1996 + impl<S: State> sealed::Sealed for SetStartedAt<S> {} 1997 + impl<S: State> State for SetStartedAt<S> { 1998 + type Dids = S::Dids; 1999 1999 type Link = S::Link; 2000 2000 type Topic = S::Topic; 2001 - type Dids = Set<members::dids>; 2001 + type StartedAt = Set<members::started_at>; 2002 2002 type PostCount = S::PostCount; 2003 - type StartedAt = S::StartedAt; 2003 + type DisplayName = S::DisplayName; 2004 2004 } 2005 2005 ///State transition - sets the `post_count` field to Set 2006 2006 pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>); 2007 2007 impl<S: State> sealed::Sealed for SetPostCount<S> {} 2008 2008 impl<S: State> State for SetPostCount<S> { 2009 - type DisplayName = S::DisplayName; 2009 + type Dids = S::Dids; 2010 2010 type Link = S::Link; 2011 2011 type Topic = S::Topic; 2012 - type Dids = S::Dids; 2013 - type PostCount = Set<members::post_count>; 2014 2012 type StartedAt = S::StartedAt; 2015 - } 2016 - ///State transition - sets the `started_at` field to Set 2017 - pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>); 2018 - impl<S: State> sealed::Sealed for SetStartedAt<S> {} 2019 - impl<S: State> State for SetStartedAt<S> { 2013 + type PostCount = Set<members::post_count>; 2020 2014 type DisplayName = S::DisplayName; 2015 + } 2016 + ///State transition - sets the `display_name` field to Set 2017 + pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 2018 + impl<S: State> sealed::Sealed for SetDisplayName<S> {} 2019 + impl<S: State> State for SetDisplayName<S> { 2020 + type Dids = S::Dids; 2021 2021 type Link = S::Link; 2022 2022 type Topic = S::Topic; 2023 - type Dids = S::Dids; 2023 + type StartedAt = S::StartedAt; 2024 2024 type PostCount = S::PostCount; 2025 - type StartedAt = Set<members::started_at>; 2025 + type DisplayName = Set<members::display_name>; 2026 2026 } 2027 2027 /// Marker types for field names 2028 2028 #[allow(non_camel_case_types)] 2029 2029 pub mod members { 2030 - ///Marker type for the `display_name` field 2031 - pub struct display_name(()); 2030 + ///Marker type for the `dids` field 2031 + pub struct dids(()); 2032 2032 ///Marker type for the `link` field 2033 2033 pub struct link(()); 2034 2034 ///Marker type for the `topic` field 2035 2035 pub struct topic(()); 2036 - ///Marker type for the `dids` field 2037 - pub struct dids(()); 2038 - ///Marker type for the `post_count` field 2039 - pub struct post_count(()); 2040 2036 ///Marker type for the `started_at` field 2041 2037 pub struct started_at(()); 2038 + ///Marker type for the `post_count` field 2039 + pub struct post_count(()); 2040 + ///Marker type for the `display_name` field 2041 + pub struct display_name(()); 2042 2042 } 2043 2043 } 2044 2044 ··· 2222 2222 impl<'a, S> SkeletonTrendBuilder<'a, S> 2223 2223 where 2224 2224 S: skeleton_trend_state::State, 2225 - S::DisplayName: skeleton_trend_state::IsSet, 2225 + S::Dids: skeleton_trend_state::IsSet, 2226 2226 S::Link: skeleton_trend_state::IsSet, 2227 2227 S::Topic: skeleton_trend_state::IsSet, 2228 - S::Dids: skeleton_trend_state::IsSet, 2228 + S::StartedAt: skeleton_trend_state::IsSet, 2229 2229 S::PostCount: skeleton_trend_state::IsSet, 2230 - S::StartedAt: skeleton_trend_state::IsSet, 2230 + S::DisplayName: skeleton_trend_state::IsSet, 2231 2231 { 2232 2232 /// Build the final struct 2233 2233 pub fn build(self) -> SkeletonTrend<'a> { ··· 2599 2599 } 2600 2600 /// State trait tracking which required fields have been set 2601 2601 pub trait State: sealed::Sealed { 2602 - type Post; 2602 + type MutedByViewer; 2603 2603 type MoreParents; 2604 2604 type MoreReplies; 2605 2605 type OpThread; 2606 + type Post; 2606 2607 type HiddenByThreadgate; 2607 - type MutedByViewer; 2608 2608 } 2609 2609 /// Empty state - all required fields are unset 2610 2610 pub struct Empty(()); 2611 2611 impl sealed::Sealed for Empty {} 2612 2612 impl State for Empty { 2613 - type Post = Unset; 2613 + type MutedByViewer = Unset; 2614 2614 type MoreParents = Unset; 2615 2615 type MoreReplies = Unset; 2616 2616 type OpThread = Unset; 2617 + type Post = Unset; 2617 2618 type HiddenByThreadgate = Unset; 2618 - type MutedByViewer = Unset; 2619 2619 } 2620 - ///State transition - sets the `post` field to Set 2621 - pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 2622 - impl<S: State> sealed::Sealed for SetPost<S> {} 2623 - impl<S: State> State for SetPost<S> { 2624 - type Post = Set<members::post>; 2620 + ///State transition - sets the `muted_by_viewer` field to Set 2621 + pub struct SetMutedByViewer<S: State = Empty>(PhantomData<fn() -> S>); 2622 + impl<S: State> sealed::Sealed for SetMutedByViewer<S> {} 2623 + impl<S: State> State for SetMutedByViewer<S> { 2624 + type MutedByViewer = Set<members::muted_by_viewer>; 2625 2625 type MoreParents = S::MoreParents; 2626 2626 type MoreReplies = S::MoreReplies; 2627 2627 type OpThread = S::OpThread; 2628 + type Post = S::Post; 2628 2629 type HiddenByThreadgate = S::HiddenByThreadgate; 2629 - type MutedByViewer = S::MutedByViewer; 2630 2630 } 2631 2631 ///State transition - sets the `more_parents` field to Set 2632 2632 pub struct SetMoreParents<S: State = Empty>(PhantomData<fn() -> S>); 2633 2633 impl<S: State> sealed::Sealed for SetMoreParents<S> {} 2634 2634 impl<S: State> State for SetMoreParents<S> { 2635 - type Post = S::Post; 2635 + type MutedByViewer = S::MutedByViewer; 2636 2636 type MoreParents = Set<members::more_parents>; 2637 2637 type MoreReplies = S::MoreReplies; 2638 2638 type OpThread = S::OpThread; 2639 + type Post = S::Post; 2639 2640 type HiddenByThreadgate = S::HiddenByThreadgate; 2640 - type MutedByViewer = S::MutedByViewer; 2641 2641 } 2642 2642 ///State transition - sets the `more_replies` field to Set 2643 2643 pub struct SetMoreReplies<S: State = Empty>(PhantomData<fn() -> S>); 2644 2644 impl<S: State> sealed::Sealed for SetMoreReplies<S> {} 2645 2645 impl<S: State> State for SetMoreReplies<S> { 2646 - type Post = S::Post; 2646 + type MutedByViewer = S::MutedByViewer; 2647 2647 type MoreParents = S::MoreParents; 2648 2648 type MoreReplies = Set<members::more_replies>; 2649 2649 type OpThread = S::OpThread; 2650 + type Post = S::Post; 2650 2651 type HiddenByThreadgate = S::HiddenByThreadgate; 2651 - type MutedByViewer = S::MutedByViewer; 2652 2652 } 2653 2653 ///State transition - sets the `op_thread` field to Set 2654 2654 pub struct SetOpThread<S: State = Empty>(PhantomData<fn() -> S>); 2655 2655 impl<S: State> sealed::Sealed for SetOpThread<S> {} 2656 2656 impl<S: State> State for SetOpThread<S> { 2657 - type Post = S::Post; 2657 + type MutedByViewer = S::MutedByViewer; 2658 2658 type MoreParents = S::MoreParents; 2659 2659 type MoreReplies = S::MoreReplies; 2660 2660 type OpThread = Set<members::op_thread>; 2661 + type Post = S::Post; 2661 2662 type HiddenByThreadgate = S::HiddenByThreadgate; 2663 + } 2664 + ///State transition - sets the `post` field to Set 2665 + pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 2666 + impl<S: State> sealed::Sealed for SetPost<S> {} 2667 + impl<S: State> State for SetPost<S> { 2662 2668 type MutedByViewer = S::MutedByViewer; 2669 + type MoreParents = S::MoreParents; 2670 + type MoreReplies = S::MoreReplies; 2671 + type OpThread = S::OpThread; 2672 + type Post = Set<members::post>; 2673 + type HiddenByThreadgate = S::HiddenByThreadgate; 2663 2674 } 2664 2675 ///State transition - sets the `hidden_by_threadgate` field to Set 2665 2676 pub struct SetHiddenByThreadgate<S: State = Empty>(PhantomData<fn() -> S>); 2666 2677 impl<S: State> sealed::Sealed for SetHiddenByThreadgate<S> {} 2667 2678 impl<S: State> State for SetHiddenByThreadgate<S> { 2668 - type Post = S::Post; 2669 - type MoreParents = S::MoreParents; 2670 - type MoreReplies = S::MoreReplies; 2671 - type OpThread = S::OpThread; 2672 - type HiddenByThreadgate = Set<members::hidden_by_threadgate>; 2673 2679 type MutedByViewer = S::MutedByViewer; 2674 - } 2675 - ///State transition - sets the `muted_by_viewer` field to Set 2676 - pub struct SetMutedByViewer<S: State = Empty>(PhantomData<fn() -> S>); 2677 - impl<S: State> sealed::Sealed for SetMutedByViewer<S> {} 2678 - impl<S: State> State for SetMutedByViewer<S> { 2679 - type Post = S::Post; 2680 2680 type MoreParents = S::MoreParents; 2681 2681 type MoreReplies = S::MoreReplies; 2682 2682 type OpThread = S::OpThread; 2683 - type HiddenByThreadgate = S::HiddenByThreadgate; 2684 - type MutedByViewer = Set<members::muted_by_viewer>; 2683 + type Post = S::Post; 2684 + type HiddenByThreadgate = Set<members::hidden_by_threadgate>; 2685 2685 } 2686 2686 /// Marker types for field names 2687 2687 #[allow(non_camel_case_types)] 2688 2688 pub mod members { 2689 - ///Marker type for the `post` field 2690 - pub struct post(()); 2689 + ///Marker type for the `muted_by_viewer` field 2690 + pub struct muted_by_viewer(()); 2691 2691 ///Marker type for the `more_parents` field 2692 2692 pub struct more_parents(()); 2693 2693 ///Marker type for the `more_replies` field 2694 2694 pub struct more_replies(()); 2695 2695 ///Marker type for the `op_thread` field 2696 2696 pub struct op_thread(()); 2697 + ///Marker type for the `post` field 2698 + pub struct post(()); 2697 2699 ///Marker type for the `hidden_by_threadgate` field 2698 2700 pub struct hidden_by_threadgate(()); 2699 - ///Marker type for the `muted_by_viewer` field 2700 - pub struct muted_by_viewer(()); 2701 2701 } 2702 2702 } 2703 2703 ··· 2850 2850 impl<'a, S> ThreadItemPostBuilder<'a, S> 2851 2851 where 2852 2852 S: thread_item_post_state::State, 2853 - S::Post: thread_item_post_state::IsSet, 2853 + S::MutedByViewer: thread_item_post_state::IsSet, 2854 2854 S::MoreParents: thread_item_post_state::IsSet, 2855 2855 S::MoreReplies: thread_item_post_state::IsSet, 2856 2856 S::OpThread: thread_item_post_state::IsSet, 2857 + S::Post: thread_item_post_state::IsSet, 2857 2858 S::HiddenByThreadgate: thread_item_post_state::IsSet, 2858 - S::MutedByViewer: thread_item_post_state::IsSet, 2859 2859 { 2860 2860 /// Build the final struct 2861 2861 pub fn build(self) -> ThreadItemPost<'a> { ··· 2947 2947 /// State trait tracking which required fields have been set 2948 2948 pub trait State: sealed::Sealed { 2949 2949 type Topic; 2950 - type DisplayName; 2951 - type Link; 2952 - type PostCount; 2953 2950 type Actors; 2954 2951 type StartedAt; 2952 + type PostCount; 2953 + type Link; 2954 + type DisplayName; 2955 2955 } 2956 2956 /// Empty state - all required fields are unset 2957 2957 pub struct Empty(()); 2958 2958 impl sealed::Sealed for Empty {} 2959 2959 impl State for Empty { 2960 2960 type Topic = Unset; 2961 - type DisplayName = Unset; 2962 - type Link = Unset; 2963 - type PostCount = Unset; 2964 2961 type Actors = Unset; 2965 2962 type StartedAt = Unset; 2963 + type PostCount = Unset; 2964 + type Link = Unset; 2965 + type DisplayName = Unset; 2966 2966 } 2967 2967 ///State transition - sets the `topic` field to Set 2968 2968 pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>); 2969 2969 impl<S: State> sealed::Sealed for SetTopic<S> {} 2970 2970 impl<S: State> State for SetTopic<S> { 2971 2971 type Topic = Set<members::topic>; 2972 - type DisplayName = S::DisplayName; 2973 - type Link = S::Link; 2974 - type PostCount = S::PostCount; 2975 2972 type Actors = S::Actors; 2976 2973 type StartedAt = S::StartedAt; 2977 - } 2978 - ///State transition - sets the `display_name` field to Set 2979 - pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 2980 - impl<S: State> sealed::Sealed for SetDisplayName<S> {} 2981 - impl<S: State> State for SetDisplayName<S> { 2982 - type Topic = S::Topic; 2983 - type DisplayName = Set<members::display_name>; 2984 - type Link = S::Link; 2985 2974 type PostCount = S::PostCount; 2986 - type Actors = S::Actors; 2987 - type StartedAt = S::StartedAt; 2988 - } 2989 - ///State transition - sets the `link` field to Set 2990 - pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 2991 - impl<S: State> sealed::Sealed for SetLink<S> {} 2992 - impl<S: State> State for SetLink<S> { 2993 - type Topic = S::Topic; 2994 - type DisplayName = S::DisplayName; 2995 - type Link = Set<members::link>; 2996 - type PostCount = S::PostCount; 2997 - type Actors = S::Actors; 2998 - type StartedAt = S::StartedAt; 2999 - } 3000 - ///State transition - sets the `post_count` field to Set 3001 - pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>); 3002 - impl<S: State> sealed::Sealed for SetPostCount<S> {} 3003 - impl<S: State> State for SetPostCount<S> { 3004 - type Topic = S::Topic; 3005 - type DisplayName = S::DisplayName; 3006 2975 type Link = S::Link; 3007 - type PostCount = Set<members::post_count>; 3008 - type Actors = S::Actors; 3009 - type StartedAt = S::StartedAt; 2976 + type DisplayName = S::DisplayName; 3010 2977 } 3011 2978 ///State transition - sets the `actors` field to Set 3012 2979 pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>); 3013 2980 impl<S: State> sealed::Sealed for SetActors<S> {} 3014 2981 impl<S: State> State for SetActors<S> { 3015 2982 type Topic = S::Topic; 3016 - type DisplayName = S::DisplayName; 3017 - type Link = S::Link; 3018 - type PostCount = S::PostCount; 3019 2983 type Actors = Set<members::actors>; 3020 2984 type StartedAt = S::StartedAt; 2985 + type PostCount = S::PostCount; 2986 + type Link = S::Link; 2987 + type DisplayName = S::DisplayName; 3021 2988 } 3022 2989 ///State transition - sets the `started_at` field to Set 3023 2990 pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>); 3024 2991 impl<S: State> sealed::Sealed for SetStartedAt<S> {} 3025 2992 impl<S: State> State for SetStartedAt<S> { 3026 2993 type Topic = S::Topic; 2994 + type Actors = S::Actors; 2995 + type StartedAt = Set<members::started_at>; 2996 + type PostCount = S::PostCount; 2997 + type Link = S::Link; 3027 2998 type DisplayName = S::DisplayName; 2999 + } 3000 + ///State transition - sets the `post_count` field to Set 3001 + pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>); 3002 + impl<S: State> sealed::Sealed for SetPostCount<S> {} 3003 + impl<S: State> State for SetPostCount<S> { 3004 + type Topic = S::Topic; 3005 + type Actors = S::Actors; 3006 + type StartedAt = S::StartedAt; 3007 + type PostCount = Set<members::post_count>; 3028 3008 type Link = S::Link; 3009 + type DisplayName = S::DisplayName; 3010 + } 3011 + ///State transition - sets the `link` field to Set 3012 + pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 3013 + impl<S: State> sealed::Sealed for SetLink<S> {} 3014 + impl<S: State> State for SetLink<S> { 3015 + type Topic = S::Topic; 3016 + type Actors = S::Actors; 3017 + type StartedAt = S::StartedAt; 3029 3018 type PostCount = S::PostCount; 3019 + type Link = Set<members::link>; 3020 + type DisplayName = S::DisplayName; 3021 + } 3022 + ///State transition - sets the `display_name` field to Set 3023 + pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 3024 + impl<S: State> sealed::Sealed for SetDisplayName<S> {} 3025 + impl<S: State> State for SetDisplayName<S> { 3026 + type Topic = S::Topic; 3030 3027 type Actors = S::Actors; 3031 - type StartedAt = Set<members::started_at>; 3028 + type StartedAt = S::StartedAt; 3029 + type PostCount = S::PostCount; 3030 + type Link = S::Link; 3031 + type DisplayName = Set<members::display_name>; 3032 3032 } 3033 3033 /// Marker types for field names 3034 3034 #[allow(non_camel_case_types)] 3035 3035 pub mod members { 3036 3036 ///Marker type for the `topic` field 3037 3037 pub struct topic(()); 3038 - ///Marker type for the `display_name` field 3039 - pub struct display_name(()); 3040 - ///Marker type for the `link` field 3041 - pub struct link(()); 3042 - ///Marker type for the `post_count` field 3043 - pub struct post_count(()); 3044 3038 ///Marker type for the `actors` field 3045 3039 pub struct actors(()); 3046 3040 ///Marker type for the `started_at` field 3047 3041 pub struct started_at(()); 3042 + ///Marker type for the `post_count` field 3043 + pub struct post_count(()); 3044 + ///Marker type for the `link` field 3045 + pub struct link(()); 3046 + ///Marker type for the `display_name` field 3047 + pub struct display_name(()); 3048 3048 } 3049 3049 } 3050 3050 ··· 3229 3229 where 3230 3230 S: trend_view_state::State, 3231 3231 S::Topic: trend_view_state::IsSet, 3232 - S::DisplayName: trend_view_state::IsSet, 3233 - S::Link: trend_view_state::IsSet, 3234 - S::PostCount: trend_view_state::IsSet, 3235 3232 S::Actors: trend_view_state::IsSet, 3236 3233 S::StartedAt: trend_view_state::IsSet, 3234 + S::PostCount: trend_view_state::IsSet, 3235 + S::Link: trend_view_state::IsSet, 3236 + S::DisplayName: trend_view_state::IsSet, 3237 3237 { 3238 3238 /// Build the final struct 3239 3239 pub fn build(self) -> TrendView<'a> {
+24 -24
crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs
··· 189 189 } 190 190 /// State trait tracking which required fields have been set 191 191 pub trait State: sealed::Sealed { 192 - type Uri; 193 - type Value; 194 192 type Depth; 193 + type Value; 194 + type Uri; 195 195 } 196 196 /// Empty state - all required fields are unset 197 197 pub struct Empty(()); 198 198 impl sealed::Sealed for Empty {} 199 199 impl State for Empty { 200 + type Depth = Unset; 201 + type Value = Unset; 200 202 type Uri = Unset; 201 - type Value = Unset; 202 - type Depth = Unset; 203 203 } 204 - ///State transition - sets the `uri` field to Set 205 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 206 - impl<S: State> sealed::Sealed for SetUri<S> {} 207 - impl<S: State> State for SetUri<S> { 208 - type Uri = Set<members::uri>; 204 + ///State transition - sets the `depth` field to Set 205 + pub struct SetDepth<S: State = Empty>(PhantomData<fn() -> S>); 206 + impl<S: State> sealed::Sealed for SetDepth<S> {} 207 + impl<S: State> State for SetDepth<S> { 208 + type Depth = Set<members::depth>; 209 209 type Value = S::Value; 210 - type Depth = S::Depth; 210 + type Uri = S::Uri; 211 211 } 212 212 ///State transition - sets the `value` field to Set 213 213 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 214 214 impl<S: State> sealed::Sealed for SetValue<S> {} 215 215 impl<S: State> State for SetValue<S> { 216 - type Uri = S::Uri; 217 - type Value = Set<members::value>; 218 216 type Depth = S::Depth; 217 + type Value = Set<members::value>; 218 + type Uri = S::Uri; 219 219 } 220 - ///State transition - sets the `depth` field to Set 221 - pub struct SetDepth<S: State = Empty>(PhantomData<fn() -> S>); 222 - impl<S: State> sealed::Sealed for SetDepth<S> {} 223 - impl<S: State> State for SetDepth<S> { 224 - type Uri = S::Uri; 220 + ///State transition - sets the `uri` field to Set 221 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 222 + impl<S: State> sealed::Sealed for SetUri<S> {} 223 + impl<S: State> State for SetUri<S> { 224 + type Depth = S::Depth; 225 225 type Value = S::Value; 226 - type Depth = Set<members::depth>; 226 + type Uri = Set<members::uri>; 227 227 } 228 228 /// Marker types for field names 229 229 #[allow(non_camel_case_types)] 230 230 pub mod members { 231 + ///Marker type for the `depth` field 232 + pub struct depth(()); 233 + ///Marker type for the `value` field 234 + pub struct value(()); 231 235 ///Marker type for the `uri` field 232 236 pub struct uri(()); 233 - ///Marker type for the `value` field 234 - pub struct value(()); 235 - ///Marker type for the `depth` field 236 - pub struct depth(()); 237 237 } 238 238 } 239 239 ··· 326 326 impl<'a, S> ThreadItemBuilder<'a, S> 327 327 where 328 328 S: thread_item_state::State, 329 - S::Uri: thread_item_state::IsSet, 330 - S::Value: thread_item_state::IsSet, 331 329 S::Depth: thread_item_state::IsSet, 330 + S::Value: thread_item_state::IsSet, 331 + S::Uri: thread_item_state::IsSet, 332 332 { 333 333 /// Build the final struct 334 334 pub fn build(self) -> ThreadItem<'a> {
+15 -15
crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs
··· 265 265 } 266 266 /// State trait tracking which required fields have been set 267 267 pub trait State: sealed::Sealed { 268 - type Uri; 269 268 type Depth; 269 + type Uri; 270 270 type Value; 271 271 } 272 272 /// Empty state - all required fields are unset 273 273 pub struct Empty(()); 274 274 impl sealed::Sealed for Empty {} 275 275 impl State for Empty { 276 - type Uri = Unset; 277 276 type Depth = Unset; 277 + type Uri = Unset; 278 278 type Value = Unset; 279 279 } 280 - ///State transition - sets the `uri` field to Set 281 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 282 - impl<S: State> sealed::Sealed for SetUri<S> {} 283 - impl<S: State> State for SetUri<S> { 284 - type Uri = Set<members::uri>; 285 - type Depth = S::Depth; 286 - type Value = S::Value; 287 - } 288 280 ///State transition - sets the `depth` field to Set 289 281 pub struct SetDepth<S: State = Empty>(PhantomData<fn() -> S>); 290 282 impl<S: State> sealed::Sealed for SetDepth<S> {} 291 283 impl<S: State> State for SetDepth<S> { 292 - type Uri = S::Uri; 293 284 type Depth = Set<members::depth>; 285 + type Uri = S::Uri; 286 + type Value = S::Value; 287 + } 288 + ///State transition - sets the `uri` field to Set 289 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 290 + impl<S: State> sealed::Sealed for SetUri<S> {} 291 + impl<S: State> State for SetUri<S> { 292 + type Depth = S::Depth; 293 + type Uri = Set<members::uri>; 294 294 type Value = S::Value; 295 295 } 296 296 ///State transition - sets the `value` field to Set 297 297 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 298 298 impl<S: State> sealed::Sealed for SetValue<S> {} 299 299 impl<S: State> State for SetValue<S> { 300 - type Uri = S::Uri; 301 300 type Depth = S::Depth; 301 + type Uri = S::Uri; 302 302 type Value = Set<members::value>; 303 303 } 304 304 /// Marker types for field names 305 305 #[allow(non_camel_case_types)] 306 306 pub mod members { 307 + ///Marker type for the `depth` field 308 + pub struct depth(()); 307 309 ///Marker type for the `uri` field 308 310 pub struct uri(()); 309 - ///Marker type for the `depth` field 310 - pub struct depth(()); 311 311 ///Marker type for the `value` field 312 312 pub struct value(()); 313 313 } ··· 402 402 impl<'a, S> ThreadItemBuilder<'a, S> 403 403 where 404 404 S: thread_item_state::State, 405 - S::Uri: thread_item_state::IsSet, 406 405 S::Depth: thread_item_state::IsSet, 406 + S::Uri: thread_item_state::IsSet, 407 407 S::Value: thread_item_state::IsSet, 408 408 { 409 409 /// Build the final struct
+15 -15
crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs
··· 90 90 } 91 91 /// State trait tracking which required fields have been set 92 92 pub trait State: sealed::Sealed { 93 - type Tag; 94 93 type SubjectType; 94 + type Tag; 95 95 type Subject; 96 96 } 97 97 /// Empty state - all required fields are unset 98 98 pub struct Empty(()); 99 99 impl sealed::Sealed for Empty {} 100 100 impl State for Empty { 101 - type Tag = Unset; 102 101 type SubjectType = Unset; 102 + type Tag = Unset; 103 103 type Subject = Unset; 104 104 } 105 - ///State transition - sets the `tag` field to Set 106 - pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 107 - impl<S: State> sealed::Sealed for SetTag<S> {} 108 - impl<S: State> State for SetTag<S> { 109 - type Tag = Set<members::tag>; 110 - type SubjectType = S::SubjectType; 111 - type Subject = S::Subject; 112 - } 113 105 ///State transition - sets the `subject_type` field to Set 114 106 pub struct SetSubjectType<S: State = Empty>(PhantomData<fn() -> S>); 115 107 impl<S: State> sealed::Sealed for SetSubjectType<S> {} 116 108 impl<S: State> State for SetSubjectType<S> { 117 - type Tag = S::Tag; 118 109 type SubjectType = Set<members::subject_type>; 110 + type Tag = S::Tag; 111 + type Subject = S::Subject; 112 + } 113 + ///State transition - sets the `tag` field to Set 114 + pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 115 + impl<S: State> sealed::Sealed for SetTag<S> {} 116 + impl<S: State> State for SetTag<S> { 117 + type SubjectType = S::SubjectType; 118 + type Tag = Set<members::tag>; 119 119 type Subject = S::Subject; 120 120 } 121 121 ///State transition - sets the `subject` field to Set 122 122 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 123 123 impl<S: State> sealed::Sealed for SetSubject<S> {} 124 124 impl<S: State> State for SetSubject<S> { 125 - type Tag = S::Tag; 126 125 type SubjectType = S::SubjectType; 126 + type Tag = S::Tag; 127 127 type Subject = Set<members::subject>; 128 128 } 129 129 /// Marker types for field names 130 130 #[allow(non_camel_case_types)] 131 131 pub mod members { 132 + ///Marker type for the `subject_type` field 133 + pub struct subject_type(()); 132 134 ///Marker type for the `tag` field 133 135 pub struct tag(()); 134 - ///Marker type for the `subject_type` field 135 - pub struct subject_type(()); 136 136 ///Marker type for the `subject` field 137 137 pub struct subject(()); 138 138 } ··· 227 227 impl<'a, S> SuggestionBuilder<'a, S> 228 228 where 229 229 S: suggestion_state::State, 230 - S::Tag: suggestion_state::IsSet, 231 230 S::SubjectType: suggestion_state::IsSet, 231 + S::Tag: suggestion_state::IsSet, 232 232 S::Subject: suggestion_state::IsSet, 233 233 { 234 234 /// Build the final struct
+15 -15
crates/weaver-api/src/app_bsky/video.rs
··· 52 52 } 53 53 /// State trait tracking which required fields have been set 54 54 pub trait State: sealed::Sealed { 55 - type State; 56 55 type Did; 56 + type State; 57 57 type JobId; 58 58 } 59 59 /// Empty state - all required fields are unset 60 60 pub struct Empty(()); 61 61 impl sealed::Sealed for Empty {} 62 62 impl State for Empty { 63 - type State = Unset; 64 63 type Did = Unset; 64 + type State = Unset; 65 65 type JobId = Unset; 66 66 } 67 - ///State transition - sets the `state` field to Set 68 - pub struct SetState<S: State = Empty>(PhantomData<fn() -> S>); 69 - impl<S: State> sealed::Sealed for SetState<S> {} 70 - impl<S: State> State for SetState<S> { 71 - type State = Set<members::state>; 72 - type Did = S::Did; 73 - type JobId = S::JobId; 74 - } 75 67 ///State transition - sets the `did` field to Set 76 68 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 77 69 impl<S: State> sealed::Sealed for SetDid<S> {} 78 70 impl<S: State> State for SetDid<S> { 79 - type State = S::State; 80 71 type Did = Set<members::did>; 72 + type State = S::State; 73 + type JobId = S::JobId; 74 + } 75 + ///State transition - sets the `state` field to Set 76 + pub struct SetState<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetState<S> {} 78 + impl<S: State> State for SetState<S> { 79 + type Did = S::Did; 80 + type State = Set<members::state>; 81 81 type JobId = S::JobId; 82 82 } 83 83 ///State transition - sets the `job_id` field to Set 84 84 pub struct SetJobId<S: State = Empty>(PhantomData<fn() -> S>); 85 85 impl<S: State> sealed::Sealed for SetJobId<S> {} 86 86 impl<S: State> State for SetJobId<S> { 87 - type State = S::State; 88 87 type Did = S::Did; 88 + type State = S::State; 89 89 type JobId = Set<members::job_id>; 90 90 } 91 91 /// Marker types for field names 92 92 #[allow(non_camel_case_types)] 93 93 pub mod members { 94 + ///Marker type for the `did` field 95 + pub struct did(()); 94 96 ///Marker type for the `state` field 95 97 pub struct state(()); 96 - ///Marker type for the `did` field 97 - pub struct did(()); 98 98 ///Marker type for the `job_id` field 99 99 pub struct job_id(()); 100 100 } ··· 257 257 impl<'a, S> JobStatusBuilder<'a, S> 258 258 where 259 259 S: job_status_state::State, 260 - S::State: job_status_state::IsSet, 261 260 S::Did: job_status_state::IsSet, 261 + S::State: job_status_state::IsSet, 262 262 S::JobId: job_status_state::IsSet, 263 263 { 264 264 /// Build the final struct
+13 -13
crates/weaver-api/src/blog_pckt/block/mention.rs
··· 35 35 } 36 36 /// State trait tracking which required fields have been set 37 37 pub trait State: sealed::Sealed { 38 - type Handle; 39 38 type Did; 39 + type Handle; 40 40 } 41 41 /// Empty state - all required fields are unset 42 42 pub struct Empty(()); 43 43 impl sealed::Sealed for Empty {} 44 44 impl State for Empty { 45 - type Handle = Unset; 46 45 type Did = Unset; 47 - } 48 - ///State transition - sets the `handle` field to Set 49 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetHandle<S> {} 51 - impl<S: State> State for SetHandle<S> { 52 - type Handle = Set<members::handle>; 53 - type Did = S::Did; 46 + type Handle = Unset; 54 47 } 55 48 ///State transition - sets the `did` field to Set 56 49 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 57 50 impl<S: State> sealed::Sealed for SetDid<S> {} 58 51 impl<S: State> State for SetDid<S> { 59 - type Handle = S::Handle; 60 52 type Did = Set<members::did>; 53 + type Handle = S::Handle; 54 + } 55 + ///State transition - sets the `handle` field to Set 56 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetHandle<S> {} 58 + impl<S: State> State for SetHandle<S> { 59 + type Did = S::Did; 60 + type Handle = Set<members::handle>; 61 61 } 62 62 /// Marker types for field names 63 63 #[allow(non_camel_case_types)] 64 64 pub mod members { 65 - ///Marker type for the `handle` field 66 - pub struct handle(()); 67 65 ///Marker type for the `did` field 68 66 pub struct did(()); 67 + ///Marker type for the `handle` field 68 + pub struct handle(()); 69 69 } 70 70 } 71 71 ··· 138 138 impl<'a, S> MentionBuilder<'a, S> 139 139 where 140 140 S: mention_state::State, 141 - S::Handle: mention_state::IsSet, 142 141 S::Did: mention_state::IsSet, 142 + S::Handle: mention_state::IsSet, 143 143 { 144 144 /// Build the final struct 145 145 pub fn build(self) -> Mention<'a> {
+13 -13
crates/weaver-api/src/blog_pckt/block/task_item.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Checked; 38 37 type Content; 38 + type Checked; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type Checked = Unset; 45 44 type Content = Unset; 46 - } 47 - ///State transition - sets the `checked` field to Set 48 - pub struct SetChecked<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetChecked<S> {} 50 - impl<S: State> State for SetChecked<S> { 51 - type Checked = Set<members::checked>; 52 - type Content = S::Content; 45 + type Checked = Unset; 53 46 } 54 47 ///State transition - sets the `content` field to Set 55 48 pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetContent<S> {} 57 50 impl<S: State> State for SetContent<S> { 58 - type Checked = S::Checked; 59 51 type Content = Set<members::content>; 52 + type Checked = S::Checked; 53 + } 54 + ///State transition - sets the `checked` field to Set 55 + pub struct SetChecked<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetChecked<S> {} 57 + impl<S: State> State for SetChecked<S> { 58 + type Content = S::Content; 59 + type Checked = Set<members::checked>; 60 60 } 61 61 /// Marker types for field names 62 62 #[allow(non_camel_case_types)] 63 63 pub mod members { 64 - ///Marker type for the `checked` field 65 - pub struct checked(()); 66 64 ///Marker type for the `content` field 67 65 pub struct content(()); 66 + ///Marker type for the `checked` field 67 + pub struct checked(()); 68 68 } 69 69 } 70 70 ··· 137 137 impl<'a, S> TaskItemBuilder<'a, S> 138 138 where 139 139 S: task_item_state::State, 140 - S::Checked: task_item_state::IsSet, 141 140 S::Content: task_item_state::IsSet, 141 + S::Checked: task_item_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> TaskItem<'a> {
+26 -26
crates/weaver-api/src/blog_pckt/post.rs
··· 53 53 } 54 54 /// State trait tracking which required fields have been set 55 55 pub trait State: sealed::Sealed { 56 - type Title; 56 + type Blog; 57 57 type Blocks; 58 58 type Url; 59 - type Blog; 59 + type Title; 60 60 } 61 61 /// Empty state - all required fields are unset 62 62 pub struct Empty(()); 63 63 impl sealed::Sealed for Empty {} 64 64 impl State for Empty { 65 - type Title = Unset; 65 + type Blog = Unset; 66 66 type Blocks = Unset; 67 67 type Url = Unset; 68 - type Blog = Unset; 68 + type Title = Unset; 69 69 } 70 - ///State transition - sets the `title` field to Set 71 - pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 72 - impl<S: State> sealed::Sealed for SetTitle<S> {} 73 - impl<S: State> State for SetTitle<S> { 74 - type Title = Set<members::title>; 70 + ///State transition - sets the `blog` field to Set 71 + pub struct SetBlog<S: State = Empty>(PhantomData<fn() -> S>); 72 + impl<S: State> sealed::Sealed for SetBlog<S> {} 73 + impl<S: State> State for SetBlog<S> { 74 + type Blog = Set<members::blog>; 75 75 type Blocks = S::Blocks; 76 76 type Url = S::Url; 77 - type Blog = S::Blog; 77 + type Title = S::Title; 78 78 } 79 79 ///State transition - sets the `blocks` field to Set 80 80 pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>); 81 81 impl<S: State> sealed::Sealed for SetBlocks<S> {} 82 82 impl<S: State> State for SetBlocks<S> { 83 - type Title = S::Title; 83 + type Blog = S::Blog; 84 84 type Blocks = Set<members::blocks>; 85 85 type Url = S::Url; 86 - type Blog = S::Blog; 86 + type Title = S::Title; 87 87 } 88 88 ///State transition - sets the `url` field to Set 89 89 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 90 90 impl<S: State> sealed::Sealed for SetUrl<S> {} 91 91 impl<S: State> State for SetUrl<S> { 92 - type Title = S::Title; 92 + type Blog = S::Blog; 93 93 type Blocks = S::Blocks; 94 94 type Url = Set<members::url>; 95 - type Blog = S::Blog; 96 - } 97 - ///State transition - sets the `blog` field to Set 98 - pub struct SetBlog<S: State = Empty>(PhantomData<fn() -> S>); 99 - impl<S: State> sealed::Sealed for SetBlog<S> {} 100 - impl<S: State> State for SetBlog<S> { 101 95 type Title = S::Title; 96 + } 97 + ///State transition - sets the `title` field to Set 98 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 99 + impl<S: State> sealed::Sealed for SetTitle<S> {} 100 + impl<S: State> State for SetTitle<S> { 101 + type Blog = S::Blog; 102 102 type Blocks = S::Blocks; 103 103 type Url = S::Url; 104 - type Blog = Set<members::blog>; 104 + type Title = Set<members::title>; 105 105 } 106 106 /// Marker types for field names 107 107 #[allow(non_camel_case_types)] 108 108 pub mod members { 109 - ///Marker type for the `title` field 110 - pub struct title(()); 109 + ///Marker type for the `blog` field 110 + pub struct blog(()); 111 111 ///Marker type for the `blocks` field 112 112 pub struct blocks(()); 113 113 ///Marker type for the `url` field 114 114 pub struct url(()); 115 - ///Marker type for the `blog` field 116 - pub struct blog(()); 115 + ///Marker type for the `title` field 116 + pub struct title(()); 117 117 } 118 118 } 119 119 ··· 357 357 impl<'a, S> PostBuilder<'a, S> 358 358 where 359 359 S: post_state::State, 360 - S::Title: post_state::IsSet, 360 + S::Blog: post_state::IsSet, 361 361 S::Blocks: post_state::IsSet, 362 362 S::Url: post_state::IsSet, 363 - S::Blog: post_state::IsSet, 363 + S::Title: post_state::IsSet, 364 364 { 365 365 /// Build the final struct 366 366 pub fn build(self) -> Post<'a> {
+26 -26
crates/weaver-api/src/blog_pckt/richtext/facet.rs
··· 552 552 } 553 553 /// State trait tracking which required fields have been set 554 554 pub trait State: sealed::Sealed { 555 - type ByteStart; 556 555 type ByteEnd; 556 + type ByteStart; 557 557 } 558 558 /// Empty state - all required fields are unset 559 559 pub struct Empty(()); 560 560 impl sealed::Sealed for Empty {} 561 561 impl State for Empty { 562 - type ByteStart = Unset; 563 562 type ByteEnd = Unset; 564 - } 565 - ///State transition - sets the `byte_start` field to Set 566 - pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 567 - impl<S: State> sealed::Sealed for SetByteStart<S> {} 568 - impl<S: State> State for SetByteStart<S> { 569 - type ByteStart = Set<members::byte_start>; 570 - type ByteEnd = S::ByteEnd; 563 + type ByteStart = Unset; 571 564 } 572 565 ///State transition - sets the `byte_end` field to Set 573 566 pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>); 574 567 impl<S: State> sealed::Sealed for SetByteEnd<S> {} 575 568 impl<S: State> State for SetByteEnd<S> { 576 - type ByteStart = S::ByteStart; 577 569 type ByteEnd = Set<members::byte_end>; 570 + type ByteStart = S::ByteStart; 571 + } 572 + ///State transition - sets the `byte_start` field to Set 573 + pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 574 + impl<S: State> sealed::Sealed for SetByteStart<S> {} 575 + impl<S: State> State for SetByteStart<S> { 576 + type ByteEnd = S::ByteEnd; 577 + type ByteStart = Set<members::byte_start>; 578 578 } 579 579 /// Marker types for field names 580 580 #[allow(non_camel_case_types)] 581 581 pub mod members { 582 - ///Marker type for the `byte_start` field 583 - pub struct byte_start(()); 584 582 ///Marker type for the `byte_end` field 585 583 pub struct byte_end(()); 584 + ///Marker type for the `byte_start` field 585 + pub struct byte_start(()); 586 586 } 587 587 } 588 588 ··· 652 652 impl<'a, S> ByteSliceBuilder<'a, S> 653 653 where 654 654 S: byte_slice_state::State, 655 - S::ByteStart: byte_slice_state::IsSet, 656 655 S::ByteEnd: byte_slice_state::IsSet, 656 + S::ByteStart: byte_slice_state::IsSet, 657 657 { 658 658 /// Build the final struct 659 659 pub fn build(self) -> ByteSlice<'a> { ··· 1051 1051 } 1052 1052 /// State trait tracking which required fields have been set 1053 1053 pub trait State: sealed::Sealed { 1054 - type Index; 1055 1054 type Features; 1055 + type Index; 1056 1056 } 1057 1057 /// Empty state - all required fields are unset 1058 1058 pub struct Empty(()); 1059 1059 impl sealed::Sealed for Empty {} 1060 1060 impl State for Empty { 1061 - type Index = Unset; 1062 1061 type Features = Unset; 1063 - } 1064 - ///State transition - sets the `index` field to Set 1065 - pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 1066 - impl<S: State> sealed::Sealed for SetIndex<S> {} 1067 - impl<S: State> State for SetIndex<S> { 1068 - type Index = Set<members::index>; 1069 - type Features = S::Features; 1062 + type Index = Unset; 1070 1063 } 1071 1064 ///State transition - sets the `features` field to Set 1072 1065 pub struct SetFeatures<S: State = Empty>(PhantomData<fn() -> S>); 1073 1066 impl<S: State> sealed::Sealed for SetFeatures<S> {} 1074 1067 impl<S: State> State for SetFeatures<S> { 1075 - type Index = S::Index; 1076 1068 type Features = Set<members::features>; 1069 + type Index = S::Index; 1070 + } 1071 + ///State transition - sets the `index` field to Set 1072 + pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 1073 + impl<S: State> sealed::Sealed for SetIndex<S> {} 1074 + impl<S: State> State for SetIndex<S> { 1075 + type Features = S::Features; 1076 + type Index = Set<members::index>; 1077 1077 } 1078 1078 /// Marker types for field names 1079 1079 #[allow(non_camel_case_types)] 1080 1080 pub mod members { 1081 - ///Marker type for the `index` field 1082 - pub struct index(()); 1083 1081 ///Marker type for the `features` field 1084 1082 pub struct features(()); 1083 + ///Marker type for the `index` field 1084 + pub struct index(()); 1085 1085 } 1086 1086 } 1087 1087 ··· 1154 1154 impl<'a, S> FacetBuilder<'a, S> 1155 1155 where 1156 1156 S: facet_state::State, 1157 - S::Index: facet_state::IsSet, 1158 1157 S::Features: facet_state::IsSet, 1158 + S::Index: facet_state::IsSet, 1159 1159 { 1160 1160 /// Build the final struct 1161 1161 pub fn build(self) -> Facet<'a> {
+226 -226
crates/weaver-api/src/chat_bsky/convo.rs
··· 66 66 } 67 67 /// State trait tracking which required fields have been set 68 68 pub trait State: sealed::Sealed { 69 + type Id; 69 70 type Muted; 70 71 type UnreadCount; 71 - type Id; 72 - type Members; 73 72 type Rev; 73 + type Members; 74 74 } 75 75 /// Empty state - all required fields are unset 76 76 pub struct Empty(()); 77 77 impl sealed::Sealed for Empty {} 78 78 impl State for Empty { 79 + type Id = Unset; 79 80 type Muted = Unset; 80 81 type UnreadCount = Unset; 81 - type Id = Unset; 82 - type Members = Unset; 83 82 type Rev = Unset; 83 + type Members = Unset; 84 + } 85 + ///State transition - sets the `id` field to Set 86 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 87 + impl<S: State> sealed::Sealed for SetId<S> {} 88 + impl<S: State> State for SetId<S> { 89 + type Id = Set<members::id>; 90 + type Muted = S::Muted; 91 + type UnreadCount = S::UnreadCount; 92 + type Rev = S::Rev; 93 + type Members = S::Members; 84 94 } 85 95 ///State transition - sets the `muted` field to Set 86 96 pub struct SetMuted<S: State = Empty>(PhantomData<fn() -> S>); 87 97 impl<S: State> sealed::Sealed for SetMuted<S> {} 88 98 impl<S: State> State for SetMuted<S> { 99 + type Id = S::Id; 89 100 type Muted = Set<members::muted>; 90 101 type UnreadCount = S::UnreadCount; 91 - type Id = S::Id; 102 + type Rev = S::Rev; 92 103 type Members = S::Members; 93 - type Rev = S::Rev; 94 104 } 95 105 ///State transition - sets the `unread_count` field to Set 96 106 pub struct SetUnreadCount<S: State = Empty>(PhantomData<fn() -> S>); 97 107 impl<S: State> sealed::Sealed for SetUnreadCount<S> {} 98 108 impl<S: State> State for SetUnreadCount<S> { 109 + type Id = S::Id; 99 110 type Muted = S::Muted; 100 111 type UnreadCount = Set<members::unread_count>; 101 - type Id = S::Id; 102 - type Members = S::Members; 103 112 type Rev = S::Rev; 113 + type Members = S::Members; 104 114 } 105 - ///State transition - sets the `id` field to Set 106 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 107 - impl<S: State> sealed::Sealed for SetId<S> {} 108 - impl<S: State> State for SetId<S> { 115 + ///State transition - sets the `rev` field to Set 116 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 117 + impl<S: State> sealed::Sealed for SetRev<S> {} 118 + impl<S: State> State for SetRev<S> { 119 + type Id = S::Id; 109 120 type Muted = S::Muted; 110 121 type UnreadCount = S::UnreadCount; 111 - type Id = Set<members::id>; 122 + type Rev = Set<members::rev>; 112 123 type Members = S::Members; 113 - type Rev = S::Rev; 114 124 } 115 125 ///State transition - sets the `members` field to Set 116 126 pub struct SetMembers<S: State = Empty>(PhantomData<fn() -> S>); 117 127 impl<S: State> sealed::Sealed for SetMembers<S> {} 118 128 impl<S: State> State for SetMembers<S> { 119 - type Muted = S::Muted; 120 - type UnreadCount = S::UnreadCount; 121 129 type Id = S::Id; 122 - type Members = Set<members::members>; 123 - type Rev = S::Rev; 124 - } 125 - ///State transition - sets the `rev` field to Set 126 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 127 - impl<S: State> sealed::Sealed for SetRev<S> {} 128 - impl<S: State> State for SetRev<S> { 129 130 type Muted = S::Muted; 130 131 type UnreadCount = S::UnreadCount; 131 - type Id = S::Id; 132 - type Members = S::Members; 133 - type Rev = Set<members::rev>; 132 + type Rev = S::Rev; 133 + type Members = Set<members::members>; 134 134 } 135 135 /// Marker types for field names 136 136 #[allow(non_camel_case_types)] 137 137 pub mod members { 138 + ///Marker type for the `id` field 139 + pub struct id(()); 138 140 ///Marker type for the `muted` field 139 141 pub struct muted(()); 140 142 ///Marker type for the `unread_count` field 141 143 pub struct unread_count(()); 142 - ///Marker type for the `id` field 143 - pub struct id(()); 144 + ///Marker type for the `rev` field 145 + pub struct rev(()); 144 146 ///Marker type for the `members` field 145 147 pub struct members(()); 146 - ///Marker type for the `rev` field 147 - pub struct rev(()); 148 148 } 149 149 } 150 150 ··· 331 331 impl<'a, S> ConvoViewBuilder<'a, S> 332 332 where 333 333 S: convo_view_state::State, 334 + S::Id: convo_view_state::IsSet, 334 335 S::Muted: convo_view_state::IsSet, 335 336 S::UnreadCount: convo_view_state::IsSet, 336 - S::Id: convo_view_state::IsSet, 337 - S::Members: convo_view_state::IsSet, 338 337 S::Rev: convo_view_state::IsSet, 338 + S::Members: convo_view_state::IsSet, 339 339 { 340 340 /// Build the final struct 341 341 pub fn build(self) -> ConvoView<'a> { ··· 1733 1733 } 1734 1734 /// State trait tracking which required fields have been set 1735 1735 pub trait State: sealed::Sealed { 1736 + type Rev; 1736 1737 type Sender; 1737 - type SentAt; 1738 1738 type Id; 1739 - type Rev; 1739 + type SentAt; 1740 1740 } 1741 1741 /// Empty state - all required fields are unset 1742 1742 pub struct Empty(()); 1743 1743 impl sealed::Sealed for Empty {} 1744 1744 impl State for Empty { 1745 + type Rev = Unset; 1745 1746 type Sender = Unset; 1747 + type Id = Unset; 1746 1748 type SentAt = Unset; 1747 - type Id = Unset; 1748 - type Rev = Unset; 1749 + } 1750 + ///State transition - sets the `rev` field to Set 1751 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1752 + impl<S: State> sealed::Sealed for SetRev<S> {} 1753 + impl<S: State> State for SetRev<S> { 1754 + type Rev = Set<members::rev>; 1755 + type Sender = S::Sender; 1756 + type Id = S::Id; 1757 + type SentAt = S::SentAt; 1749 1758 } 1750 1759 ///State transition - sets the `sender` field to Set 1751 1760 pub struct SetSender<S: State = Empty>(PhantomData<fn() -> S>); 1752 1761 impl<S: State> sealed::Sealed for SetSender<S> {} 1753 1762 impl<S: State> State for SetSender<S> { 1763 + type Rev = S::Rev; 1754 1764 type Sender = Set<members::sender>; 1755 - type SentAt = S::SentAt; 1756 1765 type Id = S::Id; 1757 - type Rev = S::Rev; 1758 - } 1759 - ///State transition - sets the `sent_at` field to Set 1760 - pub struct SetSentAt<S: State = Empty>(PhantomData<fn() -> S>); 1761 - impl<S: State> sealed::Sealed for SetSentAt<S> {} 1762 - impl<S: State> State for SetSentAt<S> { 1763 - type Sender = S::Sender; 1764 - type SentAt = Set<members::sent_at>; 1765 - type Id = S::Id; 1766 - type Rev = S::Rev; 1766 + type SentAt = S::SentAt; 1767 1767 } 1768 1768 ///State transition - sets the `id` field to Set 1769 1769 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 1770 1770 impl<S: State> sealed::Sealed for SetId<S> {} 1771 1771 impl<S: State> State for SetId<S> { 1772 + type Rev = S::Rev; 1772 1773 type Sender = S::Sender; 1773 - type SentAt = S::SentAt; 1774 1774 type Id = Set<members::id>; 1775 - type Rev = S::Rev; 1775 + type SentAt = S::SentAt; 1776 1776 } 1777 - ///State transition - sets the `rev` field to Set 1778 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1779 - impl<S: State> sealed::Sealed for SetRev<S> {} 1780 - impl<S: State> State for SetRev<S> { 1777 + ///State transition - sets the `sent_at` field to Set 1778 + pub struct SetSentAt<S: State = Empty>(PhantomData<fn() -> S>); 1779 + impl<S: State> sealed::Sealed for SetSentAt<S> {} 1780 + impl<S: State> State for SetSentAt<S> { 1781 + type Rev = S::Rev; 1781 1782 type Sender = S::Sender; 1782 - type SentAt = S::SentAt; 1783 1783 type Id = S::Id; 1784 - type Rev = Set<members::rev>; 1784 + type SentAt = Set<members::sent_at>; 1785 1785 } 1786 1786 /// Marker types for field names 1787 1787 #[allow(non_camel_case_types)] 1788 1788 pub mod members { 1789 + ///Marker type for the `rev` field 1790 + pub struct rev(()); 1789 1791 ///Marker type for the `sender` field 1790 1792 pub struct sender(()); 1791 - ///Marker type for the `sent_at` field 1792 - pub struct sent_at(()); 1793 1793 ///Marker type for the `id` field 1794 1794 pub struct id(()); 1795 - ///Marker type for the `rev` field 1796 - pub struct rev(()); 1795 + ///Marker type for the `sent_at` field 1796 + pub struct sent_at(()); 1797 1797 } 1798 1798 } 1799 1799 ··· 1906 1906 impl<'a, S> DeletedMessageViewBuilder<'a, S> 1907 1907 where 1908 1908 S: deleted_message_view_state::State, 1909 + S::Rev: deleted_message_view_state::IsSet, 1909 1910 S::Sender: deleted_message_view_state::IsSet, 1910 - S::SentAt: deleted_message_view_state::IsSet, 1911 1911 S::Id: deleted_message_view_state::IsSet, 1912 - S::Rev: deleted_message_view_state::IsSet, 1912 + S::SentAt: deleted_message_view_state::IsSet, 1913 1913 { 1914 1914 /// Build the final struct 1915 1915 pub fn build(self) -> DeletedMessageView<'a> { ··· 2025 2025 /// State trait tracking which required fields have been set 2026 2026 pub trait State: sealed::Sealed { 2027 2027 type Rev; 2028 - type Message; 2028 + type ConvoId; 2029 2029 type Reaction; 2030 - type ConvoId; 2030 + type Message; 2031 2031 } 2032 2032 /// Empty state - all required fields are unset 2033 2033 pub struct Empty(()); 2034 2034 impl sealed::Sealed for Empty {} 2035 2035 impl State for Empty { 2036 2036 type Rev = Unset; 2037 - type Message = Unset; 2038 - type Reaction = Unset; 2039 2037 type ConvoId = Unset; 2038 + type Reaction = Unset; 2039 + type Message = Unset; 2040 2040 } 2041 2041 ///State transition - sets the `rev` field to Set 2042 2042 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2043 2043 impl<S: State> sealed::Sealed for SetRev<S> {} 2044 2044 impl<S: State> State for SetRev<S> { 2045 2045 type Rev = Set<members::rev>; 2046 + type ConvoId = S::ConvoId; 2047 + type Reaction = S::Reaction; 2046 2048 type Message = S::Message; 2047 - type Reaction = S::Reaction; 2048 - type ConvoId = S::ConvoId; 2049 2049 } 2050 - ///State transition - sets the `message` field to Set 2051 - pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2052 - impl<S: State> sealed::Sealed for SetMessage<S> {} 2053 - impl<S: State> State for SetMessage<S> { 2050 + ///State transition - sets the `convo_id` field to Set 2051 + pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2052 + impl<S: State> sealed::Sealed for SetConvoId<S> {} 2053 + impl<S: State> State for SetConvoId<S> { 2054 2054 type Rev = S::Rev; 2055 - type Message = Set<members::message>; 2055 + type ConvoId = Set<members::convo_id>; 2056 2056 type Reaction = S::Reaction; 2057 - type ConvoId = S::ConvoId; 2057 + type Message = S::Message; 2058 2058 } 2059 2059 ///State transition - sets the `reaction` field to Set 2060 2060 pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 2061 2061 impl<S: State> sealed::Sealed for SetReaction<S> {} 2062 2062 impl<S: State> State for SetReaction<S> { 2063 2063 type Rev = S::Rev; 2064 + type ConvoId = S::ConvoId; 2065 + type Reaction = Set<members::reaction>; 2064 2066 type Message = S::Message; 2065 - type Reaction = Set<members::reaction>; 2066 - type ConvoId = S::ConvoId; 2067 2067 } 2068 - ///State transition - sets the `convo_id` field to Set 2069 - pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2070 - impl<S: State> sealed::Sealed for SetConvoId<S> {} 2071 - impl<S: State> State for SetConvoId<S> { 2068 + ///State transition - sets the `message` field to Set 2069 + pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2070 + impl<S: State> sealed::Sealed for SetMessage<S> {} 2071 + impl<S: State> State for SetMessage<S> { 2072 2072 type Rev = S::Rev; 2073 - type Message = S::Message; 2073 + type ConvoId = S::ConvoId; 2074 2074 type Reaction = S::Reaction; 2075 - type ConvoId = Set<members::convo_id>; 2075 + type Message = Set<members::message>; 2076 2076 } 2077 2077 /// Marker types for field names 2078 2078 #[allow(non_camel_case_types)] 2079 2079 pub mod members { 2080 2080 ///Marker type for the `rev` field 2081 2081 pub struct rev(()); 2082 + ///Marker type for the `convo_id` field 2083 + pub struct convo_id(()); 2084 + ///Marker type for the `reaction` field 2085 + pub struct reaction(()); 2082 2086 ///Marker type for the `message` field 2083 2087 pub struct message(()); 2084 - ///Marker type for the `reaction` field 2085 - pub struct reaction(()); 2086 - ///Marker type for the `convo_id` field 2087 - pub struct convo_id(()); 2088 2088 } 2089 2089 } 2090 2090 ··· 2198 2198 where 2199 2199 S: log_add_reaction_state::State, 2200 2200 S::Rev: log_add_reaction_state::IsSet, 2201 - S::Message: log_add_reaction_state::IsSet, 2202 - S::Reaction: log_add_reaction_state::IsSet, 2203 2201 S::ConvoId: log_add_reaction_state::IsSet, 2202 + S::Reaction: log_add_reaction_state::IsSet, 2203 + S::Message: log_add_reaction_state::IsSet, 2204 2204 { 2205 2205 /// Build the final struct 2206 2206 pub fn build(self) -> LogAddReaction<'a> { ··· 2332 2332 } 2333 2333 /// State trait tracking which required fields have been set 2334 2334 pub trait State: sealed::Sealed { 2335 + type Rev; 2335 2336 type ConvoId; 2336 2337 type Message; 2337 - type Rev; 2338 2338 } 2339 2339 /// Empty state - all required fields are unset 2340 2340 pub struct Empty(()); 2341 2341 impl sealed::Sealed for Empty {} 2342 2342 impl State for Empty { 2343 + type Rev = Unset; 2343 2344 type ConvoId = Unset; 2344 2345 type Message = Unset; 2345 - type Rev = Unset; 2346 + } 2347 + ///State transition - sets the `rev` field to Set 2348 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2349 + impl<S: State> sealed::Sealed for SetRev<S> {} 2350 + impl<S: State> State for SetRev<S> { 2351 + type Rev = Set<members::rev>; 2352 + type ConvoId = S::ConvoId; 2353 + type Message = S::Message; 2346 2354 } 2347 2355 ///State transition - sets the `convo_id` field to Set 2348 2356 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2349 2357 impl<S: State> sealed::Sealed for SetConvoId<S> {} 2350 2358 impl<S: State> State for SetConvoId<S> { 2359 + type Rev = S::Rev; 2351 2360 type ConvoId = Set<members::convo_id>; 2352 2361 type Message = S::Message; 2353 - type Rev = S::Rev; 2354 2362 } 2355 2363 ///State transition - sets the `message` field to Set 2356 2364 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2357 2365 impl<S: State> sealed::Sealed for SetMessage<S> {} 2358 2366 impl<S: State> State for SetMessage<S> { 2359 - type ConvoId = S::ConvoId; 2360 - type Message = Set<members::message>; 2361 2367 type Rev = S::Rev; 2362 - } 2363 - ///State transition - sets the `rev` field to Set 2364 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2365 - impl<S: State> sealed::Sealed for SetRev<S> {} 2366 - impl<S: State> State for SetRev<S> { 2367 2368 type ConvoId = S::ConvoId; 2368 - type Message = S::Message; 2369 - type Rev = Set<members::rev>; 2369 + type Message = Set<members::message>; 2370 2370 } 2371 2371 /// Marker types for field names 2372 2372 #[allow(non_camel_case_types)] 2373 2373 pub mod members { 2374 + ///Marker type for the `rev` field 2375 + pub struct rev(()); 2374 2376 ///Marker type for the `convo_id` field 2375 2377 pub struct convo_id(()); 2376 2378 ///Marker type for the `message` field 2377 2379 pub struct message(()); 2378 - ///Marker type for the `rev` field 2379 - pub struct rev(()); 2380 2380 } 2381 2381 } 2382 2382 ··· 2469 2469 impl<'a, S> LogCreateMessageBuilder<'a, S> 2470 2470 where 2471 2471 S: log_create_message_state::State, 2472 + S::Rev: log_create_message_state::IsSet, 2472 2473 S::ConvoId: log_create_message_state::IsSet, 2473 2474 S::Message: log_create_message_state::IsSet, 2474 - S::Rev: log_create_message_state::IsSet, 2475 2475 { 2476 2476 /// Build the final struct 2477 2477 pub fn build(self) -> LogCreateMessage<'a> { ··· 2565 2565 } 2566 2566 /// State trait tracking which required fields have been set 2567 2567 pub trait State: sealed::Sealed { 2568 - type Message; 2569 2568 type Rev; 2570 2569 type ConvoId; 2570 + type Message; 2571 2571 } 2572 2572 /// Empty state - all required fields are unset 2573 2573 pub struct Empty(()); 2574 2574 impl sealed::Sealed for Empty {} 2575 2575 impl State for Empty { 2576 - type Message = Unset; 2577 2576 type Rev = Unset; 2578 2577 type ConvoId = Unset; 2579 - } 2580 - ///State transition - sets the `message` field to Set 2581 - pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2582 - impl<S: State> sealed::Sealed for SetMessage<S> {} 2583 - impl<S: State> State for SetMessage<S> { 2584 - type Message = Set<members::message>; 2585 - type Rev = S::Rev; 2586 - type ConvoId = S::ConvoId; 2578 + type Message = Unset; 2587 2579 } 2588 2580 ///State transition - sets the `rev` field to Set 2589 2581 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2590 2582 impl<S: State> sealed::Sealed for SetRev<S> {} 2591 2583 impl<S: State> State for SetRev<S> { 2592 - type Message = S::Message; 2593 2584 type Rev = Set<members::rev>; 2594 2585 type ConvoId = S::ConvoId; 2586 + type Message = S::Message; 2595 2587 } 2596 2588 ///State transition - sets the `convo_id` field to Set 2597 2589 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2598 2590 impl<S: State> sealed::Sealed for SetConvoId<S> {} 2599 2591 impl<S: State> State for SetConvoId<S> { 2600 - type Message = S::Message; 2601 2592 type Rev = S::Rev; 2602 2593 type ConvoId = Set<members::convo_id>; 2594 + type Message = S::Message; 2595 + } 2596 + ///State transition - sets the `message` field to Set 2597 + pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2598 + impl<S: State> sealed::Sealed for SetMessage<S> {} 2599 + impl<S: State> State for SetMessage<S> { 2600 + type Rev = S::Rev; 2601 + type ConvoId = S::ConvoId; 2602 + type Message = Set<members::message>; 2603 2603 } 2604 2604 /// Marker types for field names 2605 2605 #[allow(non_camel_case_types)] 2606 2606 pub mod members { 2607 - ///Marker type for the `message` field 2608 - pub struct message(()); 2609 2607 ///Marker type for the `rev` field 2610 2608 pub struct rev(()); 2611 2609 ///Marker type for the `convo_id` field 2612 2610 pub struct convo_id(()); 2611 + ///Marker type for the `message` field 2612 + pub struct message(()); 2613 2613 } 2614 2614 } 2615 2615 ··· 2702 2702 impl<'a, S> LogDeleteMessageBuilder<'a, S> 2703 2703 where 2704 2704 S: log_delete_message_state::State, 2705 - S::Message: log_delete_message_state::IsSet, 2706 2705 S::Rev: log_delete_message_state::IsSet, 2707 2706 S::ConvoId: log_delete_message_state::IsSet, 2707 + S::Message: log_delete_message_state::IsSet, 2708 2708 { 2709 2709 /// Build the final struct 2710 2710 pub fn build(self) -> LogDeleteMessage<'a> { ··· 2870 2870 } 2871 2871 /// State trait tracking which required fields have been set 2872 2872 pub trait State: sealed::Sealed { 2873 + type ConvoId; 2873 2874 type Rev; 2874 2875 type Message; 2875 - type ConvoId; 2876 2876 } 2877 2877 /// Empty state - all required fields are unset 2878 2878 pub struct Empty(()); 2879 2879 impl sealed::Sealed for Empty {} 2880 2880 impl State for Empty { 2881 + type ConvoId = Unset; 2881 2882 type Rev = Unset; 2882 2883 type Message = Unset; 2883 - type ConvoId = Unset; 2884 + } 2885 + ///State transition - sets the `convo_id` field to Set 2886 + pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2887 + impl<S: State> sealed::Sealed for SetConvoId<S> {} 2888 + impl<S: State> State for SetConvoId<S> { 2889 + type ConvoId = Set<members::convo_id>; 2890 + type Rev = S::Rev; 2891 + type Message = S::Message; 2884 2892 } 2885 2893 ///State transition - sets the `rev` field to Set 2886 2894 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2887 2895 impl<S: State> sealed::Sealed for SetRev<S> {} 2888 2896 impl<S: State> State for SetRev<S> { 2897 + type ConvoId = S::ConvoId; 2889 2898 type Rev = Set<members::rev>; 2890 2899 type Message = S::Message; 2891 - type ConvoId = S::ConvoId; 2892 2900 } 2893 2901 ///State transition - sets the `message` field to Set 2894 2902 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2895 2903 impl<S: State> sealed::Sealed for SetMessage<S> {} 2896 2904 impl<S: State> State for SetMessage<S> { 2905 + type ConvoId = S::ConvoId; 2897 2906 type Rev = S::Rev; 2898 2907 type Message = Set<members::message>; 2899 - type ConvoId = S::ConvoId; 2900 - } 2901 - ///State transition - sets the `convo_id` field to Set 2902 - pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2903 - impl<S: State> sealed::Sealed for SetConvoId<S> {} 2904 - impl<S: State> State for SetConvoId<S> { 2905 - type Rev = S::Rev; 2906 - type Message = S::Message; 2907 - type ConvoId = Set<members::convo_id>; 2908 2908 } 2909 2909 /// Marker types for field names 2910 2910 #[allow(non_camel_case_types)] 2911 2911 pub mod members { 2912 + ///Marker type for the `convo_id` field 2913 + pub struct convo_id(()); 2912 2914 ///Marker type for the `rev` field 2913 2915 pub struct rev(()); 2914 2916 ///Marker type for the `message` field 2915 2917 pub struct message(()); 2916 - ///Marker type for the `convo_id` field 2917 - pub struct convo_id(()); 2918 2918 } 2919 2919 } 2920 2920 ··· 3007 3007 impl<'a, S> LogReadMessageBuilder<'a, S> 3008 3008 where 3009 3009 S: log_read_message_state::State, 3010 + S::ConvoId: log_read_message_state::IsSet, 3010 3011 S::Rev: log_read_message_state::IsSet, 3011 3012 S::Message: log_read_message_state::IsSet, 3012 - S::ConvoId: log_read_message_state::IsSet, 3013 3013 { 3014 3014 /// Build the final struct 3015 3015 pub fn build(self) -> LogReadMessage<'a> { ··· 3107 3107 pub trait State: sealed::Sealed { 3108 3108 type Reaction; 3109 3109 type ConvoId; 3110 - type Message; 3111 3110 type Rev; 3111 + type Message; 3112 3112 } 3113 3113 /// Empty state - all required fields are unset 3114 3114 pub struct Empty(()); ··· 3116 3116 impl State for Empty { 3117 3117 type Reaction = Unset; 3118 3118 type ConvoId = Unset; 3119 + type Rev = Unset; 3119 3120 type Message = Unset; 3120 - type Rev = Unset; 3121 3121 } 3122 3122 ///State transition - sets the `reaction` field to Set 3123 3123 pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); ··· 3125 3125 impl<S: State> State for SetReaction<S> { 3126 3126 type Reaction = Set<members::reaction>; 3127 3127 type ConvoId = S::ConvoId; 3128 - type Message = S::Message; 3129 3128 type Rev = S::Rev; 3129 + type Message = S::Message; 3130 3130 } 3131 3131 ///State transition - sets the `convo_id` field to Set 3132 3132 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); ··· 3134 3134 impl<S: State> State for SetConvoId<S> { 3135 3135 type Reaction = S::Reaction; 3136 3136 type ConvoId = Set<members::convo_id>; 3137 - type Message = S::Message; 3138 3137 type Rev = S::Rev; 3138 + type Message = S::Message; 3139 + } 3140 + ///State transition - sets the `rev` field to Set 3141 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 3142 + impl<S: State> sealed::Sealed for SetRev<S> {} 3143 + impl<S: State> State for SetRev<S> { 3144 + type Reaction = S::Reaction; 3145 + type ConvoId = S::ConvoId; 3146 + type Rev = Set<members::rev>; 3147 + type Message = S::Message; 3139 3148 } 3140 3149 ///State transition - sets the `message` field to Set 3141 3150 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); ··· 3143 3152 impl<S: State> State for SetMessage<S> { 3144 3153 type Reaction = S::Reaction; 3145 3154 type ConvoId = S::ConvoId; 3146 - type Message = Set<members::message>; 3147 3155 type Rev = S::Rev; 3148 - } 3149 - ///State transition - sets the `rev` field to Set 3150 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 3151 - impl<S: State> sealed::Sealed for SetRev<S> {} 3152 - impl<S: State> State for SetRev<S> { 3153 - type Reaction = S::Reaction; 3154 - type ConvoId = S::ConvoId; 3155 - type Message = S::Message; 3156 - type Rev = Set<members::rev>; 3156 + type Message = Set<members::message>; 3157 3157 } 3158 3158 /// Marker types for field names 3159 3159 #[allow(non_camel_case_types)] ··· 3162 3162 pub struct reaction(()); 3163 3163 ///Marker type for the `convo_id` field 3164 3164 pub struct convo_id(()); 3165 + ///Marker type for the `rev` field 3166 + pub struct rev(()); 3165 3167 ///Marker type for the `message` field 3166 3168 pub struct message(()); 3167 - ///Marker type for the `rev` field 3168 - pub struct rev(()); 3169 3169 } 3170 3170 } 3171 3171 ··· 3280 3280 S: log_remove_reaction_state::State, 3281 3281 S::Reaction: log_remove_reaction_state::IsSet, 3282 3282 S::ConvoId: log_remove_reaction_state::IsSet, 3283 - S::Message: log_remove_reaction_state::IsSet, 3284 3283 S::Rev: log_remove_reaction_state::IsSet, 3284 + S::Message: log_remove_reaction_state::IsSet, 3285 3285 { 3286 3286 /// Build the final struct 3287 3287 pub fn build(self) -> LogRemoveReaction<'a> { ··· 3411 3411 } 3412 3412 /// State trait tracking which required fields have been set 3413 3413 pub trait State: sealed::Sealed { 3414 - type Reaction; 3415 3414 type Message; 3415 + type Reaction; 3416 3416 } 3417 3417 /// Empty state - all required fields are unset 3418 3418 pub struct Empty(()); 3419 3419 impl sealed::Sealed for Empty {} 3420 3420 impl State for Empty { 3421 - type Reaction = Unset; 3422 3421 type Message = Unset; 3423 - } 3424 - ///State transition - sets the `reaction` field to Set 3425 - pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 3426 - impl<S: State> sealed::Sealed for SetReaction<S> {} 3427 - impl<S: State> State for SetReaction<S> { 3428 - type Reaction = Set<members::reaction>; 3429 - type Message = S::Message; 3422 + type Reaction = Unset; 3430 3423 } 3431 3424 ///State transition - sets the `message` field to Set 3432 3425 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 3433 3426 impl<S: State> sealed::Sealed for SetMessage<S> {} 3434 3427 impl<S: State> State for SetMessage<S> { 3435 - type Reaction = S::Reaction; 3436 3428 type Message = Set<members::message>; 3429 + type Reaction = S::Reaction; 3430 + } 3431 + ///State transition - sets the `reaction` field to Set 3432 + pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 3433 + impl<S: State> sealed::Sealed for SetReaction<S> {} 3434 + impl<S: State> State for SetReaction<S> { 3435 + type Message = S::Message; 3436 + type Reaction = Set<members::reaction>; 3437 3437 } 3438 3438 /// Marker types for field names 3439 3439 #[allow(non_camel_case_types)] 3440 3440 pub mod members { 3441 + ///Marker type for the `message` field 3442 + pub struct message(()); 3441 3443 ///Marker type for the `reaction` field 3442 3444 pub struct reaction(()); 3443 - ///Marker type for the `message` field 3444 - pub struct message(()); 3445 3445 } 3446 3446 } 3447 3447 ··· 3523 3523 impl<'a, S> MessageAndReactionViewBuilder<'a, S> 3524 3524 where 3525 3525 S: message_and_reaction_view_state::State, 3526 - S::Reaction: message_and_reaction_view_state::IsSet, 3527 3526 S::Message: message_and_reaction_view_state::IsSet, 3527 + S::Reaction: message_and_reaction_view_state::IsSet, 3528 3528 { 3529 3529 /// Build the final struct 3530 3530 pub fn build(self) -> MessageAndReactionView<'a> { ··· 3670 3670 } 3671 3671 /// State trait tracking which required fields have been set 3672 3672 pub trait State: sealed::Sealed { 3673 - type MessageId; 3674 3673 type ConvoId; 3675 3674 type Did; 3675 + type MessageId; 3676 3676 } 3677 3677 /// Empty state - all required fields are unset 3678 3678 pub struct Empty(()); 3679 3679 impl sealed::Sealed for Empty {} 3680 3680 impl State for Empty { 3681 - type MessageId = Unset; 3682 3681 type ConvoId = Unset; 3683 3682 type Did = Unset; 3684 - } 3685 - ///State transition - sets the `message_id` field to Set 3686 - pub struct SetMessageId<S: State = Empty>(PhantomData<fn() -> S>); 3687 - impl<S: State> sealed::Sealed for SetMessageId<S> {} 3688 - impl<S: State> State for SetMessageId<S> { 3689 - type MessageId = Set<members::message_id>; 3690 - type ConvoId = S::ConvoId; 3691 - type Did = S::Did; 3683 + type MessageId = Unset; 3692 3684 } 3693 3685 ///State transition - sets the `convo_id` field to Set 3694 3686 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 3695 3687 impl<S: State> sealed::Sealed for SetConvoId<S> {} 3696 3688 impl<S: State> State for SetConvoId<S> { 3697 - type MessageId = S::MessageId; 3698 3689 type ConvoId = Set<members::convo_id>; 3699 3690 type Did = S::Did; 3691 + type MessageId = S::MessageId; 3700 3692 } 3701 3693 ///State transition - sets the `did` field to Set 3702 3694 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 3703 3695 impl<S: State> sealed::Sealed for SetDid<S> {} 3704 3696 impl<S: State> State for SetDid<S> { 3705 - type MessageId = S::MessageId; 3706 3697 type ConvoId = S::ConvoId; 3707 3698 type Did = Set<members::did>; 3699 + type MessageId = S::MessageId; 3700 + } 3701 + ///State transition - sets the `message_id` field to Set 3702 + pub struct SetMessageId<S: State = Empty>(PhantomData<fn() -> S>); 3703 + impl<S: State> sealed::Sealed for SetMessageId<S> {} 3704 + impl<S: State> State for SetMessageId<S> { 3705 + type ConvoId = S::ConvoId; 3706 + type Did = S::Did; 3707 + type MessageId = Set<members::message_id>; 3708 3708 } 3709 3709 /// Marker types for field names 3710 3710 #[allow(non_camel_case_types)] 3711 3711 pub mod members { 3712 - ///Marker type for the `message_id` field 3713 - pub struct message_id(()); 3714 3712 ///Marker type for the `convo_id` field 3715 3713 pub struct convo_id(()); 3716 3714 ///Marker type for the `did` field 3717 3715 pub struct did(()); 3716 + ///Marker type for the `message_id` field 3717 + pub struct message_id(()); 3718 3718 } 3719 3719 } 3720 3720 ··· 3807 3807 impl<'a, S> MessageRefBuilder<'a, S> 3808 3808 where 3809 3809 S: message_ref_state::State, 3810 - S::MessageId: message_ref_state::IsSet, 3811 3810 S::ConvoId: message_ref_state::IsSet, 3812 3811 S::Did: message_ref_state::IsSet, 3812 + S::MessageId: message_ref_state::IsSet, 3813 3813 { 3814 3814 /// Build the final struct 3815 3815 pub fn build(self) -> MessageRef<'a> { ··· 3898 3898 } 3899 3899 /// State trait tracking which required fields have been set 3900 3900 pub trait State: sealed::Sealed { 3901 - type Id; 3902 - type Sender; 3903 3901 type Rev; 3902 + type Id; 3904 3903 type Text; 3904 + type Sender; 3905 3905 type SentAt; 3906 3906 } 3907 3907 /// Empty state - all required fields are unset 3908 3908 pub struct Empty(()); 3909 3909 impl sealed::Sealed for Empty {} 3910 3910 impl State for Empty { 3911 + type Rev = Unset; 3911 3912 type Id = Unset; 3912 - type Sender = Unset; 3913 - type Rev = Unset; 3914 3913 type Text = Unset; 3914 + type Sender = Unset; 3915 3915 type SentAt = Unset; 3916 3916 } 3917 + ///State transition - sets the `rev` field to Set 3918 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 3919 + impl<S: State> sealed::Sealed for SetRev<S> {} 3920 + impl<S: State> State for SetRev<S> { 3921 + type Rev = Set<members::rev>; 3922 + type Id = S::Id; 3923 + type Text = S::Text; 3924 + type Sender = S::Sender; 3925 + type SentAt = S::SentAt; 3926 + } 3917 3927 ///State transition - sets the `id` field to Set 3918 3928 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 3919 3929 impl<S: State> sealed::Sealed for SetId<S> {} 3920 3930 impl<S: State> State for SetId<S> { 3931 + type Rev = S::Rev; 3921 3932 type Id = Set<members::id>; 3933 + type Text = S::Text; 3922 3934 type Sender = S::Sender; 3935 + type SentAt = S::SentAt; 3936 + } 3937 + ///State transition - sets the `text` field to Set 3938 + pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>); 3939 + impl<S: State> sealed::Sealed for SetText<S> {} 3940 + impl<S: State> State for SetText<S> { 3923 3941 type Rev = S::Rev; 3924 - type Text = S::Text; 3942 + type Id = S::Id; 3943 + type Text = Set<members::text>; 3944 + type Sender = S::Sender; 3925 3945 type SentAt = S::SentAt; 3926 3946 } 3927 3947 ///State transition - sets the `sender` field to Set 3928 3948 pub struct SetSender<S: State = Empty>(PhantomData<fn() -> S>); 3929 3949 impl<S: State> sealed::Sealed for SetSender<S> {} 3930 3950 impl<S: State> State for SetSender<S> { 3931 - type Id = S::Id; 3932 - type Sender = Set<members::sender>; 3933 3951 type Rev = S::Rev; 3934 - type Text = S::Text; 3935 - type SentAt = S::SentAt; 3936 - } 3937 - ///State transition - sets the `rev` field to Set 3938 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 3939 - impl<S: State> sealed::Sealed for SetRev<S> {} 3940 - impl<S: State> State for SetRev<S> { 3941 3952 type Id = S::Id; 3942 - type Sender = S::Sender; 3943 - type Rev = Set<members::rev>; 3944 3953 type Text = S::Text; 3945 - type SentAt = S::SentAt; 3946 - } 3947 - ///State transition - sets the `text` field to Set 3948 - pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>); 3949 - impl<S: State> sealed::Sealed for SetText<S> {} 3950 - impl<S: State> State for SetText<S> { 3951 - type Id = S::Id; 3952 - type Sender = S::Sender; 3953 - type Rev = S::Rev; 3954 - type Text = Set<members::text>; 3954 + type Sender = Set<members::sender>; 3955 3955 type SentAt = S::SentAt; 3956 3956 } 3957 3957 ///State transition - sets the `sent_at` field to Set 3958 3958 pub struct SetSentAt<S: State = Empty>(PhantomData<fn() -> S>); 3959 3959 impl<S: State> sealed::Sealed for SetSentAt<S> {} 3960 3960 impl<S: State> State for SetSentAt<S> { 3961 - type Id = S::Id; 3962 - type Sender = S::Sender; 3963 3961 type Rev = S::Rev; 3962 + type Id = S::Id; 3964 3963 type Text = S::Text; 3964 + type Sender = S::Sender; 3965 3965 type SentAt = Set<members::sent_at>; 3966 3966 } 3967 3967 /// Marker types for field names 3968 3968 #[allow(non_camel_case_types)] 3969 3969 pub mod members { 3970 + ///Marker type for the `rev` field 3971 + pub struct rev(()); 3970 3972 ///Marker type for the `id` field 3971 3973 pub struct id(()); 3974 + ///Marker type for the `text` field 3975 + pub struct text(()); 3972 3976 ///Marker type for the `sender` field 3973 3977 pub struct sender(()); 3974 - ///Marker type for the `rev` field 3975 - pub struct rev(()); 3976 - ///Marker type for the `text` field 3977 - pub struct text(()); 3978 3978 ///Marker type for the `sent_at` field 3979 3979 pub struct sent_at(()); 3980 3980 } ··· 4169 4169 impl<'a, S> MessageViewBuilder<'a, S> 4170 4170 where 4171 4171 S: message_view_state::State, 4172 - S::Id: message_view_state::IsSet, 4173 - S::Sender: message_view_state::IsSet, 4174 4172 S::Rev: message_view_state::IsSet, 4173 + S::Id: message_view_state::IsSet, 4175 4174 S::Text: message_view_state::IsSet, 4175 + S::Sender: message_view_state::IsSet, 4176 4176 S::SentAt: message_view_state::IsSet, 4177 4177 { 4178 4178 /// Build the final struct ··· 4428 4428 /// State trait tracking which required fields have been set 4429 4429 pub trait State: sealed::Sealed { 4430 4430 type Value; 4431 - type Sender; 4432 4431 type CreatedAt; 4432 + type Sender; 4433 4433 } 4434 4434 /// Empty state - all required fields are unset 4435 4435 pub struct Empty(()); 4436 4436 impl sealed::Sealed for Empty {} 4437 4437 impl State for Empty { 4438 4438 type Value = Unset; 4439 - type Sender = Unset; 4440 4439 type CreatedAt = Unset; 4440 + type Sender = Unset; 4441 4441 } 4442 4442 ///State transition - sets the `value` field to Set 4443 4443 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 4444 4444 impl<S: State> sealed::Sealed for SetValue<S> {} 4445 4445 impl<S: State> State for SetValue<S> { 4446 4446 type Value = Set<members::value>; 4447 - type Sender = S::Sender; 4448 4447 type CreatedAt = S::CreatedAt; 4449 - } 4450 - ///State transition - sets the `sender` field to Set 4451 - pub struct SetSender<S: State = Empty>(PhantomData<fn() -> S>); 4452 - impl<S: State> sealed::Sealed for SetSender<S> {} 4453 - impl<S: State> State for SetSender<S> { 4454 - type Value = S::Value; 4455 - type Sender = Set<members::sender>; 4456 - type CreatedAt = S::CreatedAt; 4448 + type Sender = S::Sender; 4457 4449 } 4458 4450 ///State transition - sets the `created_at` field to Set 4459 4451 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 4460 4452 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 4461 4453 impl<S: State> State for SetCreatedAt<S> { 4462 4454 type Value = S::Value; 4463 - type Sender = S::Sender; 4464 4455 type CreatedAt = Set<members::created_at>; 4456 + type Sender = S::Sender; 4457 + } 4458 + ///State transition - sets the `sender` field to Set 4459 + pub struct SetSender<S: State = Empty>(PhantomData<fn() -> S>); 4460 + impl<S: State> sealed::Sealed for SetSender<S> {} 4461 + impl<S: State> State for SetSender<S> { 4462 + type Value = S::Value; 4463 + type CreatedAt = S::CreatedAt; 4464 + type Sender = Set<members::sender>; 4465 4465 } 4466 4466 /// Marker types for field names 4467 4467 #[allow(non_camel_case_types)] 4468 4468 pub mod members { 4469 4469 ///Marker type for the `value` field 4470 4470 pub struct value(()); 4471 - ///Marker type for the `sender` field 4472 - pub struct sender(()); 4473 4471 ///Marker type for the `created_at` field 4474 4472 pub struct created_at(()); 4473 + ///Marker type for the `sender` field 4474 + pub struct sender(()); 4475 4475 } 4476 4476 } 4477 4477 ··· 4565 4565 where 4566 4566 S: reaction_view_state::State, 4567 4567 S::Value: reaction_view_state::IsSet, 4568 - S::Sender: reaction_view_state::IsSet, 4569 4568 S::CreatedAt: reaction_view_state::IsSet, 4569 + S::Sender: reaction_view_state::IsSet, 4570 4570 { 4571 4571 /// Build the final struct 4572 4572 pub fn build(self) -> ReactionView<'a> {
+30 -30
crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs
··· 185 185 } 186 186 /// State trait tracking which required fields have been set 187 187 pub trait State: sealed::Sealed { 188 - type ConvosStarted; 189 - type MessagesSent; 190 188 type MessagesReceived; 189 + type ConvosStarted; 191 190 type Convos; 191 + type MessagesSent; 192 192 } 193 193 /// Empty state - all required fields are unset 194 194 pub struct Empty(()); 195 195 impl sealed::Sealed for Empty {} 196 196 impl State for Empty { 197 + type MessagesReceived = Unset; 197 198 type ConvosStarted = Unset; 198 - type MessagesSent = Unset; 199 - type MessagesReceived = Unset; 200 199 type Convos = Unset; 201 - } 202 - ///State transition - sets the `convos_started` field to Set 203 - pub struct SetConvosStarted<S: State = Empty>(PhantomData<fn() -> S>); 204 - impl<S: State> sealed::Sealed for SetConvosStarted<S> {} 205 - impl<S: State> State for SetConvosStarted<S> { 206 - type ConvosStarted = Set<members::convos_started>; 207 - type MessagesSent = S::MessagesSent; 208 - type MessagesReceived = S::MessagesReceived; 209 - type Convos = S::Convos; 210 - } 211 - ///State transition - sets the `messages_sent` field to Set 212 - pub struct SetMessagesSent<S: State = Empty>(PhantomData<fn() -> S>); 213 - impl<S: State> sealed::Sealed for SetMessagesSent<S> {} 214 - impl<S: State> State for SetMessagesSent<S> { 215 - type ConvosStarted = S::ConvosStarted; 216 - type MessagesSent = Set<members::messages_sent>; 217 - type MessagesReceived = S::MessagesReceived; 218 - type Convos = S::Convos; 200 + type MessagesSent = Unset; 219 201 } 220 202 ///State transition - sets the `messages_received` field to Set 221 203 pub struct SetMessagesReceived<S: State = Empty>(PhantomData<fn() -> S>); 222 204 impl<S: State> sealed::Sealed for SetMessagesReceived<S> {} 223 205 impl<S: State> State for SetMessagesReceived<S> { 206 + type MessagesReceived = Set<members::messages_received>; 224 207 type ConvosStarted = S::ConvosStarted; 208 + type Convos = S::Convos; 225 209 type MessagesSent = S::MessagesSent; 226 - type MessagesReceived = Set<members::messages_received>; 210 + } 211 + ///State transition - sets the `convos_started` field to Set 212 + pub struct SetConvosStarted<S: State = Empty>(PhantomData<fn() -> S>); 213 + impl<S: State> sealed::Sealed for SetConvosStarted<S> {} 214 + impl<S: State> State for SetConvosStarted<S> { 215 + type MessagesReceived = S::MessagesReceived; 216 + type ConvosStarted = Set<members::convos_started>; 227 217 type Convos = S::Convos; 218 + type MessagesSent = S::MessagesSent; 228 219 } 229 220 ///State transition - sets the `convos` field to Set 230 221 pub struct SetConvos<S: State = Empty>(PhantomData<fn() -> S>); 231 222 impl<S: State> sealed::Sealed for SetConvos<S> {} 232 223 impl<S: State> State for SetConvos<S> { 224 + type MessagesReceived = S::MessagesReceived; 233 225 type ConvosStarted = S::ConvosStarted; 226 + type Convos = Set<members::convos>; 234 227 type MessagesSent = S::MessagesSent; 228 + } 229 + ///State transition - sets the `messages_sent` field to Set 230 + pub struct SetMessagesSent<S: State = Empty>(PhantomData<fn() -> S>); 231 + impl<S: State> sealed::Sealed for SetMessagesSent<S> {} 232 + impl<S: State> State for SetMessagesSent<S> { 235 233 type MessagesReceived = S::MessagesReceived; 236 - type Convos = Set<members::convos>; 234 + type ConvosStarted = S::ConvosStarted; 235 + type Convos = S::Convos; 236 + type MessagesSent = Set<members::messages_sent>; 237 237 } 238 238 /// Marker types for field names 239 239 #[allow(non_camel_case_types)] 240 240 pub mod members { 241 - ///Marker type for the `convos_started` field 242 - pub struct convos_started(()); 243 - ///Marker type for the `messages_sent` field 244 - pub struct messages_sent(()); 245 241 ///Marker type for the `messages_received` field 246 242 pub struct messages_received(()); 243 + ///Marker type for the `convos_started` field 244 + pub struct convos_started(()); 247 245 ///Marker type for the `convos` field 248 246 pub struct convos(()); 247 + ///Marker type for the `messages_sent` field 248 + pub struct messages_sent(()); 249 249 } 250 250 } 251 251 ··· 358 358 impl<'a, S> MetadataBuilder<'a, S> 359 359 where 360 360 S: metadata_state::State, 361 - S::ConvosStarted: metadata_state::IsSet, 362 - S::MessagesSent: metadata_state::IsSet, 363 361 S::MessagesReceived: metadata_state::IsSet, 362 + S::ConvosStarted: metadata_state::IsSet, 364 363 S::Convos: metadata_state::IsSet, 364 + S::MessagesSent: metadata_state::IsSet, 365 365 { 366 366 /// Build the final struct 367 367 pub fn build(self) -> Metadata<'a> {
+13 -13
crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs
··· 35 35 } 36 36 /// State trait tracking which required fields have been set 37 37 pub trait State: sealed::Sealed { 38 - type Actor; 39 38 type AllowAccess; 39 + type Actor; 40 40 } 41 41 /// Empty state - all required fields are unset 42 42 pub struct Empty(()); 43 43 impl sealed::Sealed for Empty {} 44 44 impl State for Empty { 45 - type Actor = Unset; 46 45 type AllowAccess = Unset; 47 - } 48 - ///State transition - sets the `actor` field to Set 49 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetActor<S> {} 51 - impl<S: State> State for SetActor<S> { 52 - type Actor = Set<members::actor>; 53 - type AllowAccess = S::AllowAccess; 46 + type Actor = Unset; 54 47 } 55 48 ///State transition - sets the `allow_access` field to Set 56 49 pub struct SetAllowAccess<S: State = Empty>(PhantomData<fn() -> S>); 57 50 impl<S: State> sealed::Sealed for SetAllowAccess<S> {} 58 51 impl<S: State> State for SetAllowAccess<S> { 59 - type Actor = S::Actor; 60 52 type AllowAccess = Set<members::allow_access>; 53 + type Actor = S::Actor; 54 + } 55 + ///State transition - sets the `actor` field to Set 56 + pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetActor<S> {} 58 + impl<S: State> State for SetActor<S> { 59 + type AllowAccess = S::AllowAccess; 60 + type Actor = Set<members::actor>; 61 61 } 62 62 /// Marker types for field names 63 63 #[allow(non_camel_case_types)] 64 64 pub mod members { 65 - ///Marker type for the `actor` field 66 - pub struct actor(()); 67 65 ///Marker type for the `allow_access` field 68 66 pub struct allow_access(()); 67 + ///Marker type for the `actor` field 68 + pub struct actor(()); 69 69 } 70 70 } 71 71 ··· 155 155 impl<'a, S> UpdateActorAccessBuilder<'a, S> 156 156 where 157 157 S: update_actor_access_state::State, 158 - S::Actor: update_actor_access_state::IsSet, 159 158 S::AllowAccess: update_actor_access_state::IsSet, 159 + S::Actor: update_actor_access_state::IsSet, 160 160 { 161 161 /// Build the final struct 162 162 pub fn build(self) -> UpdateActorAccess<'a> {
+37 -37
crates/weaver-api/src/com_atproto/admin.rs
··· 80 80 } 81 81 /// State trait tracking which required fields have been set 82 82 pub trait State: sealed::Sealed { 83 - type Handle; 84 - type Did; 85 83 type IndexedAt; 84 + type Did; 85 + type Handle; 86 86 } 87 87 /// Empty state - all required fields are unset 88 88 pub struct Empty(()); 89 89 impl sealed::Sealed for Empty {} 90 90 impl State for Empty { 91 + type IndexedAt = Unset; 92 + type Did = Unset; 91 93 type Handle = Unset; 92 - type Did = Unset; 93 - type IndexedAt = Unset; 94 94 } 95 - ///State transition - sets the `handle` field to Set 96 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 97 - impl<S: State> sealed::Sealed for SetHandle<S> {} 98 - impl<S: State> State for SetHandle<S> { 99 - type Handle = Set<members::handle>; 95 + ///State transition - sets the `indexed_at` field to Set 96 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 97 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 98 + impl<S: State> State for SetIndexedAt<S> { 99 + type IndexedAt = Set<members::indexed_at>; 100 100 type Did = S::Did; 101 - type IndexedAt = S::IndexedAt; 101 + type Handle = S::Handle; 102 102 } 103 103 ///State transition - sets the `did` field to Set 104 104 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 105 105 impl<S: State> sealed::Sealed for SetDid<S> {} 106 106 impl<S: State> State for SetDid<S> { 107 - type Handle = S::Handle; 108 - type Did = Set<members::did>; 109 107 type IndexedAt = S::IndexedAt; 108 + type Did = Set<members::did>; 109 + type Handle = S::Handle; 110 110 } 111 - ///State transition - sets the `indexed_at` field to Set 112 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 113 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 114 - impl<S: State> State for SetIndexedAt<S> { 115 - type Handle = S::Handle; 111 + ///State transition - sets the `handle` field to Set 112 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 113 + impl<S: State> sealed::Sealed for SetHandle<S> {} 114 + impl<S: State> State for SetHandle<S> { 115 + type IndexedAt = S::IndexedAt; 116 116 type Did = S::Did; 117 - type IndexedAt = Set<members::indexed_at>; 117 + type Handle = Set<members::handle>; 118 118 } 119 119 /// Marker types for field names 120 120 #[allow(non_camel_case_types)] 121 121 pub mod members { 122 + ///Marker type for the `indexed_at` field 123 + pub struct indexed_at(()); 124 + ///Marker type for the `did` field 125 + pub struct did(()); 122 126 ///Marker type for the `handle` field 123 127 pub struct handle(()); 124 - ///Marker type for the `did` field 125 - pub struct did(()); 126 - ///Marker type for the `indexed_at` field 127 - pub struct indexed_at(()); 128 128 } 129 129 } 130 130 ··· 401 401 impl<'a, S> AccountViewBuilder<'a, S> 402 402 where 403 403 S: account_view_state::State, 404 - S::Handle: account_view_state::IsSet, 405 - S::Did: account_view_state::IsSet, 406 404 S::IndexedAt: account_view_state::IsSet, 405 + S::Did: account_view_state::IsSet, 406 + S::Handle: account_view_state::IsSet, 407 407 { 408 408 /// Build the final struct 409 409 pub fn build(self) -> AccountView<'a> { ··· 907 907 } 908 908 /// State trait tracking which required fields have been set 909 909 pub trait State: sealed::Sealed { 910 - type Did; 911 910 type Cid; 911 + type Did; 912 912 } 913 913 /// Empty state - all required fields are unset 914 914 pub struct Empty(()); 915 915 impl sealed::Sealed for Empty {} 916 916 impl State for Empty { 917 - type Did = Unset; 918 917 type Cid = Unset; 919 - } 920 - ///State transition - sets the `did` field to Set 921 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 922 - impl<S: State> sealed::Sealed for SetDid<S> {} 923 - impl<S: State> State for SetDid<S> { 924 - type Did = Set<members::did>; 925 - type Cid = S::Cid; 918 + type Did = Unset; 926 919 } 927 920 ///State transition - sets the `cid` field to Set 928 921 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 929 922 impl<S: State> sealed::Sealed for SetCid<S> {} 930 923 impl<S: State> State for SetCid<S> { 931 - type Did = S::Did; 932 924 type Cid = Set<members::cid>; 925 + type Did = S::Did; 926 + } 927 + ///State transition - sets the `did` field to Set 928 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 929 + impl<S: State> sealed::Sealed for SetDid<S> {} 930 + impl<S: State> State for SetDid<S> { 931 + type Cid = S::Cid; 932 + type Did = Set<members::did>; 933 933 } 934 934 /// Marker types for field names 935 935 #[allow(non_camel_case_types)] 936 936 pub mod members { 937 - ///Marker type for the `did` field 938 - pub struct did(()); 939 937 ///Marker type for the `cid` field 940 938 pub struct cid(()); 939 + ///Marker type for the `did` field 940 + pub struct did(()); 941 941 } 942 942 } 943 943 ··· 1030 1030 impl<'a, S> RepoBlobRefBuilder<'a, S> 1031 1031 where 1032 1032 S: repo_blob_ref_state::State, 1033 - S::Did: repo_blob_ref_state::IsSet, 1034 1033 S::Cid: repo_blob_ref_state::IsSet, 1034 + S::Did: repo_blob_ref_state::IsSet, 1035 1035 { 1036 1036 /// Build the final struct 1037 1037 pub fn build(self) -> RepoBlobRef<'a> {
+24 -24
crates/weaver-api/src/com_atproto/admin/send_email.rs
··· 42 42 } 43 43 /// State trait tracking which required fields have been set 44 44 pub trait State: sealed::Sealed { 45 - type Content; 46 - type SenderDid; 47 45 type RecipientDid; 46 + type SenderDid; 47 + type Content; 48 48 } 49 49 /// Empty state - all required fields are unset 50 50 pub struct Empty(()); 51 51 impl sealed::Sealed for Empty {} 52 52 impl State for Empty { 53 + type RecipientDid = Unset; 54 + type SenderDid = Unset; 53 55 type Content = Unset; 54 - type SenderDid = Unset; 55 - type RecipientDid = Unset; 56 56 } 57 - ///State transition - sets the `content` field to Set 58 - pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 59 - impl<S: State> sealed::Sealed for SetContent<S> {} 60 - impl<S: State> State for SetContent<S> { 61 - type Content = Set<members::content>; 57 + ///State transition - sets the `recipient_did` field to Set 58 + pub struct SetRecipientDid<S: State = Empty>(PhantomData<fn() -> S>); 59 + impl<S: State> sealed::Sealed for SetRecipientDid<S> {} 60 + impl<S: State> State for SetRecipientDid<S> { 61 + type RecipientDid = Set<members::recipient_did>; 62 62 type SenderDid = S::SenderDid; 63 - type RecipientDid = S::RecipientDid; 63 + type Content = S::Content; 64 64 } 65 65 ///State transition - sets the `sender_did` field to Set 66 66 pub struct SetSenderDid<S: State = Empty>(PhantomData<fn() -> S>); 67 67 impl<S: State> sealed::Sealed for SetSenderDid<S> {} 68 68 impl<S: State> State for SetSenderDid<S> { 69 - type Content = S::Content; 70 - type SenderDid = Set<members::sender_did>; 71 69 type RecipientDid = S::RecipientDid; 70 + type SenderDid = Set<members::sender_did>; 71 + type Content = S::Content; 72 72 } 73 - ///State transition - sets the `recipient_did` field to Set 74 - pub struct SetRecipientDid<S: State = Empty>(PhantomData<fn() -> S>); 75 - impl<S: State> sealed::Sealed for SetRecipientDid<S> {} 76 - impl<S: State> State for SetRecipientDid<S> { 77 - type Content = S::Content; 73 + ///State transition - sets the `content` field to Set 74 + pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 75 + impl<S: State> sealed::Sealed for SetContent<S> {} 76 + impl<S: State> State for SetContent<S> { 77 + type RecipientDid = S::RecipientDid; 78 78 type SenderDid = S::SenderDid; 79 - type RecipientDid = Set<members::recipient_did>; 79 + type Content = Set<members::content>; 80 80 } 81 81 /// Marker types for field names 82 82 #[allow(non_camel_case_types)] 83 83 pub mod members { 84 + ///Marker type for the `recipient_did` field 85 + pub struct recipient_did(()); 86 + ///Marker type for the `sender_did` field 87 + pub struct sender_did(()); 84 88 ///Marker type for the `content` field 85 89 pub struct content(()); 86 - ///Marker type for the `sender_did` field 87 - pub struct sender_did(()); 88 - ///Marker type for the `recipient_did` field 89 - pub struct recipient_did(()); 90 90 } 91 91 } 92 92 ··· 213 213 impl<'a, S> SendEmailBuilder<'a, S> 214 214 where 215 215 S: send_email_state::State, 216 - S::Content: send_email_state::IsSet, 217 - S::SenderDid: send_email_state::IsSet, 218 216 S::RecipientDid: send_email_state::IsSet, 217 + S::SenderDid: send_email_state::IsSet, 218 + S::Content: send_email_state::IsSet, 219 219 { 220 220 /// Build the final struct 221 221 pub fn build(self) -> SendEmail<'a> {
+24 -24
crates/weaver-api/src/com_atproto/identity.rs
··· 47 47 } 48 48 /// State trait tracking which required fields have been set 49 49 pub trait State: sealed::Sealed { 50 - type Did; 51 - type Handle; 52 50 type DidDoc; 51 + type Handle; 52 + type Did; 53 53 } 54 54 /// Empty state - all required fields are unset 55 55 pub struct Empty(()); 56 56 impl sealed::Sealed for Empty {} 57 57 impl State for Empty { 58 + type DidDoc = Unset; 59 + type Handle = Unset; 58 60 type Did = Unset; 59 - type Handle = Unset; 60 - type DidDoc = Unset; 61 61 } 62 - ///State transition - sets the `did` field to Set 63 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 64 - impl<S: State> sealed::Sealed for SetDid<S> {} 65 - impl<S: State> State for SetDid<S> { 66 - type Did = Set<members::did>; 62 + ///State transition - sets the `did_doc` field to Set 63 + pub struct SetDidDoc<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetDidDoc<S> {} 65 + impl<S: State> State for SetDidDoc<S> { 66 + type DidDoc = Set<members::did_doc>; 67 67 type Handle = S::Handle; 68 - type DidDoc = S::DidDoc; 68 + type Did = S::Did; 69 69 } 70 70 ///State transition - sets the `handle` field to Set 71 71 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 72 72 impl<S: State> sealed::Sealed for SetHandle<S> {} 73 73 impl<S: State> State for SetHandle<S> { 74 - type Did = S::Did; 75 - type Handle = Set<members::handle>; 76 74 type DidDoc = S::DidDoc; 75 + type Handle = Set<members::handle>; 76 + type Did = S::Did; 77 77 } 78 - ///State transition - sets the `did_doc` field to Set 79 - pub struct SetDidDoc<S: State = Empty>(PhantomData<fn() -> S>); 80 - impl<S: State> sealed::Sealed for SetDidDoc<S> {} 81 - impl<S: State> State for SetDidDoc<S> { 82 - type Did = S::Did; 78 + ///State transition - sets the `did` field to Set 79 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 80 + impl<S: State> sealed::Sealed for SetDid<S> {} 81 + impl<S: State> State for SetDid<S> { 82 + type DidDoc = S::DidDoc; 83 83 type Handle = S::Handle; 84 - type DidDoc = Set<members::did_doc>; 84 + type Did = Set<members::did>; 85 85 } 86 86 /// Marker types for field names 87 87 #[allow(non_camel_case_types)] 88 88 pub mod members { 89 + ///Marker type for the `did_doc` field 90 + pub struct did_doc(()); 91 + ///Marker type for the `handle` field 92 + pub struct handle(()); 89 93 ///Marker type for the `did` field 90 94 pub struct did(()); 91 - ///Marker type for the `handle` field 92 - pub struct handle(()); 93 - ///Marker type for the `did_doc` field 94 - pub struct did_doc(()); 95 95 } 96 96 } 97 97 ··· 184 184 impl<'a, S> IdentityInfoBuilder<'a, S> 185 185 where 186 186 S: identity_info_state::State, 187 - S::Did: identity_info_state::IsSet, 188 - S::Handle: identity_info_state::IsSet, 189 187 S::DidDoc: identity_info_state::IsSet, 188 + S::Handle: identity_info_state::IsSet, 189 + S::Did: identity_info_state::IsSet, 190 190 { 191 191 /// Build the final struct 192 192 pub fn build(self) -> IdentityInfo<'a> {
+62 -62
crates/weaver-api/src/com_atproto/label.rs
··· 63 63 } 64 64 /// State trait tracking which required fields have been set 65 65 pub trait State: sealed::Sealed { 66 - type Src; 67 66 type Uri; 68 - type Val; 69 67 type Cts; 68 + type Src; 69 + type Val; 70 70 } 71 71 /// Empty state - all required fields are unset 72 72 pub struct Empty(()); 73 73 impl sealed::Sealed for Empty {} 74 74 impl State for Empty { 75 - type Src = Unset; 76 75 type Uri = Unset; 77 - type Val = Unset; 78 76 type Cts = Unset; 79 - } 80 - ///State transition - sets the `src` field to Set 81 - pub struct SetSrc<S: State = Empty>(PhantomData<fn() -> S>); 82 - impl<S: State> sealed::Sealed for SetSrc<S> {} 83 - impl<S: State> State for SetSrc<S> { 84 - type Src = Set<members::src>; 85 - type Uri = S::Uri; 86 - type Val = S::Val; 87 - type Cts = S::Cts; 77 + type Src = Unset; 78 + type Val = Unset; 88 79 } 89 80 ///State transition - sets the `uri` field to Set 90 81 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 91 82 impl<S: State> sealed::Sealed for SetUri<S> {} 92 83 impl<S: State> State for SetUri<S> { 93 - type Src = S::Src; 94 84 type Uri = Set<members::uri>; 95 - type Val = S::Val; 96 85 type Cts = S::Cts; 97 - } 98 - ///State transition - sets the `val` field to Set 99 - pub struct SetVal<S: State = Empty>(PhantomData<fn() -> S>); 100 - impl<S: State> sealed::Sealed for SetVal<S> {} 101 - impl<S: State> State for SetVal<S> { 102 86 type Src = S::Src; 103 - type Uri = S::Uri; 104 - type Val = Set<members::val>; 105 - type Cts = S::Cts; 87 + type Val = S::Val; 106 88 } 107 89 ///State transition - sets the `cts` field to Set 108 90 pub struct SetCts<S: State = Empty>(PhantomData<fn() -> S>); 109 91 impl<S: State> sealed::Sealed for SetCts<S> {} 110 92 impl<S: State> State for SetCts<S> { 93 + type Uri = S::Uri; 94 + type Cts = Set<members::cts>; 111 95 type Src = S::Src; 96 + type Val = S::Val; 97 + } 98 + ///State transition - sets the `src` field to Set 99 + pub struct SetSrc<S: State = Empty>(PhantomData<fn() -> S>); 100 + impl<S: State> sealed::Sealed for SetSrc<S> {} 101 + impl<S: State> State for SetSrc<S> { 112 102 type Uri = S::Uri; 103 + type Cts = S::Cts; 104 + type Src = Set<members::src>; 113 105 type Val = S::Val; 114 - type Cts = Set<members::cts>; 106 + } 107 + ///State transition - sets the `val` field to Set 108 + pub struct SetVal<S: State = Empty>(PhantomData<fn() -> S>); 109 + impl<S: State> sealed::Sealed for SetVal<S> {} 110 + impl<S: State> State for SetVal<S> { 111 + type Uri = S::Uri; 112 + type Cts = S::Cts; 113 + type Src = S::Src; 114 + type Val = Set<members::val>; 115 115 } 116 116 /// Marker types for field names 117 117 #[allow(non_camel_case_types)] 118 118 pub mod members { 119 - ///Marker type for the `src` field 120 - pub struct src(()); 121 119 ///Marker type for the `uri` field 122 120 pub struct uri(()); 121 + ///Marker type for the `cts` field 122 + pub struct cts(()); 123 + ///Marker type for the `src` field 124 + pub struct src(()); 123 125 ///Marker type for the `val` field 124 126 pub struct val(()); 125 - ///Marker type for the `cts` field 126 - pub struct cts(()); 127 127 } 128 128 } 129 129 ··· 328 328 impl<'a, S> LabelBuilder<'a, S> 329 329 where 330 330 S: label_state::State, 331 - S::Src: label_state::IsSet, 332 331 S::Uri: label_state::IsSet, 333 - S::Val: label_state::IsSet, 334 332 S::Cts: label_state::IsSet, 333 + S::Src: label_state::IsSet, 334 + S::Val: label_state::IsSet, 335 335 { 336 336 /// Build the final struct 337 337 pub fn build(self) -> Label<'a> { ··· 1061 1061 pub trait State: sealed::Sealed { 1062 1062 type Severity; 1063 1063 type Identifier; 1064 - type Locales; 1065 1064 type Blurs; 1065 + type Locales; 1066 1066 } 1067 1067 /// Empty state - all required fields are unset 1068 1068 pub struct Empty(()); ··· 1070 1070 impl State for Empty { 1071 1071 type Severity = Unset; 1072 1072 type Identifier = Unset; 1073 - type Locales = Unset; 1074 1073 type Blurs = Unset; 1074 + type Locales = Unset; 1075 1075 } 1076 1076 ///State transition - sets the `severity` field to Set 1077 1077 pub struct SetSeverity<S: State = Empty>(PhantomData<fn() -> S>); ··· 1079 1079 impl<S: State> State for SetSeverity<S> { 1080 1080 type Severity = Set<members::severity>; 1081 1081 type Identifier = S::Identifier; 1082 - type Locales = S::Locales; 1083 1082 type Blurs = S::Blurs; 1083 + type Locales = S::Locales; 1084 1084 } 1085 1085 ///State transition - sets the `identifier` field to Set 1086 1086 pub struct SetIdentifier<S: State = Empty>(PhantomData<fn() -> S>); ··· 1088 1088 impl<S: State> State for SetIdentifier<S> { 1089 1089 type Severity = S::Severity; 1090 1090 type Identifier = Set<members::identifier>; 1091 - type Locales = S::Locales; 1092 1091 type Blurs = S::Blurs; 1093 - } 1094 - ///State transition - sets the `locales` field to Set 1095 - pub struct SetLocales<S: State = Empty>(PhantomData<fn() -> S>); 1096 - impl<S: State> sealed::Sealed for SetLocales<S> {} 1097 - impl<S: State> State for SetLocales<S> { 1098 - type Severity = S::Severity; 1099 - type Identifier = S::Identifier; 1100 - type Locales = Set<members::locales>; 1101 - type Blurs = S::Blurs; 1092 + type Locales = S::Locales; 1102 1093 } 1103 1094 ///State transition - sets the `blurs` field to Set 1104 1095 pub struct SetBlurs<S: State = Empty>(PhantomData<fn() -> S>); ··· 1106 1097 impl<S: State> State for SetBlurs<S> { 1107 1098 type Severity = S::Severity; 1108 1099 type Identifier = S::Identifier; 1100 + type Blurs = Set<members::blurs>; 1109 1101 type Locales = S::Locales; 1110 - type Blurs = Set<members::blurs>; 1102 + } 1103 + ///State transition - sets the `locales` field to Set 1104 + pub struct SetLocales<S: State = Empty>(PhantomData<fn() -> S>); 1105 + impl<S: State> sealed::Sealed for SetLocales<S> {} 1106 + impl<S: State> State for SetLocales<S> { 1107 + type Severity = S::Severity; 1108 + type Identifier = S::Identifier; 1109 + type Blurs = S::Blurs; 1110 + type Locales = Set<members::locales>; 1111 1111 } 1112 1112 /// Marker types for field names 1113 1113 #[allow(non_camel_case_types)] ··· 1116 1116 pub struct severity(()); 1117 1117 ///Marker type for the `identifier` field 1118 1118 pub struct identifier(()); 1119 + ///Marker type for the `blurs` field 1120 + pub struct blurs(()); 1119 1121 ///Marker type for the `locales` field 1120 1122 pub struct locales(()); 1121 - ///Marker type for the `blurs` field 1122 - pub struct blurs(()); 1123 1123 } 1124 1124 } 1125 1125 ··· 1276 1276 S: label_value_definition_state::State, 1277 1277 S::Severity: label_value_definition_state::IsSet, 1278 1278 S::Identifier: label_value_definition_state::IsSet, 1279 - S::Locales: label_value_definition_state::IsSet, 1280 1279 S::Blurs: label_value_definition_state::IsSet, 1280 + S::Locales: label_value_definition_state::IsSet, 1281 1281 { 1282 1282 /// Build the final struct 1283 1283 pub fn build(self) -> LabelValueDefinition<'a> { ··· 1688 1688 /// State trait tracking which required fields have been set 1689 1689 pub trait State: sealed::Sealed { 1690 1690 type Name; 1691 - type Description; 1692 1691 type Lang; 1692 + type Description; 1693 1693 } 1694 1694 /// Empty state - all required fields are unset 1695 1695 pub struct Empty(()); 1696 1696 impl sealed::Sealed for Empty {} 1697 1697 impl State for Empty { 1698 1698 type Name = Unset; 1699 - type Description = Unset; 1700 1699 type Lang = Unset; 1700 + type Description = Unset; 1701 1701 } 1702 1702 ///State transition - sets the `name` field to Set 1703 1703 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1704 1704 impl<S: State> sealed::Sealed for SetName<S> {} 1705 1705 impl<S: State> State for SetName<S> { 1706 1706 type Name = Set<members::name>; 1707 - type Description = S::Description; 1708 1707 type Lang = S::Lang; 1709 - } 1710 - ///State transition - sets the `description` field to Set 1711 - pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 1712 - impl<S: State> sealed::Sealed for SetDescription<S> {} 1713 - impl<S: State> State for SetDescription<S> { 1714 - type Name = S::Name; 1715 - type Description = Set<members::description>; 1716 - type Lang = S::Lang; 1708 + type Description = S::Description; 1717 1709 } 1718 1710 ///State transition - sets the `lang` field to Set 1719 1711 pub struct SetLang<S: State = Empty>(PhantomData<fn() -> S>); 1720 1712 impl<S: State> sealed::Sealed for SetLang<S> {} 1721 1713 impl<S: State> State for SetLang<S> { 1722 1714 type Name = S::Name; 1723 - type Description = S::Description; 1724 1715 type Lang = Set<members::lang>; 1716 + type Description = S::Description; 1717 + } 1718 + ///State transition - sets the `description` field to Set 1719 + pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 1720 + impl<S: State> sealed::Sealed for SetDescription<S> {} 1721 + impl<S: State> State for SetDescription<S> { 1722 + type Name = S::Name; 1723 + type Lang = S::Lang; 1724 + type Description = Set<members::description>; 1725 1725 } 1726 1726 /// Marker types for field names 1727 1727 #[allow(non_camel_case_types)] 1728 1728 pub mod members { 1729 1729 ///Marker type for the `name` field 1730 1730 pub struct name(()); 1731 + ///Marker type for the `lang` field 1732 + pub struct lang(()); 1731 1733 ///Marker type for the `description` field 1732 1734 pub struct description(()); 1733 - ///Marker type for the `lang` field 1734 - pub struct lang(()); 1735 1735 } 1736 1736 } 1737 1737 ··· 1842 1842 where 1843 1843 S: label_value_definition_strings_state::State, 1844 1844 S::Name: label_value_definition_strings_state::IsSet, 1845 - S::Description: label_value_definition_strings_state::IsSet, 1846 1845 S::Lang: label_value_definition_strings_state::IsSet, 1846 + S::Description: label_value_definition_strings_state::IsSet, 1847 1847 { 1848 1848 /// Build the final struct 1849 1849 pub fn build(self) -> LabelValueDefinitionStrings<'a> {
+13 -13
crates/weaver-api/src/com_atproto/label/subscribe_labels.rs
··· 286 286 } 287 287 /// State trait tracking which required fields have been set 288 288 pub trait State: sealed::Sealed { 289 - type Seq; 290 289 type Labels; 290 + type Seq; 291 291 } 292 292 /// Empty state - all required fields are unset 293 293 pub struct Empty(()); 294 294 impl sealed::Sealed for Empty {} 295 295 impl State for Empty { 296 - type Seq = Unset; 297 296 type Labels = Unset; 298 - } 299 - ///State transition - sets the `seq` field to Set 300 - pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 301 - impl<S: State> sealed::Sealed for SetSeq<S> {} 302 - impl<S: State> State for SetSeq<S> { 303 - type Seq = Set<members::seq>; 304 - type Labels = S::Labels; 297 + type Seq = Unset; 305 298 } 306 299 ///State transition - sets the `labels` field to Set 307 300 pub struct SetLabels<S: State = Empty>(PhantomData<fn() -> S>); 308 301 impl<S: State> sealed::Sealed for SetLabels<S> {} 309 302 impl<S: State> State for SetLabels<S> { 310 - type Seq = S::Seq; 311 303 type Labels = Set<members::labels>; 304 + type Seq = S::Seq; 305 + } 306 + ///State transition - sets the `seq` field to Set 307 + pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 308 + impl<S: State> sealed::Sealed for SetSeq<S> {} 309 + impl<S: State> State for SetSeq<S> { 310 + type Labels = S::Labels; 311 + type Seq = Set<members::seq>; 312 312 } 313 313 /// Marker types for field names 314 314 #[allow(non_camel_case_types)] 315 315 pub mod members { 316 - ///Marker type for the `seq` field 317 - pub struct seq(()); 318 316 ///Marker type for the `labels` field 319 317 pub struct labels(()); 318 + ///Marker type for the `seq` field 319 + pub struct seq(()); 320 320 } 321 321 } 322 322 ··· 389 389 impl<'a, S> LabelsBuilder<'a, S> 390 390 where 391 391 S: labels_state::State, 392 - S::Seq: labels_state::IsSet, 393 392 S::Labels: labels_state::IsSet, 393 + S::Seq: labels_state::IsSet, 394 394 { 395 395 /// Build the final struct 396 396 pub fn build(self) -> Labels<'a> {
+13 -13
crates/weaver-api/src/com_atproto/repo.rs
··· 44 44 } 45 45 /// State trait tracking which required fields have been set 46 46 pub trait State: sealed::Sealed { 47 - type Rev; 48 47 type Cid; 48 + type Rev; 49 49 } 50 50 /// Empty state - all required fields are unset 51 51 pub struct Empty(()); 52 52 impl sealed::Sealed for Empty {} 53 53 impl State for Empty { 54 - type Rev = Unset; 55 54 type Cid = Unset; 56 - } 57 - ///State transition - sets the `rev` field to Set 58 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 59 - impl<S: State> sealed::Sealed for SetRev<S> {} 60 - impl<S: State> State for SetRev<S> { 61 - type Rev = Set<members::rev>; 62 - type Cid = S::Cid; 55 + type Rev = Unset; 63 56 } 64 57 ///State transition - sets the `cid` field to Set 65 58 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 66 59 impl<S: State> sealed::Sealed for SetCid<S> {} 67 60 impl<S: State> State for SetCid<S> { 68 - type Rev = S::Rev; 69 61 type Cid = Set<members::cid>; 62 + type Rev = S::Rev; 63 + } 64 + ///State transition - sets the `rev` field to Set 65 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 66 + impl<S: State> sealed::Sealed for SetRev<S> {} 67 + impl<S: State> State for SetRev<S> { 68 + type Cid = S::Cid; 69 + type Rev = Set<members::rev>; 70 70 } 71 71 /// Marker types for field names 72 72 #[allow(non_camel_case_types)] 73 73 pub mod members { 74 - ///Marker type for the `rev` field 75 - pub struct rev(()); 76 74 ///Marker type for the `cid` field 77 75 pub struct cid(()); 76 + ///Marker type for the `rev` field 77 + pub struct rev(()); 78 78 } 79 79 } 80 80 ··· 147 147 impl<'a, S> CommitMetaBuilder<'a, S> 148 148 where 149 149 S: commit_meta_state::State, 150 - S::Rev: commit_meta_state::IsSet, 151 150 S::Cid: commit_meta_state::IsSet, 151 + S::Rev: commit_meta_state::IsSet, 152 152 { 153 153 /// Build the final struct 154 154 pub fn build(self) -> CommitMeta<'a> {
+63 -63
crates/weaver-api/src/com_atproto/repo/apply_writes.rs
··· 42 42 } 43 43 /// State trait tracking which required fields have been set 44 44 pub trait State: sealed::Sealed { 45 - type Value; 46 45 type Collection; 46 + type Value; 47 47 } 48 48 /// Empty state - all required fields are unset 49 49 pub struct Empty(()); 50 50 impl sealed::Sealed for Empty {} 51 51 impl State for Empty { 52 - type Value = Unset; 53 52 type Collection = Unset; 54 - } 55 - ///State transition - sets the `value` field to Set 56 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 57 - impl<S: State> sealed::Sealed for SetValue<S> {} 58 - impl<S: State> State for SetValue<S> { 59 - type Value = Set<members::value>; 60 - type Collection = S::Collection; 53 + type Value = Unset; 61 54 } 62 55 ///State transition - sets the `collection` field to Set 63 56 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 64 57 impl<S: State> sealed::Sealed for SetCollection<S> {} 65 58 impl<S: State> State for SetCollection<S> { 66 - type Value = S::Value; 67 59 type Collection = Set<members::collection>; 60 + type Value = S::Value; 61 + } 62 + ///State transition - sets the `value` field to Set 63 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetValue<S> {} 65 + impl<S: State> State for SetValue<S> { 66 + type Collection = S::Collection; 67 + type Value = Set<members::value>; 68 68 } 69 69 /// Marker types for field names 70 70 #[allow(non_camel_case_types)] 71 71 pub mod members { 72 - ///Marker type for the `value` field 73 - pub struct value(()); 74 72 ///Marker type for the `collection` field 75 73 pub struct collection(()); 74 + ///Marker type for the `value` field 75 + pub struct value(()); 76 76 } 77 77 } 78 78 ··· 179 179 impl<'a, S> CreateBuilder<'a, S> 180 180 where 181 181 S: create_state::State, 182 - S::Value: create_state::IsSet, 183 182 S::Collection: create_state::IsSet, 183 + S::Value: create_state::IsSet, 184 184 { 185 185 /// Build the final struct 186 186 pub fn build(self) -> Create<'a> { ··· 728 728 } 729 729 /// State trait tracking which required fields have been set 730 730 pub trait State: sealed::Sealed { 731 - type Cid; 732 731 type Uri; 732 + type Cid; 733 733 } 734 734 /// Empty state - all required fields are unset 735 735 pub struct Empty(()); 736 736 impl sealed::Sealed for Empty {} 737 737 impl State for Empty { 738 + type Uri = Unset; 738 739 type Cid = Unset; 739 - type Uri = Unset; 740 + } 741 + ///State transition - sets the `uri` field to Set 742 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 743 + impl<S: State> sealed::Sealed for SetUri<S> {} 744 + impl<S: State> State for SetUri<S> { 745 + type Uri = Set<members::uri>; 746 + type Cid = S::Cid; 740 747 } 741 748 ///State transition - sets the `cid` field to Set 742 749 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 743 750 impl<S: State> sealed::Sealed for SetCid<S> {} 744 751 impl<S: State> State for SetCid<S> { 745 - type Cid = Set<members::cid>; 746 752 type Uri = S::Uri; 747 - } 748 - ///State transition - sets the `uri` field to Set 749 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 750 - impl<S: State> sealed::Sealed for SetUri<S> {} 751 - impl<S: State> State for SetUri<S> { 752 - type Cid = S::Cid; 753 - type Uri = Set<members::uri>; 753 + type Cid = Set<members::cid>; 754 754 } 755 755 /// Marker types for field names 756 756 #[allow(non_camel_case_types)] 757 757 pub mod members { 758 + ///Marker type for the `uri` field 759 + pub struct uri(()); 758 760 ///Marker type for the `cid` field 759 761 pub struct cid(()); 760 - ///Marker type for the `uri` field 761 - pub struct uri(()); 762 762 } 763 763 } 764 764 ··· 851 851 impl<'a, S> CreateResultBuilder<'a, S> 852 852 where 853 853 S: create_result_state::State, 854 - S::Cid: create_result_state::IsSet, 855 854 S::Uri: create_result_state::IsSet, 855 + S::Cid: create_result_state::IsSet, 856 856 { 857 857 /// Build the final struct 858 858 pub fn build(self) -> CreateResult<'a> { ··· 1241 1241 } 1242 1242 /// State trait tracking which required fields have been set 1243 1243 pub trait State: sealed::Sealed { 1244 - type Repo; 1245 1244 type Writes; 1245 + type Repo; 1246 1246 } 1247 1247 /// Empty state - all required fields are unset 1248 1248 pub struct Empty(()); 1249 1249 impl sealed::Sealed for Empty {} 1250 1250 impl State for Empty { 1251 - type Repo = Unset; 1252 1251 type Writes = Unset; 1253 - } 1254 - ///State transition - sets the `repo` field to Set 1255 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1256 - impl<S: State> sealed::Sealed for SetRepo<S> {} 1257 - impl<S: State> State for SetRepo<S> { 1258 - type Repo = Set<members::repo>; 1259 - type Writes = S::Writes; 1252 + type Repo = Unset; 1260 1253 } 1261 1254 ///State transition - sets the `writes` field to Set 1262 1255 pub struct SetWrites<S: State = Empty>(PhantomData<fn() -> S>); 1263 1256 impl<S: State> sealed::Sealed for SetWrites<S> {} 1264 1257 impl<S: State> State for SetWrites<S> { 1258 + type Writes = Set<members::writes>; 1265 1259 type Repo = S::Repo; 1266 - type Writes = Set<members::writes>; 1260 + } 1261 + ///State transition - sets the `repo` field to Set 1262 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1263 + impl<S: State> sealed::Sealed for SetRepo<S> {} 1264 + impl<S: State> State for SetRepo<S> { 1265 + type Writes = S::Writes; 1266 + type Repo = Set<members::repo>; 1267 1267 } 1268 1268 /// Marker types for field names 1269 1269 #[allow(non_camel_case_types)] 1270 1270 pub mod members { 1271 - ///Marker type for the `repo` field 1272 - pub struct repo(()); 1273 1271 ///Marker type for the `writes` field 1274 1272 pub struct writes(()); 1273 + ///Marker type for the `repo` field 1274 + pub struct repo(()); 1275 1275 } 1276 1276 } 1277 1277 ··· 1378 1378 impl<'a, S> ApplyWritesBuilder<'a, S> 1379 1379 where 1380 1380 S: apply_writes_state::State, 1381 - S::Repo: apply_writes_state::IsSet, 1382 1381 S::Writes: apply_writes_state::IsSet, 1382 + S::Repo: apply_writes_state::IsSet, 1383 1383 { 1384 1384 /// Build the final struct 1385 1385 pub fn build(self) -> ApplyWrites<'a> { ··· 1568 1568 } 1569 1569 /// State trait tracking which required fields have been set 1570 1570 pub trait State: sealed::Sealed { 1571 - type Value; 1572 - type Rkey; 1573 1571 type Collection; 1572 + type Rkey; 1573 + type Value; 1574 1574 } 1575 1575 /// Empty state - all required fields are unset 1576 1576 pub struct Empty(()); 1577 1577 impl sealed::Sealed for Empty {} 1578 1578 impl State for Empty { 1579 - type Value = Unset; 1579 + type Collection = Unset; 1580 1580 type Rkey = Unset; 1581 - type Collection = Unset; 1581 + type Value = Unset; 1582 1582 } 1583 - ///State transition - sets the `value` field to Set 1584 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1585 - impl<S: State> sealed::Sealed for SetValue<S> {} 1586 - impl<S: State> State for SetValue<S> { 1587 - type Value = Set<members::value>; 1583 + ///State transition - sets the `collection` field to Set 1584 + pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 1585 + impl<S: State> sealed::Sealed for SetCollection<S> {} 1586 + impl<S: State> State for SetCollection<S> { 1587 + type Collection = Set<members::collection>; 1588 1588 type Rkey = S::Rkey; 1589 - type Collection = S::Collection; 1589 + type Value = S::Value; 1590 1590 } 1591 1591 ///State transition - sets the `rkey` field to Set 1592 1592 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 1593 1593 impl<S: State> sealed::Sealed for SetRkey<S> {} 1594 1594 impl<S: State> State for SetRkey<S> { 1595 - type Value = S::Value; 1595 + type Collection = S::Collection; 1596 1596 type Rkey = Set<members::rkey>; 1597 - type Collection = S::Collection; 1597 + type Value = S::Value; 1598 1598 } 1599 - ///State transition - sets the `collection` field to Set 1600 - pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 1601 - impl<S: State> sealed::Sealed for SetCollection<S> {} 1602 - impl<S: State> State for SetCollection<S> { 1603 - type Value = S::Value; 1599 + ///State transition - sets the `value` field to Set 1600 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1601 + impl<S: State> sealed::Sealed for SetValue<S> {} 1602 + impl<S: State> State for SetValue<S> { 1603 + type Collection = S::Collection; 1604 1604 type Rkey = S::Rkey; 1605 - type Collection = Set<members::collection>; 1605 + type Value = Set<members::value>; 1606 1606 } 1607 1607 /// Marker types for field names 1608 1608 #[allow(non_camel_case_types)] 1609 1609 pub mod members { 1610 - ///Marker type for the `value` field 1611 - pub struct value(()); 1610 + ///Marker type for the `collection` field 1611 + pub struct collection(()); 1612 1612 ///Marker type for the `rkey` field 1613 1613 pub struct rkey(()); 1614 - ///Marker type for the `collection` field 1615 - pub struct collection(()); 1614 + ///Marker type for the `value` field 1615 + pub struct value(()); 1616 1616 } 1617 1617 } 1618 1618 ··· 1713 1713 impl<'a, S> UpdateBuilder<'a, S> 1714 1714 where 1715 1715 S: update_state::State, 1716 - S::Value: update_state::IsSet, 1717 - S::Rkey: update_state::IsSet, 1718 1716 S::Collection: update_state::IsSet, 1717 + S::Rkey: update_state::IsSet, 1718 + S::Value: update_state::IsSet, 1719 1719 { 1720 1720 /// Build the final struct 1721 1721 pub fn build(self) -> Update<'a> {
+15 -15
crates/weaver-api/src/com_atproto/repo/create_record.rs
··· 54 54 /// State trait tracking which required fields have been set 55 55 pub trait State: sealed::Sealed { 56 56 type Record; 57 - type Collection; 58 57 type Repo; 58 + type Collection; 59 59 } 60 60 /// Empty state - all required fields are unset 61 61 pub struct Empty(()); 62 62 impl sealed::Sealed for Empty {} 63 63 impl State for Empty { 64 64 type Record = Unset; 65 - type Collection = Unset; 66 65 type Repo = Unset; 66 + type Collection = Unset; 67 67 } 68 68 ///State transition - sets the `record` field to Set 69 69 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 70 70 impl<S: State> sealed::Sealed for SetRecord<S> {} 71 71 impl<S: State> State for SetRecord<S> { 72 72 type Record = Set<members::record>; 73 - type Collection = S::Collection; 74 73 type Repo = S::Repo; 75 - } 76 - ///State transition - sets the `collection` field to Set 77 - pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 78 - impl<S: State> sealed::Sealed for SetCollection<S> {} 79 - impl<S: State> State for SetCollection<S> { 80 - type Record = S::Record; 81 - type Collection = Set<members::collection>; 82 - type Repo = S::Repo; 74 + type Collection = S::Collection; 83 75 } 84 76 ///State transition - sets the `repo` field to Set 85 77 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 86 78 impl<S: State> sealed::Sealed for SetRepo<S> {} 87 79 impl<S: State> State for SetRepo<S> { 88 80 type Record = S::Record; 89 - type Collection = S::Collection; 90 81 type Repo = Set<members::repo>; 82 + type Collection = S::Collection; 83 + } 84 + ///State transition - sets the `collection` field to Set 85 + pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 86 + impl<S: State> sealed::Sealed for SetCollection<S> {} 87 + impl<S: State> State for SetCollection<S> { 88 + type Record = S::Record; 89 + type Repo = S::Repo; 90 + type Collection = Set<members::collection>; 91 91 } 92 92 /// Marker types for field names 93 93 #[allow(non_camel_case_types)] 94 94 pub mod members { 95 95 ///Marker type for the `record` field 96 96 pub struct record(()); 97 + ///Marker type for the `repo` field 98 + pub struct repo(()); 97 99 ///Marker type for the `collection` field 98 100 pub struct collection(()); 99 - ///Marker type for the `repo` field 100 - pub struct repo(()); 101 101 } 102 102 } 103 103 ··· 259 259 where 260 260 S: create_record_state::State, 261 261 S::Record: create_record_state::IsSet, 262 - S::Collection: create_record_state::IsSet, 263 262 S::Repo: create_record_state::IsSet, 263 + S::Collection: create_record_state::IsSet, 264 264 { 265 265 /// Build the final struct 266 266 pub fn build(self) -> CreateRecord<'a> {
+15 -15
crates/weaver-api/src/com_atproto/repo/delete_record.rs
··· 48 48 } 49 49 /// State trait tracking which required fields have been set 50 50 pub trait State: sealed::Sealed { 51 - type Collection; 52 51 type Repo; 52 + type Collection; 53 53 type Rkey; 54 54 } 55 55 /// Empty state - all required fields are unset 56 56 pub struct Empty(()); 57 57 impl sealed::Sealed for Empty {} 58 58 impl State for Empty { 59 - type Collection = Unset; 60 59 type Repo = Unset; 60 + type Collection = Unset; 61 61 type Rkey = Unset; 62 62 } 63 - ///State transition - sets the `collection` field to Set 64 - pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 65 - impl<S: State> sealed::Sealed for SetCollection<S> {} 66 - impl<S: State> State for SetCollection<S> { 67 - type Collection = Set<members::collection>; 68 - type Repo = S::Repo; 69 - type Rkey = S::Rkey; 70 - } 71 63 ///State transition - sets the `repo` field to Set 72 64 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 73 65 impl<S: State> sealed::Sealed for SetRepo<S> {} 74 66 impl<S: State> State for SetRepo<S> { 75 - type Collection = S::Collection; 76 67 type Repo = Set<members::repo>; 68 + type Collection = S::Collection; 69 + type Rkey = S::Rkey; 70 + } 71 + ///State transition - sets the `collection` field to Set 72 + pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 73 + impl<S: State> sealed::Sealed for SetCollection<S> {} 74 + impl<S: State> State for SetCollection<S> { 75 + type Repo = S::Repo; 76 + type Collection = Set<members::collection>; 77 77 type Rkey = S::Rkey; 78 78 } 79 79 ///State transition - sets the `rkey` field to Set 80 80 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 81 81 impl<S: State> sealed::Sealed for SetRkey<S> {} 82 82 impl<S: State> State for SetRkey<S> { 83 - type Collection = S::Collection; 84 83 type Repo = S::Repo; 84 + type Collection = S::Collection; 85 85 type Rkey = Set<members::rkey>; 86 86 } 87 87 /// Marker types for field names 88 88 #[allow(non_camel_case_types)] 89 89 pub mod members { 90 + ///Marker type for the `repo` field 91 + pub struct repo(()); 90 92 ///Marker type for the `collection` field 91 93 pub struct collection(()); 92 - ///Marker type for the `repo` field 93 - pub struct repo(()); 94 94 ///Marker type for the `rkey` field 95 95 pub struct rkey(()); 96 96 } ··· 233 233 impl<'a, S> DeleteRecordBuilder<'a, S> 234 234 where 235 235 S: delete_record_state::State, 236 - S::Collection: delete_record_state::IsSet, 237 236 S::Repo: delete_record_state::IsSet, 237 + S::Collection: delete_record_state::IsSet, 238 238 S::Rkey: delete_record_state::IsSet, 239 239 { 240 240 /// Build the final struct
+15 -15
crates/weaver-api/src/com_atproto/repo/get_record.rs
··· 40 40 /// State trait tracking which required fields have been set 41 41 pub trait State: sealed::Sealed { 42 42 type Rkey; 43 - type Repo; 44 43 type Collection; 44 + type Repo; 45 45 } 46 46 /// Empty state - all required fields are unset 47 47 pub struct Empty(()); 48 48 impl sealed::Sealed for Empty {} 49 49 impl State for Empty { 50 50 type Rkey = Unset; 51 - type Repo = Unset; 52 51 type Collection = Unset; 52 + type Repo = Unset; 53 53 } 54 54 ///State transition - sets the `rkey` field to Set 55 55 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 56 56 impl<S: State> sealed::Sealed for SetRkey<S> {} 57 57 impl<S: State> State for SetRkey<S> { 58 58 type Rkey = Set<members::rkey>; 59 - type Repo = S::Repo; 60 59 type Collection = S::Collection; 61 - } 62 - ///State transition - sets the `repo` field to Set 63 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 64 - impl<S: State> sealed::Sealed for SetRepo<S> {} 65 - impl<S: State> State for SetRepo<S> { 66 - type Rkey = S::Rkey; 67 - type Repo = Set<members::repo>; 68 - type Collection = S::Collection; 60 + type Repo = S::Repo; 69 61 } 70 62 ///State transition - sets the `collection` field to Set 71 63 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 72 64 impl<S: State> sealed::Sealed for SetCollection<S> {} 73 65 impl<S: State> State for SetCollection<S> { 74 66 type Rkey = S::Rkey; 75 - type Repo = S::Repo; 76 67 type Collection = Set<members::collection>; 68 + type Repo = S::Repo; 69 + } 70 + ///State transition - sets the `repo` field to Set 71 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 72 + impl<S: State> sealed::Sealed for SetRepo<S> {} 73 + impl<S: State> State for SetRepo<S> { 74 + type Rkey = S::Rkey; 75 + type Collection = S::Collection; 76 + type Repo = Set<members::repo>; 77 77 } 78 78 /// Marker types for field names 79 79 #[allow(non_camel_case_types)] 80 80 pub mod members { 81 81 ///Marker type for the `rkey` field 82 82 pub struct rkey(()); 83 + ///Marker type for the `collection` field 84 + pub struct collection(()); 83 85 ///Marker type for the `repo` field 84 86 pub struct repo(()); 85 - ///Marker type for the `collection` field 86 - pub struct collection(()); 87 87 } 88 88 } 89 89 ··· 205 205 where 206 206 S: get_record_state::State, 207 207 S::Rkey: get_record_state::IsSet, 208 - S::Repo: get_record_state::IsSet, 209 208 S::Collection: get_record_state::IsSet, 209 + S::Repo: get_record_state::IsSet, 210 210 { 211 211 /// Build the final struct 212 212 pub fn build(self) -> GetRecord<'a> {
+13 -13
crates/weaver-api/src/com_atproto/repo/list_missing_blobs.rs
··· 186 186 } 187 187 /// State trait tracking which required fields have been set 188 188 pub trait State: sealed::Sealed { 189 - type RecordUri; 190 189 type Cid; 190 + type RecordUri; 191 191 } 192 192 /// Empty state - all required fields are unset 193 193 pub struct Empty(()); 194 194 impl sealed::Sealed for Empty {} 195 195 impl State for Empty { 196 - type RecordUri = Unset; 197 196 type Cid = Unset; 198 - } 199 - ///State transition - sets the `record_uri` field to Set 200 - pub struct SetRecordUri<S: State = Empty>(PhantomData<fn() -> S>); 201 - impl<S: State> sealed::Sealed for SetRecordUri<S> {} 202 - impl<S: State> State for SetRecordUri<S> { 203 - type RecordUri = Set<members::record_uri>; 204 - type Cid = S::Cid; 197 + type RecordUri = Unset; 205 198 } 206 199 ///State transition - sets the `cid` field to Set 207 200 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 208 201 impl<S: State> sealed::Sealed for SetCid<S> {} 209 202 impl<S: State> State for SetCid<S> { 210 - type RecordUri = S::RecordUri; 211 203 type Cid = Set<members::cid>; 204 + type RecordUri = S::RecordUri; 205 + } 206 + ///State transition - sets the `record_uri` field to Set 207 + pub struct SetRecordUri<S: State = Empty>(PhantomData<fn() -> S>); 208 + impl<S: State> sealed::Sealed for SetRecordUri<S> {} 209 + impl<S: State> State for SetRecordUri<S> { 210 + type Cid = S::Cid; 211 + type RecordUri = Set<members::record_uri>; 212 212 } 213 213 /// Marker types for field names 214 214 #[allow(non_camel_case_types)] 215 215 pub mod members { 216 - ///Marker type for the `record_uri` field 217 - pub struct record_uri(()); 218 216 ///Marker type for the `cid` field 219 217 pub struct cid(()); 218 + ///Marker type for the `record_uri` field 219 + pub struct record_uri(()); 220 220 } 221 221 } 222 222 ··· 289 289 impl<'a, S> RecordBlobBuilder<'a, S> 290 290 where 291 291 S: record_blob_state::State, 292 - S::RecordUri: record_blob_state::IsSet, 293 292 S::Cid: record_blob_state::IsSet, 293 + S::RecordUri: record_blob_state::IsSet, 294 294 { 295 295 /// Build the final struct 296 296 pub fn build(self) -> RecordBlob<'a> {
+28 -28
crates/weaver-api/src/com_atproto/repo/list_records.rs
··· 40 40 } 41 41 /// State trait tracking which required fields have been set 42 42 pub trait State: sealed::Sealed { 43 - type Repo; 44 43 type Collection; 44 + type Repo; 45 45 } 46 46 /// Empty state - all required fields are unset 47 47 pub struct Empty(()); 48 48 impl sealed::Sealed for Empty {} 49 49 impl State for Empty { 50 - type Repo = Unset; 51 50 type Collection = Unset; 52 - } 53 - ///State transition - sets the `repo` field to Set 54 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 55 - impl<S: State> sealed::Sealed for SetRepo<S> {} 56 - impl<S: State> State for SetRepo<S> { 57 - type Repo = Set<members::repo>; 58 - type Collection = S::Collection; 51 + type Repo = Unset; 59 52 } 60 53 ///State transition - sets the `collection` field to Set 61 54 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 62 55 impl<S: State> sealed::Sealed for SetCollection<S> {} 63 56 impl<S: State> State for SetCollection<S> { 64 - type Repo = S::Repo; 65 57 type Collection = Set<members::collection>; 58 + type Repo = S::Repo; 59 + } 60 + ///State transition - sets the `repo` field to Set 61 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 62 + impl<S: State> sealed::Sealed for SetRepo<S> {} 63 + impl<S: State> State for SetRepo<S> { 64 + type Collection = S::Collection; 65 + type Repo = Set<members::repo>; 66 66 } 67 67 /// Marker types for field names 68 68 #[allow(non_camel_case_types)] 69 69 pub mod members { 70 + ///Marker type for the `collection` field 71 + pub struct collection(()); 70 72 ///Marker type for the `repo` field 71 73 pub struct repo(()); 72 - ///Marker type for the `collection` field 73 - pub struct collection(()); 74 74 } 75 75 } 76 76 ··· 188 188 impl<'a, S> ListRecordsBuilder<'a, S> 189 189 where 190 190 S: list_records_state::State, 191 - S::Repo: list_records_state::IsSet, 192 191 S::Collection: list_records_state::IsSet, 192 + S::Repo: list_records_state::IsSet, 193 193 { 194 194 /// Build the final struct 195 195 pub fn build(self) -> ListRecords<'a> { ··· 278 278 } 279 279 /// State trait tracking which required fields have been set 280 280 pub trait State: sealed::Sealed { 281 - type Value; 282 281 type Uri; 283 282 type Cid; 283 + type Value; 284 284 } 285 285 /// Empty state - all required fields are unset 286 286 pub struct Empty(()); 287 287 impl sealed::Sealed for Empty {} 288 288 impl State for Empty { 289 - type Value = Unset; 290 289 type Uri = Unset; 291 290 type Cid = Unset; 292 - } 293 - ///State transition - sets the `value` field to Set 294 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 295 - impl<S: State> sealed::Sealed for SetValue<S> {} 296 - impl<S: State> State for SetValue<S> { 297 - type Value = Set<members::value>; 298 - type Uri = S::Uri; 299 - type Cid = S::Cid; 291 + type Value = Unset; 300 292 } 301 293 ///State transition - sets the `uri` field to Set 302 294 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 303 295 impl<S: State> sealed::Sealed for SetUri<S> {} 304 296 impl<S: State> State for SetUri<S> { 305 - type Value = S::Value; 306 297 type Uri = Set<members::uri>; 307 298 type Cid = S::Cid; 299 + type Value = S::Value; 308 300 } 309 301 ///State transition - sets the `cid` field to Set 310 302 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 311 303 impl<S: State> sealed::Sealed for SetCid<S> {} 312 304 impl<S: State> State for SetCid<S> { 313 - type Value = S::Value; 314 305 type Uri = S::Uri; 315 306 type Cid = Set<members::cid>; 307 + type Value = S::Value; 308 + } 309 + ///State transition - sets the `value` field to Set 310 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 311 + impl<S: State> sealed::Sealed for SetValue<S> {} 312 + impl<S: State> State for SetValue<S> { 313 + type Uri = S::Uri; 314 + type Cid = S::Cid; 315 + type Value = Set<members::value>; 316 316 } 317 317 /// Marker types for field names 318 318 #[allow(non_camel_case_types)] 319 319 pub mod members { 320 - ///Marker type for the `value` field 321 - pub struct value(()); 322 320 ///Marker type for the `uri` field 323 321 pub struct uri(()); 324 322 ///Marker type for the `cid` field 325 323 pub struct cid(()); 324 + ///Marker type for the `value` field 325 + pub struct value(()); 326 326 } 327 327 } 328 328 ··· 415 415 impl<'a, S> RecordBuilder<'a, S> 416 416 where 417 417 S: record_state::State, 418 - S::Value: record_state::IsSet, 419 418 S::Uri: record_state::IsSet, 420 419 S::Cid: record_state::IsSet, 420 + S::Value: record_state::IsSet, 421 421 { 422 422 /// Build the final struct 423 423 pub fn build(self) -> Record<'a> {
+17 -17
crates/weaver-api/src/com_atproto/repo/put_record.rs
··· 54 54 } 55 55 /// State trait tracking which required fields have been set 56 56 pub trait State: sealed::Sealed { 57 - type Repo; 58 57 type Record; 58 + type Repo; 59 59 type Collection; 60 60 type Rkey; 61 61 } ··· 63 63 pub struct Empty(()); 64 64 impl sealed::Sealed for Empty {} 65 65 impl State for Empty { 66 - type Repo = Unset; 67 66 type Record = Unset; 67 + type Repo = Unset; 68 68 type Collection = Unset; 69 69 type Rkey = Unset; 70 70 } 71 - ///State transition - sets the `repo` field to Set 72 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 73 - impl<S: State> sealed::Sealed for SetRepo<S> {} 74 - impl<S: State> State for SetRepo<S> { 75 - type Repo = Set<members::repo>; 76 - type Record = S::Record; 77 - type Collection = S::Collection; 78 - type Rkey = S::Rkey; 79 - } 80 71 ///State transition - sets the `record` field to Set 81 72 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 82 73 impl<S: State> sealed::Sealed for SetRecord<S> {} 83 74 impl<S: State> State for SetRecord<S> { 84 - type Repo = S::Repo; 85 75 type Record = Set<members::record>; 76 + type Repo = S::Repo; 77 + type Collection = S::Collection; 78 + type Rkey = S::Rkey; 79 + } 80 + ///State transition - sets the `repo` field to Set 81 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 82 + impl<S: State> sealed::Sealed for SetRepo<S> {} 83 + impl<S: State> State for SetRepo<S> { 84 + type Record = S::Record; 85 + type Repo = Set<members::repo>; 86 86 type Collection = S::Collection; 87 87 type Rkey = S::Rkey; 88 88 } ··· 90 90 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 91 91 impl<S: State> sealed::Sealed for SetCollection<S> {} 92 92 impl<S: State> State for SetCollection<S> { 93 - type Repo = S::Repo; 94 93 type Record = S::Record; 94 + type Repo = S::Repo; 95 95 type Collection = Set<members::collection>; 96 96 type Rkey = S::Rkey; 97 97 } ··· 99 99 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 100 100 impl<S: State> sealed::Sealed for SetRkey<S> {} 101 101 impl<S: State> State for SetRkey<S> { 102 - type Repo = S::Repo; 103 102 type Record = S::Record; 103 + type Repo = S::Repo; 104 104 type Collection = S::Collection; 105 105 type Rkey = Set<members::rkey>; 106 106 } 107 107 /// Marker types for field names 108 108 #[allow(non_camel_case_types)] 109 109 pub mod members { 110 + ///Marker type for the `record` field 111 + pub struct record(()); 110 112 ///Marker type for the `repo` field 111 113 pub struct repo(()); 112 - ///Marker type for the `record` field 113 - pub struct record(()); 114 114 ///Marker type for the `collection` field 115 115 pub struct collection(()); 116 116 ///Marker type for the `rkey` field ··· 289 289 impl<'a, S> PutRecordBuilder<'a, S> 290 290 where 291 291 S: put_record_state::State, 292 - S::Repo: put_record_state::IsSet, 293 292 S::Record: put_record_state::IsSet, 293 + S::Repo: put_record_state::IsSet, 294 294 S::Collection: put_record_state::IsSet, 295 295 S::Rkey: put_record_state::IsSet, 296 296 {
+13 -13
crates/weaver-api/src/com_atproto/repo/strong_ref.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Cid; 37 36 type Uri; 37 + type Cid; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Cid = Unset; 44 43 type Uri = Unset; 45 - } 46 - ///State transition - sets the `cid` field to Set 47 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetCid<S> {} 49 - impl<S: State> State for SetCid<S> { 50 - type Cid = Set<members::cid>; 51 - type Uri = S::Uri; 44 + type Cid = Unset; 52 45 } 53 46 ///State transition - sets the `uri` field to Set 54 47 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetUri<S> {} 56 49 impl<S: State> State for SetUri<S> { 57 - type Cid = S::Cid; 58 50 type Uri = Set<members::uri>; 51 + type Cid = S::Cid; 52 + } 53 + ///State transition - sets the `cid` field to Set 54 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetCid<S> {} 56 + impl<S: State> State for SetCid<S> { 57 + type Uri = S::Uri; 58 + type Cid = Set<members::cid>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `cid` field 64 - pub struct cid(()); 65 63 ///Marker type for the `uri` field 66 64 pub struct uri(()); 65 + ///Marker type for the `cid` field 66 + pub struct cid(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> StrongRefBuilder<'a, S> 137 137 where 138 138 S: strong_ref_state::State, 139 - S::Cid: strong_ref_state::IsSet, 140 139 S::Uri: strong_ref_state::IsSet, 140 + S::Cid: strong_ref_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> StrongRef<'a> {
+84 -84
crates/weaver-api/src/com_atproto/server.rs
··· 66 66 } 67 67 /// State trait tracking which required fields have been set 68 68 pub trait State: sealed::Sealed { 69 + type Available; 70 + type CreatedAt; 69 71 type Code; 70 - type Disabled; 71 72 type Uses; 72 - type CreatedAt; 73 - type Available; 73 + type Disabled; 74 + type CreatedBy; 74 75 type ForAccount; 75 - type CreatedBy; 76 76 } 77 77 /// Empty state - all required fields are unset 78 78 pub struct Empty(()); 79 79 impl sealed::Sealed for Empty {} 80 80 impl State for Empty { 81 + type Available = Unset; 82 + type CreatedAt = Unset; 81 83 type Code = Unset; 84 + type Uses = Unset; 82 85 type Disabled = Unset; 83 - type Uses = Unset; 84 - type CreatedAt = Unset; 85 - type Available = Unset; 86 + type CreatedBy = Unset; 86 87 type ForAccount = Unset; 87 - type CreatedBy = Unset; 88 + } 89 + ///State transition - sets the `available` field to Set 90 + pub struct SetAvailable<S: State = Empty>(PhantomData<fn() -> S>); 91 + impl<S: State> sealed::Sealed for SetAvailable<S> {} 92 + impl<S: State> State for SetAvailable<S> { 93 + type Available = Set<members::available>; 94 + type CreatedAt = S::CreatedAt; 95 + type Code = S::Code; 96 + type Uses = S::Uses; 97 + type Disabled = S::Disabled; 98 + type CreatedBy = S::CreatedBy; 99 + type ForAccount = S::ForAccount; 100 + } 101 + ///State transition - sets the `created_at` field to Set 102 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 103 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 104 + impl<S: State> State for SetCreatedAt<S> { 105 + type Available = S::Available; 106 + type CreatedAt = Set<members::created_at>; 107 + type Code = S::Code; 108 + type Uses = S::Uses; 109 + type Disabled = S::Disabled; 110 + type CreatedBy = S::CreatedBy; 111 + type ForAccount = S::ForAccount; 88 112 } 89 113 ///State transition - sets the `code` field to Set 90 114 pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 91 115 impl<S: State> sealed::Sealed for SetCode<S> {} 92 116 impl<S: State> State for SetCode<S> { 117 + type Available = S::Available; 118 + type CreatedAt = S::CreatedAt; 93 119 type Code = Set<members::code>; 94 - type Disabled = S::Disabled; 95 120 type Uses = S::Uses; 96 - type CreatedAt = S::CreatedAt; 97 - type Available = S::Available; 98 - type ForAccount = S::ForAccount; 121 + type Disabled = S::Disabled; 99 122 type CreatedBy = S::CreatedBy; 100 - } 101 - ///State transition - sets the `disabled` field to Set 102 - pub struct SetDisabled<S: State = Empty>(PhantomData<fn() -> S>); 103 - impl<S: State> sealed::Sealed for SetDisabled<S> {} 104 - impl<S: State> State for SetDisabled<S> { 105 - type Code = S::Code; 106 - type Disabled = Set<members::disabled>; 107 - type Uses = S::Uses; 108 - type CreatedAt = S::CreatedAt; 109 - type Available = S::Available; 110 123 type ForAccount = S::ForAccount; 111 - type CreatedBy = S::CreatedBy; 112 124 } 113 125 ///State transition - sets the `uses` field to Set 114 126 pub struct SetUses<S: State = Empty>(PhantomData<fn() -> S>); 115 127 impl<S: State> sealed::Sealed for SetUses<S> {} 116 128 impl<S: State> State for SetUses<S> { 129 + type Available = S::Available; 130 + type CreatedAt = S::CreatedAt; 117 131 type Code = S::Code; 118 - type Disabled = S::Disabled; 119 132 type Uses = Set<members::uses>; 120 - type CreatedAt = S::CreatedAt; 121 - type Available = S::Available; 133 + type Disabled = S::Disabled; 134 + type CreatedBy = S::CreatedBy; 122 135 type ForAccount = S::ForAccount; 123 - type CreatedBy = S::CreatedBy; 124 136 } 125 - ///State transition - sets the `created_at` field to Set 126 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 127 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 128 - impl<S: State> State for SetCreatedAt<S> { 137 + ///State transition - sets the `disabled` field to Set 138 + pub struct SetDisabled<S: State = Empty>(PhantomData<fn() -> S>); 139 + impl<S: State> sealed::Sealed for SetDisabled<S> {} 140 + impl<S: State> State for SetDisabled<S> { 141 + type Available = S::Available; 142 + type CreatedAt = S::CreatedAt; 129 143 type Code = S::Code; 130 - type Disabled = S::Disabled; 131 144 type Uses = S::Uses; 132 - type CreatedAt = Set<members::created_at>; 133 - type Available = S::Available; 145 + type Disabled = Set<members::disabled>; 146 + type CreatedBy = S::CreatedBy; 134 147 type ForAccount = S::ForAccount; 135 - type CreatedBy = S::CreatedBy; 136 148 } 137 - ///State transition - sets the `available` field to Set 138 - pub struct SetAvailable<S: State = Empty>(PhantomData<fn() -> S>); 139 - impl<S: State> sealed::Sealed for SetAvailable<S> {} 140 - impl<S: State> State for SetAvailable<S> { 149 + ///State transition - sets the `created_by` field to Set 150 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 151 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 152 + impl<S: State> State for SetCreatedBy<S> { 153 + type Available = S::Available; 154 + type CreatedAt = S::CreatedAt; 141 155 type Code = S::Code; 156 + type Uses = S::Uses; 142 157 type Disabled = S::Disabled; 143 - type Uses = S::Uses; 144 - type CreatedAt = S::CreatedAt; 145 - type Available = Set<members::available>; 158 + type CreatedBy = Set<members::created_by>; 146 159 type ForAccount = S::ForAccount; 147 - type CreatedBy = S::CreatedBy; 148 160 } 149 161 ///State transition - sets the `for_account` field to Set 150 162 pub struct SetForAccount<S: State = Empty>(PhantomData<fn() -> S>); 151 163 impl<S: State> sealed::Sealed for SetForAccount<S> {} 152 164 impl<S: State> State for SetForAccount<S> { 153 - type Code = S::Code; 154 - type Disabled = S::Disabled; 155 - type Uses = S::Uses; 156 - type CreatedAt = S::CreatedAt; 157 165 type Available = S::Available; 158 - type ForAccount = Set<members::for_account>; 159 - type CreatedBy = S::CreatedBy; 160 - } 161 - ///State transition - sets the `created_by` field to Set 162 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 163 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 164 - impl<S: State> State for SetCreatedBy<S> { 166 + type CreatedAt = S::CreatedAt; 165 167 type Code = S::Code; 168 + type Uses = S::Uses; 166 169 type Disabled = S::Disabled; 167 - type Uses = S::Uses; 168 - type CreatedAt = S::CreatedAt; 169 - type Available = S::Available; 170 - type ForAccount = S::ForAccount; 171 - type CreatedBy = Set<members::created_by>; 170 + type CreatedBy = S::CreatedBy; 171 + type ForAccount = Set<members::for_account>; 172 172 } 173 173 /// Marker types for field names 174 174 #[allow(non_camel_case_types)] 175 175 pub mod members { 176 + ///Marker type for the `available` field 177 + pub struct available(()); 178 + ///Marker type for the `created_at` field 179 + pub struct created_at(()); 176 180 ///Marker type for the `code` field 177 181 pub struct code(()); 178 - ///Marker type for the `disabled` field 179 - pub struct disabled(()); 180 182 ///Marker type for the `uses` field 181 183 pub struct uses(()); 182 - ///Marker type for the `created_at` field 183 - pub struct created_at(()); 184 - ///Marker type for the `available` field 185 - pub struct available(()); 186 - ///Marker type for the `for_account` field 187 - pub struct for_account(()); 184 + ///Marker type for the `disabled` field 185 + pub struct disabled(()); 188 186 ///Marker type for the `created_by` field 189 187 pub struct created_by(()); 188 + ///Marker type for the `for_account` field 189 + pub struct for_account(()); 190 190 } 191 191 } 192 192 ··· 359 359 impl<'a, S> InviteCodeBuilder<'a, S> 360 360 where 361 361 S: invite_code_state::State, 362 + S::Available: invite_code_state::IsSet, 363 + S::CreatedAt: invite_code_state::IsSet, 362 364 S::Code: invite_code_state::IsSet, 363 - S::Disabled: invite_code_state::IsSet, 364 365 S::Uses: invite_code_state::IsSet, 365 - S::CreatedAt: invite_code_state::IsSet, 366 - S::Available: invite_code_state::IsSet, 367 - S::ForAccount: invite_code_state::IsSet, 366 + S::Disabled: invite_code_state::IsSet, 368 367 S::CreatedBy: invite_code_state::IsSet, 368 + S::ForAccount: invite_code_state::IsSet, 369 369 { 370 370 /// Build the final struct 371 371 pub fn build(self) -> InviteCode<'a> { ··· 638 638 } 639 639 /// State trait tracking which required fields have been set 640 640 pub trait State: sealed::Sealed { 641 - type UsedAt; 642 641 type UsedBy; 642 + type UsedAt; 643 643 } 644 644 /// Empty state - all required fields are unset 645 645 pub struct Empty(()); 646 646 impl sealed::Sealed for Empty {} 647 647 impl State for Empty { 648 - type UsedAt = Unset; 649 648 type UsedBy = Unset; 650 - } 651 - ///State transition - sets the `used_at` field to Set 652 - pub struct SetUsedAt<S: State = Empty>(PhantomData<fn() -> S>); 653 - impl<S: State> sealed::Sealed for SetUsedAt<S> {} 654 - impl<S: State> State for SetUsedAt<S> { 655 - type UsedAt = Set<members::used_at>; 656 - type UsedBy = S::UsedBy; 649 + type UsedAt = Unset; 657 650 } 658 651 ///State transition - sets the `used_by` field to Set 659 652 pub struct SetUsedBy<S: State = Empty>(PhantomData<fn() -> S>); 660 653 impl<S: State> sealed::Sealed for SetUsedBy<S> {} 661 654 impl<S: State> State for SetUsedBy<S> { 655 + type UsedBy = Set<members::used_by>; 662 656 type UsedAt = S::UsedAt; 663 - type UsedBy = Set<members::used_by>; 657 + } 658 + ///State transition - sets the `used_at` field to Set 659 + pub struct SetUsedAt<S: State = Empty>(PhantomData<fn() -> S>); 660 + impl<S: State> sealed::Sealed for SetUsedAt<S> {} 661 + impl<S: State> State for SetUsedAt<S> { 662 + type UsedBy = S::UsedBy; 663 + type UsedAt = Set<members::used_at>; 664 664 } 665 665 /// Marker types for field names 666 666 #[allow(non_camel_case_types)] 667 667 pub mod members { 668 + ///Marker type for the `used_by` field 669 + pub struct used_by(()); 668 670 ///Marker type for the `used_at` field 669 671 pub struct used_at(()); 670 - ///Marker type for the `used_by` field 671 - pub struct used_by(()); 672 672 } 673 673 } 674 674 ··· 741 741 impl<'a, S> InviteCodeUseBuilder<'a, S> 742 742 where 743 743 S: invite_code_use_state::State, 744 - S::UsedAt: invite_code_use_state::IsSet, 745 744 S::UsedBy: invite_code_use_state::IsSet, 745 + S::UsedAt: invite_code_use_state::IsSet, 746 746 { 747 747 /// Build the final struct 748 748 pub fn build(self) -> InviteCodeUse<'a> {
+15 -15
crates/weaver-api/src/com_atproto/server/create_app_password.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Password; 40 39 type Name; 40 + type Password; 41 41 type CreatedAt; 42 42 } 43 43 /// Empty state - all required fields are unset 44 44 pub struct Empty(()); 45 45 impl sealed::Sealed for Empty {} 46 46 impl State for Empty { 47 - type Password = Unset; 48 47 type Name = Unset; 48 + type Password = Unset; 49 49 type CreatedAt = Unset; 50 50 } 51 - ///State transition - sets the `password` field to Set 52 - pub struct SetPassword<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetPassword<S> {} 54 - impl<S: State> State for SetPassword<S> { 55 - type Password = Set<members::password>; 56 - type Name = S::Name; 57 - type CreatedAt = S::CreatedAt; 58 - } 59 51 ///State transition - sets the `name` field to Set 60 52 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 61 53 impl<S: State> sealed::Sealed for SetName<S> {} 62 54 impl<S: State> State for SetName<S> { 63 - type Password = S::Password; 64 55 type Name = Set<members::name>; 56 + type Password = S::Password; 57 + type CreatedAt = S::CreatedAt; 58 + } 59 + ///State transition - sets the `password` field to Set 60 + pub struct SetPassword<S: State = Empty>(PhantomData<fn() -> S>); 61 + impl<S: State> sealed::Sealed for SetPassword<S> {} 62 + impl<S: State> State for SetPassword<S> { 63 + type Name = S::Name; 64 + type Password = Set<members::password>; 65 65 type CreatedAt = S::CreatedAt; 66 66 } 67 67 ///State transition - sets the `created_at` field to Set 68 68 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 69 69 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 70 70 impl<S: State> State for SetCreatedAt<S> { 71 - type Password = S::Password; 72 71 type Name = S::Name; 72 + type Password = S::Password; 73 73 type CreatedAt = Set<members::created_at>; 74 74 } 75 75 /// Marker types for field names 76 76 #[allow(non_camel_case_types)] 77 77 pub mod members { 78 + ///Marker type for the `name` field 79 + pub struct name(()); 78 80 ///Marker type for the `password` field 79 81 pub struct password(()); 80 - ///Marker type for the `name` field 81 - pub struct name(()); 82 82 ///Marker type for the `created_at` field 83 83 pub struct created_at(()); 84 84 } ··· 187 187 impl<'a, S> AppPasswordBuilder<'a, S> 188 188 where 189 189 S: app_password_state::State, 190 - S::Password: app_password_state::IsSet, 191 190 S::Name: app_password_state::IsSet, 191 + S::Password: app_password_state::IsSet, 192 192 S::CreatedAt: app_password_state::IsSet, 193 193 { 194 194 /// Build the final struct
+13 -13
crates/weaver-api/src/com_atproto/server/create_invite_codes.rs
··· 361 361 } 362 362 /// State trait tracking which required fields have been set 363 363 pub trait State: sealed::Sealed { 364 - type CodeCount; 365 364 type UseCount; 365 + type CodeCount; 366 366 } 367 367 /// Empty state - all required fields are unset 368 368 pub struct Empty(()); 369 369 impl sealed::Sealed for Empty {} 370 370 impl State for Empty { 371 - type CodeCount = Unset; 372 371 type UseCount = Unset; 373 - } 374 - ///State transition - sets the `code_count` field to Set 375 - pub struct SetCodeCount<S: State = Empty>(PhantomData<fn() -> S>); 376 - impl<S: State> sealed::Sealed for SetCodeCount<S> {} 377 - impl<S: State> State for SetCodeCount<S> { 378 - type CodeCount = Set<members::code_count>; 379 - type UseCount = S::UseCount; 372 + type CodeCount = Unset; 380 373 } 381 374 ///State transition - sets the `use_count` field to Set 382 375 pub struct SetUseCount<S: State = Empty>(PhantomData<fn() -> S>); 383 376 impl<S: State> sealed::Sealed for SetUseCount<S> {} 384 377 impl<S: State> State for SetUseCount<S> { 385 - type CodeCount = S::CodeCount; 386 378 type UseCount = Set<members::use_count>; 379 + type CodeCount = S::CodeCount; 380 + } 381 + ///State transition - sets the `code_count` field to Set 382 + pub struct SetCodeCount<S: State = Empty>(PhantomData<fn() -> S>); 383 + impl<S: State> sealed::Sealed for SetCodeCount<S> {} 384 + impl<S: State> State for SetCodeCount<S> { 385 + type UseCount = S::UseCount; 386 + type CodeCount = Set<members::code_count>; 387 387 } 388 388 /// Marker types for field names 389 389 #[allow(non_camel_case_types)] 390 390 pub mod members { 391 - ///Marker type for the `code_count` field 392 - pub struct code_count(()); 393 391 ///Marker type for the `use_count` field 394 392 pub struct use_count(()); 393 + ///Marker type for the `code_count` field 394 + pub struct code_count(()); 395 395 } 396 396 } 397 397 ··· 484 484 impl<'a, S> CreateInviteCodesBuilder<'a, S> 485 485 where 486 486 S: create_invite_codes_state::State, 487 - S::CodeCount: create_invite_codes_state::IsSet, 488 487 S::UseCount: create_invite_codes_state::IsSet, 488 + S::CodeCount: create_invite_codes_state::IsSet, 489 489 { 490 490 /// Build the final struct 491 491 pub fn build(self) -> CreateInviteCodes<'a> {
+15 -15
crates/weaver-api/src/com_atproto/server/delete_account.rs
··· 35 35 } 36 36 /// State trait tracking which required fields have been set 37 37 pub trait State: sealed::Sealed { 38 + type Did; 38 39 type Password; 39 40 type Token; 40 - type Did; 41 41 } 42 42 /// Empty state - all required fields are unset 43 43 pub struct Empty(()); 44 44 impl sealed::Sealed for Empty {} 45 45 impl State for Empty { 46 + type Did = Unset; 46 47 type Password = Unset; 47 48 type Token = Unset; 48 - type Did = Unset; 49 + } 50 + ///State transition - sets the `did` field to Set 51 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 52 + impl<S: State> sealed::Sealed for SetDid<S> {} 53 + impl<S: State> State for SetDid<S> { 54 + type Did = Set<members::did>; 55 + type Password = S::Password; 56 + type Token = S::Token; 49 57 } 50 58 ///State transition - sets the `password` field to Set 51 59 pub struct SetPassword<S: State = Empty>(PhantomData<fn() -> S>); 52 60 impl<S: State> sealed::Sealed for SetPassword<S> {} 53 61 impl<S: State> State for SetPassword<S> { 62 + type Did = S::Did; 54 63 type Password = Set<members::password>; 55 64 type Token = S::Token; 56 - type Did = S::Did; 57 65 } 58 66 ///State transition - sets the `token` field to Set 59 67 pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 60 68 impl<S: State> sealed::Sealed for SetToken<S> {} 61 69 impl<S: State> State for SetToken<S> { 62 - type Password = S::Password; 63 - type Token = Set<members::token>; 64 70 type Did = S::Did; 65 - } 66 - ///State transition - sets the `did` field to Set 67 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 68 - impl<S: State> sealed::Sealed for SetDid<S> {} 69 - impl<S: State> State for SetDid<S> { 70 71 type Password = S::Password; 71 - type Token = S::Token; 72 - type Did = Set<members::did>; 72 + type Token = Set<members::token>; 73 73 } 74 74 /// Marker types for field names 75 75 #[allow(non_camel_case_types)] 76 76 pub mod members { 77 + ///Marker type for the `did` field 78 + pub struct did(()); 77 79 ///Marker type for the `password` field 78 80 pub struct password(()); 79 81 ///Marker type for the `token` field 80 82 pub struct token(()); 81 - ///Marker type for the `did` field 82 - pub struct did(()); 83 83 } 84 84 } 85 85 ··· 172 172 impl<'a, S> DeleteAccountBuilder<'a, S> 173 173 where 174 174 S: delete_account_state::State, 175 + S::Did: delete_account_state::IsSet, 175 176 S::Password: delete_account_state::IsSet, 176 177 S::Token: delete_account_state::IsSet, 177 - S::Did: delete_account_state::IsSet, 178 178 { 179 179 /// Build the final struct 180 180 pub fn build(self) -> DeleteAccount<'a> {
+13 -13
crates/weaver-api/src/com_atproto/sync/get_blob.rs
··· 32 32 } 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 - type Cid; 36 35 type Did; 36 + type Cid; 37 37 } 38 38 /// Empty state - all required fields are unset 39 39 pub struct Empty(()); 40 40 impl sealed::Sealed for Empty {} 41 41 impl State for Empty { 42 - type Cid = Unset; 43 42 type Did = Unset; 44 - } 45 - ///State transition - sets the `cid` field to Set 46 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetCid<S> {} 48 - impl<S: State> State for SetCid<S> { 49 - type Cid = Set<members::cid>; 50 - type Did = S::Did; 43 + type Cid = Unset; 51 44 } 52 45 ///State transition - sets the `did` field to Set 53 46 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 54 47 impl<S: State> sealed::Sealed for SetDid<S> {} 55 48 impl<S: State> State for SetDid<S> { 56 - type Cid = S::Cid; 57 49 type Did = Set<members::did>; 50 + type Cid = S::Cid; 51 + } 52 + ///State transition - sets the `cid` field to Set 53 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetCid<S> {} 55 + impl<S: State> State for SetCid<S> { 56 + type Did = S::Did; 57 + type Cid = Set<members::cid>; 58 58 } 59 59 /// Marker types for field names 60 60 #[allow(non_camel_case_types)] 61 61 pub mod members { 62 - ///Marker type for the `cid` field 63 - pub struct cid(()); 64 62 ///Marker type for the `did` field 65 63 pub struct did(()); 64 + ///Marker type for the `cid` field 65 + pub struct cid(()); 66 66 } 67 67 } 68 68 ··· 135 135 impl<'a, S> GetBlobBuilder<'a, S> 136 136 where 137 137 S: get_blob_state::State, 138 - S::Cid: get_blob_state::IsSet, 139 138 S::Did: get_blob_state::IsSet, 139 + S::Cid: get_blob_state::IsSet, 140 140 { 141 141 /// Build the final struct 142 142 pub fn build(self) -> GetBlob<'a> {
+13 -13
crates/weaver-api/src/com_atproto/sync/get_blocks.rs
··· 32 32 } 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 - type Did; 36 35 type Cids; 36 + type Did; 37 37 } 38 38 /// Empty state - all required fields are unset 39 39 pub struct Empty(()); 40 40 impl sealed::Sealed for Empty {} 41 41 impl State for Empty { 42 - type Did = Unset; 43 42 type Cids = Unset; 44 - } 45 - ///State transition - sets the `did` field to Set 46 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetDid<S> {} 48 - impl<S: State> State for SetDid<S> { 49 - type Did = Set<members::did>; 50 - type Cids = S::Cids; 43 + type Did = Unset; 51 44 } 52 45 ///State transition - sets the `cids` field to Set 53 46 pub struct SetCids<S: State = Empty>(PhantomData<fn() -> S>); 54 47 impl<S: State> sealed::Sealed for SetCids<S> {} 55 48 impl<S: State> State for SetCids<S> { 56 - type Did = S::Did; 57 49 type Cids = Set<members::cids>; 50 + type Did = S::Did; 51 + } 52 + ///State transition - sets the `did` field to Set 53 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetDid<S> {} 55 + impl<S: State> State for SetDid<S> { 56 + type Cids = S::Cids; 57 + type Did = Set<members::did>; 58 58 } 59 59 /// Marker types for field names 60 60 #[allow(non_camel_case_types)] 61 61 pub mod members { 62 - ///Marker type for the `did` field 63 - pub struct did(()); 64 62 ///Marker type for the `cids` field 65 63 pub struct cids(()); 64 + ///Marker type for the `did` field 65 + pub struct did(()); 66 66 } 67 67 } 68 68 ··· 135 135 impl<'a, S> GetBlocksBuilder<'a, S> 136 136 where 137 137 S: get_blocks_state::State, 138 - S::Did: get_blocks_state::IsSet, 139 138 S::Cids: get_blocks_state::IsSet, 139 + S::Did: get_blocks_state::IsSet, 140 140 { 141 141 /// Build the final struct 142 142 pub fn build(self) -> GetBlocks<'a> {
+15 -15
crates/weaver-api/src/com_atproto/sync/get_record.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Rkey; 40 39 type Collection; 41 40 type Did; 41 + type Rkey; 42 42 } 43 43 /// Empty state - all required fields are unset 44 44 pub struct Empty(()); 45 45 impl sealed::Sealed for Empty {} 46 46 impl State for Empty { 47 - type Rkey = Unset; 48 47 type Collection = Unset; 49 48 type Did = Unset; 50 - } 51 - ///State transition - sets the `rkey` field to Set 52 - pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetRkey<S> {} 54 - impl<S: State> State for SetRkey<S> { 55 - type Rkey = Set<members::rkey>; 56 - type Collection = S::Collection; 57 - type Did = S::Did; 49 + type Rkey = Unset; 58 50 } 59 51 ///State transition - sets the `collection` field to Set 60 52 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 61 53 impl<S: State> sealed::Sealed for SetCollection<S> {} 62 54 impl<S: State> State for SetCollection<S> { 63 - type Rkey = S::Rkey; 64 55 type Collection = Set<members::collection>; 65 56 type Did = S::Did; 57 + type Rkey = S::Rkey; 66 58 } 67 59 ///State transition - sets the `did` field to Set 68 60 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 69 61 impl<S: State> sealed::Sealed for SetDid<S> {} 70 62 impl<S: State> State for SetDid<S> { 71 - type Rkey = S::Rkey; 72 63 type Collection = S::Collection; 73 64 type Did = Set<members::did>; 65 + type Rkey = S::Rkey; 66 + } 67 + ///State transition - sets the `rkey` field to Set 68 + pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 69 + impl<S: State> sealed::Sealed for SetRkey<S> {} 70 + impl<S: State> State for SetRkey<S> { 71 + type Collection = S::Collection; 72 + type Did = S::Did; 73 + type Rkey = Set<members::rkey>; 74 74 } 75 75 /// Marker types for field names 76 76 #[allow(non_camel_case_types)] 77 77 pub mod members { 78 - ///Marker type for the `rkey` field 79 - pub struct rkey(()); 80 78 ///Marker type for the `collection` field 81 79 pub struct collection(()); 82 80 ///Marker type for the `did` field 83 81 pub struct did(()); 82 + ///Marker type for the `rkey` field 83 + pub struct rkey(()); 84 84 } 85 85 } 86 86 ··· 181 181 impl<'a, S> GetRecordBuilder<'a, S> 182 182 where 183 183 S: get_record_state::State, 184 - S::Rkey: get_record_state::IsSet, 185 184 S::Collection: get_record_state::IsSet, 186 185 S::Did: get_record_state::IsSet, 186 + S::Rkey: get_record_state::IsSet, 187 187 { 188 188 /// Build the final struct 189 189 pub fn build(self) -> GetRecord<'a> {
+15 -15
crates/weaver-api/src/com_atproto/sync/list_repos.rs
··· 195 195 /// State trait tracking which required fields have been set 196 196 pub trait State: sealed::Sealed { 197 197 type Did; 198 - type Head; 199 198 type Rev; 199 + type Head; 200 200 } 201 201 /// Empty state - all required fields are unset 202 202 pub struct Empty(()); 203 203 impl sealed::Sealed for Empty {} 204 204 impl State for Empty { 205 205 type Did = Unset; 206 - type Head = Unset; 207 206 type Rev = Unset; 207 + type Head = Unset; 208 208 } 209 209 ///State transition - sets the `did` field to Set 210 210 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 211 211 impl<S: State> sealed::Sealed for SetDid<S> {} 212 212 impl<S: State> State for SetDid<S> { 213 213 type Did = Set<members::did>; 214 - type Head = S::Head; 215 214 type Rev = S::Rev; 216 - } 217 - ///State transition - sets the `head` field to Set 218 - pub struct SetHead<S: State = Empty>(PhantomData<fn() -> S>); 219 - impl<S: State> sealed::Sealed for SetHead<S> {} 220 - impl<S: State> State for SetHead<S> { 221 - type Did = S::Did; 222 - type Head = Set<members::head>; 223 - type Rev = S::Rev; 215 + type Head = S::Head; 224 216 } 225 217 ///State transition - sets the `rev` field to Set 226 218 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 227 219 impl<S: State> sealed::Sealed for SetRev<S> {} 228 220 impl<S: State> State for SetRev<S> { 229 221 type Did = S::Did; 230 - type Head = S::Head; 231 222 type Rev = Set<members::rev>; 223 + type Head = S::Head; 224 + } 225 + ///State transition - sets the `head` field to Set 226 + pub struct SetHead<S: State = Empty>(PhantomData<fn() -> S>); 227 + impl<S: State> sealed::Sealed for SetHead<S> {} 228 + impl<S: State> State for SetHead<S> { 229 + type Did = S::Did; 230 + type Rev = S::Rev; 231 + type Head = Set<members::head>; 232 232 } 233 233 /// Marker types for field names 234 234 #[allow(non_camel_case_types)] 235 235 pub mod members { 236 236 ///Marker type for the `did` field 237 237 pub struct did(()); 238 + ///Marker type for the `rev` field 239 + pub struct rev(()); 238 240 ///Marker type for the `head` field 239 241 pub struct head(()); 240 - ///Marker type for the `rev` field 241 - pub struct rev(()); 242 242 } 243 243 } 244 244 ··· 360 360 where 361 361 S: repo_state::State, 362 362 S::Did: repo_state::IsSet, 363 - S::Head: repo_state::IsSet, 364 363 S::Rev: repo_state::IsSet, 364 + S::Head: repo_state::IsSet, 365 365 { 366 366 /// Build the final struct 367 367 pub fn build(self) -> Repo<'a> {
+203 -203
crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs
··· 42 42 pub trait State: sealed::Sealed { 43 43 type Did; 44 44 type Active; 45 - type Seq; 46 45 type Time; 46 + type Seq; 47 47 } 48 48 /// Empty state - all required fields are unset 49 49 pub struct Empty(()); ··· 51 51 impl State for Empty { 52 52 type Did = Unset; 53 53 type Active = Unset; 54 - type Seq = Unset; 55 54 type Time = Unset; 55 + type Seq = Unset; 56 56 } 57 57 ///State transition - sets the `did` field to Set 58 58 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); ··· 60 60 impl<S: State> State for SetDid<S> { 61 61 type Did = Set<members::did>; 62 62 type Active = S::Active; 63 - type Seq = S::Seq; 64 63 type Time = S::Time; 64 + type Seq = S::Seq; 65 65 } 66 66 ///State transition - sets the `active` field to Set 67 67 pub struct SetActive<S: State = Empty>(PhantomData<fn() -> S>); ··· 69 69 impl<S: State> State for SetActive<S> { 70 70 type Did = S::Did; 71 71 type Active = Set<members::active>; 72 - type Seq = S::Seq; 73 - type Time = S::Time; 74 - } 75 - ///State transition - sets the `seq` field to Set 76 - pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 77 - impl<S: State> sealed::Sealed for SetSeq<S> {} 78 - impl<S: State> State for SetSeq<S> { 79 - type Did = S::Did; 80 - type Active = S::Active; 81 - type Seq = Set<members::seq>; 82 72 type Time = S::Time; 73 + type Seq = S::Seq; 83 74 } 84 75 ///State transition - sets the `time` field to Set 85 76 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); ··· 87 78 impl<S: State> State for SetTime<S> { 88 79 type Did = S::Did; 89 80 type Active = S::Active; 90 - type Seq = S::Seq; 91 81 type Time = Set<members::time>; 82 + type Seq = S::Seq; 83 + } 84 + ///State transition - sets the `seq` field to Set 85 + pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 86 + impl<S: State> sealed::Sealed for SetSeq<S> {} 87 + impl<S: State> State for SetSeq<S> { 88 + type Did = S::Did; 89 + type Active = S::Active; 90 + type Time = S::Time; 91 + type Seq = Set<members::seq>; 92 92 } 93 93 /// Marker types for field names 94 94 #[allow(non_camel_case_types)] ··· 97 97 pub struct did(()); 98 98 ///Marker type for the `active` field 99 99 pub struct active(()); 100 + ///Marker type for the `time` field 101 + pub struct time(()); 100 102 ///Marker type for the `seq` field 101 103 pub struct seq(()); 102 - ///Marker type for the `time` field 103 - pub struct time(()); 104 104 } 105 105 } 106 106 ··· 229 229 S: account_state::State, 230 230 S::Did: account_state::IsSet, 231 231 S::Active: account_state::IsSet, 232 - S::Seq: account_state::IsSet, 233 232 S::Time: account_state::IsSet, 233 + S::Seq: account_state::IsSet, 234 234 { 235 235 /// Build the final struct 236 236 pub fn build(self) -> Account<'a> { ··· 1073 1073 } 1074 1074 /// State trait tracking which required fields have been set 1075 1075 pub trait State: sealed::Sealed { 1076 - type Seq; 1076 + type TooBig; 1077 1077 type Blobs; 1078 - type Blocks; 1078 + type Repo; 1079 + type Time; 1079 1080 type Rev; 1080 1081 type Commit; 1082 + type Blocks; 1081 1083 type Ops; 1082 - type Repo; 1083 - type Time; 1084 1084 type Rebase; 1085 - type TooBig; 1085 + type Seq; 1086 1086 } 1087 1087 /// Empty state - all required fields are unset 1088 1088 pub struct Empty(()); 1089 1089 impl sealed::Sealed for Empty {} 1090 1090 impl State for Empty { 1091 - type Seq = Unset; 1091 + type TooBig = Unset; 1092 1092 type Blobs = Unset; 1093 - type Blocks = Unset; 1093 + type Repo = Unset; 1094 + type Time = Unset; 1094 1095 type Rev = Unset; 1095 1096 type Commit = Unset; 1097 + type Blocks = Unset; 1096 1098 type Ops = Unset; 1097 - type Repo = Unset; 1098 - type Time = Unset; 1099 1099 type Rebase = Unset; 1100 - type TooBig = Unset; 1100 + type Seq = Unset; 1101 1101 } 1102 - ///State transition - sets the `seq` field to Set 1103 - pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 1104 - impl<S: State> sealed::Sealed for SetSeq<S> {} 1105 - impl<S: State> State for SetSeq<S> { 1106 - type Seq = Set<members::seq>; 1102 + ///State transition - sets the `too_big` field to Set 1103 + pub struct SetTooBig<S: State = Empty>(PhantomData<fn() -> S>); 1104 + impl<S: State> sealed::Sealed for SetTooBig<S> {} 1105 + impl<S: State> State for SetTooBig<S> { 1106 + type TooBig = Set<members::too_big>; 1107 1107 type Blobs = S::Blobs; 1108 - type Blocks = S::Blocks; 1108 + type Repo = S::Repo; 1109 + type Time = S::Time; 1109 1110 type Rev = S::Rev; 1110 1111 type Commit = S::Commit; 1112 + type Blocks = S::Blocks; 1111 1113 type Ops = S::Ops; 1112 - type Repo = S::Repo; 1113 - type Time = S::Time; 1114 1114 type Rebase = S::Rebase; 1115 - type TooBig = S::TooBig; 1115 + type Seq = S::Seq; 1116 1116 } 1117 1117 ///State transition - sets the `blobs` field to Set 1118 1118 pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>); 1119 1119 impl<S: State> sealed::Sealed for SetBlobs<S> {} 1120 1120 impl<S: State> State for SetBlobs<S> { 1121 - type Seq = S::Seq; 1121 + type TooBig = S::TooBig; 1122 1122 type Blobs = Set<members::blobs>; 1123 + type Repo = S::Repo; 1124 + type Time = S::Time; 1125 + type Rev = S::Rev; 1126 + type Commit = S::Commit; 1123 1127 type Blocks = S::Blocks; 1128 + type Ops = S::Ops; 1129 + type Rebase = S::Rebase; 1130 + type Seq = S::Seq; 1131 + } 1132 + ///State transition - sets the `repo` field to Set 1133 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1134 + impl<S: State> sealed::Sealed for SetRepo<S> {} 1135 + impl<S: State> State for SetRepo<S> { 1136 + type TooBig = S::TooBig; 1137 + type Blobs = S::Blobs; 1138 + type Repo = Set<members::repo>; 1139 + type Time = S::Time; 1124 1140 type Rev = S::Rev; 1125 1141 type Commit = S::Commit; 1142 + type Blocks = S::Blocks; 1126 1143 type Ops = S::Ops; 1127 - type Repo = S::Repo; 1128 - type Time = S::Time; 1129 1144 type Rebase = S::Rebase; 1130 - type TooBig = S::TooBig; 1131 - } 1132 - ///State transition - sets the `blocks` field to Set 1133 - pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>); 1134 - impl<S: State> sealed::Sealed for SetBlocks<S> {} 1135 - impl<S: State> State for SetBlocks<S> { 1136 1145 type Seq = S::Seq; 1146 + } 1147 + ///State transition - sets the `time` field to Set 1148 + pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 1149 + impl<S: State> sealed::Sealed for SetTime<S> {} 1150 + impl<S: State> State for SetTime<S> { 1151 + type TooBig = S::TooBig; 1137 1152 type Blobs = S::Blobs; 1138 - type Blocks = Set<members::blocks>; 1153 + type Repo = S::Repo; 1154 + type Time = Set<members::time>; 1139 1155 type Rev = S::Rev; 1140 1156 type Commit = S::Commit; 1157 + type Blocks = S::Blocks; 1141 1158 type Ops = S::Ops; 1142 - type Repo = S::Repo; 1143 - type Time = S::Time; 1144 1159 type Rebase = S::Rebase; 1145 - type TooBig = S::TooBig; 1160 + type Seq = S::Seq; 1146 1161 } 1147 1162 ///State transition - sets the `rev` field to Set 1148 1163 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1149 1164 impl<S: State> sealed::Sealed for SetRev<S> {} 1150 1165 impl<S: State> State for SetRev<S> { 1151 - type Seq = S::Seq; 1166 + type TooBig = S::TooBig; 1152 1167 type Blobs = S::Blobs; 1153 - type Blocks = S::Blocks; 1168 + type Repo = S::Repo; 1169 + type Time = S::Time; 1154 1170 type Rev = Set<members::rev>; 1155 1171 type Commit = S::Commit; 1172 + type Blocks = S::Blocks; 1156 1173 type Ops = S::Ops; 1157 - type Repo = S::Repo; 1158 - type Time = S::Time; 1159 1174 type Rebase = S::Rebase; 1160 - type TooBig = S::TooBig; 1175 + type Seq = S::Seq; 1161 1176 } 1162 1177 ///State transition - sets the `commit` field to Set 1163 1178 pub struct SetCommit<S: State = Empty>(PhantomData<fn() -> S>); 1164 1179 impl<S: State> sealed::Sealed for SetCommit<S> {} 1165 1180 impl<S: State> State for SetCommit<S> { 1166 - type Seq = S::Seq; 1181 + type TooBig = S::TooBig; 1167 1182 type Blobs = S::Blobs; 1168 - type Blocks = S::Blocks; 1183 + type Repo = S::Repo; 1184 + type Time = S::Time; 1169 1185 type Rev = S::Rev; 1170 1186 type Commit = Set<members::commit>; 1187 + type Blocks = S::Blocks; 1171 1188 type Ops = S::Ops; 1189 + type Rebase = S::Rebase; 1190 + type Seq = S::Seq; 1191 + } 1192 + ///State transition - sets the `blocks` field to Set 1193 + pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>); 1194 + impl<S: State> sealed::Sealed for SetBlocks<S> {} 1195 + impl<S: State> State for SetBlocks<S> { 1196 + type TooBig = S::TooBig; 1197 + type Blobs = S::Blobs; 1172 1198 type Repo = S::Repo; 1173 1199 type Time = S::Time; 1200 + type Rev = S::Rev; 1201 + type Commit = S::Commit; 1202 + type Blocks = Set<members::blocks>; 1203 + type Ops = S::Ops; 1174 1204 type Rebase = S::Rebase; 1175 - type TooBig = S::TooBig; 1205 + type Seq = S::Seq; 1176 1206 } 1177 1207 ///State transition - sets the `ops` field to Set 1178 1208 pub struct SetOps<S: State = Empty>(PhantomData<fn() -> S>); 1179 1209 impl<S: State> sealed::Sealed for SetOps<S> {} 1180 1210 impl<S: State> State for SetOps<S> { 1181 - type Seq = S::Seq; 1211 + type TooBig = S::TooBig; 1182 1212 type Blobs = S::Blobs; 1183 - type Blocks = S::Blocks; 1184 - type Rev = S::Rev; 1185 - type Commit = S::Commit; 1186 - type Ops = Set<members::ops>; 1187 1213 type Repo = S::Repo; 1188 1214 type Time = S::Time; 1189 - type Rebase = S::Rebase; 1190 - type TooBig = S::TooBig; 1191 - } 1192 - ///State transition - sets the `repo` field to Set 1193 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1194 - impl<S: State> sealed::Sealed for SetRepo<S> {} 1195 - impl<S: State> State for SetRepo<S> { 1196 - type Seq = S::Seq; 1197 - type Blobs = S::Blobs; 1198 - type Blocks = S::Blocks; 1199 1215 type Rev = S::Rev; 1200 1216 type Commit = S::Commit; 1201 - type Ops = S::Ops; 1202 - type Repo = Set<members::repo>; 1203 - type Time = S::Time; 1217 + type Blocks = S::Blocks; 1218 + type Ops = Set<members::ops>; 1204 1219 type Rebase = S::Rebase; 1205 - type TooBig = S::TooBig; 1206 - } 1207 - ///State transition - sets the `time` field to Set 1208 - pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 1209 - impl<S: State> sealed::Sealed for SetTime<S> {} 1210 - impl<S: State> State for SetTime<S> { 1211 1220 type Seq = S::Seq; 1212 - type Blobs = S::Blobs; 1213 - type Blocks = S::Blocks; 1214 - type Rev = S::Rev; 1215 - type Commit = S::Commit; 1216 - type Ops = S::Ops; 1217 - type Repo = S::Repo; 1218 - type Time = Set<members::time>; 1219 - type Rebase = S::Rebase; 1220 - type TooBig = S::TooBig; 1221 1221 } 1222 1222 ///State transition - sets the `rebase` field to Set 1223 1223 pub struct SetRebase<S: State = Empty>(PhantomData<fn() -> S>); 1224 1224 impl<S: State> sealed::Sealed for SetRebase<S> {} 1225 1225 impl<S: State> State for SetRebase<S> { 1226 - type Seq = S::Seq; 1226 + type TooBig = S::TooBig; 1227 1227 type Blobs = S::Blobs; 1228 - type Blocks = S::Blocks; 1228 + type Repo = S::Repo; 1229 + type Time = S::Time; 1229 1230 type Rev = S::Rev; 1230 1231 type Commit = S::Commit; 1232 + type Blocks = S::Blocks; 1231 1233 type Ops = S::Ops; 1232 - type Repo = S::Repo; 1233 - type Time = S::Time; 1234 1234 type Rebase = Set<members::rebase>; 1235 + type Seq = S::Seq; 1236 + } 1237 + ///State transition - sets the `seq` field to Set 1238 + pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 1239 + impl<S: State> sealed::Sealed for SetSeq<S> {} 1240 + impl<S: State> State for SetSeq<S> { 1235 1241 type TooBig = S::TooBig; 1236 - } 1237 - ///State transition - sets the `too_big` field to Set 1238 - pub struct SetTooBig<S: State = Empty>(PhantomData<fn() -> S>); 1239 - impl<S: State> sealed::Sealed for SetTooBig<S> {} 1240 - impl<S: State> State for SetTooBig<S> { 1241 - type Seq = S::Seq; 1242 1242 type Blobs = S::Blobs; 1243 - type Blocks = S::Blocks; 1243 + type Repo = S::Repo; 1244 + type Time = S::Time; 1244 1245 type Rev = S::Rev; 1245 1246 type Commit = S::Commit; 1247 + type Blocks = S::Blocks; 1246 1248 type Ops = S::Ops; 1247 - type Repo = S::Repo; 1248 - type Time = S::Time; 1249 1249 type Rebase = S::Rebase; 1250 - type TooBig = Set<members::too_big>; 1250 + type Seq = Set<members::seq>; 1251 1251 } 1252 1252 /// Marker types for field names 1253 1253 #[allow(non_camel_case_types)] 1254 1254 pub mod members { 1255 - ///Marker type for the `seq` field 1256 - pub struct seq(()); 1255 + ///Marker type for the `too_big` field 1256 + pub struct too_big(()); 1257 1257 ///Marker type for the `blobs` field 1258 1258 pub struct blobs(()); 1259 - ///Marker type for the `blocks` field 1260 - pub struct blocks(()); 1259 + ///Marker type for the `repo` field 1260 + pub struct repo(()); 1261 + ///Marker type for the `time` field 1262 + pub struct time(()); 1261 1263 ///Marker type for the `rev` field 1262 1264 pub struct rev(()); 1263 1265 ///Marker type for the `commit` field 1264 1266 pub struct commit(()); 1267 + ///Marker type for the `blocks` field 1268 + pub struct blocks(()); 1265 1269 ///Marker type for the `ops` field 1266 1270 pub struct ops(()); 1267 - ///Marker type for the `repo` field 1268 - pub struct repo(()); 1269 - ///Marker type for the `time` field 1270 - pub struct time(()); 1271 1271 ///Marker type for the `rebase` field 1272 1272 pub struct rebase(()); 1273 - ///Marker type for the `too_big` field 1274 - pub struct too_big(()); 1273 + ///Marker type for the `seq` field 1274 + pub struct seq(()); 1275 1275 } 1276 1276 } 1277 1277 ··· 1559 1559 impl<'a, S> CommitBuilder<'a, S> 1560 1560 where 1561 1561 S: commit_state::State, 1562 - S::Seq: commit_state::IsSet, 1562 + S::TooBig: commit_state::IsSet, 1563 1563 S::Blobs: commit_state::IsSet, 1564 - S::Blocks: commit_state::IsSet, 1564 + S::Repo: commit_state::IsSet, 1565 + S::Time: commit_state::IsSet, 1565 1566 S::Rev: commit_state::IsSet, 1566 1567 S::Commit: commit_state::IsSet, 1568 + S::Blocks: commit_state::IsSet, 1567 1569 S::Ops: commit_state::IsSet, 1568 - S::Repo: commit_state::IsSet, 1569 - S::Time: commit_state::IsSet, 1570 1570 S::Rebase: commit_state::IsSet, 1571 - S::TooBig: commit_state::IsSet, 1571 + S::Seq: commit_state::IsSet, 1572 1572 { 1573 1573 /// Build the final struct 1574 1574 pub fn build(self) -> Commit<'a> { ··· 1677 1677 } 1678 1678 /// State trait tracking which required fields have been set 1679 1679 pub trait State: sealed::Sealed { 1680 - type Time; 1681 - type Did; 1682 1680 type Seq; 1681 + type Did; 1682 + type Time; 1683 1683 } 1684 1684 /// Empty state - all required fields are unset 1685 1685 pub struct Empty(()); 1686 1686 impl sealed::Sealed for Empty {} 1687 1687 impl State for Empty { 1688 - type Time = Unset; 1689 - type Did = Unset; 1690 1688 type Seq = Unset; 1689 + type Did = Unset; 1690 + type Time = Unset; 1691 1691 } 1692 - ///State transition - sets the `time` field to Set 1693 - pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 1694 - impl<S: State> sealed::Sealed for SetTime<S> {} 1695 - impl<S: State> State for SetTime<S> { 1696 - type Time = Set<members::time>; 1692 + ///State transition - sets the `seq` field to Set 1693 + pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 1694 + impl<S: State> sealed::Sealed for SetSeq<S> {} 1695 + impl<S: State> State for SetSeq<S> { 1696 + type Seq = Set<members::seq>; 1697 1697 type Did = S::Did; 1698 - type Seq = S::Seq; 1698 + type Time = S::Time; 1699 1699 } 1700 1700 ///State transition - sets the `did` field to Set 1701 1701 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 1702 1702 impl<S: State> sealed::Sealed for SetDid<S> {} 1703 1703 impl<S: State> State for SetDid<S> { 1704 - type Time = S::Time; 1705 - type Did = Set<members::did>; 1706 1704 type Seq = S::Seq; 1707 - } 1708 - ///State transition - sets the `seq` field to Set 1709 - pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 1710 - impl<S: State> sealed::Sealed for SetSeq<S> {} 1711 - impl<S: State> State for SetSeq<S> { 1705 + type Did = Set<members::did>; 1712 1706 type Time = S::Time; 1707 + } 1708 + ///State transition - sets the `time` field to Set 1709 + pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 1710 + impl<S: State> sealed::Sealed for SetTime<S> {} 1711 + impl<S: State> State for SetTime<S> { 1712 + type Seq = S::Seq; 1713 1713 type Did = S::Did; 1714 - type Seq = Set<members::seq>; 1714 + type Time = Set<members::time>; 1715 1715 } 1716 1716 /// Marker types for field names 1717 1717 #[allow(non_camel_case_types)] 1718 1718 pub mod members { 1719 - ///Marker type for the `time` field 1720 - pub struct time(()); 1719 + ///Marker type for the `seq` field 1720 + pub struct seq(()); 1721 1721 ///Marker type for the `did` field 1722 1722 pub struct did(()); 1723 - ///Marker type for the `seq` field 1724 - pub struct seq(()); 1723 + ///Marker type for the `time` field 1724 + pub struct time(()); 1725 1725 } 1726 1726 } 1727 1727 ··· 1834 1834 impl<'a, S> IdentityBuilder<'a, S> 1835 1835 where 1836 1836 S: identity_state::State, 1837 - S::Time: identity_state::IsSet, 1838 - S::Did: identity_state::IsSet, 1839 1837 S::Seq: identity_state::IsSet, 1838 + S::Did: identity_state::IsSet, 1839 + S::Time: identity_state::IsSet, 1840 1840 { 1841 1841 /// Build the final struct 1842 1842 pub fn build(self) -> Identity<'a> { ··· 2257 2257 } 2258 2258 /// State trait tracking which required fields have been set 2259 2259 pub trait State: sealed::Sealed { 2260 - type Action; 2261 2260 type Path; 2261 + type Action; 2262 2262 } 2263 2263 /// Empty state - all required fields are unset 2264 2264 pub struct Empty(()); 2265 2265 impl sealed::Sealed for Empty {} 2266 2266 impl State for Empty { 2267 + type Path = Unset; 2267 2268 type Action = Unset; 2268 - type Path = Unset; 2269 + } 2270 + ///State transition - sets the `path` field to Set 2271 + pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 2272 + impl<S: State> sealed::Sealed for SetPath<S> {} 2273 + impl<S: State> State for SetPath<S> { 2274 + type Path = Set<members::path>; 2275 + type Action = S::Action; 2269 2276 } 2270 2277 ///State transition - sets the `action` field to Set 2271 2278 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 2272 2279 impl<S: State> sealed::Sealed for SetAction<S> {} 2273 2280 impl<S: State> State for SetAction<S> { 2274 - type Action = Set<members::action>; 2275 2281 type Path = S::Path; 2276 - } 2277 - ///State transition - sets the `path` field to Set 2278 - pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 2279 - impl<S: State> sealed::Sealed for SetPath<S> {} 2280 - impl<S: State> State for SetPath<S> { 2281 - type Action = S::Action; 2282 - type Path = Set<members::path>; 2282 + type Action = Set<members::action>; 2283 2283 } 2284 2284 /// Marker types for field names 2285 2285 #[allow(non_camel_case_types)] 2286 2286 pub mod members { 2287 + ///Marker type for the `path` field 2288 + pub struct path(()); 2287 2289 ///Marker type for the `action` field 2288 2290 pub struct action(()); 2289 - ///Marker type for the `path` field 2290 - pub struct path(()); 2291 2291 } 2292 2292 } 2293 2293 ··· 2400 2400 impl<'a, S> RepoOpBuilder<'a, S> 2401 2401 where 2402 2402 S: repo_op_state::State, 2403 - S::Action: repo_op_state::IsSet, 2404 2403 S::Path: repo_op_state::IsSet, 2404 + S::Action: repo_op_state::IsSet, 2405 2405 { 2406 2406 /// Build the final struct 2407 2407 pub fn build(self) -> RepoOp<'a> { ··· 2579 2579 } 2580 2580 /// State trait tracking which required fields have been set 2581 2581 pub trait State: sealed::Sealed { 2582 + type Rev; 2583 + type Blocks; 2582 2584 type Did; 2583 - type Time; 2584 2585 type Seq; 2585 - type Blocks; 2586 - type Rev; 2586 + type Time; 2587 2587 } 2588 2588 /// Empty state - all required fields are unset 2589 2589 pub struct Empty(()); 2590 2590 impl sealed::Sealed for Empty {} 2591 2591 impl State for Empty { 2592 + type Rev = Unset; 2593 + type Blocks = Unset; 2592 2594 type Did = Unset; 2593 - type Time = Unset; 2594 2595 type Seq = Unset; 2595 - type Blocks = Unset; 2596 - type Rev = Unset; 2596 + type Time = Unset; 2597 + } 2598 + ///State transition - sets the `rev` field to Set 2599 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2600 + impl<S: State> sealed::Sealed for SetRev<S> {} 2601 + impl<S: State> State for SetRev<S> { 2602 + type Rev = Set<members::rev>; 2603 + type Blocks = S::Blocks; 2604 + type Did = S::Did; 2605 + type Seq = S::Seq; 2606 + type Time = S::Time; 2607 + } 2608 + ///State transition - sets the `blocks` field to Set 2609 + pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>); 2610 + impl<S: State> sealed::Sealed for SetBlocks<S> {} 2611 + impl<S: State> State for SetBlocks<S> { 2612 + type Rev = S::Rev; 2613 + type Blocks = Set<members::blocks>; 2614 + type Did = S::Did; 2615 + type Seq = S::Seq; 2616 + type Time = S::Time; 2597 2617 } 2598 2618 ///State transition - sets the `did` field to Set 2599 2619 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2600 2620 impl<S: State> sealed::Sealed for SetDid<S> {} 2601 2621 impl<S: State> State for SetDid<S> { 2622 + type Rev = S::Rev; 2623 + type Blocks = S::Blocks; 2602 2624 type Did = Set<members::did>; 2603 - type Time = S::Time; 2604 2625 type Seq = S::Seq; 2605 - type Blocks = S::Blocks; 2606 - type Rev = S::Rev; 2607 - } 2608 - ///State transition - sets the `time` field to Set 2609 - pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 2610 - impl<S: State> sealed::Sealed for SetTime<S> {} 2611 - impl<S: State> State for SetTime<S> { 2612 - type Did = S::Did; 2613 - type Time = Set<members::time>; 2614 - type Seq = S::Seq; 2615 - type Blocks = S::Blocks; 2616 - type Rev = S::Rev; 2626 + type Time = S::Time; 2617 2627 } 2618 2628 ///State transition - sets the `seq` field to Set 2619 2629 pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 2620 2630 impl<S: State> sealed::Sealed for SetSeq<S> {} 2621 2631 impl<S: State> State for SetSeq<S> { 2622 - type Did = S::Did; 2623 - type Time = S::Time; 2624 - type Seq = Set<members::seq>; 2625 - type Blocks = S::Blocks; 2626 2632 type Rev = S::Rev; 2627 - } 2628 - ///State transition - sets the `blocks` field to Set 2629 - pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>); 2630 - impl<S: State> sealed::Sealed for SetBlocks<S> {} 2631 - impl<S: State> State for SetBlocks<S> { 2633 + type Blocks = S::Blocks; 2632 2634 type Did = S::Did; 2635 + type Seq = Set<members::seq>; 2633 2636 type Time = S::Time; 2634 - type Seq = S::Seq; 2635 - type Blocks = Set<members::blocks>; 2636 - type Rev = S::Rev; 2637 2637 } 2638 - ///State transition - sets the `rev` field to Set 2639 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2640 - impl<S: State> sealed::Sealed for SetRev<S> {} 2641 - impl<S: State> State for SetRev<S> { 2638 + ///State transition - sets the `time` field to Set 2639 + pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 2640 + impl<S: State> sealed::Sealed for SetTime<S> {} 2641 + impl<S: State> State for SetTime<S> { 2642 + type Rev = S::Rev; 2643 + type Blocks = S::Blocks; 2642 2644 type Did = S::Did; 2643 - type Time = S::Time; 2644 2645 type Seq = S::Seq; 2645 - type Blocks = S::Blocks; 2646 - type Rev = Set<members::rev>; 2646 + type Time = Set<members::time>; 2647 2647 } 2648 2648 /// Marker types for field names 2649 2649 #[allow(non_camel_case_types)] 2650 2650 pub mod members { 2651 + ///Marker type for the `rev` field 2652 + pub struct rev(()); 2653 + ///Marker type for the `blocks` field 2654 + pub struct blocks(()); 2651 2655 ///Marker type for the `did` field 2652 2656 pub struct did(()); 2657 + ///Marker type for the `seq` field 2658 + pub struct seq(()); 2653 2659 ///Marker type for the `time` field 2654 2660 pub struct time(()); 2655 - ///Marker type for the `seq` field 2656 - pub struct seq(()); 2657 - ///Marker type for the `blocks` field 2658 - pub struct blocks(()); 2659 - ///Marker type for the `rev` field 2660 - pub struct rev(()); 2661 2661 } 2662 2662 } 2663 2663 ··· 2790 2790 impl<'a, S> SyncBuilder<'a, S> 2791 2791 where 2792 2792 S: sync_state::State, 2793 + S::Rev: sync_state::IsSet, 2794 + S::Blocks: sync_state::IsSet, 2793 2795 S::Did: sync_state::IsSet, 2794 - S::Time: sync_state::IsSet, 2795 2796 S::Seq: sync_state::IsSet, 2796 - S::Blocks: sync_state::IsSet, 2797 - S::Rev: sync_state::IsSet, 2797 + S::Time: sync_state::IsSet, 2798 2798 { 2799 2799 /// Build the final struct 2800 2800 pub fn build(self) -> Sync<'a> {
+39 -39
crates/weaver-api/src/com_deckbelcher/deck/list.rs
··· 42 42 } 43 43 /// State trait tracking which required fields have been set 44 44 pub trait State: sealed::Sealed { 45 - type Section; 46 45 type ScryfallId; 47 46 type Quantity; 47 + type Section; 48 48 } 49 49 /// Empty state - all required fields are unset 50 50 pub struct Empty(()); 51 51 impl sealed::Sealed for Empty {} 52 52 impl State for Empty { 53 - type Section = Unset; 54 53 type ScryfallId = Unset; 55 54 type Quantity = Unset; 56 - } 57 - ///State transition - sets the `section` field to Set 58 - pub struct SetSection<S: State = Empty>(PhantomData<fn() -> S>); 59 - impl<S: State> sealed::Sealed for SetSection<S> {} 60 - impl<S: State> State for SetSection<S> { 61 - type Section = Set<members::section>; 62 - type ScryfallId = S::ScryfallId; 63 - type Quantity = S::Quantity; 55 + type Section = Unset; 64 56 } 65 57 ///State transition - sets the `scryfall_id` field to Set 66 58 pub struct SetScryfallId<S: State = Empty>(PhantomData<fn() -> S>); 67 59 impl<S: State> sealed::Sealed for SetScryfallId<S> {} 68 60 impl<S: State> State for SetScryfallId<S> { 69 - type Section = S::Section; 70 61 type ScryfallId = Set<members::scryfall_id>; 71 62 type Quantity = S::Quantity; 63 + type Section = S::Section; 72 64 } 73 65 ///State transition - sets the `quantity` field to Set 74 66 pub struct SetQuantity<S: State = Empty>(PhantomData<fn() -> S>); 75 67 impl<S: State> sealed::Sealed for SetQuantity<S> {} 76 68 impl<S: State> State for SetQuantity<S> { 77 - type Section = S::Section; 78 69 type ScryfallId = S::ScryfallId; 79 70 type Quantity = Set<members::quantity>; 71 + type Section = S::Section; 72 + } 73 + ///State transition - sets the `section` field to Set 74 + pub struct SetSection<S: State = Empty>(PhantomData<fn() -> S>); 75 + impl<S: State> sealed::Sealed for SetSection<S> {} 76 + impl<S: State> State for SetSection<S> { 77 + type ScryfallId = S::ScryfallId; 78 + type Quantity = S::Quantity; 79 + type Section = Set<members::section>; 80 80 } 81 81 /// Marker types for field names 82 82 #[allow(non_camel_case_types)] 83 83 pub mod members { 84 - ///Marker type for the `section` field 85 - pub struct section(()); 86 84 ///Marker type for the `scryfall_id` field 87 85 pub struct scryfall_id(()); 88 86 ///Marker type for the `quantity` field 89 87 pub struct quantity(()); 88 + ///Marker type for the `section` field 89 + pub struct section(()); 90 90 } 91 91 } 92 92 ··· 199 199 impl<'a, S> CardBuilder<'a, S> 200 200 where 201 201 S: card_state::State, 202 - S::Section: card_state::IsSet, 203 202 S::ScryfallId: card_state::IsSet, 204 203 S::Quantity: card_state::IsSet, 204 + S::Section: card_state::IsSet, 205 205 { 206 206 /// Build the final struct 207 207 pub fn build(self) -> Card<'a> { ··· 704 704 } 705 705 /// State trait tracking which required fields have been set 706 706 pub trait State: sealed::Sealed { 707 - type Cards; 708 - type Name; 709 707 type CreatedAt; 708 + type Name; 709 + type Cards; 710 710 } 711 711 /// Empty state - all required fields are unset 712 712 pub struct Empty(()); 713 713 impl sealed::Sealed for Empty {} 714 714 impl State for Empty { 715 + type CreatedAt = Unset; 716 + type Name = Unset; 715 717 type Cards = Unset; 716 - type Name = Unset; 717 - type CreatedAt = Unset; 718 718 } 719 - ///State transition - sets the `cards` field to Set 720 - pub struct SetCards<S: State = Empty>(PhantomData<fn() -> S>); 721 - impl<S: State> sealed::Sealed for SetCards<S> {} 722 - impl<S: State> State for SetCards<S> { 723 - type Cards = Set<members::cards>; 719 + ///State transition - sets the `created_at` field to Set 720 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 721 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 722 + impl<S: State> State for SetCreatedAt<S> { 723 + type CreatedAt = Set<members::created_at>; 724 724 type Name = S::Name; 725 - type CreatedAt = S::CreatedAt; 725 + type Cards = S::Cards; 726 726 } 727 727 ///State transition - sets the `name` field to Set 728 728 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 729 729 impl<S: State> sealed::Sealed for SetName<S> {} 730 730 impl<S: State> State for SetName<S> { 731 - type Cards = S::Cards; 732 - type Name = Set<members::name>; 733 731 type CreatedAt = S::CreatedAt; 732 + type Name = Set<members::name>; 733 + type Cards = S::Cards; 734 734 } 735 - ///State transition - sets the `created_at` field to Set 736 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 737 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 738 - impl<S: State> State for SetCreatedAt<S> { 739 - type Cards = S::Cards; 735 + ///State transition - sets the `cards` field to Set 736 + pub struct SetCards<S: State = Empty>(PhantomData<fn() -> S>); 737 + impl<S: State> sealed::Sealed for SetCards<S> {} 738 + impl<S: State> State for SetCards<S> { 739 + type CreatedAt = S::CreatedAt; 740 740 type Name = S::Name; 741 - type CreatedAt = Set<members::created_at>; 741 + type Cards = Set<members::cards>; 742 742 } 743 743 /// Marker types for field names 744 744 #[allow(non_camel_case_types)] 745 745 pub mod members { 746 + ///Marker type for the `created_at` field 747 + pub struct created_at(()); 748 + ///Marker type for the `name` field 749 + pub struct name(()); 746 750 ///Marker type for the `cards` field 747 751 pub struct cards(()); 748 - ///Marker type for the `name` field 749 - pub struct name(()); 750 - ///Marker type for the `created_at` field 751 - pub struct created_at(()); 752 752 } 753 753 } 754 754 ··· 915 915 impl<'a, S> ListBuilder<'a, S> 916 916 where 917 917 S: list_state::State, 918 - S::Cards: list_state::IsSet, 919 - S::Name: list_state::IsSet, 920 918 S::CreatedAt: list_state::IsSet, 919 + S::Name: list_state::IsSet, 920 + S::Cards: list_state::IsSet, 921 921 { 922 922 /// Build the final struct 923 923 pub fn build(self) -> List<'a> {
+13 -13
crates/weaver-api/src/com_deckbelcher/richtext/facet.rs
··· 585 585 } 586 586 /// State trait tracking which required fields have been set 587 587 pub trait State: sealed::Sealed { 588 - type Features; 589 588 type Index; 589 + type Features; 590 590 } 591 591 /// Empty state - all required fields are unset 592 592 pub struct Empty(()); 593 593 impl sealed::Sealed for Empty {} 594 594 impl State for Empty { 595 - type Features = Unset; 596 595 type Index = Unset; 597 - } 598 - ///State transition - sets the `features` field to Set 599 - pub struct SetFeatures<S: State = Empty>(PhantomData<fn() -> S>); 600 - impl<S: State> sealed::Sealed for SetFeatures<S> {} 601 - impl<S: State> State for SetFeatures<S> { 602 - type Features = Set<members::features>; 603 - type Index = S::Index; 596 + type Features = Unset; 604 597 } 605 598 ///State transition - sets the `index` field to Set 606 599 pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 607 600 impl<S: State> sealed::Sealed for SetIndex<S> {} 608 601 impl<S: State> State for SetIndex<S> { 609 - type Features = S::Features; 610 602 type Index = Set<members::index>; 603 + type Features = S::Features; 604 + } 605 + ///State transition - sets the `features` field to Set 606 + pub struct SetFeatures<S: State = Empty>(PhantomData<fn() -> S>); 607 + impl<S: State> sealed::Sealed for SetFeatures<S> {} 608 + impl<S: State> State for SetFeatures<S> { 609 + type Index = S::Index; 610 + type Features = Set<members::features>; 611 611 } 612 612 /// Marker types for field names 613 613 #[allow(non_camel_case_types)] 614 614 pub mod members { 615 - ///Marker type for the `features` field 616 - pub struct features(()); 617 615 ///Marker type for the `index` field 618 616 pub struct index(()); 617 + ///Marker type for the `features` field 618 + pub struct features(()); 619 619 } 620 620 } 621 621 ··· 688 688 impl<'a, S> FacetBuilder<'a, S> 689 689 where 690 690 S: facet_state::State, 691 - S::Features: facet_state::IsSet, 692 691 S::Index: facet_state::IsSet, 692 + S::Features: facet_state::IsSet, 693 693 { 694 694 /// Build the final struct 695 695 pub fn build(self) -> Facet<'a> {
+13 -13
crates/weaver-api/src/com_deckbelcher/social/like.rs
··· 35 35 } 36 36 /// State trait tracking which required fields have been set 37 37 pub trait State: sealed::Sealed { 38 - type Subject; 39 38 type CreatedAt; 39 + type Subject; 40 40 } 41 41 /// Empty state - all required fields are unset 42 42 pub struct Empty(()); 43 43 impl sealed::Sealed for Empty {} 44 44 impl State for Empty { 45 - type Subject = Unset; 46 45 type CreatedAt = Unset; 47 - } 48 - ///State transition - sets the `subject` field to Set 49 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetSubject<S> {} 51 - impl<S: State> State for SetSubject<S> { 52 - type Subject = Set<members::subject>; 53 - type CreatedAt = S::CreatedAt; 46 + type Subject = Unset; 54 47 } 55 48 ///State transition - sets the `created_at` field to Set 56 49 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 57 50 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 58 51 impl<S: State> State for SetCreatedAt<S> { 59 - type Subject = S::Subject; 60 52 type CreatedAt = Set<members::created_at>; 53 + type Subject = S::Subject; 54 + } 55 + ///State transition - sets the `subject` field to Set 56 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetSubject<S> {} 58 + impl<S: State> State for SetSubject<S> { 59 + type CreatedAt = S::CreatedAt; 60 + type Subject = Set<members::subject>; 61 61 } 62 62 /// Marker types for field names 63 63 #[allow(non_camel_case_types)] 64 64 pub mod members { 65 - ///Marker type for the `subject` field 66 - pub struct subject(()); 67 65 ///Marker type for the `created_at` field 68 66 pub struct created_at(()); 67 + ///Marker type for the `subject` field 68 + pub struct subject(()); 69 69 } 70 70 } 71 71 ··· 138 138 impl<'a, S> LikeBuilder<'a, S> 139 139 where 140 140 S: like_state::State, 141 - S::Subject: like_state::IsSet, 142 141 S::CreatedAt: like_state::IsSet, 142 + S::Subject: like_state::IsSet, 143 143 { 144 144 /// Build the final struct 145 145 pub fn build(self) -> Like<'a> {
+13 -13
crates/weaver-api/src/com_whtwnd/blog.rs
··· 454 454 } 455 455 /// State trait tracking which required fields have been set 456 456 pub trait State: sealed::Sealed { 457 - type Content; 458 457 type EntryUri; 458 + type Content; 459 459 } 460 460 /// Empty state - all required fields are unset 461 461 pub struct Empty(()); 462 462 impl sealed::Sealed for Empty {} 463 463 impl State for Empty { 464 - type Content = Unset; 465 464 type EntryUri = Unset; 466 - } 467 - ///State transition - sets the `content` field to Set 468 - pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 469 - impl<S: State> sealed::Sealed for SetContent<S> {} 470 - impl<S: State> State for SetContent<S> { 471 - type Content = Set<members::content>; 472 - type EntryUri = S::EntryUri; 465 + type Content = Unset; 473 466 } 474 467 ///State transition - sets the `entry_uri` field to Set 475 468 pub struct SetEntryUri<S: State = Empty>(PhantomData<fn() -> S>); 476 469 impl<S: State> sealed::Sealed for SetEntryUri<S> {} 477 470 impl<S: State> State for SetEntryUri<S> { 478 - type Content = S::Content; 479 471 type EntryUri = Set<members::entry_uri>; 472 + type Content = S::Content; 473 + } 474 + ///State transition - sets the `content` field to Set 475 + pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 476 + impl<S: State> sealed::Sealed for SetContent<S> {} 477 + impl<S: State> State for SetContent<S> { 478 + type EntryUri = S::EntryUri; 479 + type Content = Set<members::content>; 480 480 } 481 481 /// Marker types for field names 482 482 #[allow(non_camel_case_types)] 483 483 pub mod members { 484 - ///Marker type for the `content` field 485 - pub struct content(()); 486 484 ///Marker type for the `entry_uri` field 487 485 pub struct entry_uri(()); 486 + ///Marker type for the `content` field 487 + pub struct content(()); 488 488 } 489 489 } 490 490 ··· 557 557 impl<'a, S> CommentBuilder<'a, S> 558 558 where 559 559 S: comment_state::State, 560 - S::Content: comment_state::IsSet, 561 560 S::EntryUri: comment_state::IsSet, 561 + S::Content: comment_state::IsSet, 562 562 { 563 563 /// Build the final struct 564 564 pub fn build(self) -> Comment<'a> {
+13 -13
crates/weaver-api/src/com_whtwnd/blog/get_entry_metadata_by_name.rs
··· 32 32 } 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 - type Author; 36 35 type EntryTitle; 36 + type Author; 37 37 } 38 38 /// Empty state - all required fields are unset 39 39 pub struct Empty(()); 40 40 impl sealed::Sealed for Empty {} 41 41 impl State for Empty { 42 - type Author = Unset; 43 42 type EntryTitle = Unset; 44 - } 45 - ///State transition - sets the `author` field to Set 46 - pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetAuthor<S> {} 48 - impl<S: State> State for SetAuthor<S> { 49 - type Author = Set<members::author>; 50 - type EntryTitle = S::EntryTitle; 43 + type Author = Unset; 51 44 } 52 45 ///State transition - sets the `entry_title` field to Set 53 46 pub struct SetEntryTitle<S: State = Empty>(PhantomData<fn() -> S>); 54 47 impl<S: State> sealed::Sealed for SetEntryTitle<S> {} 55 48 impl<S: State> State for SetEntryTitle<S> { 56 - type Author = S::Author; 57 49 type EntryTitle = Set<members::entry_title>; 50 + type Author = S::Author; 51 + } 52 + ///State transition - sets the `author` field to Set 53 + pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetAuthor<S> {} 55 + impl<S: State> State for SetAuthor<S> { 56 + type EntryTitle = S::EntryTitle; 57 + type Author = Set<members::author>; 58 58 } 59 59 /// Marker types for field names 60 60 #[allow(non_camel_case_types)] 61 61 pub mod members { 62 - ///Marker type for the `author` field 63 - pub struct author(()); 64 62 ///Marker type for the `entry_title` field 65 63 pub struct entry_title(()); 64 + ///Marker type for the `author` field 65 + pub struct author(()); 66 66 } 67 67 } 68 68 ··· 147 147 impl<'a, S> GetEntryMetadataByNameBuilder<'a, S> 148 148 where 149 149 S: get_entry_metadata_by_name_state::State, 150 - S::Author: get_entry_metadata_by_name_state::IsSet, 151 150 S::EntryTitle: get_entry_metadata_by_name_state::IsSet, 151 + S::Author: get_entry_metadata_by_name_state::IsSet, 152 152 { 153 153 /// Build the final struct 154 154 pub fn build(self) -> GetEntryMetadataByName<'a> {
+13 -13
crates/weaver-api/src/pub_leaflet/blocks/button.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Url; 37 36 type Text; 37 + type Url; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Url = Unset; 44 43 type Text = Unset; 45 - } 46 - ///State transition - sets the `url` field to Set 47 - pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetUrl<S> {} 49 - impl<S: State> State for SetUrl<S> { 50 - type Url = Set<members::url>; 51 - type Text = S::Text; 44 + type Url = Unset; 52 45 } 53 46 ///State transition - sets the `text` field to Set 54 47 pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetText<S> {} 56 49 impl<S: State> State for SetText<S> { 57 - type Url = S::Url; 58 50 type Text = Set<members::text>; 51 + type Url = S::Url; 52 + } 53 + ///State transition - sets the `url` field to Set 54 + pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetUrl<S> {} 56 + impl<S: State> State for SetUrl<S> { 57 + type Text = S::Text; 58 + type Url = Set<members::url>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `url` field 64 - pub struct url(()); 65 63 ///Marker type for the `text` field 66 64 pub struct text(()); 65 + ///Marker type for the `url` field 66 + pub struct url(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> ButtonBuilder<'a, S> 137 137 where 138 138 S: button_state::State, 139 - S::Url: button_state::IsSet, 140 139 S::Text: button_state::IsSet, 140 + S::Url: button_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> Button<'a> {
+15 -15
crates/weaver-api/src/pub_leaflet/comment.rs
··· 443 443 } 444 444 /// State trait tracking which required fields have been set 445 445 pub trait State: sealed::Sealed { 446 + type CreatedAt; 446 447 type Plaintext; 447 448 type Subject; 448 - type CreatedAt; 449 449 } 450 450 /// Empty state - all required fields are unset 451 451 pub struct Empty(()); 452 452 impl sealed::Sealed for Empty {} 453 453 impl State for Empty { 454 + type CreatedAt = Unset; 454 455 type Plaintext = Unset; 455 456 type Subject = Unset; 456 - type CreatedAt = Unset; 457 + } 458 + ///State transition - sets the `created_at` field to Set 459 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 460 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 461 + impl<S: State> State for SetCreatedAt<S> { 462 + type CreatedAt = Set<members::created_at>; 463 + type Plaintext = S::Plaintext; 464 + type Subject = S::Subject; 457 465 } 458 466 ///State transition - sets the `plaintext` field to Set 459 467 pub struct SetPlaintext<S: State = Empty>(PhantomData<fn() -> S>); 460 468 impl<S: State> sealed::Sealed for SetPlaintext<S> {} 461 469 impl<S: State> State for SetPlaintext<S> { 470 + type CreatedAt = S::CreatedAt; 462 471 type Plaintext = Set<members::plaintext>; 463 472 type Subject = S::Subject; 464 - type CreatedAt = S::CreatedAt; 465 473 } 466 474 ///State transition - sets the `subject` field to Set 467 475 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 468 476 impl<S: State> sealed::Sealed for SetSubject<S> {} 469 477 impl<S: State> State for SetSubject<S> { 470 - type Plaintext = S::Plaintext; 471 - type Subject = Set<members::subject>; 472 478 type CreatedAt = S::CreatedAt; 473 - } 474 - ///State transition - sets the `created_at` field to Set 475 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 476 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 477 - impl<S: State> State for SetCreatedAt<S> { 478 479 type Plaintext = S::Plaintext; 479 - type Subject = S::Subject; 480 - type CreatedAt = Set<members::created_at>; 480 + type Subject = Set<members::subject>; 481 481 } 482 482 /// Marker types for field names 483 483 #[allow(non_camel_case_types)] 484 484 pub mod members { 485 + ///Marker type for the `created_at` field 486 + pub struct created_at(()); 485 487 ///Marker type for the `plaintext` field 486 488 pub struct plaintext(()); 487 489 ///Marker type for the `subject` field 488 490 pub struct subject(()); 489 - ///Marker type for the `created_at` field 490 - pub struct created_at(()); 491 491 } 492 492 } 493 493 ··· 657 657 impl<'a, S> CommentBuilder<'a, S> 658 658 where 659 659 S: comment_state::State, 660 + S::CreatedAt: comment_state::IsSet, 660 661 S::Plaintext: comment_state::IsSet, 661 662 S::Subject: comment_state::IsSet, 662 - S::CreatedAt: comment_state::IsSet, 663 663 { 664 664 /// Build the final struct 665 665 pub fn build(self) -> Comment<'a> {
+15 -15
crates/weaver-api/src/pub_leaflet/document.rs
··· 55 55 } 56 56 /// State trait tracking which required fields have been set 57 57 pub trait State: sealed::Sealed { 58 - type Title; 59 58 type Pages; 60 59 type Author; 60 + type Title; 61 61 } 62 62 /// Empty state - all required fields are unset 63 63 pub struct Empty(()); 64 64 impl sealed::Sealed for Empty {} 65 65 impl State for Empty { 66 - type Title = Unset; 67 66 type Pages = Unset; 68 67 type Author = Unset; 69 - } 70 - ///State transition - sets the `title` field to Set 71 - pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 72 - impl<S: State> sealed::Sealed for SetTitle<S> {} 73 - impl<S: State> State for SetTitle<S> { 74 - type Title = Set<members::title>; 75 - type Pages = S::Pages; 76 - type Author = S::Author; 68 + type Title = Unset; 77 69 } 78 70 ///State transition - sets the `pages` field to Set 79 71 pub struct SetPages<S: State = Empty>(PhantomData<fn() -> S>); 80 72 impl<S: State> sealed::Sealed for SetPages<S> {} 81 73 impl<S: State> State for SetPages<S> { 82 - type Title = S::Title; 83 74 type Pages = Set<members::pages>; 84 75 type Author = S::Author; 76 + type Title = S::Title; 85 77 } 86 78 ///State transition - sets the `author` field to Set 87 79 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 88 80 impl<S: State> sealed::Sealed for SetAuthor<S> {} 89 81 impl<S: State> State for SetAuthor<S> { 90 - type Title = S::Title; 91 82 type Pages = S::Pages; 92 83 type Author = Set<members::author>; 84 + type Title = S::Title; 85 + } 86 + ///State transition - sets the `title` field to Set 87 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 88 + impl<S: State> sealed::Sealed for SetTitle<S> {} 89 + impl<S: State> State for SetTitle<S> { 90 + type Pages = S::Pages; 91 + type Author = S::Author; 92 + type Title = Set<members::title>; 93 93 } 94 94 /// Marker types for field names 95 95 #[allow(non_camel_case_types)] 96 96 pub mod members { 97 - ///Marker type for the `title` field 98 - pub struct title(()); 99 97 ///Marker type for the `pages` field 100 98 pub struct pages(()); 101 99 ///Marker type for the `author` field 102 100 pub struct author(()); 101 + ///Marker type for the `title` field 102 + pub struct title(()); 103 103 } 104 104 } 105 105 ··· 322 322 impl<'a, S> DocumentBuilder<'a, S> 323 323 where 324 324 S: document_state::State, 325 - S::Title: document_state::IsSet, 326 325 S::Pages: document_state::IsSet, 327 326 S::Author: document_state::IsSet, 327 + S::Title: document_state::IsSet, 328 328 { 329 329 /// Build the final struct 330 330 pub fn build(self) -> Document<'a> {
+45 -45
crates/weaver-api/src/pub_leaflet/pages/canvas.rs
··· 39 39 } 40 40 /// State trait tracking which required fields have been set 41 41 pub trait State: sealed::Sealed { 42 + type X; 43 + type Block; 42 44 type Width; 43 45 type Y; 44 - type Block; 45 - type X; 46 46 } 47 47 /// Empty state - all required fields are unset 48 48 pub struct Empty(()); 49 49 impl sealed::Sealed for Empty {} 50 50 impl State for Empty { 51 + type X = Unset; 52 + type Block = Unset; 51 53 type Width = Unset; 52 54 type Y = Unset; 53 - type Block = Unset; 54 - type X = Unset; 55 + } 56 + ///State transition - sets the `x` field to Set 57 + pub struct SetX<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetX<S> {} 59 + impl<S: State> State for SetX<S> { 60 + type X = Set<members::x>; 61 + type Block = S::Block; 62 + type Width = S::Width; 63 + type Y = S::Y; 64 + } 65 + ///State transition - sets the `block` field to Set 66 + pub struct SetBlock<S: State = Empty>(PhantomData<fn() -> S>); 67 + impl<S: State> sealed::Sealed for SetBlock<S> {} 68 + impl<S: State> State for SetBlock<S> { 69 + type X = S::X; 70 + type Block = Set<members::block>; 71 + type Width = S::Width; 72 + type Y = S::Y; 55 73 } 56 74 ///State transition - sets the `width` field to Set 57 75 pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 58 76 impl<S: State> sealed::Sealed for SetWidth<S> {} 59 77 impl<S: State> State for SetWidth<S> { 78 + type X = S::X; 79 + type Block = S::Block; 60 80 type Width = Set<members::width>; 61 81 type Y = S::Y; 62 - type Block = S::Block; 63 - type X = S::X; 64 82 } 65 83 ///State transition - sets the `y` field to Set 66 84 pub struct SetY<S: State = Empty>(PhantomData<fn() -> S>); 67 85 impl<S: State> sealed::Sealed for SetY<S> {} 68 86 impl<S: State> State for SetY<S> { 69 - type Width = S::Width; 70 - type Y = Set<members::y>; 71 - type Block = S::Block; 72 87 type X = S::X; 73 - } 74 - ///State transition - sets the `block` field to Set 75 - pub struct SetBlock<S: State = Empty>(PhantomData<fn() -> S>); 76 - impl<S: State> sealed::Sealed for SetBlock<S> {} 77 - impl<S: State> State for SetBlock<S> { 78 - type Width = S::Width; 79 - type Y = S::Y; 80 - type Block = Set<members::block>; 81 - type X = S::X; 82 - } 83 - ///State transition - sets the `x` field to Set 84 - pub struct SetX<S: State = Empty>(PhantomData<fn() -> S>); 85 - impl<S: State> sealed::Sealed for SetX<S> {} 86 - impl<S: State> State for SetX<S> { 87 - type Width = S::Width; 88 - type Y = S::Y; 89 88 type Block = S::Block; 90 - type X = Set<members::x>; 89 + type Width = S::Width; 90 + type Y = Set<members::y>; 91 91 } 92 92 /// Marker types for field names 93 93 #[allow(non_camel_case_types)] 94 94 pub mod members { 95 + ///Marker type for the `x` field 96 + pub struct x(()); 97 + ///Marker type for the `block` field 98 + pub struct block(()); 95 99 ///Marker type for the `width` field 96 100 pub struct width(()); 97 101 ///Marker type for the `y` field 98 102 pub struct y(()); 99 - ///Marker type for the `block` field 100 - pub struct block(()); 101 - ///Marker type for the `x` field 102 - pub struct x(()); 103 103 } 104 104 } 105 105 ··· 234 234 impl<'a, S> BlockBuilder<'a, S> 235 235 where 236 236 S: block_state::State, 237 + S::X: block_state::IsSet, 238 + S::Block: block_state::IsSet, 237 239 S::Width: block_state::IsSet, 238 240 S::Y: block_state::IsSet, 239 - S::Block: block_state::IsSet, 240 - S::X: block_state::IsSet, 241 241 { 242 242 /// Build the final struct 243 243 pub fn build(self) -> Block<'a> { ··· 764 764 } 765 765 /// State trait tracking which required fields have been set 766 766 pub trait State: sealed::Sealed { 767 - type Block; 768 767 type Offset; 768 + type Block; 769 769 } 770 770 /// Empty state - all required fields are unset 771 771 pub struct Empty(()); 772 772 impl sealed::Sealed for Empty {} 773 773 impl State for Empty { 774 - type Block = Unset; 775 774 type Offset = Unset; 776 - } 777 - ///State transition - sets the `block` field to Set 778 - pub struct SetBlock<S: State = Empty>(PhantomData<fn() -> S>); 779 - impl<S: State> sealed::Sealed for SetBlock<S> {} 780 - impl<S: State> State for SetBlock<S> { 781 - type Block = Set<members::block>; 782 - type Offset = S::Offset; 775 + type Block = Unset; 783 776 } 784 777 ///State transition - sets the `offset` field to Set 785 778 pub struct SetOffset<S: State = Empty>(PhantomData<fn() -> S>); 786 779 impl<S: State> sealed::Sealed for SetOffset<S> {} 787 780 impl<S: State> State for SetOffset<S> { 788 - type Block = S::Block; 789 781 type Offset = Set<members::offset>; 782 + type Block = S::Block; 783 + } 784 + ///State transition - sets the `block` field to Set 785 + pub struct SetBlock<S: State = Empty>(PhantomData<fn() -> S>); 786 + impl<S: State> sealed::Sealed for SetBlock<S> {} 787 + impl<S: State> State for SetBlock<S> { 788 + type Offset = S::Offset; 789 + type Block = Set<members::block>; 790 790 } 791 791 /// Marker types for field names 792 792 #[allow(non_camel_case_types)] 793 793 pub mod members { 794 - ///Marker type for the `block` field 795 - pub struct block(()); 796 794 ///Marker type for the `offset` field 797 795 pub struct offset(()); 796 + ///Marker type for the `block` field 797 + pub struct block(()); 798 798 } 799 799 } 800 800 ··· 867 867 impl<'a, S> PositionBuilder<'a, S> 868 868 where 869 869 S: position_state::State, 870 - S::Block: position_state::IsSet, 871 870 S::Offset: position_state::IsSet, 871 + S::Block: position_state::IsSet, 872 872 { 873 873 /// Build the final struct 874 874 pub fn build(self) -> Position<'a> {
+13 -13
crates/weaver-api/src/pub_leaflet/poll/vote.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Option; 38 37 type Poll; 38 + type Option; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type Option = Unset; 45 44 type Poll = Unset; 46 - } 47 - ///State transition - sets the `option` field to Set 48 - pub struct SetOption<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetOption<S> {} 50 - impl<S: State> State for SetOption<S> { 51 - type Option = Set<members::option>; 52 - type Poll = S::Poll; 45 + type Option = Unset; 53 46 } 54 47 ///State transition - sets the `poll` field to Set 55 48 pub struct SetPoll<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetPoll<S> {} 57 50 impl<S: State> State for SetPoll<S> { 58 - type Option = S::Option; 59 51 type Poll = Set<members::poll>; 52 + type Option = S::Option; 53 + } 54 + ///State transition - sets the `option` field to Set 55 + pub struct SetOption<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetOption<S> {} 57 + impl<S: State> State for SetOption<S> { 58 + type Poll = S::Poll; 59 + type Option = Set<members::option>; 60 60 } 61 61 /// Marker types for field names 62 62 #[allow(non_camel_case_types)] 63 63 pub mod members { 64 - ///Marker type for the `option` field 65 - pub struct option(()); 66 64 ///Marker type for the `poll` field 67 65 pub struct poll(()); 66 + ///Marker type for the `option` field 67 + pub struct option(()); 68 68 } 69 69 } 70 70 ··· 137 137 impl<'a, S> VoteBuilder<'a, S> 138 138 where 139 139 S: vote_state::State, 140 - S::Option: vote_state::IsSet, 141 140 S::Poll: vote_state::IsSet, 141 + S::Option: vote_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> Vote<'a> {
+13 -13
crates/weaver-api/src/pub_leaflet/richtext/facet.rs
··· 556 556 } 557 557 /// State trait tracking which required fields have been set 558 558 pub trait State: sealed::Sealed { 559 - type ByteEnd; 560 559 type ByteStart; 560 + type ByteEnd; 561 561 } 562 562 /// Empty state - all required fields are unset 563 563 pub struct Empty(()); 564 564 impl sealed::Sealed for Empty {} 565 565 impl State for Empty { 566 - type ByteEnd = Unset; 567 566 type ByteStart = Unset; 568 - } 569 - ///State transition - sets the `byte_end` field to Set 570 - pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>); 571 - impl<S: State> sealed::Sealed for SetByteEnd<S> {} 572 - impl<S: State> State for SetByteEnd<S> { 573 - type ByteEnd = Set<members::byte_end>; 574 - type ByteStart = S::ByteStart; 567 + type ByteEnd = Unset; 575 568 } 576 569 ///State transition - sets the `byte_start` field to Set 577 570 pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 578 571 impl<S: State> sealed::Sealed for SetByteStart<S> {} 579 572 impl<S: State> State for SetByteStart<S> { 580 - type ByteEnd = S::ByteEnd; 581 573 type ByteStart = Set<members::byte_start>; 574 + type ByteEnd = S::ByteEnd; 575 + } 576 + ///State transition - sets the `byte_end` field to Set 577 + pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>); 578 + impl<S: State> sealed::Sealed for SetByteEnd<S> {} 579 + impl<S: State> State for SetByteEnd<S> { 580 + type ByteStart = S::ByteStart; 581 + type ByteEnd = Set<members::byte_end>; 582 582 } 583 583 /// Marker types for field names 584 584 #[allow(non_camel_case_types)] 585 585 pub mod members { 586 - ///Marker type for the `byte_end` field 587 - pub struct byte_end(()); 588 586 ///Marker type for the `byte_start` field 589 587 pub struct byte_start(()); 588 + ///Marker type for the `byte_end` field 589 + pub struct byte_end(()); 590 590 } 591 591 } 592 592 ··· 656 656 impl<'a, S> ByteSliceBuilder<'a, S> 657 657 where 658 658 S: byte_slice_state::State, 659 - S::ByteEnd: byte_slice_state::IsSet, 660 659 S::ByteStart: byte_slice_state::IsSet, 660 + S::ByteEnd: byte_slice_state::IsSet, 661 661 { 662 662 /// Build the final struct 663 663 pub fn build(self) -> ByteSlice<'a> {
+32 -32
crates/weaver-api/src/pub_leaflet/theme/color.rs
··· 32 32 } 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 + type R; 35 36 type G; 36 37 type B; 37 - type R; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 + type R = Unset; 43 44 type G = Unset; 44 45 type B = Unset; 45 - type R = Unset; 46 + } 47 + ///State transition - sets the `r` field to Set 48 + pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>); 49 + impl<S: State> sealed::Sealed for SetR<S> {} 50 + impl<S: State> State for SetR<S> { 51 + type R = Set<members::r>; 52 + type G = S::G; 53 + type B = S::B; 46 54 } 47 55 ///State transition - sets the `g` field to Set 48 56 pub struct SetG<S: State = Empty>(PhantomData<fn() -> S>); 49 57 impl<S: State> sealed::Sealed for SetG<S> {} 50 58 impl<S: State> State for SetG<S> { 59 + type R = S::R; 51 60 type G = Set<members::g>; 52 61 type B = S::B; 53 - type R = S::R; 54 62 } 55 63 ///State transition - sets the `b` field to Set 56 64 pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>); 57 65 impl<S: State> sealed::Sealed for SetB<S> {} 58 66 impl<S: State> State for SetB<S> { 59 - type G = S::G; 60 - type B = Set<members::b>; 61 67 type R = S::R; 62 - } 63 - ///State transition - sets the `r` field to Set 64 - pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>); 65 - impl<S: State> sealed::Sealed for SetR<S> {} 66 - impl<S: State> State for SetR<S> { 67 68 type G = S::G; 68 - type B = S::B; 69 - type R = Set<members::r>; 69 + type B = Set<members::b>; 70 70 } 71 71 /// Marker types for field names 72 72 #[allow(non_camel_case_types)] 73 73 pub mod members { 74 + ///Marker type for the `r` field 75 + pub struct r(()); 74 76 ///Marker type for the `g` field 75 77 pub struct g(()); 76 78 ///Marker type for the `b` field 77 79 pub struct b(()); 78 - ///Marker type for the `r` field 79 - pub struct r(()); 80 80 } 81 81 } 82 82 ··· 160 160 impl<'a, S> RgbBuilder<'a, S> 161 161 where 162 162 S: rgb_state::State, 163 + S::R: rgb_state::IsSet, 163 164 S::G: rgb_state::IsSet, 164 165 S::B: rgb_state::IsSet, 165 - S::R: rgb_state::IsSet, 166 166 { 167 167 /// Build the final struct 168 168 pub fn build(self) -> Rgb<'a> { ··· 439 439 /// State trait tracking which required fields have been set 440 440 pub trait State: sealed::Sealed { 441 441 type R; 442 - type B; 443 442 type A; 443 + type B; 444 444 type G; 445 445 } 446 446 /// Empty state - all required fields are unset ··· 448 448 impl sealed::Sealed for Empty {} 449 449 impl State for Empty { 450 450 type R = Unset; 451 - type B = Unset; 452 451 type A = Unset; 452 + type B = Unset; 453 453 type G = Unset; 454 454 } 455 455 ///State transition - sets the `r` field to Set ··· 457 457 impl<S: State> sealed::Sealed for SetR<S> {} 458 458 impl<S: State> State for SetR<S> { 459 459 type R = Set<members::r>; 460 - type B = S::B; 461 460 type A = S::A; 462 - type G = S::G; 463 - } 464 - ///State transition - sets the `b` field to Set 465 - pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>); 466 - impl<S: State> sealed::Sealed for SetB<S> {} 467 - impl<S: State> State for SetB<S> { 468 - type R = S::R; 469 - type B = Set<members::b>; 470 - type A = S::A; 461 + type B = S::B; 471 462 type G = S::G; 472 463 } 473 464 ///State transition - sets the `a` field to Set ··· 475 466 impl<S: State> sealed::Sealed for SetA<S> {} 476 467 impl<S: State> State for SetA<S> { 477 468 type R = S::R; 478 - type B = S::B; 479 469 type A = Set<members::a>; 470 + type B = S::B; 471 + type G = S::G; 472 + } 473 + ///State transition - sets the `b` field to Set 474 + pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>); 475 + impl<S: State> sealed::Sealed for SetB<S> {} 476 + impl<S: State> State for SetB<S> { 477 + type R = S::R; 478 + type A = S::A; 479 + type B = Set<members::b>; 480 480 type G = S::G; 481 481 } 482 482 ///State transition - sets the `g` field to Set ··· 484 484 impl<S: State> sealed::Sealed for SetG<S> {} 485 485 impl<S: State> State for SetG<S> { 486 486 type R = S::R; 487 - type B = S::B; 488 487 type A = S::A; 488 + type B = S::B; 489 489 type G = Set<members::g>; 490 490 } 491 491 /// Marker types for field names ··· 493 493 pub mod members { 494 494 ///Marker type for the `r` field 495 495 pub struct r(()); 496 + ///Marker type for the `a` field 497 + pub struct a(()); 496 498 ///Marker type for the `b` field 497 499 pub struct b(()); 498 - ///Marker type for the `a` field 499 - pub struct a(()); 500 500 ///Marker type for the `g` field 501 501 pub struct g(()); 502 502 } ··· 600 600 where 601 601 S: rgba_state::State, 602 602 S::R: rgba_state::IsSet, 603 - S::B: rgba_state::IsSet, 604 603 S::A: rgba_state::IsSet, 604 + S::B: rgba_state::IsSet, 605 605 S::G: rgba_state::IsSet, 606 606 { 607 607 /// Build the final struct
+28 -28
crates/weaver-api/src/sh_weaver/actor.rs
··· 1979 1979 } 1980 1980 /// State trait tracking which required fields have been set 1981 1981 pub trait State: sealed::Sealed { 1982 - type Handle; 1983 1982 type Did; 1983 + type Handle; 1984 1984 } 1985 1985 /// Empty state - all required fields are unset 1986 1986 pub struct Empty(()); 1987 1987 impl sealed::Sealed for Empty {} 1988 1988 impl State for Empty { 1989 - type Handle = Unset; 1990 1989 type Did = Unset; 1991 - } 1992 - ///State transition - sets the `handle` field to Set 1993 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 1994 - impl<S: State> sealed::Sealed for SetHandle<S> {} 1995 - impl<S: State> State for SetHandle<S> { 1996 - type Handle = Set<members::handle>; 1997 - type Did = S::Did; 1990 + type Handle = Unset; 1998 1991 } 1999 1992 ///State transition - sets the `did` field to Set 2000 1993 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2001 1994 impl<S: State> sealed::Sealed for SetDid<S> {} 2002 1995 impl<S: State> State for SetDid<S> { 2003 - type Handle = S::Handle; 2004 1996 type Did = Set<members::did>; 1997 + type Handle = S::Handle; 1998 + } 1999 + ///State transition - sets the `handle` field to Set 2000 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 2001 + impl<S: State> sealed::Sealed for SetHandle<S> {} 2002 + impl<S: State> State for SetHandle<S> { 2003 + type Did = S::Did; 2004 + type Handle = Set<members::handle>; 2005 2005 } 2006 2006 /// Marker types for field names 2007 2007 #[allow(non_camel_case_types)] 2008 2008 pub mod members { 2009 - ///Marker type for the `handle` field 2010 - pub struct handle(()); 2011 2009 ///Marker type for the `did` field 2012 2010 pub struct did(()); 2011 + ///Marker type for the `handle` field 2012 + pub struct handle(()); 2013 2013 } 2014 2014 } 2015 2015 ··· 2388 2388 impl<'a, S> ProfileViewBuilder<'a, S> 2389 2389 where 2390 2390 S: profile_view_state::State, 2391 - S::Handle: profile_view_state::IsSet, 2392 2391 S::Did: profile_view_state::IsSet, 2392 + S::Handle: profile_view_state::IsSet, 2393 2393 { 2394 2394 /// Build the final struct 2395 2395 pub fn build(self) -> ProfileView<'a> { ··· 3167 3167 /// State trait tracking which required fields have been set 3168 3168 pub trait State: sealed::Sealed { 3169 3169 type Did; 3170 - type Bluesky; 3171 3170 type Handle; 3171 + type Bluesky; 3172 3172 } 3173 3173 /// Empty state - all required fields are unset 3174 3174 pub struct Empty(()); 3175 3175 impl sealed::Sealed for Empty {} 3176 3176 impl State for Empty { 3177 3177 type Did = Unset; 3178 - type Bluesky = Unset; 3179 3178 type Handle = Unset; 3179 + type Bluesky = Unset; 3180 3180 } 3181 3181 ///State transition - sets the `did` field to Set 3182 3182 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 3183 3183 impl<S: State> sealed::Sealed for SetDid<S> {} 3184 3184 impl<S: State> State for SetDid<S> { 3185 3185 type Did = Set<members::did>; 3186 - type Bluesky = S::Bluesky; 3187 3186 type Handle = S::Handle; 3188 - } 3189 - ///State transition - sets the `bluesky` field to Set 3190 - pub struct SetBluesky<S: State = Empty>(PhantomData<fn() -> S>); 3191 - impl<S: State> sealed::Sealed for SetBluesky<S> {} 3192 - impl<S: State> State for SetBluesky<S> { 3193 - type Did = S::Did; 3194 - type Bluesky = Set<members::bluesky>; 3195 - type Handle = S::Handle; 3187 + type Bluesky = S::Bluesky; 3196 3188 } 3197 3189 ///State transition - sets the `handle` field to Set 3198 3190 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 3199 3191 impl<S: State> sealed::Sealed for SetHandle<S> {} 3200 3192 impl<S: State> State for SetHandle<S> { 3201 3193 type Did = S::Did; 3202 - type Bluesky = S::Bluesky; 3203 3194 type Handle = Set<members::handle>; 3195 + type Bluesky = S::Bluesky; 3196 + } 3197 + ///State transition - sets the `bluesky` field to Set 3198 + pub struct SetBluesky<S: State = Empty>(PhantomData<fn() -> S>); 3199 + impl<S: State> sealed::Sealed for SetBluesky<S> {} 3200 + impl<S: State> State for SetBluesky<S> { 3201 + type Did = S::Did; 3202 + type Handle = S::Handle; 3203 + type Bluesky = Set<members::bluesky>; 3204 3204 } 3205 3205 /// Marker types for field names 3206 3206 #[allow(non_camel_case_types)] 3207 3207 pub mod members { 3208 3208 ///Marker type for the `did` field 3209 3209 pub struct did(()); 3210 + ///Marker type for the `handle` field 3211 + pub struct handle(()); 3210 3212 ///Marker type for the `bluesky` field 3211 3213 pub struct bluesky(()); 3212 - ///Marker type for the `handle` field 3213 - pub struct handle(()); 3214 3214 } 3215 3215 } 3216 3216 ··· 3401 3401 where 3402 3402 S: tangled_profile_view_state::State, 3403 3403 S::Did: tangled_profile_view_state::IsSet, 3404 - S::Bluesky: tangled_profile_view_state::IsSet, 3405 3404 S::Handle: tangled_profile_view_state::IsSet, 3405 + S::Bluesky: tangled_profile_view_state::IsSet, 3406 3406 { 3407 3407 /// Build the final struct 3408 3408 pub fn build(self) -> TangledProfileView<'a> {
+153 -153
crates/weaver-api/src/sh_weaver/collab.rs
··· 1610 1610 } 1611 1611 /// State trait tracking which required fields have been set 1612 1612 pub trait State: sealed::Sealed { 1613 + type EndReason; 1613 1614 type WasActiveFrom; 1614 1615 type WasActiveUntil; 1615 - type EndReason; 1616 1616 type User; 1617 1617 } 1618 1618 /// Empty state - all required fields are unset 1619 1619 pub struct Empty(()); 1620 1620 impl sealed::Sealed for Empty {} 1621 1621 impl State for Empty { 1622 + type EndReason = Unset; 1622 1623 type WasActiveFrom = Unset; 1623 1624 type WasActiveUntil = Unset; 1624 - type EndReason = Unset; 1625 1625 type User = Unset; 1626 1626 } 1627 + ///State transition - sets the `end_reason` field to Set 1628 + pub struct SetEndReason<S: State = Empty>(PhantomData<fn() -> S>); 1629 + impl<S: State> sealed::Sealed for SetEndReason<S> {} 1630 + impl<S: State> State for SetEndReason<S> { 1631 + type EndReason = Set<members::end_reason>; 1632 + type WasActiveFrom = S::WasActiveFrom; 1633 + type WasActiveUntil = S::WasActiveUntil; 1634 + type User = S::User; 1635 + } 1627 1636 ///State transition - sets the `was_active_from` field to Set 1628 1637 pub struct SetWasActiveFrom<S: State = Empty>(PhantomData<fn() -> S>); 1629 1638 impl<S: State> sealed::Sealed for SetWasActiveFrom<S> {} 1630 1639 impl<S: State> State for SetWasActiveFrom<S> { 1640 + type EndReason = S::EndReason; 1631 1641 type WasActiveFrom = Set<members::was_active_from>; 1632 1642 type WasActiveUntil = S::WasActiveUntil; 1633 - type EndReason = S::EndReason; 1634 1643 type User = S::User; 1635 1644 } 1636 1645 ///State transition - sets the `was_active_until` field to Set 1637 1646 pub struct SetWasActiveUntil<S: State = Empty>(PhantomData<fn() -> S>); 1638 1647 impl<S: State> sealed::Sealed for SetWasActiveUntil<S> {} 1639 1648 impl<S: State> State for SetWasActiveUntil<S> { 1649 + type EndReason = S::EndReason; 1640 1650 type WasActiveFrom = S::WasActiveFrom; 1641 1651 type WasActiveUntil = Set<members::was_active_until>; 1642 - type EndReason = S::EndReason; 1643 - type User = S::User; 1644 - } 1645 - ///State transition - sets the `end_reason` field to Set 1646 - pub struct SetEndReason<S: State = Empty>(PhantomData<fn() -> S>); 1647 - impl<S: State> sealed::Sealed for SetEndReason<S> {} 1648 - impl<S: State> State for SetEndReason<S> { 1649 - type WasActiveFrom = S::WasActiveFrom; 1650 - type WasActiveUntil = S::WasActiveUntil; 1651 - type EndReason = Set<members::end_reason>; 1652 1652 type User = S::User; 1653 1653 } 1654 1654 ///State transition - sets the `user` field to Set 1655 1655 pub struct SetUser<S: State = Empty>(PhantomData<fn() -> S>); 1656 1656 impl<S: State> sealed::Sealed for SetUser<S> {} 1657 1657 impl<S: State> State for SetUser<S> { 1658 + type EndReason = S::EndReason; 1658 1659 type WasActiveFrom = S::WasActiveFrom; 1659 1660 type WasActiveUntil = S::WasActiveUntil; 1660 - type EndReason = S::EndReason; 1661 1661 type User = Set<members::user>; 1662 1662 } 1663 1663 /// Marker types for field names 1664 1664 #[allow(non_camel_case_types)] 1665 1665 pub mod members { 1666 + ///Marker type for the `end_reason` field 1667 + pub struct end_reason(()); 1666 1668 ///Marker type for the `was_active_from` field 1667 1669 pub struct was_active_from(()); 1668 1670 ///Marker type for the `was_active_until` field 1669 1671 pub struct was_active_until(()); 1670 - ///Marker type for the `end_reason` field 1671 - pub struct end_reason(()); 1672 1672 ///Marker type for the `user` field 1673 1673 pub struct user(()); 1674 1674 } ··· 1843 1843 impl<'a, S> FormerCollaboratorViewBuilder<'a, S> 1844 1844 where 1845 1845 S: former_collaborator_view_state::State, 1846 + S::EndReason: former_collaborator_view_state::IsSet, 1846 1847 S::WasActiveFrom: former_collaborator_view_state::IsSet, 1847 1848 S::WasActiveUntil: former_collaborator_view_state::IsSet, 1848 - S::EndReason: former_collaborator_view_state::IsSet, 1849 1849 S::User: former_collaborator_view_state::IsSet, 1850 1850 { 1851 1851 /// Build the final struct ··· 2061 2061 } 2062 2062 /// State trait tracking which required fields have been set 2063 2063 pub trait State: sealed::Sealed { 2064 + type Resource; 2065 + type Invitee; 2066 + type Cid; 2067 + type CreatedAt; 2068 + type Status; 2064 2069 type Uri; 2065 2070 type Inviter; 2066 - type CreatedAt; 2067 - type Status; 2068 - type Cid; 2069 - type Resource; 2070 - type Invitee; 2071 2071 } 2072 2072 /// Empty state - all required fields are unset 2073 2073 pub struct Empty(()); 2074 2074 impl sealed::Sealed for Empty {} 2075 2075 impl State for Empty { 2076 + type Resource = Unset; 2077 + type Invitee = Unset; 2078 + type Cid = Unset; 2079 + type CreatedAt = Unset; 2080 + type Status = Unset; 2076 2081 type Uri = Unset; 2077 2082 type Inviter = Unset; 2078 - type CreatedAt = Unset; 2079 - type Status = Unset; 2080 - type Cid = Unset; 2081 - type Resource = Unset; 2082 - type Invitee = Unset; 2083 2083 } 2084 - ///State transition - sets the `uri` field to Set 2085 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2086 - impl<S: State> sealed::Sealed for SetUri<S> {} 2087 - impl<S: State> State for SetUri<S> { 2088 - type Uri = Set<members::uri>; 2084 + ///State transition - sets the `resource` field to Set 2085 + pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 2086 + impl<S: State> sealed::Sealed for SetResource<S> {} 2087 + impl<S: State> State for SetResource<S> { 2088 + type Resource = Set<members::resource>; 2089 + type Invitee = S::Invitee; 2090 + type Cid = S::Cid; 2091 + type CreatedAt = S::CreatedAt; 2092 + type Status = S::Status; 2093 + type Uri = S::Uri; 2089 2094 type Inviter = S::Inviter; 2095 + } 2096 + ///State transition - sets the `invitee` field to Set 2097 + pub struct SetInvitee<S: State = Empty>(PhantomData<fn() -> S>); 2098 + impl<S: State> sealed::Sealed for SetInvitee<S> {} 2099 + impl<S: State> State for SetInvitee<S> { 2100 + type Resource = S::Resource; 2101 + type Invitee = Set<members::invitee>; 2102 + type Cid = S::Cid; 2090 2103 type CreatedAt = S::CreatedAt; 2091 2104 type Status = S::Status; 2092 - type Cid = S::Cid; 2105 + type Uri = S::Uri; 2106 + type Inviter = S::Inviter; 2107 + } 2108 + ///State transition - sets the `cid` field to Set 2109 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2110 + impl<S: State> sealed::Sealed for SetCid<S> {} 2111 + impl<S: State> State for SetCid<S> { 2093 2112 type Resource = S::Resource; 2094 2113 type Invitee = S::Invitee; 2095 - } 2096 - ///State transition - sets the `inviter` field to Set 2097 - pub struct SetInviter<S: State = Empty>(PhantomData<fn() -> S>); 2098 - impl<S: State> sealed::Sealed for SetInviter<S> {} 2099 - impl<S: State> State for SetInviter<S> { 2100 - type Uri = S::Uri; 2101 - type Inviter = Set<members::inviter>; 2114 + type Cid = Set<members::cid>; 2102 2115 type CreatedAt = S::CreatedAt; 2103 2116 type Status = S::Status; 2104 - type Cid = S::Cid; 2105 - type Resource = S::Resource; 2106 - type Invitee = S::Invitee; 2117 + type Uri = S::Uri; 2118 + type Inviter = S::Inviter; 2107 2119 } 2108 2120 ///State transition - sets the `created_at` field to Set 2109 2121 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 2110 2122 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 2111 2123 impl<S: State> State for SetCreatedAt<S> { 2112 - type Uri = S::Uri; 2113 - type Inviter = S::Inviter; 2124 + type Resource = S::Resource; 2125 + type Invitee = S::Invitee; 2126 + type Cid = S::Cid; 2114 2127 type CreatedAt = Set<members::created_at>; 2115 2128 type Status = S::Status; 2116 - type Cid = S::Cid; 2117 - type Resource = S::Resource; 2118 - type Invitee = S::Invitee; 2129 + type Uri = S::Uri; 2130 + type Inviter = S::Inviter; 2119 2131 } 2120 2132 ///State transition - sets the `status` field to Set 2121 2133 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 2122 2134 impl<S: State> sealed::Sealed for SetStatus<S> {} 2123 2135 impl<S: State> State for SetStatus<S> { 2124 - type Uri = S::Uri; 2125 - type Inviter = S::Inviter; 2126 - type CreatedAt = S::CreatedAt; 2127 - type Status = Set<members::status>; 2128 - type Cid = S::Cid; 2129 2136 type Resource = S::Resource; 2130 2137 type Invitee = S::Invitee; 2131 - } 2132 - ///State transition - sets the `cid` field to Set 2133 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2134 - impl<S: State> sealed::Sealed for SetCid<S> {} 2135 - impl<S: State> State for SetCid<S> { 2138 + type Cid = S::Cid; 2139 + type CreatedAt = S::CreatedAt; 2140 + type Status = Set<members::status>; 2136 2141 type Uri = S::Uri; 2137 2142 type Inviter = S::Inviter; 2138 - type CreatedAt = S::CreatedAt; 2139 - type Status = S::Status; 2140 - type Cid = Set<members::cid>; 2143 + } 2144 + ///State transition - sets the `uri` field to Set 2145 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2146 + impl<S: State> sealed::Sealed for SetUri<S> {} 2147 + impl<S: State> State for SetUri<S> { 2141 2148 type Resource = S::Resource; 2142 2149 type Invitee = S::Invitee; 2143 - } 2144 - ///State transition - sets the `resource` field to Set 2145 - pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 2146 - impl<S: State> sealed::Sealed for SetResource<S> {} 2147 - impl<S: State> State for SetResource<S> { 2148 - type Uri = S::Uri; 2149 - type Inviter = S::Inviter; 2150 + type Cid = S::Cid; 2150 2151 type CreatedAt = S::CreatedAt; 2151 2152 type Status = S::Status; 2152 - type Cid = S::Cid; 2153 - type Resource = Set<members::resource>; 2154 - type Invitee = S::Invitee; 2153 + type Uri = Set<members::uri>; 2154 + type Inviter = S::Inviter; 2155 2155 } 2156 - ///State transition - sets the `invitee` field to Set 2157 - pub struct SetInvitee<S: State = Empty>(PhantomData<fn() -> S>); 2158 - impl<S: State> sealed::Sealed for SetInvitee<S> {} 2159 - impl<S: State> State for SetInvitee<S> { 2160 - type Uri = S::Uri; 2161 - type Inviter = S::Inviter; 2156 + ///State transition - sets the `inviter` field to Set 2157 + pub struct SetInviter<S: State = Empty>(PhantomData<fn() -> S>); 2158 + impl<S: State> sealed::Sealed for SetInviter<S> {} 2159 + impl<S: State> State for SetInviter<S> { 2160 + type Resource = S::Resource; 2161 + type Invitee = S::Invitee; 2162 + type Cid = S::Cid; 2162 2163 type CreatedAt = S::CreatedAt; 2163 2164 type Status = S::Status; 2164 - type Cid = S::Cid; 2165 - type Resource = S::Resource; 2166 - type Invitee = Set<members::invitee>; 2165 + type Uri = S::Uri; 2166 + type Inviter = Set<members::inviter>; 2167 2167 } 2168 2168 /// Marker types for field names 2169 2169 #[allow(non_camel_case_types)] 2170 2170 pub mod members { 2171 + ///Marker type for the `resource` field 2172 + pub struct resource(()); 2173 + ///Marker type for the `invitee` field 2174 + pub struct invitee(()); 2175 + ///Marker type for the `cid` field 2176 + pub struct cid(()); 2177 + ///Marker type for the `created_at` field 2178 + pub struct created_at(()); 2179 + ///Marker type for the `status` field 2180 + pub struct status(()); 2171 2181 ///Marker type for the `uri` field 2172 2182 pub struct uri(()); 2173 2183 ///Marker type for the `inviter` field 2174 2184 pub struct inviter(()); 2175 - ///Marker type for the `created_at` field 2176 - pub struct created_at(()); 2177 - ///Marker type for the `status` field 2178 - pub struct status(()); 2179 - ///Marker type for the `cid` field 2180 - pub struct cid(()); 2181 - ///Marker type for the `resource` field 2182 - pub struct resource(()); 2183 - ///Marker type for the `invitee` field 2184 - pub struct invitee(()); 2185 2185 } 2186 2186 } 2187 2187 ··· 2479 2479 impl<'a, S> InviteViewBuilder<'a, S> 2480 2480 where 2481 2481 S: invite_view_state::State, 2482 - S::Uri: invite_view_state::IsSet, 2483 - S::Inviter: invite_view_state::IsSet, 2484 - S::CreatedAt: invite_view_state::IsSet, 2485 - S::Status: invite_view_state::IsSet, 2486 - S::Cid: invite_view_state::IsSet, 2487 2482 S::Resource: invite_view_state::IsSet, 2488 2483 S::Invitee: invite_view_state::IsSet, 2484 + S::Cid: invite_view_state::IsSet, 2485 + S::CreatedAt: invite_view_state::IsSet, 2486 + S::Status: invite_view_state::IsSet, 2487 + S::Uri: invite_view_state::IsSet, 2488 + S::Inviter: invite_view_state::IsSet, 2489 2489 { 2490 2490 /// Build the final struct 2491 2491 pub fn build(self) -> InviteView<'a> { ··· 2821 2821 } 2822 2822 /// State trait tracking which required fields have been set 2823 2823 pub trait State: sealed::Sealed { 2824 - type User; 2825 2824 type Role; 2826 2825 type Status; 2826 + type User; 2827 2827 } 2828 2828 /// Empty state - all required fields are unset 2829 2829 pub struct Empty(()); 2830 2830 impl sealed::Sealed for Empty {} 2831 2831 impl State for Empty { 2832 - type User = Unset; 2833 2832 type Role = Unset; 2834 2833 type Status = Unset; 2835 - } 2836 - ///State transition - sets the `user` field to Set 2837 - pub struct SetUser<S: State = Empty>(PhantomData<fn() -> S>); 2838 - impl<S: State> sealed::Sealed for SetUser<S> {} 2839 - impl<S: State> State for SetUser<S> { 2840 - type User = Set<members::user>; 2841 - type Role = S::Role; 2842 - type Status = S::Status; 2834 + type User = Unset; 2843 2835 } 2844 2836 ///State transition - sets the `role` field to Set 2845 2837 pub struct SetRole<S: State = Empty>(PhantomData<fn() -> S>); 2846 2838 impl<S: State> sealed::Sealed for SetRole<S> {} 2847 2839 impl<S: State> State for SetRole<S> { 2848 - type User = S::User; 2849 2840 type Role = Set<members::role>; 2850 2841 type Status = S::Status; 2842 + type User = S::User; 2851 2843 } 2852 2844 ///State transition - sets the `status` field to Set 2853 2845 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 2854 2846 impl<S: State> sealed::Sealed for SetStatus<S> {} 2855 2847 impl<S: State> State for SetStatus<S> { 2856 - type User = S::User; 2857 2848 type Role = S::Role; 2858 2849 type Status = Set<members::status>; 2850 + type User = S::User; 2851 + } 2852 + ///State transition - sets the `user` field to Set 2853 + pub struct SetUser<S: State = Empty>(PhantomData<fn() -> S>); 2854 + impl<S: State> sealed::Sealed for SetUser<S> {} 2855 + impl<S: State> State for SetUser<S> { 2856 + type Role = S::Role; 2857 + type Status = S::Status; 2858 + type User = Set<members::user>; 2859 2859 } 2860 2860 /// Marker types for field names 2861 2861 #[allow(non_camel_case_types)] 2862 2862 pub mod members { 2863 - ///Marker type for the `user` field 2864 - pub struct user(()); 2865 2863 ///Marker type for the `role` field 2866 2864 pub struct role(()); 2867 2865 ///Marker type for the `status` field 2868 2866 pub struct status(()); 2867 + ///Marker type for the `user` field 2868 + pub struct user(()); 2869 2869 } 2870 2870 } 2871 2871 ··· 3127 3127 impl<'a, S> ParticipantStateViewBuilder<'a, S> 3128 3128 where 3129 3129 S: participant_state_view_state::State, 3130 - S::User: participant_state_view_state::IsSet, 3131 3130 S::Role: participant_state_view_state::IsSet, 3132 3131 S::Status: participant_state_view_state::IsSet, 3132 + S::User: participant_state_view_state::IsSet, 3133 3133 { 3134 3134 /// Build the final struct 3135 3135 pub fn build(self) -> ParticipantStateView<'a> { ··· 3543 3543 } 3544 3544 /// State trait tracking which required fields have been set 3545 3545 pub trait State: sealed::Sealed { 3546 - type User; 3546 + type Resource; 3547 + type Uri; 3547 3548 type CreatedAt; 3548 3549 type NodeId; 3549 - type Resource; 3550 - type Uri; 3550 + type User; 3551 3551 } 3552 3552 /// Empty state - all required fields are unset 3553 3553 pub struct Empty(()); 3554 3554 impl sealed::Sealed for Empty {} 3555 3555 impl State for Empty { 3556 - type User = Unset; 3556 + type Resource = Unset; 3557 + type Uri = Unset; 3557 3558 type CreatedAt = Unset; 3558 3559 type NodeId = Unset; 3559 - type Resource = Unset; 3560 - type Uri = Unset; 3560 + type User = Unset; 3561 3561 } 3562 - ///State transition - sets the `user` field to Set 3563 - pub struct SetUser<S: State = Empty>(PhantomData<fn() -> S>); 3564 - impl<S: State> sealed::Sealed for SetUser<S> {} 3565 - impl<S: State> State for SetUser<S> { 3566 - type User = Set<members::user>; 3562 + ///State transition - sets the `resource` field to Set 3563 + pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 3564 + impl<S: State> sealed::Sealed for SetResource<S> {} 3565 + impl<S: State> State for SetResource<S> { 3566 + type Resource = Set<members::resource>; 3567 + type Uri = S::Uri; 3567 3568 type CreatedAt = S::CreatedAt; 3568 3569 type NodeId = S::NodeId; 3570 + type User = S::User; 3571 + } 3572 + ///State transition - sets the `uri` field to Set 3573 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3574 + impl<S: State> sealed::Sealed for SetUri<S> {} 3575 + impl<S: State> State for SetUri<S> { 3569 3576 type Resource = S::Resource; 3570 - type Uri = S::Uri; 3577 + type Uri = Set<members::uri>; 3578 + type CreatedAt = S::CreatedAt; 3579 + type NodeId = S::NodeId; 3580 + type User = S::User; 3571 3581 } 3572 3582 ///State transition - sets the `created_at` field to Set 3573 3583 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 3574 3584 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 3575 3585 impl<S: State> State for SetCreatedAt<S> { 3576 - type User = S::User; 3586 + type Resource = S::Resource; 3587 + type Uri = S::Uri; 3577 3588 type CreatedAt = Set<members::created_at>; 3578 3589 type NodeId = S::NodeId; 3579 - type Resource = S::Resource; 3580 - type Uri = S::Uri; 3590 + type User = S::User; 3581 3591 } 3582 3592 ///State transition - sets the `node_id` field to Set 3583 3593 pub struct SetNodeId<S: State = Empty>(PhantomData<fn() -> S>); 3584 3594 impl<S: State> sealed::Sealed for SetNodeId<S> {} 3585 3595 impl<S: State> State for SetNodeId<S> { 3586 - type User = S::User; 3587 - type CreatedAt = S::CreatedAt; 3588 - type NodeId = Set<members::node_id>; 3589 3596 type Resource = S::Resource; 3590 3597 type Uri = S::Uri; 3591 - } 3592 - ///State transition - sets the `resource` field to Set 3593 - pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 3594 - impl<S: State> sealed::Sealed for SetResource<S> {} 3595 - impl<S: State> State for SetResource<S> { 3598 + type CreatedAt = S::CreatedAt; 3599 + type NodeId = Set<members::node_id>; 3596 3600 type User = S::User; 3597 - type CreatedAt = S::CreatedAt; 3598 - type NodeId = S::NodeId; 3599 - type Resource = Set<members::resource>; 3600 - type Uri = S::Uri; 3601 3601 } 3602 - ///State transition - sets the `uri` field to Set 3603 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3604 - impl<S: State> sealed::Sealed for SetUri<S> {} 3605 - impl<S: State> State for SetUri<S> { 3606 - type User = S::User; 3602 + ///State transition - sets the `user` field to Set 3603 + pub struct SetUser<S: State = Empty>(PhantomData<fn() -> S>); 3604 + impl<S: State> sealed::Sealed for SetUser<S> {} 3605 + impl<S: State> State for SetUser<S> { 3606 + type Resource = S::Resource; 3607 + type Uri = S::Uri; 3607 3608 type CreatedAt = S::CreatedAt; 3608 3609 type NodeId = S::NodeId; 3609 - type Resource = S::Resource; 3610 - type Uri = Set<members::uri>; 3610 + type User = Set<members::user>; 3611 3611 } 3612 3612 /// Marker types for field names 3613 3613 #[allow(non_camel_case_types)] 3614 3614 pub mod members { 3615 - ///Marker type for the `user` field 3616 - pub struct user(()); 3615 + ///Marker type for the `resource` field 3616 + pub struct resource(()); 3617 + ///Marker type for the `uri` field 3618 + pub struct uri(()); 3617 3619 ///Marker type for the `created_at` field 3618 3620 pub struct created_at(()); 3619 3621 ///Marker type for the `node_id` field 3620 3622 pub struct node_id(()); 3621 - ///Marker type for the `resource` field 3622 - pub struct resource(()); 3623 - ///Marker type for the `uri` field 3624 - pub struct uri(()); 3623 + ///Marker type for the `user` field 3624 + pub struct user(()); 3625 3625 } 3626 3626 } 3627 3627 ··· 3794 3794 impl<'a, S> SessionViewBuilder<'a, S> 3795 3795 where 3796 3796 S: session_view_state::State, 3797 - S::User: session_view_state::IsSet, 3798 - S::CreatedAt: session_view_state::IsSet, 3799 - S::NodeId: session_view_state::IsSet, 3800 3797 S::Resource: session_view_state::IsSet, 3801 3798 S::Uri: session_view_state::IsSet, 3799 + S::CreatedAt: session_view_state::IsSet, 3800 + S::NodeId: session_view_state::IsSet, 3801 + S::User: session_view_state::IsSet, 3802 3802 { 3803 3803 /// Build the final struct 3804 3804 pub fn build(self) -> SessionView<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/collab/accept.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 + type Invite; 40 41 type Resource; 41 42 type CreatedAt; 42 - type Invite; 43 43 } 44 44 /// Empty state - all required fields are unset 45 45 pub struct Empty(()); 46 46 impl sealed::Sealed for Empty {} 47 47 impl State for Empty { 48 + type Invite = Unset; 48 49 type Resource = Unset; 49 50 type CreatedAt = Unset; 50 - type Invite = Unset; 51 + } 52 + ///State transition - sets the `invite` field to Set 53 + pub struct SetInvite<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetInvite<S> {} 55 + impl<S: State> State for SetInvite<S> { 56 + type Invite = Set<members::invite>; 57 + type Resource = S::Resource; 58 + type CreatedAt = S::CreatedAt; 51 59 } 52 60 ///State transition - sets the `resource` field to Set 53 61 pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 54 62 impl<S: State> sealed::Sealed for SetResource<S> {} 55 63 impl<S: State> State for SetResource<S> { 64 + type Invite = S::Invite; 56 65 type Resource = Set<members::resource>; 57 66 type CreatedAt = S::CreatedAt; 58 - type Invite = S::Invite; 59 67 } 60 68 ///State transition - sets the `created_at` field to Set 61 69 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 62 70 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 63 71 impl<S: State> State for SetCreatedAt<S> { 64 - type Resource = S::Resource; 65 - type CreatedAt = Set<members::created_at>; 66 72 type Invite = S::Invite; 67 - } 68 - ///State transition - sets the `invite` field to Set 69 - pub struct SetInvite<S: State = Empty>(PhantomData<fn() -> S>); 70 - impl<S: State> sealed::Sealed for SetInvite<S> {} 71 - impl<S: State> State for SetInvite<S> { 72 73 type Resource = S::Resource; 73 - type CreatedAt = S::CreatedAt; 74 - type Invite = Set<members::invite>; 74 + type CreatedAt = Set<members::created_at>; 75 75 } 76 76 /// Marker types for field names 77 77 #[allow(non_camel_case_types)] 78 78 pub mod members { 79 + ///Marker type for the `invite` field 80 + pub struct invite(()); 79 81 ///Marker type for the `resource` field 80 82 pub struct resource(()); 81 83 ///Marker type for the `created_at` field 82 84 pub struct created_at(()); 83 - ///Marker type for the `invite` field 84 - pub struct invite(()); 85 85 } 86 86 } 87 87 ··· 174 174 impl<'a, S> AcceptBuilder<'a, S> 175 175 where 176 176 S: accept_state::State, 177 + S::Invite: accept_state::IsSet, 177 178 S::Resource: accept_state::IsSet, 178 179 S::CreatedAt: accept_state::IsSet, 179 - S::Invite: accept_state::IsSet, 180 180 { 181 181 /// Build the final struct 182 182 pub fn build(self) -> Accept<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/collab/invite.rs
··· 140 140 } 141 141 /// State trait tracking which required fields have been set 142 142 pub trait State: sealed::Sealed { 143 - type CreatedAt; 144 143 type Invitee; 144 + type CreatedAt; 145 145 type Resource; 146 146 } 147 147 /// Empty state - all required fields are unset 148 148 pub struct Empty(()); 149 149 impl sealed::Sealed for Empty {} 150 150 impl State for Empty { 151 - type CreatedAt = Unset; 152 151 type Invitee = Unset; 152 + type CreatedAt = Unset; 153 153 type Resource = Unset; 154 154 } 155 - ///State transition - sets the `created_at` field to Set 156 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 157 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 158 - impl<S: State> State for SetCreatedAt<S> { 159 - type CreatedAt = Set<members::created_at>; 160 - type Invitee = S::Invitee; 161 - type Resource = S::Resource; 162 - } 163 155 ///State transition - sets the `invitee` field to Set 164 156 pub struct SetInvitee<S: State = Empty>(PhantomData<fn() -> S>); 165 157 impl<S: State> sealed::Sealed for SetInvitee<S> {} 166 158 impl<S: State> State for SetInvitee<S> { 167 - type CreatedAt = S::CreatedAt; 168 159 type Invitee = Set<members::invitee>; 160 + type CreatedAt = S::CreatedAt; 161 + type Resource = S::Resource; 162 + } 163 + ///State transition - sets the `created_at` field to Set 164 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 165 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 166 + impl<S: State> State for SetCreatedAt<S> { 167 + type Invitee = S::Invitee; 168 + type CreatedAt = Set<members::created_at>; 169 169 type Resource = S::Resource; 170 170 } 171 171 ///State transition - sets the `resource` field to Set 172 172 pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 173 173 impl<S: State> sealed::Sealed for SetResource<S> {} 174 174 impl<S: State> State for SetResource<S> { 175 - type CreatedAt = S::CreatedAt; 176 175 type Invitee = S::Invitee; 176 + type CreatedAt = S::CreatedAt; 177 177 type Resource = Set<members::resource>; 178 178 } 179 179 /// Marker types for field names 180 180 #[allow(non_camel_case_types)] 181 181 pub mod members { 182 + ///Marker type for the `invitee` field 183 + pub struct invitee(()); 182 184 ///Marker type for the `created_at` field 183 185 pub struct created_at(()); 184 - ///Marker type for the `invitee` field 185 - pub struct invitee(()); 186 186 ///Marker type for the `resource` field 187 187 pub struct resource(()); 188 188 } ··· 334 334 impl<'a, S> InviteBuilder<'a, S> 335 335 where 336 336 S: invite_state::State, 337 - S::CreatedAt: invite_state::IsSet, 338 337 S::Invitee: invite_state::IsSet, 338 + S::CreatedAt: invite_state::IsSet, 339 339 S::Resource: invite_state::IsSet, 340 340 { 341 341 /// Build the final struct
+15 -15
crates/weaver-api/src/sh_weaver/collab/session.rs
··· 44 44 } 45 45 /// State trait tracking which required fields have been set 46 46 pub trait State: sealed::Sealed { 47 - type NodeId; 48 47 type CreatedAt; 48 + type NodeId; 49 49 type Resource; 50 50 } 51 51 /// Empty state - all required fields are unset 52 52 pub struct Empty(()); 53 53 impl sealed::Sealed for Empty {} 54 54 impl State for Empty { 55 - type NodeId = Unset; 56 55 type CreatedAt = Unset; 56 + type NodeId = Unset; 57 57 type Resource = Unset; 58 58 } 59 - ///State transition - sets the `node_id` field to Set 60 - pub struct SetNodeId<S: State = Empty>(PhantomData<fn() -> S>); 61 - impl<S: State> sealed::Sealed for SetNodeId<S> {} 62 - impl<S: State> State for SetNodeId<S> { 63 - type NodeId = Set<members::node_id>; 64 - type CreatedAt = S::CreatedAt; 65 - type Resource = S::Resource; 66 - } 67 59 ///State transition - sets the `created_at` field to Set 68 60 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 69 61 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 70 62 impl<S: State> State for SetCreatedAt<S> { 71 - type NodeId = S::NodeId; 72 63 type CreatedAt = Set<members::created_at>; 64 + type NodeId = S::NodeId; 65 + type Resource = S::Resource; 66 + } 67 + ///State transition - sets the `node_id` field to Set 68 + pub struct SetNodeId<S: State = Empty>(PhantomData<fn() -> S>); 69 + impl<S: State> sealed::Sealed for SetNodeId<S> {} 70 + impl<S: State> State for SetNodeId<S> { 71 + type CreatedAt = S::CreatedAt; 72 + type NodeId = Set<members::node_id>; 73 73 type Resource = S::Resource; 74 74 } 75 75 ///State transition - sets the `resource` field to Set 76 76 pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 77 77 impl<S: State> sealed::Sealed for SetResource<S> {} 78 78 impl<S: State> State for SetResource<S> { 79 - type NodeId = S::NodeId; 80 79 type CreatedAt = S::CreatedAt; 80 + type NodeId = S::NodeId; 81 81 type Resource = Set<members::resource>; 82 82 } 83 83 /// Marker types for field names 84 84 #[allow(non_camel_case_types)] 85 85 pub mod members { 86 + ///Marker type for the `created_at` field 87 + pub struct created_at(()); 86 88 ///Marker type for the `node_id` field 87 89 pub struct node_id(()); 88 - ///Marker type for the `created_at` field 89 - pub struct created_at(()); 90 90 ///Marker type for the `resource` field 91 91 pub struct resource(()); 92 92 } ··· 221 221 impl<'a, S> SessionBuilder<'a, S> 222 222 where 223 223 S: session_state::State, 224 - S::NodeId: session_state::IsSet, 225 224 S::CreatedAt: session_state::IsSet, 225 + S::NodeId: session_state::IsSet, 226 226 S::Resource: session_state::IsSet, 227 227 { 228 228 /// Build the final struct
+19 -19
crates/weaver-api/src/sh_weaver/edit.rs
··· 1053 1053 } 1054 1054 /// State trait tracking which required fields have been set 1055 1055 pub trait State: sealed::Sealed { 1056 - type Uri; 1057 1056 type Cid; 1057 + type Uri; 1058 1058 type Author; 1059 1059 type CreatedAt; 1060 1060 type Type; ··· 1063 1063 pub struct Empty(()); 1064 1064 impl sealed::Sealed for Empty {} 1065 1065 impl State for Empty { 1066 + type Cid = Unset; 1066 1067 type Uri = Unset; 1067 - type Cid = Unset; 1068 1068 type Author = Unset; 1069 1069 type CreatedAt = Unset; 1070 1070 type Type = Unset; 1071 1071 } 1072 - ///State transition - sets the `uri` field to Set 1073 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1074 - impl<S: State> sealed::Sealed for SetUri<S> {} 1075 - impl<S: State> State for SetUri<S> { 1076 - type Uri = Set<members::uri>; 1077 - type Cid = S::Cid; 1078 - type Author = S::Author; 1079 - type CreatedAt = S::CreatedAt; 1080 - type Type = S::Type; 1081 - } 1082 1072 ///State transition - sets the `cid` field to Set 1083 1073 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1084 1074 impl<S: State> sealed::Sealed for SetCid<S> {} 1085 1075 impl<S: State> State for SetCid<S> { 1086 - type Uri = S::Uri; 1087 1076 type Cid = Set<members::cid>; 1077 + type Uri = S::Uri; 1078 + type Author = S::Author; 1079 + type CreatedAt = S::CreatedAt; 1080 + type Type = S::Type; 1081 + } 1082 + ///State transition - sets the `uri` field to Set 1083 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1084 + impl<S: State> sealed::Sealed for SetUri<S> {} 1085 + impl<S: State> State for SetUri<S> { 1086 + type Cid = S::Cid; 1087 + type Uri = Set<members::uri>; 1088 1088 type Author = S::Author; 1089 1089 type CreatedAt = S::CreatedAt; 1090 1090 type Type = S::Type; ··· 1093 1093 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1094 1094 impl<S: State> sealed::Sealed for SetAuthor<S> {} 1095 1095 impl<S: State> State for SetAuthor<S> { 1096 - type Uri = S::Uri; 1097 1096 type Cid = S::Cid; 1097 + type Uri = S::Uri; 1098 1098 type Author = Set<members::author>; 1099 1099 type CreatedAt = S::CreatedAt; 1100 1100 type Type = S::Type; ··· 1103 1103 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1104 1104 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1105 1105 impl<S: State> State for SetCreatedAt<S> { 1106 - type Uri = S::Uri; 1107 1106 type Cid = S::Cid; 1107 + type Uri = S::Uri; 1108 1108 type Author = S::Author; 1109 1109 type CreatedAt = Set<members::created_at>; 1110 1110 type Type = S::Type; ··· 1113 1113 pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 1114 1114 impl<S: State> sealed::Sealed for SetType<S> {} 1115 1115 impl<S: State> State for SetType<S> { 1116 - type Uri = S::Uri; 1117 1116 type Cid = S::Cid; 1117 + type Uri = S::Uri; 1118 1118 type Author = S::Author; 1119 1119 type CreatedAt = S::CreatedAt; 1120 1120 type Type = Set<members::r#type>; ··· 1122 1122 /// Marker types for field names 1123 1123 #[allow(non_camel_case_types)] 1124 1124 pub mod members { 1125 + ///Marker type for the `cid` field 1126 + pub struct cid(()); 1125 1127 ///Marker type for the `uri` field 1126 1128 pub struct uri(()); 1127 - ///Marker type for the `cid` field 1128 - pub struct cid(()); 1129 1129 ///Marker type for the `author` field 1130 1130 pub struct author(()); 1131 1131 ///Marker type for the `created_at` field ··· 1348 1348 impl<'a, S> EditHistoryEntryBuilder<'a, S> 1349 1349 where 1350 1350 S: edit_history_entry_state::State, 1351 - S::Uri: edit_history_entry_state::IsSet, 1352 1351 S::Cid: edit_history_entry_state::IsSet, 1352 + S::Uri: edit_history_entry_state::IsSet, 1353 1353 S::Author: edit_history_entry_state::IsSet, 1354 1354 S::CreatedAt: edit_history_entry_state::IsSet, 1355 1355 S::Type: edit_history_entry_state::IsSet,
+28 -28
crates/weaver-api/src/sh_weaver/edit/cursor.rs
··· 586 586 } 587 587 /// State trait tracking which required fields have been set 588 588 pub trait State: sealed::Sealed { 589 - type Peer; 590 589 type Counter; 590 + type Peer; 591 591 } 592 592 /// Empty state - all required fields are unset 593 593 pub struct Empty(()); 594 594 impl sealed::Sealed for Empty {} 595 595 impl State for Empty { 596 - type Peer = Unset; 597 596 type Counter = Unset; 598 - } 599 - ///State transition - sets the `peer` field to Set 600 - pub struct SetPeer<S: State = Empty>(PhantomData<fn() -> S>); 601 - impl<S: State> sealed::Sealed for SetPeer<S> {} 602 - impl<S: State> State for SetPeer<S> { 603 - type Peer = Set<members::peer>; 604 - type Counter = S::Counter; 597 + type Peer = Unset; 605 598 } 606 599 ///State transition - sets the `counter` field to Set 607 600 pub struct SetCounter<S: State = Empty>(PhantomData<fn() -> S>); 608 601 impl<S: State> sealed::Sealed for SetCounter<S> {} 609 602 impl<S: State> State for SetCounter<S> { 610 - type Peer = S::Peer; 611 603 type Counter = Set<members::counter>; 604 + type Peer = S::Peer; 605 + } 606 + ///State transition - sets the `peer` field to Set 607 + pub struct SetPeer<S: State = Empty>(PhantomData<fn() -> S>); 608 + impl<S: State> sealed::Sealed for SetPeer<S> {} 609 + impl<S: State> State for SetPeer<S> { 610 + type Counter = S::Counter; 611 + type Peer = Set<members::peer>; 612 612 } 613 613 /// Marker types for field names 614 614 #[allow(non_camel_case_types)] 615 615 pub mod members { 616 - ///Marker type for the `peer` field 617 - pub struct peer(()); 618 616 ///Marker type for the `counter` field 619 617 pub struct counter(()); 618 + ///Marker type for the `peer` field 619 + pub struct peer(()); 620 620 } 621 621 } 622 622 ··· 683 683 impl<'a, S> IdBuilder<'a, S> 684 684 where 685 685 S: id_state::State, 686 - S::Peer: id_state::IsSet, 687 686 S::Counter: id_state::IsSet, 687 + S::Peer: id_state::IsSet, 688 688 { 689 689 /// Build the final struct 690 690 pub fn build(self) -> Id<'a> { ··· 1018 1018 /// State trait tracking which required fields have been set 1019 1019 pub trait State: sealed::Sealed { 1020 1020 type Counter; 1021 - type Peer; 1022 1021 type ContainerType; 1022 + type Peer; 1023 1023 } 1024 1024 /// Empty state - all required fields are unset 1025 1025 pub struct Empty(()); 1026 1026 impl sealed::Sealed for Empty {} 1027 1027 impl State for Empty { 1028 1028 type Counter = Unset; 1029 - type Peer = Unset; 1030 1029 type ContainerType = Unset; 1030 + type Peer = Unset; 1031 1031 } 1032 1032 ///State transition - sets the `counter` field to Set 1033 1033 pub struct SetCounter<S: State = Empty>(PhantomData<fn() -> S>); 1034 1034 impl<S: State> sealed::Sealed for SetCounter<S> {} 1035 1035 impl<S: State> State for SetCounter<S> { 1036 1036 type Counter = Set<members::counter>; 1037 - type Peer = S::Peer; 1038 1037 type ContainerType = S::ContainerType; 1039 - } 1040 - ///State transition - sets the `peer` field to Set 1041 - pub struct SetPeer<S: State = Empty>(PhantomData<fn() -> S>); 1042 - impl<S: State> sealed::Sealed for SetPeer<S> {} 1043 - impl<S: State> State for SetPeer<S> { 1044 - type Counter = S::Counter; 1045 - type Peer = Set<members::peer>; 1046 - type ContainerType = S::ContainerType; 1038 + type Peer = S::Peer; 1047 1039 } 1048 1040 ///State transition - sets the `container_type` field to Set 1049 1041 pub struct SetContainerType<S: State = Empty>(PhantomData<fn() -> S>); 1050 1042 impl<S: State> sealed::Sealed for SetContainerType<S> {} 1051 1043 impl<S: State> State for SetContainerType<S> { 1052 1044 type Counter = S::Counter; 1053 - type Peer = S::Peer; 1054 1045 type ContainerType = Set<members::container_type>; 1046 + type Peer = S::Peer; 1047 + } 1048 + ///State transition - sets the `peer` field to Set 1049 + pub struct SetPeer<S: State = Empty>(PhantomData<fn() -> S>); 1050 + impl<S: State> sealed::Sealed for SetPeer<S> {} 1051 + impl<S: State> State for SetPeer<S> { 1052 + type Counter = S::Counter; 1053 + type ContainerType = S::ContainerType; 1054 + type Peer = Set<members::peer>; 1055 1055 } 1056 1056 /// Marker types for field names 1057 1057 #[allow(non_camel_case_types)] 1058 1058 pub mod members { 1059 1059 ///Marker type for the `counter` field 1060 1060 pub struct counter(()); 1061 + ///Marker type for the `container_type` field 1062 + pub struct container_type(()); 1061 1063 ///Marker type for the `peer` field 1062 1064 pub struct peer(()); 1063 - ///Marker type for the `container_type` field 1064 - pub struct container_type(()); 1065 1065 } 1066 1066 } 1067 1067 ··· 1155 1155 where 1156 1156 S: normal_container_id_state::State, 1157 1157 S::Counter: normal_container_id_state::IsSet, 1158 - S::Peer: normal_container_id_state::IsSet, 1159 1158 S::ContainerType: normal_container_id_state::IsSet, 1159 + S::Peer: normal_container_id_state::IsSet, 1160 1160 { 1161 1161 /// Build the final struct 1162 1162 pub fn build(self) -> NormalContainerId<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/edit/diff.rs
··· 47 47 } 48 48 /// State trait tracking which required fields have been set 49 49 pub trait State: sealed::Sealed { 50 - type Root; 51 50 type Doc; 51 + type Root; 52 52 } 53 53 /// Empty state - all required fields are unset 54 54 pub struct Empty(()); 55 55 impl sealed::Sealed for Empty {} 56 56 impl State for Empty { 57 - type Root = Unset; 58 57 type Doc = Unset; 59 - } 60 - ///State transition - sets the `root` field to Set 61 - pub struct SetRoot<S: State = Empty>(PhantomData<fn() -> S>); 62 - impl<S: State> sealed::Sealed for SetRoot<S> {} 63 - impl<S: State> State for SetRoot<S> { 64 - type Root = Set<members::root>; 65 - type Doc = S::Doc; 58 + type Root = Unset; 66 59 } 67 60 ///State transition - sets the `doc` field to Set 68 61 pub struct SetDoc<S: State = Empty>(PhantomData<fn() -> S>); 69 62 impl<S: State> sealed::Sealed for SetDoc<S> {} 70 63 impl<S: State> State for SetDoc<S> { 71 - type Root = S::Root; 72 64 type Doc = Set<members::doc>; 65 + type Root = S::Root; 66 + } 67 + ///State transition - sets the `root` field to Set 68 + pub struct SetRoot<S: State = Empty>(PhantomData<fn() -> S>); 69 + impl<S: State> sealed::Sealed for SetRoot<S> {} 70 + impl<S: State> State for SetRoot<S> { 71 + type Doc = S::Doc; 72 + type Root = Set<members::root>; 73 73 } 74 74 /// Marker types for field names 75 75 #[allow(non_camel_case_types)] 76 76 pub mod members { 77 - ///Marker type for the `root` field 78 - pub struct root(()); 79 77 ///Marker type for the `doc` field 80 78 pub struct doc(()); 79 + ///Marker type for the `root` field 80 + pub struct root(()); 81 81 } 82 82 } 83 83 ··· 224 224 impl<'a, S> DiffBuilder<'a, S> 225 225 where 226 226 S: diff_state::State, 227 - S::Root: diff_state::IsSet, 228 227 S::Doc: diff_state::IsSet, 228 + S::Root: diff_state::IsSet, 229 229 { 230 230 /// Build the final struct 231 231 pub fn build(self) -> Diff<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/embed.rs
··· 312 312 } 313 313 /// State trait tracking which required fields have been set 314 314 pub trait State: sealed::Sealed { 315 - type Width; 316 315 type Height; 316 + type Width; 317 317 } 318 318 /// Empty state - all required fields are unset 319 319 pub struct Empty(()); 320 320 impl sealed::Sealed for Empty {} 321 321 impl State for Empty { 322 - type Width = Unset; 323 322 type Height = Unset; 324 - } 325 - ///State transition - sets the `width` field to Set 326 - pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 327 - impl<S: State> sealed::Sealed for SetWidth<S> {} 328 - impl<S: State> State for SetWidth<S> { 329 - type Width = Set<members::width>; 330 - type Height = S::Height; 323 + type Width = Unset; 331 324 } 332 325 ///State transition - sets the `height` field to Set 333 326 pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 334 327 impl<S: State> sealed::Sealed for SetHeight<S> {} 335 328 impl<S: State> State for SetHeight<S> { 336 - type Width = S::Width; 337 329 type Height = Set<members::height>; 330 + type Width = S::Width; 331 + } 332 + ///State transition - sets the `width` field to Set 333 + pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 334 + impl<S: State> sealed::Sealed for SetWidth<S> {} 335 + impl<S: State> State for SetWidth<S> { 336 + type Height = S::Height; 337 + type Width = Set<members::width>; 338 338 } 339 339 /// Marker types for field names 340 340 #[allow(non_camel_case_types)] 341 341 pub mod members { 342 - ///Marker type for the `width` field 343 - pub struct width(()); 344 342 ///Marker type for the `height` field 345 343 pub struct height(()); 344 + ///Marker type for the `width` field 345 + pub struct width(()); 346 346 } 347 347 } 348 348 ··· 412 412 impl<'a, S> PixelSizeBuilder<'a, S> 413 413 where 414 414 S: pixel_size_state::State, 415 - S::Width: pixel_size_state::IsSet, 416 415 S::Height: pixel_size_state::IsSet, 416 + S::Width: pixel_size_state::IsSet, 417 417 { 418 418 /// Build the final struct 419 419 pub fn build(self) -> PixelSize<'a> {
+39 -39
crates/weaver-api/src/sh_weaver/embed/external.rs
··· 38 38 } 39 39 /// State trait tracking which required fields have been set 40 40 pub trait State: sealed::Sealed { 41 + type Description; 41 42 type Title; 42 43 type Uri; 43 - type Description; 44 44 } 45 45 /// Empty state - all required fields are unset 46 46 pub struct Empty(()); 47 47 impl sealed::Sealed for Empty {} 48 48 impl State for Empty { 49 + type Description = Unset; 49 50 type Title = Unset; 50 51 type Uri = Unset; 51 - type Description = Unset; 52 + } 53 + ///State transition - sets the `description` field to Set 54 + pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetDescription<S> {} 56 + impl<S: State> State for SetDescription<S> { 57 + type Description = Set<members::description>; 58 + type Title = S::Title; 59 + type Uri = S::Uri; 52 60 } 53 61 ///State transition - sets the `title` field to Set 54 62 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 55 63 impl<S: State> sealed::Sealed for SetTitle<S> {} 56 64 impl<S: State> State for SetTitle<S> { 65 + type Description = S::Description; 57 66 type Title = Set<members::title>; 58 67 type Uri = S::Uri; 59 - type Description = S::Description; 60 68 } 61 69 ///State transition - sets the `uri` field to Set 62 70 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 63 71 impl<S: State> sealed::Sealed for SetUri<S> {} 64 72 impl<S: State> State for SetUri<S> { 65 - type Title = S::Title; 66 - type Uri = Set<members::uri>; 67 73 type Description = S::Description; 68 - } 69 - ///State transition - sets the `description` field to Set 70 - pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 71 - impl<S: State> sealed::Sealed for SetDescription<S> {} 72 - impl<S: State> State for SetDescription<S> { 73 74 type Title = S::Title; 74 - type Uri = S::Uri; 75 - type Description = Set<members::description>; 75 + type Uri = Set<members::uri>; 76 76 } 77 77 /// Marker types for field names 78 78 #[allow(non_camel_case_types)] 79 79 pub mod members { 80 + ///Marker type for the `description` field 81 + pub struct description(()); 80 82 ///Marker type for the `title` field 81 83 pub struct title(()); 82 84 ///Marker type for the `uri` field 83 85 pub struct uri(()); 84 - ///Marker type for the `description` field 85 - pub struct description(()); 86 86 } 87 87 } 88 88 ··· 195 195 impl<'a, S> ExternalEmbedBuilder<'a, S> 196 196 where 197 197 S: external_embed_state::State, 198 + S::Description: external_embed_state::IsSet, 198 199 S::Title: external_embed_state::IsSet, 199 200 S::Uri: external_embed_state::IsSet, 200 - S::Description: external_embed_state::IsSet, 201 201 { 202 202 /// Build the final struct 203 203 pub fn build(self) -> ExternalEmbed<'a> { ··· 817 817 } 818 818 /// State trait tracking which required fields have been set 819 819 pub trait State: sealed::Sealed { 820 - type Title; 821 - type Description; 822 820 type Uri; 821 + type Description; 822 + type Title; 823 823 } 824 824 /// Empty state - all required fields are unset 825 825 pub struct Empty(()); 826 826 impl sealed::Sealed for Empty {} 827 827 impl State for Empty { 828 + type Uri = Unset; 829 + type Description = Unset; 828 830 type Title = Unset; 829 - type Description = Unset; 830 - type Uri = Unset; 831 831 } 832 - ///State transition - sets the `title` field to Set 833 - pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 834 - impl<S: State> sealed::Sealed for SetTitle<S> {} 835 - impl<S: State> State for SetTitle<S> { 836 - type Title = Set<members::title>; 832 + ///State transition - sets the `uri` field to Set 833 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 834 + impl<S: State> sealed::Sealed for SetUri<S> {} 835 + impl<S: State> State for SetUri<S> { 836 + type Uri = Set<members::uri>; 837 837 type Description = S::Description; 838 - type Uri = S::Uri; 838 + type Title = S::Title; 839 839 } 840 840 ///State transition - sets the `description` field to Set 841 841 pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 842 842 impl<S: State> sealed::Sealed for SetDescription<S> {} 843 843 impl<S: State> State for SetDescription<S> { 844 - type Title = S::Title; 845 - type Description = Set<members::description>; 846 844 type Uri = S::Uri; 845 + type Description = Set<members::description>; 846 + type Title = S::Title; 847 847 } 848 - ///State transition - sets the `uri` field to Set 849 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 850 - impl<S: State> sealed::Sealed for SetUri<S> {} 851 - impl<S: State> State for SetUri<S> { 852 - type Title = S::Title; 848 + ///State transition - sets the `title` field to Set 849 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 850 + impl<S: State> sealed::Sealed for SetTitle<S> {} 851 + impl<S: State> State for SetTitle<S> { 852 + type Uri = S::Uri; 853 853 type Description = S::Description; 854 - type Uri = Set<members::uri>; 854 + type Title = Set<members::title>; 855 855 } 856 856 /// Marker types for field names 857 857 #[allow(non_camel_case_types)] 858 858 pub mod members { 859 + ///Marker type for the `uri` field 860 + pub struct uri(()); 861 + ///Marker type for the `description` field 862 + pub struct description(()); 859 863 ///Marker type for the `title` field 860 864 pub struct title(()); 861 - ///Marker type for the `description` field 862 - pub struct description(()); 863 - ///Marker type for the `uri` field 864 - pub struct uri(()); 865 865 } 866 866 } 867 867 ··· 974 974 impl<'a, S> ViewExternalBuilder<'a, S> 975 975 where 976 976 S: view_external_state::State, 977 - S::Title: view_external_state::IsSet, 978 - S::Description: view_external_state::IsSet, 979 977 S::Uri: view_external_state::IsSet, 978 + S::Description: view_external_state::IsSet, 979 + S::Title: view_external_state::IsSet, 980 980 { 981 981 /// Build the final struct 982 982 pub fn build(self) -> ViewExternal<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/embed/images.rs
··· 902 902 } 903 903 /// State trait tracking which required fields have been set 904 904 pub trait State: sealed::Sealed { 905 + type Alt; 905 906 type Thumb; 906 907 type Fullsize; 907 - type Alt; 908 908 } 909 909 /// Empty state - all required fields are unset 910 910 pub struct Empty(()); 911 911 impl sealed::Sealed for Empty {} 912 912 impl State for Empty { 913 + type Alt = Unset; 913 914 type Thumb = Unset; 914 915 type Fullsize = Unset; 915 - type Alt = Unset; 916 + } 917 + ///State transition - sets the `alt` field to Set 918 + pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 919 + impl<S: State> sealed::Sealed for SetAlt<S> {} 920 + impl<S: State> State for SetAlt<S> { 921 + type Alt = Set<members::alt>; 922 + type Thumb = S::Thumb; 923 + type Fullsize = S::Fullsize; 916 924 } 917 925 ///State transition - sets the `thumb` field to Set 918 926 pub struct SetThumb<S: State = Empty>(PhantomData<fn() -> S>); 919 927 impl<S: State> sealed::Sealed for SetThumb<S> {} 920 928 impl<S: State> State for SetThumb<S> { 929 + type Alt = S::Alt; 921 930 type Thumb = Set<members::thumb>; 922 931 type Fullsize = S::Fullsize; 923 - type Alt = S::Alt; 924 932 } 925 933 ///State transition - sets the `fullsize` field to Set 926 934 pub struct SetFullsize<S: State = Empty>(PhantomData<fn() -> S>); 927 935 impl<S: State> sealed::Sealed for SetFullsize<S> {} 928 936 impl<S: State> State for SetFullsize<S> { 929 - type Thumb = S::Thumb; 930 - type Fullsize = Set<members::fullsize>; 931 937 type Alt = S::Alt; 932 - } 933 - ///State transition - sets the `alt` field to Set 934 - pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 935 - impl<S: State> sealed::Sealed for SetAlt<S> {} 936 - impl<S: State> State for SetAlt<S> { 937 938 type Thumb = S::Thumb; 938 - type Fullsize = S::Fullsize; 939 - type Alt = Set<members::alt>; 939 + type Fullsize = Set<members::fullsize>; 940 940 } 941 941 /// Marker types for field names 942 942 #[allow(non_camel_case_types)] 943 943 pub mod members { 944 + ///Marker type for the `alt` field 945 + pub struct alt(()); 944 946 ///Marker type for the `thumb` field 945 947 pub struct thumb(()); 946 948 ///Marker type for the `fullsize` field 947 949 pub struct fullsize(()); 948 - ///Marker type for the `alt` field 949 - pub struct alt(()); 950 950 } 951 951 } 952 952 ··· 1073 1073 impl<'a, S> ViewImageBuilder<'a, S> 1074 1074 where 1075 1075 S: view_image_state::State, 1076 + S::Alt: view_image_state::IsSet, 1076 1077 S::Thumb: view_image_state::IsSet, 1077 1078 S::Fullsize: view_image_state::IsSet, 1078 - S::Alt: view_image_state::IsSet, 1079 1079 { 1080 1080 /// Build the final struct 1081 1081 pub fn build(self) -> ViewImage<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/embed/record_with_media.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Media; 37 36 type Records; 37 + type Media; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Media = Unset; 44 43 type Records = Unset; 45 - } 46 - ///State transition - sets the `media` field to Set 47 - pub struct SetMedia<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetMedia<S> {} 49 - impl<S: State> State for SetMedia<S> { 50 - type Media = Set<members::media>; 51 - type Records = S::Records; 44 + type Media = Unset; 52 45 } 53 46 ///State transition - sets the `records` field to Set 54 47 pub struct SetRecords<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetRecords<S> {} 56 49 impl<S: State> State for SetRecords<S> { 57 - type Media = S::Media; 58 50 type Records = Set<members::records>; 51 + type Media = S::Media; 52 + } 53 + ///State transition - sets the `media` field to Set 54 + pub struct SetMedia<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetMedia<S> {} 56 + impl<S: State> State for SetMedia<S> { 57 + type Records = S::Records; 58 + type Media = Set<members::media>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `media` field 64 - pub struct media(()); 65 63 ///Marker type for the `records` field 66 64 pub struct records(()); 65 + ///Marker type for the `media` field 66 + pub struct media(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> RecordWithMediaBuilder<'a, S> 137 137 where 138 138 S: record_with_media_state::State, 139 - S::Media: record_with_media_state::IsSet, 140 139 S::Records: record_with_media_state::IsSet, 140 + S::Media: record_with_media_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> RecordWithMedia<'a> {
+48 -48
crates/weaver-api/src/sh_weaver/embed/records.rs
··· 1188 1188 /// State trait tracking which required fields have been set 1189 1189 pub trait State: sealed::Sealed { 1190 1190 type Author; 1191 - type Blocked; 1192 1191 type Uri; 1192 + type Blocked; 1193 1193 } 1194 1194 /// Empty state - all required fields are unset 1195 1195 pub struct Empty(()); 1196 1196 impl sealed::Sealed for Empty {} 1197 1197 impl State for Empty { 1198 1198 type Author = Unset; 1199 - type Blocked = Unset; 1200 1199 type Uri = Unset; 1200 + type Blocked = Unset; 1201 1201 } 1202 1202 ///State transition - sets the `author` field to Set 1203 1203 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1204 1204 impl<S: State> sealed::Sealed for SetAuthor<S> {} 1205 1205 impl<S: State> State for SetAuthor<S> { 1206 1206 type Author = Set<members::author>; 1207 - type Blocked = S::Blocked; 1208 1207 type Uri = S::Uri; 1209 - } 1210 - ///State transition - sets the `blocked` field to Set 1211 - pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 1212 - impl<S: State> sealed::Sealed for SetBlocked<S> {} 1213 - impl<S: State> State for SetBlocked<S> { 1214 - type Author = S::Author; 1215 - type Blocked = Set<members::blocked>; 1216 - type Uri = S::Uri; 1208 + type Blocked = S::Blocked; 1217 1209 } 1218 1210 ///State transition - sets the `uri` field to Set 1219 1211 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1220 1212 impl<S: State> sealed::Sealed for SetUri<S> {} 1221 1213 impl<S: State> State for SetUri<S> { 1222 1214 type Author = S::Author; 1223 - type Blocked = S::Blocked; 1224 1215 type Uri = Set<members::uri>; 1216 + type Blocked = S::Blocked; 1217 + } 1218 + ///State transition - sets the `blocked` field to Set 1219 + pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 1220 + impl<S: State> sealed::Sealed for SetBlocked<S> {} 1221 + impl<S: State> State for SetBlocked<S> { 1222 + type Author = S::Author; 1223 + type Uri = S::Uri; 1224 + type Blocked = Set<members::blocked>; 1225 1225 } 1226 1226 /// Marker types for field names 1227 1227 #[allow(non_camel_case_types)] 1228 1228 pub mod members { 1229 1229 ///Marker type for the `author` field 1230 1230 pub struct author(()); 1231 + ///Marker type for the `uri` field 1232 + pub struct uri(()); 1231 1233 ///Marker type for the `blocked` field 1232 1234 pub struct blocked(()); 1233 - ///Marker type for the `uri` field 1234 - pub struct uri(()); 1235 1235 } 1236 1236 } 1237 1237 ··· 1325 1325 where 1326 1326 S: view_blocked_state::State, 1327 1327 S::Author: view_blocked_state::IsSet, 1328 - S::Blocked: view_blocked_state::IsSet, 1329 1328 S::Uri: view_blocked_state::IsSet, 1329 + S::Blocked: view_blocked_state::IsSet, 1330 1330 { 1331 1331 /// Build the final struct 1332 1332 pub fn build(self) -> ViewBlocked<'a> { ··· 1770 1770 /// State trait tracking which required fields have been set 1771 1771 pub trait State: sealed::Sealed { 1772 1772 type Cid; 1773 - type Value; 1774 - type IndexedAt; 1775 1773 type Uri; 1774 + type Value; 1776 1775 type Author; 1776 + type IndexedAt; 1777 1777 } 1778 1778 /// Empty state - all required fields are unset 1779 1779 pub struct Empty(()); 1780 1780 impl sealed::Sealed for Empty {} 1781 1781 impl State for Empty { 1782 1782 type Cid = Unset; 1783 + type Uri = Unset; 1783 1784 type Value = Unset; 1785 + type Author = Unset; 1784 1786 type IndexedAt = Unset; 1785 - type Uri = Unset; 1786 - type Author = Unset; 1787 1787 } 1788 1788 ///State transition - sets the `cid` field to Set 1789 1789 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1790 1790 impl<S: State> sealed::Sealed for SetCid<S> {} 1791 1791 impl<S: State> State for SetCid<S> { 1792 1792 type Cid = Set<members::cid>; 1793 - type Value = S::Value; 1794 - type IndexedAt = S::IndexedAt; 1795 1793 type Uri = S::Uri; 1796 - type Author = S::Author; 1797 - } 1798 - ///State transition - sets the `value` field to Set 1799 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1800 - impl<S: State> sealed::Sealed for SetValue<S> {} 1801 - impl<S: State> State for SetValue<S> { 1802 - type Cid = S::Cid; 1803 - type Value = Set<members::value>; 1804 - type IndexedAt = S::IndexedAt; 1805 - type Uri = S::Uri; 1806 - type Author = S::Author; 1807 - } 1808 - ///State transition - sets the `indexed_at` field to Set 1809 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1810 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1811 - impl<S: State> State for SetIndexedAt<S> { 1812 - type Cid = S::Cid; 1813 1794 type Value = S::Value; 1814 - type IndexedAt = Set<members::indexed_at>; 1815 - type Uri = S::Uri; 1816 1795 type Author = S::Author; 1796 + type IndexedAt = S::IndexedAt; 1817 1797 } 1818 1798 ///State transition - sets the `uri` field to Set 1819 1799 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1820 1800 impl<S: State> sealed::Sealed for SetUri<S> {} 1821 1801 impl<S: State> State for SetUri<S> { 1822 1802 type Cid = S::Cid; 1803 + type Uri = Set<members::uri>; 1823 1804 type Value = S::Value; 1805 + type Author = S::Author; 1824 1806 type IndexedAt = S::IndexedAt; 1825 - type Uri = Set<members::uri>; 1807 + } 1808 + ///State transition - sets the `value` field to Set 1809 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1810 + impl<S: State> sealed::Sealed for SetValue<S> {} 1811 + impl<S: State> State for SetValue<S> { 1812 + type Cid = S::Cid; 1813 + type Uri = S::Uri; 1814 + type Value = Set<members::value>; 1826 1815 type Author = S::Author; 1816 + type IndexedAt = S::IndexedAt; 1827 1817 } 1828 1818 ///State transition - sets the `author` field to Set 1829 1819 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1830 1820 impl<S: State> sealed::Sealed for SetAuthor<S> {} 1831 1821 impl<S: State> State for SetAuthor<S> { 1832 1822 type Cid = S::Cid; 1823 + type Uri = S::Uri; 1833 1824 type Value = S::Value; 1825 + type Author = Set<members::author>; 1834 1826 type IndexedAt = S::IndexedAt; 1827 + } 1828 + ///State transition - sets the `indexed_at` field to Set 1829 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1830 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1831 + impl<S: State> State for SetIndexedAt<S> { 1832 + type Cid = S::Cid; 1835 1833 type Uri = S::Uri; 1836 - type Author = Set<members::author>; 1834 + type Value = S::Value; 1835 + type Author = S::Author; 1836 + type IndexedAt = Set<members::indexed_at>; 1837 1837 } 1838 1838 /// Marker types for field names 1839 1839 #[allow(non_camel_case_types)] 1840 1840 pub mod members { 1841 1841 ///Marker type for the `cid` field 1842 1842 pub struct cid(()); 1843 + ///Marker type for the `uri` field 1844 + pub struct uri(()); 1843 1845 ///Marker type for the `value` field 1844 1846 pub struct value(()); 1847 + ///Marker type for the `author` field 1848 + pub struct author(()); 1845 1849 ///Marker type for the `indexed_at` field 1846 1850 pub struct indexed_at(()); 1847 - ///Marker type for the `uri` field 1848 - pub struct uri(()); 1849 - ///Marker type for the `author` field 1850 - pub struct author(()); 1851 1851 } 1852 1852 } 1853 1853 ··· 2093 2093 where 2094 2094 S: view_record_state::State, 2095 2095 S::Cid: view_record_state::IsSet, 2096 - S::Value: view_record_state::IsSet, 2097 - S::IndexedAt: view_record_state::IsSet, 2098 2096 S::Uri: view_record_state::IsSet, 2097 + S::Value: view_record_state::IsSet, 2099 2098 S::Author: view_record_state::IsSet, 2099 + S::IndexedAt: view_record_state::IsSet, 2100 2100 { 2101 2101 /// Build the final struct 2102 2102 pub fn build(self) -> ViewRecord<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/embed/video.rs
··· 940 940 } 941 941 /// State trait tracking which required fields have been set 942 942 pub trait State: sealed::Sealed { 943 - type Playlist; 944 943 type Cid; 944 + type Playlist; 945 945 } 946 946 /// Empty state - all required fields are unset 947 947 pub struct Empty(()); 948 948 impl sealed::Sealed for Empty {} 949 949 impl State for Empty { 950 - type Playlist = Unset; 951 950 type Cid = Unset; 952 - } 953 - ///State transition - sets the `playlist` field to Set 954 - pub struct SetPlaylist<S: State = Empty>(PhantomData<fn() -> S>); 955 - impl<S: State> sealed::Sealed for SetPlaylist<S> {} 956 - impl<S: State> State for SetPlaylist<S> { 957 - type Playlist = Set<members::playlist>; 958 - type Cid = S::Cid; 951 + type Playlist = Unset; 959 952 } 960 953 ///State transition - sets the `cid` field to Set 961 954 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 962 955 impl<S: State> sealed::Sealed for SetCid<S> {} 963 956 impl<S: State> State for SetCid<S> { 964 - type Playlist = S::Playlist; 965 957 type Cid = Set<members::cid>; 958 + type Playlist = S::Playlist; 959 + } 960 + ///State transition - sets the `playlist` field to Set 961 + pub struct SetPlaylist<S: State = Empty>(PhantomData<fn() -> S>); 962 + impl<S: State> sealed::Sealed for SetPlaylist<S> {} 963 + impl<S: State> State for SetPlaylist<S> { 964 + type Cid = S::Cid; 965 + type Playlist = Set<members::playlist>; 966 966 } 967 967 /// Marker types for field names 968 968 #[allow(non_camel_case_types)] 969 969 pub mod members { 970 - ///Marker type for the `playlist` field 971 - pub struct playlist(()); 972 970 ///Marker type for the `cid` field 973 971 pub struct cid(()); 972 + ///Marker type for the `playlist` field 973 + pub struct playlist(()); 974 974 } 975 975 } 976 976 ··· 1108 1108 impl<'a, S> ViewBuilder<'a, S> 1109 1109 where 1110 1110 S: view_state::State, 1111 - S::Playlist: view_state::IsSet, 1112 1111 S::Cid: view_state::IsSet, 1112 + S::Playlist: view_state::IsSet, 1113 1113 { 1114 1114 /// Build the final struct 1115 1115 pub fn build(self) -> View<'a> {
+141 -141
crates/weaver-api/src/sh_weaver/graph.rs
··· 59 59 } 60 60 /// State trait tracking which required fields have been set 61 61 pub trait State: sealed::Sealed { 62 - type Count; 63 62 type Tag; 63 + type Count; 64 64 } 65 65 /// Empty state - all required fields are unset 66 66 pub struct Empty(()); 67 67 impl sealed::Sealed for Empty {} 68 68 impl State for Empty { 69 - type Count = Unset; 70 69 type Tag = Unset; 71 - } 72 - ///State transition - sets the `count` field to Set 73 - pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 74 - impl<S: State> sealed::Sealed for SetCount<S> {} 75 - impl<S: State> State for SetCount<S> { 76 - type Count = Set<members::count>; 77 - type Tag = S::Tag; 70 + type Count = Unset; 78 71 } 79 72 ///State transition - sets the `tag` field to Set 80 73 pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 81 74 impl<S: State> sealed::Sealed for SetTag<S> {} 82 75 impl<S: State> State for SetTag<S> { 83 - type Count = S::Count; 84 76 type Tag = Set<members::tag>; 77 + type Count = S::Count; 78 + } 79 + ///State transition - sets the `count` field to Set 80 + pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 81 + impl<S: State> sealed::Sealed for SetCount<S> {} 82 + impl<S: State> State for SetCount<S> { 83 + type Tag = S::Tag; 84 + type Count = Set<members::count>; 85 85 } 86 86 /// Marker types for field names 87 87 #[allow(non_camel_case_types)] 88 88 pub mod members { 89 - ///Marker type for the `count` field 90 - pub struct count(()); 91 89 ///Marker type for the `tag` field 92 90 pub struct tag(()); 91 + ///Marker type for the `count` field 92 + pub struct count(()); 93 93 } 94 94 } 95 95 ··· 162 162 impl<'a, S> CommunityTagCountBuilder<'a, S> 163 163 where 164 164 S: community_tag_count_state::State, 165 - S::Count: community_tag_count_state::IsSet, 166 165 S::Tag: community_tag_count_state::IsSet, 166 + S::Count: community_tag_count_state::IsSet, 167 167 { 168 168 /// Build the final struct 169 169 pub fn build(self) -> CommunityTagCount<'a> { ··· 883 883 } 884 884 /// State trait tracking which required fields have been set 885 885 pub trait State: sealed::Sealed { 886 - type Uri; 887 886 type Subject; 887 + type Uri; 888 888 } 889 889 /// Empty state - all required fields are unset 890 890 pub struct Empty(()); 891 891 impl sealed::Sealed for Empty {} 892 892 impl State for Empty { 893 - type Uri = Unset; 894 893 type Subject = Unset; 895 - } 896 - ///State transition - sets the `uri` field to Set 897 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 898 - impl<S: State> sealed::Sealed for SetUri<S> {} 899 - impl<S: State> State for SetUri<S> { 900 - type Uri = Set<members::uri>; 901 - type Subject = S::Subject; 894 + type Uri = Unset; 902 895 } 903 896 ///State transition - sets the `subject` field to Set 904 897 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 905 898 impl<S: State> sealed::Sealed for SetSubject<S> {} 906 899 impl<S: State> State for SetSubject<S> { 907 - type Uri = S::Uri; 908 900 type Subject = Set<members::subject>; 901 + type Uri = S::Uri; 902 + } 903 + ///State transition - sets the `uri` field to Set 904 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 905 + impl<S: State> sealed::Sealed for SetUri<S> {} 906 + impl<S: State> State for SetUri<S> { 907 + type Subject = S::Subject; 908 + type Uri = Set<members::uri>; 909 909 } 910 910 /// Marker types for field names 911 911 #[allow(non_camel_case_types)] 912 912 pub mod members { 913 - ///Marker type for the `uri` field 914 - pub struct uri(()); 915 913 ///Marker type for the `subject` field 916 914 pub struct subject(()); 915 + ///Marker type for the `uri` field 916 + pub struct uri(()); 917 917 } 918 918 } 919 919 ··· 1006 1006 impl<'a, S> ListItemViewBuilder<'a, S> 1007 1007 where 1008 1008 S: list_item_view_state::State, 1009 - S::Uri: list_item_view_state::IsSet, 1010 1009 S::Subject: list_item_view_state::IsSet, 1010 + S::Uri: list_item_view_state::IsSet, 1011 1011 { 1012 1012 /// Build the final struct 1013 1013 pub fn build(self) -> ListItemView<'a> { ··· 1212 1212 } 1213 1213 /// State trait tracking which required fields have been set 1214 1214 pub trait State: sealed::Sealed { 1215 - type Uri; 1216 1215 type Name; 1217 - type ItemCount; 1218 - type Cid; 1219 1216 type Purpose; 1220 1217 type IndexedAt; 1221 1218 type Creator; 1219 + type Uri; 1220 + type ItemCount; 1221 + type Cid; 1222 1222 } 1223 1223 /// Empty state - all required fields are unset 1224 1224 pub struct Empty(()); 1225 1225 impl sealed::Sealed for Empty {} 1226 1226 impl State for Empty { 1227 - type Uri = Unset; 1228 1227 type Name = Unset; 1229 - type ItemCount = Unset; 1230 - type Cid = Unset; 1231 1228 type Purpose = Unset; 1232 1229 type IndexedAt = Unset; 1233 1230 type Creator = Unset; 1234 - } 1235 - ///State transition - sets the `uri` field to Set 1236 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1237 - impl<S: State> sealed::Sealed for SetUri<S> {} 1238 - impl<S: State> State for SetUri<S> { 1239 - type Uri = Set<members::uri>; 1240 - type Name = S::Name; 1241 - type ItemCount = S::ItemCount; 1242 - type Cid = S::Cid; 1243 - type Purpose = S::Purpose; 1244 - type IndexedAt = S::IndexedAt; 1245 - type Creator = S::Creator; 1231 + type Uri = Unset; 1232 + type ItemCount = Unset; 1233 + type Cid = Unset; 1246 1234 } 1247 1235 ///State transition - sets the `name` field to Set 1248 1236 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1249 1237 impl<S: State> sealed::Sealed for SetName<S> {} 1250 1238 impl<S: State> State for SetName<S> { 1251 - type Uri = S::Uri; 1252 1239 type Name = Set<members::name>; 1253 - type ItemCount = S::ItemCount; 1254 - type Cid = S::Cid; 1255 1240 type Purpose = S::Purpose; 1256 1241 type IndexedAt = S::IndexedAt; 1257 1242 type Creator = S::Creator; 1258 - } 1259 - ///State transition - sets the `item_count` field to Set 1260 - pub struct SetItemCount<S: State = Empty>(PhantomData<fn() -> S>); 1261 - impl<S: State> sealed::Sealed for SetItemCount<S> {} 1262 - impl<S: State> State for SetItemCount<S> { 1263 1243 type Uri = S::Uri; 1264 - type Name = S::Name; 1265 - type ItemCount = Set<members::item_count>; 1244 + type ItemCount = S::ItemCount; 1266 1245 type Cid = S::Cid; 1267 - type Purpose = S::Purpose; 1268 - type IndexedAt = S::IndexedAt; 1269 - type Creator = S::Creator; 1270 - } 1271 - ///State transition - sets the `cid` field to Set 1272 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1273 - impl<S: State> sealed::Sealed for SetCid<S> {} 1274 - impl<S: State> State for SetCid<S> { 1275 - type Uri = S::Uri; 1276 - type Name = S::Name; 1277 - type ItemCount = S::ItemCount; 1278 - type Cid = Set<members::cid>; 1279 - type Purpose = S::Purpose; 1280 - type IndexedAt = S::IndexedAt; 1281 - type Creator = S::Creator; 1282 1246 } 1283 1247 ///State transition - sets the `purpose` field to Set 1284 1248 pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1285 1249 impl<S: State> sealed::Sealed for SetPurpose<S> {} 1286 1250 impl<S: State> State for SetPurpose<S> { 1287 - type Uri = S::Uri; 1288 1251 type Name = S::Name; 1289 - type ItemCount = S::ItemCount; 1290 - type Cid = S::Cid; 1291 1252 type Purpose = Set<members::purpose>; 1292 1253 type IndexedAt = S::IndexedAt; 1293 1254 type Creator = S::Creator; 1255 + type Uri = S::Uri; 1256 + type ItemCount = S::ItemCount; 1257 + type Cid = S::Cid; 1294 1258 } 1295 1259 ///State transition - sets the `indexed_at` field to Set 1296 1260 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1297 1261 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1298 1262 impl<S: State> State for SetIndexedAt<S> { 1299 - type Uri = S::Uri; 1300 1263 type Name = S::Name; 1301 - type ItemCount = S::ItemCount; 1302 - type Cid = S::Cid; 1303 1264 type Purpose = S::Purpose; 1304 1265 type IndexedAt = Set<members::indexed_at>; 1305 1266 type Creator = S::Creator; 1267 + type Uri = S::Uri; 1268 + type ItemCount = S::ItemCount; 1269 + type Cid = S::Cid; 1306 1270 } 1307 1271 ///State transition - sets the `creator` field to Set 1308 1272 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1309 1273 impl<S: State> sealed::Sealed for SetCreator<S> {} 1310 1274 impl<S: State> State for SetCreator<S> { 1275 + type Name = S::Name; 1276 + type Purpose = S::Purpose; 1277 + type IndexedAt = S::IndexedAt; 1278 + type Creator = Set<members::creator>; 1311 1279 type Uri = S::Uri; 1280 + type ItemCount = S::ItemCount; 1281 + type Cid = S::Cid; 1282 + } 1283 + ///State transition - sets the `uri` field to Set 1284 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1285 + impl<S: State> sealed::Sealed for SetUri<S> {} 1286 + impl<S: State> State for SetUri<S> { 1312 1287 type Name = S::Name; 1288 + type Purpose = S::Purpose; 1289 + type IndexedAt = S::IndexedAt; 1290 + type Creator = S::Creator; 1291 + type Uri = Set<members::uri>; 1313 1292 type ItemCount = S::ItemCount; 1314 1293 type Cid = S::Cid; 1294 + } 1295 + ///State transition - sets the `item_count` field to Set 1296 + pub struct SetItemCount<S: State = Empty>(PhantomData<fn() -> S>); 1297 + impl<S: State> sealed::Sealed for SetItemCount<S> {} 1298 + impl<S: State> State for SetItemCount<S> { 1299 + type Name = S::Name; 1315 1300 type Purpose = S::Purpose; 1316 1301 type IndexedAt = S::IndexedAt; 1317 - type Creator = Set<members::creator>; 1302 + type Creator = S::Creator; 1303 + type Uri = S::Uri; 1304 + type ItemCount = Set<members::item_count>; 1305 + type Cid = S::Cid; 1306 + } 1307 + ///State transition - sets the `cid` field to Set 1308 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1309 + impl<S: State> sealed::Sealed for SetCid<S> {} 1310 + impl<S: State> State for SetCid<S> { 1311 + type Name = S::Name; 1312 + type Purpose = S::Purpose; 1313 + type IndexedAt = S::IndexedAt; 1314 + type Creator = S::Creator; 1315 + type Uri = S::Uri; 1316 + type ItemCount = S::ItemCount; 1317 + type Cid = Set<members::cid>; 1318 1318 } 1319 1319 /// Marker types for field names 1320 1320 #[allow(non_camel_case_types)] 1321 1321 pub mod members { 1322 - ///Marker type for the `uri` field 1323 - pub struct uri(()); 1324 1322 ///Marker type for the `name` field 1325 1323 pub struct name(()); 1326 - ///Marker type for the `item_count` field 1327 - pub struct item_count(()); 1328 - ///Marker type for the `cid` field 1329 - pub struct cid(()); 1330 1324 ///Marker type for the `purpose` field 1331 1325 pub struct purpose(()); 1332 1326 ///Marker type for the `indexed_at` field 1333 1327 pub struct indexed_at(()); 1334 1328 ///Marker type for the `creator` field 1335 1329 pub struct creator(()); 1330 + ///Marker type for the `uri` field 1331 + pub struct uri(()); 1332 + ///Marker type for the `item_count` field 1333 + pub struct item_count(()); 1334 + ///Marker type for the `cid` field 1335 + pub struct cid(()); 1336 1336 } 1337 1337 } 1338 1338 ··· 1576 1576 impl<'a, S> ListViewBuilder<'a, S> 1577 1577 where 1578 1578 S: list_view_state::State, 1579 - S::Uri: list_view_state::IsSet, 1580 1579 S::Name: list_view_state::IsSet, 1581 - S::ItemCount: list_view_state::IsSet, 1582 - S::Cid: list_view_state::IsSet, 1583 1580 S::Purpose: list_view_state::IsSet, 1584 1581 S::IndexedAt: list_view_state::IsSet, 1585 1582 S::Creator: list_view_state::IsSet, 1583 + S::Uri: list_view_state::IsSet, 1584 + S::ItemCount: list_view_state::IsSet, 1585 + S::Cid: list_view_state::IsSet, 1586 1586 { 1587 1587 /// Build the final struct 1588 1588 pub fn build(self) -> ListView<'a> { ··· 1696 1696 } 1697 1697 /// State trait tracking which required fields have been set 1698 1698 pub trait State: sealed::Sealed { 1699 - type CommunityTags; 1700 - type Resource; 1701 1699 type AuthorTags; 1700 + type Resource; 1701 + type CommunityTags; 1702 1702 } 1703 1703 /// Empty state - all required fields are unset 1704 1704 pub struct Empty(()); 1705 1705 impl sealed::Sealed for Empty {} 1706 1706 impl State for Empty { 1707 + type AuthorTags = Unset; 1708 + type Resource = Unset; 1707 1709 type CommunityTags = Unset; 1708 - type Resource = Unset; 1709 - type AuthorTags = Unset; 1710 1710 } 1711 - ///State transition - sets the `community_tags` field to Set 1712 - pub struct SetCommunityTags<S: State = Empty>(PhantomData<fn() -> S>); 1713 - impl<S: State> sealed::Sealed for SetCommunityTags<S> {} 1714 - impl<S: State> State for SetCommunityTags<S> { 1715 - type CommunityTags = Set<members::community_tags>; 1711 + ///State transition - sets the `author_tags` field to Set 1712 + pub struct SetAuthorTags<S: State = Empty>(PhantomData<fn() -> S>); 1713 + impl<S: State> sealed::Sealed for SetAuthorTags<S> {} 1714 + impl<S: State> State for SetAuthorTags<S> { 1715 + type AuthorTags = Set<members::author_tags>; 1716 1716 type Resource = S::Resource; 1717 - type AuthorTags = S::AuthorTags; 1717 + type CommunityTags = S::CommunityTags; 1718 1718 } 1719 1719 ///State transition - sets the `resource` field to Set 1720 1720 pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 1721 1721 impl<S: State> sealed::Sealed for SetResource<S> {} 1722 1722 impl<S: State> State for SetResource<S> { 1723 - type CommunityTags = S::CommunityTags; 1723 + type AuthorTags = S::AuthorTags; 1724 1724 type Resource = Set<members::resource>; 1725 + type CommunityTags = S::CommunityTags; 1726 + } 1727 + ///State transition - sets the `community_tags` field to Set 1728 + pub struct SetCommunityTags<S: State = Empty>(PhantomData<fn() -> S>); 1729 + impl<S: State> sealed::Sealed for SetCommunityTags<S> {} 1730 + impl<S: State> State for SetCommunityTags<S> { 1725 1731 type AuthorTags = S::AuthorTags; 1726 - } 1727 - ///State transition - sets the `author_tags` field to Set 1728 - pub struct SetAuthorTags<S: State = Empty>(PhantomData<fn() -> S>); 1729 - impl<S: State> sealed::Sealed for SetAuthorTags<S> {} 1730 - impl<S: State> State for SetAuthorTags<S> { 1731 - type CommunityTags = S::CommunityTags; 1732 1732 type Resource = S::Resource; 1733 - type AuthorTags = Set<members::author_tags>; 1733 + type CommunityTags = Set<members::community_tags>; 1734 1734 } 1735 1735 /// Marker types for field names 1736 1736 #[allow(non_camel_case_types)] 1737 1737 pub mod members { 1738 - ///Marker type for the `community_tags` field 1739 - pub struct community_tags(()); 1738 + ///Marker type for the `author_tags` field 1739 + pub struct author_tags(()); 1740 1740 ///Marker type for the `resource` field 1741 1741 pub struct resource(()); 1742 - ///Marker type for the `author_tags` field 1743 - pub struct author_tags(()); 1742 + ///Marker type for the `community_tags` field 1743 + pub struct community_tags(()); 1744 1744 } 1745 1745 } 1746 1746 ··· 1853 1853 impl<'a, S> ResourceTagsViewBuilder<'a, S> 1854 1854 where 1855 1855 S: resource_tags_view_state::State, 1856 - S::CommunityTags: resource_tags_view_state::IsSet, 1857 - S::Resource: resource_tags_view_state::IsSet, 1858 1856 S::AuthorTags: resource_tags_view_state::IsSet, 1857 + S::Resource: resource_tags_view_state::IsSet, 1858 + S::CommunityTags: resource_tags_view_state::IsSet, 1859 1859 { 1860 1860 /// Build the final struct 1861 1861 pub fn build(self) -> ResourceTagsView<'a> { ··· 1952 1952 } 1953 1953 /// State trait tracking which required fields have been set 1954 1954 pub trait State: sealed::Sealed { 1955 + type Tag; 1956 + type Uri; 1955 1957 type CreatedAt; 1956 1958 type AppliedBy; 1957 - type Uri; 1958 - type Tag; 1959 1959 } 1960 1960 /// Empty state - all required fields are unset 1961 1961 pub struct Empty(()); 1962 1962 impl sealed::Sealed for Empty {} 1963 1963 impl State for Empty { 1964 + type Tag = Unset; 1965 + type Uri = Unset; 1964 1966 type CreatedAt = Unset; 1965 1967 type AppliedBy = Unset; 1966 - type Uri = Unset; 1967 - type Tag = Unset; 1968 + } 1969 + ///State transition - sets the `tag` field to Set 1970 + pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 1971 + impl<S: State> sealed::Sealed for SetTag<S> {} 1972 + impl<S: State> State for SetTag<S> { 1973 + type Tag = Set<members::tag>; 1974 + type Uri = S::Uri; 1975 + type CreatedAt = S::CreatedAt; 1976 + type AppliedBy = S::AppliedBy; 1977 + } 1978 + ///State transition - sets the `uri` field to Set 1979 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1980 + impl<S: State> sealed::Sealed for SetUri<S> {} 1981 + impl<S: State> State for SetUri<S> { 1982 + type Tag = S::Tag; 1983 + type Uri = Set<members::uri>; 1984 + type CreatedAt = S::CreatedAt; 1985 + type AppliedBy = S::AppliedBy; 1968 1986 } 1969 1987 ///State transition - sets the `created_at` field to Set 1970 1988 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1971 1989 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1972 1990 impl<S: State> State for SetCreatedAt<S> { 1991 + type Tag = S::Tag; 1992 + type Uri = S::Uri; 1973 1993 type CreatedAt = Set<members::created_at>; 1974 1994 type AppliedBy = S::AppliedBy; 1975 - type Uri = S::Uri; 1976 - type Tag = S::Tag; 1977 1995 } 1978 1996 ///State transition - sets the `applied_by` field to Set 1979 1997 pub struct SetAppliedBy<S: State = Empty>(PhantomData<fn() -> S>); 1980 1998 impl<S: State> sealed::Sealed for SetAppliedBy<S> {} 1981 1999 impl<S: State> State for SetAppliedBy<S> { 1982 - type CreatedAt = S::CreatedAt; 1983 - type AppliedBy = Set<members::applied_by>; 1984 - type Uri = S::Uri; 1985 2000 type Tag = S::Tag; 1986 - } 1987 - ///State transition - sets the `uri` field to Set 1988 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1989 - impl<S: State> sealed::Sealed for SetUri<S> {} 1990 - impl<S: State> State for SetUri<S> { 2001 + type Uri = S::Uri; 1991 2002 type CreatedAt = S::CreatedAt; 1992 - type AppliedBy = S::AppliedBy; 1993 - type Uri = Set<members::uri>; 1994 - type Tag = S::Tag; 1995 - } 1996 - ///State transition - sets the `tag` field to Set 1997 - pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 1998 - impl<S: State> sealed::Sealed for SetTag<S> {} 1999 - impl<S: State> State for SetTag<S> { 2000 - type CreatedAt = S::CreatedAt; 2001 - type AppliedBy = S::AppliedBy; 2002 - type Uri = S::Uri; 2003 - type Tag = Set<members::tag>; 2003 + type AppliedBy = Set<members::applied_by>; 2004 2004 } 2005 2005 /// Marker types for field names 2006 2006 #[allow(non_camel_case_types)] 2007 2007 pub mod members { 2008 + ///Marker type for the `tag` field 2009 + pub struct tag(()); 2010 + ///Marker type for the `uri` field 2011 + pub struct uri(()); 2008 2012 ///Marker type for the `created_at` field 2009 2013 pub struct created_at(()); 2010 2014 ///Marker type for the `applied_by` field 2011 2015 pub struct applied_by(()); 2012 - ///Marker type for the `uri` field 2013 - pub struct uri(()); 2014 - ///Marker type for the `tag` field 2015 - pub struct tag(()); 2016 2016 } 2017 2017 } 2018 2018 ··· 2125 2125 impl<'a, S> TagApplicationViewBuilder<'a, S> 2126 2126 where 2127 2127 S: tag_application_view_state::State, 2128 + S::Tag: tag_application_view_state::IsSet, 2129 + S::Uri: tag_application_view_state::IsSet, 2128 2130 S::CreatedAt: tag_application_view_state::IsSet, 2129 2131 S::AppliedBy: tag_application_view_state::IsSet, 2130 - S::Uri: tag_application_view_state::IsSet, 2131 - S::Tag: tag_application_view_state::IsSet, 2132 2132 { 2133 2133 /// Build the final struct 2134 2134 pub fn build(self) -> TagApplicationView<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/graph/bookmark.rs
··· 38 38 } 39 39 /// State trait tracking which required fields have been set 40 40 pub trait State: sealed::Sealed { 41 - type CreatedAt; 42 41 type Subject; 42 + type CreatedAt; 43 43 } 44 44 /// Empty state - all required fields are unset 45 45 pub struct Empty(()); 46 46 impl sealed::Sealed for Empty {} 47 47 impl State for Empty { 48 - type CreatedAt = Unset; 49 48 type Subject = Unset; 50 - } 51 - ///State transition - sets the `created_at` field to Set 52 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 54 - impl<S: State> State for SetCreatedAt<S> { 55 - type CreatedAt = Set<members::created_at>; 56 - type Subject = S::Subject; 49 + type CreatedAt = Unset; 57 50 } 58 51 ///State transition - sets the `subject` field to Set 59 52 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 60 53 impl<S: State> sealed::Sealed for SetSubject<S> {} 61 54 impl<S: State> State for SetSubject<S> { 62 - type CreatedAt = S::CreatedAt; 63 55 type Subject = Set<members::subject>; 56 + type CreatedAt = S::CreatedAt; 57 + } 58 + ///State transition - sets the `created_at` field to Set 59 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 60 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 61 + impl<S: State> State for SetCreatedAt<S> { 62 + type Subject = S::Subject; 63 + type CreatedAt = Set<members::created_at>; 64 64 } 65 65 /// Marker types for field names 66 66 #[allow(non_camel_case_types)] 67 67 pub mod members { 68 - ///Marker type for the `created_at` field 69 - pub struct created_at(()); 70 68 ///Marker type for the `subject` field 71 69 pub struct subject(()); 70 + ///Marker type for the `created_at` field 71 + pub struct created_at(()); 72 72 } 73 73 } 74 74 ··· 158 158 impl<'a, S> BookmarkBuilder<'a, S> 159 159 where 160 160 S: bookmark_state::State, 161 - S::CreatedAt: bookmark_state::IsSet, 162 161 S::Subject: bookmark_state::IsSet, 162 + S::CreatedAt: bookmark_state::IsSet, 163 163 { 164 164 /// Build the final struct 165 165 pub fn build(self) -> Bookmark<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/graph/like.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Subject; 38 37 type CreatedAt; 38 + type Subject; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type Subject = Unset; 45 44 type CreatedAt = Unset; 46 - } 47 - ///State transition - sets the `subject` field to Set 48 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetSubject<S> {} 50 - impl<S: State> State for SetSubject<S> { 51 - type Subject = Set<members::subject>; 52 - type CreatedAt = S::CreatedAt; 45 + type Subject = Unset; 53 46 } 54 47 ///State transition - sets the `created_at` field to Set 55 48 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 57 50 impl<S: State> State for SetCreatedAt<S> { 58 - type Subject = S::Subject; 59 51 type CreatedAt = Set<members::created_at>; 52 + type Subject = S::Subject; 53 + } 54 + ///State transition - sets the `subject` field to Set 55 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetSubject<S> {} 57 + impl<S: State> State for SetSubject<S> { 58 + type CreatedAt = S::CreatedAt; 59 + type Subject = Set<members::subject>; 60 60 } 61 61 /// Marker types for field names 62 62 #[allow(non_camel_case_types)] 63 63 pub mod members { 64 - ///Marker type for the `subject` field 65 - pub struct subject(()); 66 64 ///Marker type for the `created_at` field 67 65 pub struct created_at(()); 66 + ///Marker type for the `subject` field 67 + pub struct subject(()); 68 68 } 69 69 } 70 70 ··· 137 137 impl<'a, S> LikeBuilder<'a, S> 138 138 where 139 139 S: like_state::State, 140 - S::Subject: like_state::IsSet, 141 140 S::CreatedAt: like_state::IsSet, 141 + S::Subject: like_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> Like<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/graph/list.rs
··· 130 130 /// State trait tracking which required fields have been set 131 131 pub trait State: sealed::Sealed { 132 132 type Name; 133 - type CreatedAt; 134 133 type Purpose; 134 + type CreatedAt; 135 135 } 136 136 /// Empty state - all required fields are unset 137 137 pub struct Empty(()); 138 138 impl sealed::Sealed for Empty {} 139 139 impl State for Empty { 140 140 type Name = Unset; 141 - type CreatedAt = Unset; 142 141 type Purpose = Unset; 142 + type CreatedAt = Unset; 143 143 } 144 144 ///State transition - sets the `name` field to Set 145 145 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 146 146 impl<S: State> sealed::Sealed for SetName<S> {} 147 147 impl<S: State> State for SetName<S> { 148 148 type Name = Set<members::name>; 149 - type CreatedAt = S::CreatedAt; 150 149 type Purpose = S::Purpose; 151 - } 152 - ///State transition - sets the `created_at` field to Set 153 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 154 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 155 - impl<S: State> State for SetCreatedAt<S> { 156 - type Name = S::Name; 157 - type CreatedAt = Set<members::created_at>; 158 - type Purpose = S::Purpose; 150 + type CreatedAt = S::CreatedAt; 159 151 } 160 152 ///State transition - sets the `purpose` field to Set 161 153 pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 162 154 impl<S: State> sealed::Sealed for SetPurpose<S> {} 163 155 impl<S: State> State for SetPurpose<S> { 164 156 type Name = S::Name; 165 - type CreatedAt = S::CreatedAt; 166 157 type Purpose = Set<members::purpose>; 158 + type CreatedAt = S::CreatedAt; 159 + } 160 + ///State transition - sets the `created_at` field to Set 161 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 162 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 163 + impl<S: State> State for SetCreatedAt<S> { 164 + type Name = S::Name; 165 + type Purpose = S::Purpose; 166 + type CreatedAt = Set<members::created_at>; 167 167 } 168 168 /// Marker types for field names 169 169 #[allow(non_camel_case_types)] 170 170 pub mod members { 171 171 ///Marker type for the `name` field 172 172 pub struct name(()); 173 + ///Marker type for the `purpose` field 174 + pub struct purpose(()); 173 175 ///Marker type for the `created_at` field 174 176 pub struct created_at(()); 175 - ///Marker type for the `purpose` field 176 - pub struct purpose(()); 177 177 } 178 178 } 179 179 ··· 307 307 where 308 308 S: list_state::State, 309 309 S::Name: list_state::IsSet, 310 - S::CreatedAt: list_state::IsSet, 311 310 S::Purpose: list_state::IsSet, 311 + S::CreatedAt: list_state::IsSet, 312 312 { 313 313 /// Build the final struct 314 314 pub fn build(self) -> List<'a> {
+24 -24
crates/weaver-api/src/sh_weaver/graph/listitem.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 - type Subject; 41 - type List; 42 40 type CreatedAt; 41 + type List; 42 + type Subject; 43 43 } 44 44 /// Empty state - all required fields are unset 45 45 pub struct Empty(()); 46 46 impl sealed::Sealed for Empty {} 47 47 impl State for Empty { 48 + type CreatedAt = Unset; 49 + type List = Unset; 48 50 type Subject = Unset; 49 - type List = Unset; 50 - type CreatedAt = Unset; 51 51 } 52 - ///State transition - sets the `subject` field to Set 53 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 54 - impl<S: State> sealed::Sealed for SetSubject<S> {} 55 - impl<S: State> State for SetSubject<S> { 56 - type Subject = Set<members::subject>; 52 + ///State transition - sets the `created_at` field to Set 53 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 55 + impl<S: State> State for SetCreatedAt<S> { 56 + type CreatedAt = Set<members::created_at>; 57 57 type List = S::List; 58 - type CreatedAt = S::CreatedAt; 58 + type Subject = S::Subject; 59 59 } 60 60 ///State transition - sets the `list` field to Set 61 61 pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 62 62 impl<S: State> sealed::Sealed for SetList<S> {} 63 63 impl<S: State> State for SetList<S> { 64 - type Subject = S::Subject; 65 - type List = Set<members::list>; 66 64 type CreatedAt = S::CreatedAt; 65 + type List = Set<members::list>; 66 + type Subject = S::Subject; 67 67 } 68 - ///State transition - sets the `created_at` field to Set 69 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 70 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 71 - impl<S: State> State for SetCreatedAt<S> { 72 - type Subject = S::Subject; 68 + ///State transition - sets the `subject` field to Set 69 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 70 + impl<S: State> sealed::Sealed for SetSubject<S> {} 71 + impl<S: State> State for SetSubject<S> { 72 + type CreatedAt = S::CreatedAt; 73 73 type List = S::List; 74 - type CreatedAt = Set<members::created_at>; 74 + type Subject = Set<members::subject>; 75 75 } 76 76 /// Marker types for field names 77 77 #[allow(non_camel_case_types)] 78 78 pub mod members { 79 + ///Marker type for the `created_at` field 80 + pub struct created_at(()); 81 + ///Marker type for the `list` field 82 + pub struct list(()); 79 83 ///Marker type for the `subject` field 80 84 pub struct subject(()); 81 - ///Marker type for the `list` field 82 - pub struct list(()); 83 - ///Marker type for the `created_at` field 84 - pub struct created_at(()); 85 85 } 86 86 } 87 87 ··· 174 174 impl<'a, S> ListitemBuilder<'a, S> 175 175 where 176 176 S: listitem_state::State, 177 - S::Subject: listitem_state::IsSet, 178 - S::List: listitem_state::IsSet, 179 177 S::CreatedAt: listitem_state::IsSet, 178 + S::List: listitem_state::IsSet, 179 + S::Subject: listitem_state::IsSet, 180 180 { 181 181 /// Build the final struct 182 182 pub fn build(self) -> Listitem<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/graph/tag.rs
··· 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 40 type Tag; 41 - type CreatedAt; 42 41 type Subject; 42 + type CreatedAt; 43 43 } 44 44 /// Empty state - all required fields are unset 45 45 pub struct Empty(()); 46 46 impl sealed::Sealed for Empty {} 47 47 impl State for Empty { 48 48 type Tag = Unset; 49 - type CreatedAt = Unset; 50 49 type Subject = Unset; 50 + type CreatedAt = Unset; 51 51 } 52 52 ///State transition - sets the `tag` field to Set 53 53 pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 54 54 impl<S: State> sealed::Sealed for SetTag<S> {} 55 55 impl<S: State> State for SetTag<S> { 56 56 type Tag = Set<members::tag>; 57 - type CreatedAt = S::CreatedAt; 58 57 type Subject = S::Subject; 59 - } 60 - ///State transition - sets the `created_at` field to Set 61 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 62 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 63 - impl<S: State> State for SetCreatedAt<S> { 64 - type Tag = S::Tag; 65 - type CreatedAt = Set<members::created_at>; 66 - type Subject = S::Subject; 58 + type CreatedAt = S::CreatedAt; 67 59 } 68 60 ///State transition - sets the `subject` field to Set 69 61 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 70 62 impl<S: State> sealed::Sealed for SetSubject<S> {} 71 63 impl<S: State> State for SetSubject<S> { 72 64 type Tag = S::Tag; 73 - type CreatedAt = S::CreatedAt; 74 65 type Subject = Set<members::subject>; 66 + type CreatedAt = S::CreatedAt; 67 + } 68 + ///State transition - sets the `created_at` field to Set 69 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 70 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 71 + impl<S: State> State for SetCreatedAt<S> { 72 + type Tag = S::Tag; 73 + type Subject = S::Subject; 74 + type CreatedAt = Set<members::created_at>; 75 75 } 76 76 /// Marker types for field names 77 77 #[allow(non_camel_case_types)] 78 78 pub mod members { 79 79 ///Marker type for the `tag` field 80 80 pub struct tag(()); 81 + ///Marker type for the `subject` field 82 + pub struct subject(()); 81 83 ///Marker type for the `created_at` field 82 84 pub struct created_at(()); 83 - ///Marker type for the `subject` field 84 - pub struct subject(()); 85 85 } 86 86 } 87 87 ··· 175 175 where 176 176 S: tag_state::State, 177 177 S::Tag: tag_state::IsSet, 178 - S::CreatedAt: tag_state::IsSet, 179 178 S::Subject: tag_state::IsSet, 179 + S::CreatedAt: tag_state::IsSet, 180 180 { 181 181 /// Build the final struct 182 182 pub fn build(self) -> Tag<'a> {
+267 -266
crates/weaver-api/src/sh_weaver/notebook.rs
··· 30 30 pub mod get_suggested_notebooks; 31 31 pub mod page; 32 32 pub mod resolve_entry; 33 + pub mod resolve_global_notebook; 33 34 pub mod resolve_notebook; 34 35 pub mod resolve_version_conflict; 35 36 pub mod search_entries; ··· 2398 2399 } 2399 2400 /// State trait tracking which required fields have been set 2400 2401 pub trait State: sealed::Sealed { 2401 - type Entry; 2402 2402 type Index; 2403 + type Entry; 2403 2404 } 2404 2405 /// Empty state - all required fields are unset 2405 2406 pub struct Empty(()); 2406 2407 impl sealed::Sealed for Empty {} 2407 2408 impl State for Empty { 2409 + type Index = Unset; 2408 2410 type Entry = Unset; 2409 - type Index = Unset; 2410 - } 2411 - ///State transition - sets the `entry` field to Set 2412 - pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 2413 - impl<S: State> sealed::Sealed for SetEntry<S> {} 2414 - impl<S: State> State for SetEntry<S> { 2415 - type Entry = Set<members::entry>; 2416 - type Index = S::Index; 2417 2411 } 2418 2412 ///State transition - sets the `index` field to Set 2419 2413 pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 2420 2414 impl<S: State> sealed::Sealed for SetIndex<S> {} 2421 2415 impl<S: State> State for SetIndex<S> { 2422 - type Entry = S::Entry; 2423 2416 type Index = Set<members::index>; 2417 + type Entry = S::Entry; 2418 + } 2419 + ///State transition - sets the `entry` field to Set 2420 + pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 2421 + impl<S: State> sealed::Sealed for SetEntry<S> {} 2422 + impl<S: State> State for SetEntry<S> { 2423 + type Index = S::Index; 2424 + type Entry = Set<members::entry>; 2424 2425 } 2425 2426 /// Marker types for field names 2426 2427 #[allow(non_camel_case_types)] 2427 2428 pub mod members { 2429 + ///Marker type for the `index` field 2430 + pub struct index(()); 2428 2431 ///Marker type for the `entry` field 2429 2432 pub struct entry(()); 2430 - ///Marker type for the `index` field 2431 - pub struct index(()); 2432 2433 } 2433 2434 } 2434 2435 ··· 2541 2542 impl<'a, S> ChapterEntryViewBuilder<'a, S> 2542 2543 where 2543 2544 S: chapter_entry_view_state::State, 2544 - S::Entry: chapter_entry_view_state::IsSet, 2545 2545 S::Index: chapter_entry_view_state::IsSet, 2546 + S::Entry: chapter_entry_view_state::IsSet, 2546 2547 { 2547 2548 /// Build the final struct 2548 2549 pub fn build(self) -> ChapterEntryView<'a> { ··· 2634 2635 /// State trait tracking which required fields have been set 2635 2636 pub trait State: sealed::Sealed { 2636 2637 type Cid; 2637 - type Notebook; 2638 2638 type Authors; 2639 - type Uri; 2640 - type IndexedAt; 2641 2639 type Record; 2640 + type IndexedAt; 2641 + type Uri; 2642 + type Notebook; 2642 2643 } 2643 2644 /// Empty state - all required fields are unset 2644 2645 pub struct Empty(()); 2645 2646 impl sealed::Sealed for Empty {} 2646 2647 impl State for Empty { 2647 2648 type Cid = Unset; 2648 - type Notebook = Unset; 2649 2649 type Authors = Unset; 2650 - type Uri = Unset; 2650 + type Record = Unset; 2651 2651 type IndexedAt = Unset; 2652 - type Record = Unset; 2652 + type Uri = Unset; 2653 + type Notebook = Unset; 2653 2654 } 2654 2655 ///State transition - sets the `cid` field to Set 2655 2656 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2656 2657 impl<S: State> sealed::Sealed for SetCid<S> {} 2657 2658 impl<S: State> State for SetCid<S> { 2658 2659 type Cid = Set<members::cid>; 2659 - type Notebook = S::Notebook; 2660 2660 type Authors = S::Authors; 2661 - type Uri = S::Uri; 2662 - type IndexedAt = S::IndexedAt; 2663 2661 type Record = S::Record; 2664 - } 2665 - ///State transition - sets the `notebook` field to Set 2666 - pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 2667 - impl<S: State> sealed::Sealed for SetNotebook<S> {} 2668 - impl<S: State> State for SetNotebook<S> { 2669 - type Cid = S::Cid; 2670 - type Notebook = Set<members::notebook>; 2671 - type Authors = S::Authors; 2662 + type IndexedAt = S::IndexedAt; 2672 2663 type Uri = S::Uri; 2673 - type IndexedAt = S::IndexedAt; 2674 - type Record = S::Record; 2664 + type Notebook = S::Notebook; 2675 2665 } 2676 2666 ///State transition - sets the `authors` field to Set 2677 2667 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 2678 2668 impl<S: State> sealed::Sealed for SetAuthors<S> {} 2679 2669 impl<S: State> State for SetAuthors<S> { 2680 2670 type Cid = S::Cid; 2681 - type Notebook = S::Notebook; 2682 2671 type Authors = Set<members::authors>; 2683 - type Uri = S::Uri; 2684 - type IndexedAt = S::IndexedAt; 2685 2672 type Record = S::Record; 2673 + type IndexedAt = S::IndexedAt; 2674 + type Uri = S::Uri; 2675 + type Notebook = S::Notebook; 2686 2676 } 2687 - ///State transition - sets the `uri` field to Set 2688 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2689 - impl<S: State> sealed::Sealed for SetUri<S> {} 2690 - impl<S: State> State for SetUri<S> { 2677 + ///State transition - sets the `record` field to Set 2678 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 2679 + impl<S: State> sealed::Sealed for SetRecord<S> {} 2680 + impl<S: State> State for SetRecord<S> { 2691 2681 type Cid = S::Cid; 2692 - type Notebook = S::Notebook; 2693 2682 type Authors = S::Authors; 2694 - type Uri = Set<members::uri>; 2683 + type Record = Set<members::record>; 2695 2684 type IndexedAt = S::IndexedAt; 2696 - type Record = S::Record; 2685 + type Uri = S::Uri; 2686 + type Notebook = S::Notebook; 2697 2687 } 2698 2688 ///State transition - sets the `indexed_at` field to Set 2699 2689 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2700 2690 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2701 2691 impl<S: State> State for SetIndexedAt<S> { 2702 2692 type Cid = S::Cid; 2703 - type Notebook = S::Notebook; 2704 2693 type Authors = S::Authors; 2705 - type Uri = S::Uri; 2694 + type Record = S::Record; 2706 2695 type IndexedAt = Set<members::indexed_at>; 2696 + type Uri = S::Uri; 2697 + type Notebook = S::Notebook; 2698 + } 2699 + ///State transition - sets the `uri` field to Set 2700 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2701 + impl<S: State> sealed::Sealed for SetUri<S> {} 2702 + impl<S: State> State for SetUri<S> { 2703 + type Cid = S::Cid; 2704 + type Authors = S::Authors; 2707 2705 type Record = S::Record; 2706 + type IndexedAt = S::IndexedAt; 2707 + type Uri = Set<members::uri>; 2708 + type Notebook = S::Notebook; 2708 2709 } 2709 - ///State transition - sets the `record` field to Set 2710 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 2711 - impl<S: State> sealed::Sealed for SetRecord<S> {} 2712 - impl<S: State> State for SetRecord<S> { 2710 + ///State transition - sets the `notebook` field to Set 2711 + pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 2712 + impl<S: State> sealed::Sealed for SetNotebook<S> {} 2713 + impl<S: State> State for SetNotebook<S> { 2713 2714 type Cid = S::Cid; 2714 - type Notebook = S::Notebook; 2715 2715 type Authors = S::Authors; 2716 + type Record = S::Record; 2717 + type IndexedAt = S::IndexedAt; 2716 2718 type Uri = S::Uri; 2717 - type IndexedAt = S::IndexedAt; 2718 - type Record = Set<members::record>; 2719 + type Notebook = Set<members::notebook>; 2719 2720 } 2720 2721 /// Marker types for field names 2721 2722 #[allow(non_camel_case_types)] 2722 2723 pub mod members { 2723 2724 ///Marker type for the `cid` field 2724 2725 pub struct cid(()); 2725 - ///Marker type for the `notebook` field 2726 - pub struct notebook(()); 2727 2726 ///Marker type for the `authors` field 2728 2727 pub struct authors(()); 2728 + ///Marker type for the `record` field 2729 + pub struct record(()); 2730 + ///Marker type for the `indexed_at` field 2731 + pub struct indexed_at(()); 2729 2732 ///Marker type for the `uri` field 2730 2733 pub struct uri(()); 2731 - ///Marker type for the `indexed_at` field 2732 - pub struct indexed_at(()); 2733 - ///Marker type for the `record` field 2734 - pub struct record(()); 2734 + ///Marker type for the `notebook` field 2735 + pub struct notebook(()); 2735 2736 } 2736 2737 } 2737 2738 ··· 2949 2950 where 2950 2951 S: chapter_view_state::State, 2951 2952 S::Cid: chapter_view_state::IsSet, 2952 - S::Notebook: chapter_view_state::IsSet, 2953 2953 S::Authors: chapter_view_state::IsSet, 2954 - S::Uri: chapter_view_state::IsSet, 2955 - S::IndexedAt: chapter_view_state::IsSet, 2956 2954 S::Record: chapter_view_state::IsSet, 2955 + S::IndexedAt: chapter_view_state::IsSet, 2956 + S::Uri: chapter_view_state::IsSet, 2957 + S::Notebook: chapter_view_state::IsSet, 2957 2958 { 2958 2959 /// Build the final struct 2959 2960 pub fn build(self) -> ChapterView<'a> { ··· 3337 3338 } 3338 3339 /// State trait tracking which required fields have been set 3339 3340 pub trait State: sealed::Sealed { 3340 - type Cid; 3341 - type Uri; 3342 - type Record; 3343 3341 type IndexedAt; 3344 3342 type Authors; 3343 + type Record; 3344 + type Uri; 3345 + type Cid; 3345 3346 } 3346 3347 /// Empty state - all required fields are unset 3347 3348 pub struct Empty(()); 3348 3349 impl sealed::Sealed for Empty {} 3349 3350 impl State for Empty { 3350 - type Cid = Unset; 3351 - type Uri = Unset; 3352 - type Record = Unset; 3353 3351 type IndexedAt = Unset; 3354 3352 type Authors = Unset; 3353 + type Record = Unset; 3354 + type Uri = Unset; 3355 + type Cid = Unset; 3355 3356 } 3356 - ///State transition - sets the `cid` field to Set 3357 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3358 - impl<S: State> sealed::Sealed for SetCid<S> {} 3359 - impl<S: State> State for SetCid<S> { 3360 - type Cid = Set<members::cid>; 3357 + ///State transition - sets the `indexed_at` field to Set 3358 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3359 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3360 + impl<S: State> State for SetIndexedAt<S> { 3361 + type IndexedAt = Set<members::indexed_at>; 3362 + type Authors = S::Authors; 3363 + type Record = S::Record; 3361 3364 type Uri = S::Uri; 3365 + type Cid = S::Cid; 3366 + } 3367 + ///State transition - sets the `authors` field to Set 3368 + pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 3369 + impl<S: State> sealed::Sealed for SetAuthors<S> {} 3370 + impl<S: State> State for SetAuthors<S> { 3371 + type IndexedAt = S::IndexedAt; 3372 + type Authors = Set<members::authors>; 3362 3373 type Record = S::Record; 3374 + type Uri = S::Uri; 3375 + type Cid = S::Cid; 3376 + } 3377 + ///State transition - sets the `record` field to Set 3378 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3379 + impl<S: State> sealed::Sealed for SetRecord<S> {} 3380 + impl<S: State> State for SetRecord<S> { 3363 3381 type IndexedAt = S::IndexedAt; 3364 3382 type Authors = S::Authors; 3383 + type Record = Set<members::record>; 3384 + type Uri = S::Uri; 3385 + type Cid = S::Cid; 3365 3386 } 3366 3387 ///State transition - sets the `uri` field to Set 3367 3388 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3368 3389 impl<S: State> sealed::Sealed for SetUri<S> {} 3369 3390 impl<S: State> State for SetUri<S> { 3370 - type Cid = S::Cid; 3371 - type Uri = Set<members::uri>; 3372 - type Record = S::Record; 3373 3391 type IndexedAt = S::IndexedAt; 3374 3392 type Authors = S::Authors; 3393 + type Record = S::Record; 3394 + type Uri = Set<members::uri>; 3395 + type Cid = S::Cid; 3375 3396 } 3376 - ///State transition - sets the `record` field to Set 3377 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3378 - impl<S: State> sealed::Sealed for SetRecord<S> {} 3379 - impl<S: State> State for SetRecord<S> { 3380 - type Cid = S::Cid; 3381 - type Uri = S::Uri; 3382 - type Record = Set<members::record>; 3397 + ///State transition - sets the `cid` field to Set 3398 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3399 + impl<S: State> sealed::Sealed for SetCid<S> {} 3400 + impl<S: State> State for SetCid<S> { 3383 3401 type IndexedAt = S::IndexedAt; 3384 3402 type Authors = S::Authors; 3385 - } 3386 - ///State transition - sets the `indexed_at` field to Set 3387 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3388 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3389 - impl<S: State> State for SetIndexedAt<S> { 3390 - type Cid = S::Cid; 3391 - type Uri = S::Uri; 3392 3403 type Record = S::Record; 3393 - type IndexedAt = Set<members::indexed_at>; 3394 - type Authors = S::Authors; 3395 - } 3396 - ///State transition - sets the `authors` field to Set 3397 - pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 3398 - impl<S: State> sealed::Sealed for SetAuthors<S> {} 3399 - impl<S: State> State for SetAuthors<S> { 3400 - type Cid = S::Cid; 3401 3404 type Uri = S::Uri; 3402 - type Record = S::Record; 3403 - type IndexedAt = S::IndexedAt; 3404 - type Authors = Set<members::authors>; 3405 + type Cid = Set<members::cid>; 3405 3406 } 3406 3407 /// Marker types for field names 3407 3408 #[allow(non_camel_case_types)] 3408 3409 pub mod members { 3409 - ///Marker type for the `cid` field 3410 - pub struct cid(()); 3411 - ///Marker type for the `uri` field 3412 - pub struct uri(()); 3413 - ///Marker type for the `record` field 3414 - pub struct record(()); 3415 3410 ///Marker type for the `indexed_at` field 3416 3411 pub struct indexed_at(()); 3417 3412 ///Marker type for the `authors` field 3418 3413 pub struct authors(()); 3414 + ///Marker type for the `record` field 3415 + pub struct record(()); 3416 + ///Marker type for the `uri` field 3417 + pub struct uri(()); 3418 + ///Marker type for the `cid` field 3419 + pub struct cid(()); 3419 3420 } 3420 3421 } 3421 3422 ··· 3752 3753 impl<'a, S> EntryViewBuilder<'a, S> 3753 3754 where 3754 3755 S: entry_view_state::State, 3755 - S::Cid: entry_view_state::IsSet, 3756 - S::Uri: entry_view_state::IsSet, 3757 - S::Record: entry_view_state::IsSet, 3758 3756 S::IndexedAt: entry_view_state::IsSet, 3759 3757 S::Authors: entry_view_state::IsSet, 3758 + S::Record: entry_view_state::IsSet, 3759 + S::Uri: entry_view_state::IsSet, 3760 + S::Cid: entry_view_state::IsSet, 3760 3761 { 3761 3762 /// Build the final struct 3762 3763 pub fn build(self) -> EntryView<'a> { ··· 4307 4308 } 4308 4309 /// State trait tracking which required fields have been set 4309 4310 pub trait State: sealed::Sealed { 4310 - type Cid; 4311 - type Authors; 4312 4311 type Record; 4312 + type Cid; 4313 4313 type Uri; 4314 + type Authors; 4314 4315 type IndexedAt; 4315 4316 } 4316 4317 /// Empty state - all required fields are unset 4317 4318 pub struct Empty(()); 4318 4319 impl sealed::Sealed for Empty {} 4319 4320 impl State for Empty { 4321 + type Record = Unset; 4320 4322 type Cid = Unset; 4323 + type Uri = Unset; 4321 4324 type Authors = Unset; 4322 - type Record = Unset; 4323 - type Uri = Unset; 4324 4325 type IndexedAt = Unset; 4325 4326 } 4327 + ///State transition - sets the `record` field to Set 4328 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 4329 + impl<S: State> sealed::Sealed for SetRecord<S> {} 4330 + impl<S: State> State for SetRecord<S> { 4331 + type Record = Set<members::record>; 4332 + type Cid = S::Cid; 4333 + type Uri = S::Uri; 4334 + type Authors = S::Authors; 4335 + type IndexedAt = S::IndexedAt; 4336 + } 4326 4337 ///State transition - sets the `cid` field to Set 4327 4338 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 4328 4339 impl<S: State> sealed::Sealed for SetCid<S> {} 4329 4340 impl<S: State> State for SetCid<S> { 4341 + type Record = S::Record; 4330 4342 type Cid = Set<members::cid>; 4343 + type Uri = S::Uri; 4331 4344 type Authors = S::Authors; 4345 + type IndexedAt = S::IndexedAt; 4346 + } 4347 + ///State transition - sets the `uri` field to Set 4348 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4349 + impl<S: State> sealed::Sealed for SetUri<S> {} 4350 + impl<S: State> State for SetUri<S> { 4332 4351 type Record = S::Record; 4333 - type Uri = S::Uri; 4352 + type Cid = S::Cid; 4353 + type Uri = Set<members::uri>; 4354 + type Authors = S::Authors; 4334 4355 type IndexedAt = S::IndexedAt; 4335 4356 } 4336 4357 ///State transition - sets the `authors` field to Set 4337 4358 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 4338 4359 impl<S: State> sealed::Sealed for SetAuthors<S> {} 4339 4360 impl<S: State> State for SetAuthors<S> { 4340 - type Cid = S::Cid; 4341 - type Authors = Set<members::authors>; 4342 4361 type Record = S::Record; 4343 - type Uri = S::Uri; 4344 - type IndexedAt = S::IndexedAt; 4345 - } 4346 - ///State transition - sets the `record` field to Set 4347 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 4348 - impl<S: State> sealed::Sealed for SetRecord<S> {} 4349 - impl<S: State> State for SetRecord<S> { 4350 4362 type Cid = S::Cid; 4351 - type Authors = S::Authors; 4352 - type Record = Set<members::record>; 4353 4363 type Uri = S::Uri; 4354 - type IndexedAt = S::IndexedAt; 4355 - } 4356 - ///State transition - sets the `uri` field to Set 4357 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4358 - impl<S: State> sealed::Sealed for SetUri<S> {} 4359 - impl<S: State> State for SetUri<S> { 4360 - type Cid = S::Cid; 4361 - type Authors = S::Authors; 4362 - type Record = S::Record; 4363 - type Uri = Set<members::uri>; 4364 + type Authors = Set<members::authors>; 4364 4365 type IndexedAt = S::IndexedAt; 4365 4366 } 4366 4367 ///State transition - sets the `indexed_at` field to Set 4367 4368 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 4368 4369 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 4369 4370 impl<S: State> State for SetIndexedAt<S> { 4371 + type Record = S::Record; 4370 4372 type Cid = S::Cid; 4373 + type Uri = S::Uri; 4371 4374 type Authors = S::Authors; 4372 - type Record = S::Record; 4373 - type Uri = S::Uri; 4374 4375 type IndexedAt = Set<members::indexed_at>; 4375 4376 } 4376 4377 /// Marker types for field names 4377 4378 #[allow(non_camel_case_types)] 4378 4379 pub mod members { 4379 - ///Marker type for the `cid` field 4380 - pub struct cid(()); 4381 - ///Marker type for the `authors` field 4382 - pub struct authors(()); 4383 4380 ///Marker type for the `record` field 4384 4381 pub struct record(()); 4382 + ///Marker type for the `cid` field 4383 + pub struct cid(()); 4385 4384 ///Marker type for the `uri` field 4386 4385 pub struct uri(()); 4386 + ///Marker type for the `authors` field 4387 + pub struct authors(()); 4387 4388 ///Marker type for the `indexed_at` field 4388 4389 pub struct indexed_at(()); 4389 4390 } ··· 4752 4753 impl<'a, S> NotebookViewBuilder<'a, S> 4753 4754 where 4754 4755 S: notebook_view_state::State, 4755 - S::Cid: notebook_view_state::IsSet, 4756 - S::Authors: notebook_view_state::IsSet, 4757 4756 S::Record: notebook_view_state::IsSet, 4757 + S::Cid: notebook_view_state::IsSet, 4758 4758 S::Uri: notebook_view_state::IsSet, 4759 + S::Authors: notebook_view_state::IsSet, 4759 4760 S::IndexedAt: notebook_view_state::IsSet, 4760 4761 { 4761 4762 /// Build the final struct ··· 4871 4872 } 4872 4873 /// State trait tracking which required fields have been set 4873 4874 pub trait State: sealed::Sealed { 4874 - type IndexedAt; 4875 - type Uri; 4876 4875 type Notebook; 4876 + type Uri; 4877 + type Record; 4877 4878 type Cid; 4878 - type Record; 4879 + type IndexedAt; 4879 4880 } 4880 4881 /// Empty state - all required fields are unset 4881 4882 pub struct Empty(()); 4882 4883 impl sealed::Sealed for Empty {} 4883 4884 impl State for Empty { 4884 - type IndexedAt = Unset; 4885 + type Notebook = Unset; 4885 4886 type Uri = Unset; 4886 - type Notebook = Unset; 4887 - type Cid = Unset; 4888 4887 type Record = Unset; 4888 + type Cid = Unset; 4889 + type IndexedAt = Unset; 4889 4890 } 4890 - ///State transition - sets the `indexed_at` field to Set 4891 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 4892 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 4893 - impl<S: State> State for SetIndexedAt<S> { 4894 - type IndexedAt = Set<members::indexed_at>; 4891 + ///State transition - sets the `notebook` field to Set 4892 + pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 4893 + impl<S: State> sealed::Sealed for SetNotebook<S> {} 4894 + impl<S: State> State for SetNotebook<S> { 4895 + type Notebook = Set<members::notebook>; 4895 4896 type Uri = S::Uri; 4896 - type Notebook = S::Notebook; 4897 + type Record = S::Record; 4897 4898 type Cid = S::Cid; 4898 - type Record = S::Record; 4899 + type IndexedAt = S::IndexedAt; 4899 4900 } 4900 4901 ///State transition - sets the `uri` field to Set 4901 4902 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4902 4903 impl<S: State> sealed::Sealed for SetUri<S> {} 4903 4904 impl<S: State> State for SetUri<S> { 4904 - type IndexedAt = S::IndexedAt; 4905 - type Uri = Set<members::uri>; 4906 4905 type Notebook = S::Notebook; 4907 - type Cid = S::Cid; 4906 + type Uri = Set<members::uri>; 4908 4907 type Record = S::Record; 4909 - } 4910 - ///State transition - sets the `notebook` field to Set 4911 - pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 4912 - impl<S: State> sealed::Sealed for SetNotebook<S> {} 4913 - impl<S: State> State for SetNotebook<S> { 4908 + type Cid = S::Cid; 4914 4909 type IndexedAt = S::IndexedAt; 4910 + } 4911 + ///State transition - sets the `record` field to Set 4912 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 4913 + impl<S: State> sealed::Sealed for SetRecord<S> {} 4914 + impl<S: State> State for SetRecord<S> { 4915 + type Notebook = S::Notebook; 4915 4916 type Uri = S::Uri; 4916 - type Notebook = Set<members::notebook>; 4917 + type Record = Set<members::record>; 4917 4918 type Cid = S::Cid; 4918 - type Record = S::Record; 4919 + type IndexedAt = S::IndexedAt; 4919 4920 } 4920 4921 ///State transition - sets the `cid` field to Set 4921 4922 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 4922 4923 impl<S: State> sealed::Sealed for SetCid<S> {} 4923 4924 impl<S: State> State for SetCid<S> { 4924 - type IndexedAt = S::IndexedAt; 4925 + type Notebook = S::Notebook; 4925 4926 type Uri = S::Uri; 4926 - type Notebook = S::Notebook; 4927 + type Record = S::Record; 4927 4928 type Cid = Set<members::cid>; 4928 - type Record = S::Record; 4929 + type IndexedAt = S::IndexedAt; 4929 4930 } 4930 - ///State transition - sets the `record` field to Set 4931 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 4932 - impl<S: State> sealed::Sealed for SetRecord<S> {} 4933 - impl<S: State> State for SetRecord<S> { 4934 - type IndexedAt = S::IndexedAt; 4931 + ///State transition - sets the `indexed_at` field to Set 4932 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 4933 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 4934 + impl<S: State> State for SetIndexedAt<S> { 4935 + type Notebook = S::Notebook; 4935 4936 type Uri = S::Uri; 4936 - type Notebook = S::Notebook; 4937 + type Record = S::Record; 4937 4938 type Cid = S::Cid; 4938 - type Record = Set<members::record>; 4939 + type IndexedAt = Set<members::indexed_at>; 4939 4940 } 4940 4941 /// Marker types for field names 4941 4942 #[allow(non_camel_case_types)] 4942 4943 pub mod members { 4943 - ///Marker type for the `indexed_at` field 4944 - pub struct indexed_at(()); 4945 - ///Marker type for the `uri` field 4946 - pub struct uri(()); 4947 4944 ///Marker type for the `notebook` field 4948 4945 pub struct notebook(()); 4949 - ///Marker type for the `cid` field 4950 - pub struct cid(()); 4946 + ///Marker type for the `uri` field 4947 + pub struct uri(()); 4951 4948 ///Marker type for the `record` field 4952 4949 pub struct record(()); 4950 + ///Marker type for the `cid` field 4951 + pub struct cid(()); 4952 + ///Marker type for the `indexed_at` field 4953 + pub struct indexed_at(()); 4953 4954 } 4954 4955 } 4955 4956 ··· 5136 5137 impl<'a, S> PageViewBuilder<'a, S> 5137 5138 where 5138 5139 S: page_view_state::State, 5139 - S::IndexedAt: page_view_state::IsSet, 5140 - S::Uri: page_view_state::IsSet, 5141 5140 S::Notebook: page_view_state::IsSet, 5142 - S::Cid: page_view_state::IsSet, 5141 + S::Uri: page_view_state::IsSet, 5143 5142 S::Record: page_view_state::IsSet, 5143 + S::Cid: page_view_state::IsSet, 5144 + S::IndexedAt: page_view_state::IsSet, 5144 5145 { 5145 5146 /// Build the final struct 5146 5147 pub fn build(self) -> PageView<'a> { ··· 5232 5233 } 5233 5234 /// State trait tracking which required fields have been set 5234 5235 pub trait State: sealed::Sealed { 5235 - type Source; 5236 - type Scope; 5237 5236 type GrantedAt; 5237 + type Scope; 5238 5238 type Did; 5239 + type Source; 5239 5240 } 5240 5241 /// Empty state - all required fields are unset 5241 5242 pub struct Empty(()); 5242 5243 impl sealed::Sealed for Empty {} 5243 5244 impl State for Empty { 5244 - type Source = Unset; 5245 - type Scope = Unset; 5246 5245 type GrantedAt = Unset; 5246 + type Scope = Unset; 5247 5247 type Did = Unset; 5248 + type Source = Unset; 5248 5249 } 5249 - ///State transition - sets the `source` field to Set 5250 - pub struct SetSource<S: State = Empty>(PhantomData<fn() -> S>); 5251 - impl<S: State> sealed::Sealed for SetSource<S> {} 5252 - impl<S: State> State for SetSource<S> { 5253 - type Source = Set<members::source>; 5250 + ///State transition - sets the `granted_at` field to Set 5251 + pub struct SetGrantedAt<S: State = Empty>(PhantomData<fn() -> S>); 5252 + impl<S: State> sealed::Sealed for SetGrantedAt<S> {} 5253 + impl<S: State> State for SetGrantedAt<S> { 5254 + type GrantedAt = Set<members::granted_at>; 5254 5255 type Scope = S::Scope; 5255 - type GrantedAt = S::GrantedAt; 5256 5256 type Did = S::Did; 5257 + type Source = S::Source; 5257 5258 } 5258 5259 ///State transition - sets the `scope` field to Set 5259 5260 pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 5260 5261 impl<S: State> sealed::Sealed for SetScope<S> {} 5261 5262 impl<S: State> State for SetScope<S> { 5262 - type Source = S::Source; 5263 - type Scope = Set<members::scope>; 5264 5263 type GrantedAt = S::GrantedAt; 5264 + type Scope = Set<members::scope>; 5265 5265 type Did = S::Did; 5266 - } 5267 - ///State transition - sets the `granted_at` field to Set 5268 - pub struct SetGrantedAt<S: State = Empty>(PhantomData<fn() -> S>); 5269 - impl<S: State> sealed::Sealed for SetGrantedAt<S> {} 5270 - impl<S: State> State for SetGrantedAt<S> { 5271 5266 type Source = S::Source; 5272 - type Scope = S::Scope; 5273 - type GrantedAt = Set<members::granted_at>; 5274 - type Did = S::Did; 5275 5267 } 5276 5268 ///State transition - sets the `did` field to Set 5277 5269 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 5278 5270 impl<S: State> sealed::Sealed for SetDid<S> {} 5279 5271 impl<S: State> State for SetDid<S> { 5272 + type GrantedAt = S::GrantedAt; 5273 + type Scope = S::Scope; 5274 + type Did = Set<members::did>; 5280 5275 type Source = S::Source; 5276 + } 5277 + ///State transition - sets the `source` field to Set 5278 + pub struct SetSource<S: State = Empty>(PhantomData<fn() -> S>); 5279 + impl<S: State> sealed::Sealed for SetSource<S> {} 5280 + impl<S: State> State for SetSource<S> { 5281 + type GrantedAt = S::GrantedAt; 5281 5282 type Scope = S::Scope; 5282 - type GrantedAt = S::GrantedAt; 5283 - type Did = Set<members::did>; 5283 + type Did = S::Did; 5284 + type Source = Set<members::source>; 5284 5285 } 5285 5286 /// Marker types for field names 5286 5287 #[allow(non_camel_case_types)] 5287 5288 pub mod members { 5288 - ///Marker type for the `source` field 5289 - pub struct source(()); 5290 - ///Marker type for the `scope` field 5291 - pub struct scope(()); 5292 5289 ///Marker type for the `granted_at` field 5293 5290 pub struct granted_at(()); 5291 + ///Marker type for the `scope` field 5292 + pub struct scope(()); 5294 5293 ///Marker type for the `did` field 5295 5294 pub struct did(()); 5295 + ///Marker type for the `source` field 5296 + pub struct source(()); 5296 5297 } 5297 5298 } 5298 5299 ··· 5405 5406 impl<'a, S> PermissionGrantBuilder<'a, S> 5406 5407 where 5407 5408 S: permission_grant_state::State, 5408 - S::Source: permission_grant_state::IsSet, 5409 - S::Scope: permission_grant_state::IsSet, 5410 5409 S::GrantedAt: permission_grant_state::IsSet, 5410 + S::Scope: permission_grant_state::IsSet, 5411 5411 S::Did: permission_grant_state::IsSet, 5412 + S::Source: permission_grant_state::IsSet, 5412 5413 { 5413 5414 /// Build the final struct 5414 5415 pub fn build(self) -> PermissionGrant<'a> { ··· 5757 5758 } 5758 5759 /// State trait tracking which required fields have been set 5759 5760 pub trait State: sealed::Sealed { 5761 + type Publisher; 5762 + type PublishedAt; 5760 5763 type Cid; 5761 - type PublishedAt; 5762 5764 type Uri; 5763 - type Publisher; 5764 5765 } 5765 5766 /// Empty state - all required fields are unset 5766 5767 pub struct Empty(()); 5767 5768 impl sealed::Sealed for Empty {} 5768 5769 impl State for Empty { 5770 + type Publisher = Unset; 5771 + type PublishedAt = Unset; 5769 5772 type Cid = Unset; 5770 - type PublishedAt = Unset; 5771 5773 type Uri = Unset; 5772 - type Publisher = Unset; 5773 5774 } 5774 - ///State transition - sets the `cid` field to Set 5775 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 5776 - impl<S: State> sealed::Sealed for SetCid<S> {} 5777 - impl<S: State> State for SetCid<S> { 5778 - type Cid = Set<members::cid>; 5775 + ///State transition - sets the `publisher` field to Set 5776 + pub struct SetPublisher<S: State = Empty>(PhantomData<fn() -> S>); 5777 + impl<S: State> sealed::Sealed for SetPublisher<S> {} 5778 + impl<S: State> State for SetPublisher<S> { 5779 + type Publisher = Set<members::publisher>; 5779 5780 type PublishedAt = S::PublishedAt; 5781 + type Cid = S::Cid; 5780 5782 type Uri = S::Uri; 5781 - type Publisher = S::Publisher; 5782 5783 } 5783 5784 ///State transition - sets the `published_at` field to Set 5784 5785 pub struct SetPublishedAt<S: State = Empty>(PhantomData<fn() -> S>); 5785 5786 impl<S: State> sealed::Sealed for SetPublishedAt<S> {} 5786 5787 impl<S: State> State for SetPublishedAt<S> { 5787 - type Cid = S::Cid; 5788 + type Publisher = S::Publisher; 5788 5789 type PublishedAt = Set<members::published_at>; 5790 + type Cid = S::Cid; 5789 5791 type Uri = S::Uri; 5792 + } 5793 + ///State transition - sets the `cid` field to Set 5794 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 5795 + impl<S: State> sealed::Sealed for SetCid<S> {} 5796 + impl<S: State> State for SetCid<S> { 5790 5797 type Publisher = S::Publisher; 5798 + type PublishedAt = S::PublishedAt; 5799 + type Cid = Set<members::cid>; 5800 + type Uri = S::Uri; 5791 5801 } 5792 5802 ///State transition - sets the `uri` field to Set 5793 5803 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 5794 5804 impl<S: State> sealed::Sealed for SetUri<S> {} 5795 5805 impl<S: State> State for SetUri<S> { 5796 - type Cid = S::Cid; 5806 + type Publisher = S::Publisher; 5797 5807 type PublishedAt = S::PublishedAt; 5808 + type Cid = S::Cid; 5798 5809 type Uri = Set<members::uri>; 5799 - type Publisher = S::Publisher; 5800 - } 5801 - ///State transition - sets the `publisher` field to Set 5802 - pub struct SetPublisher<S: State = Empty>(PhantomData<fn() -> S>); 5803 - impl<S: State> sealed::Sealed for SetPublisher<S> {} 5804 - impl<S: State> State for SetPublisher<S> { 5805 - type Cid = S::Cid; 5806 - type PublishedAt = S::PublishedAt; 5807 - type Uri = S::Uri; 5808 - type Publisher = Set<members::publisher>; 5809 5810 } 5810 5811 /// Marker types for field names 5811 5812 #[allow(non_camel_case_types)] 5812 5813 pub mod members { 5813 - ///Marker type for the `cid` field 5814 - pub struct cid(()); 5814 + ///Marker type for the `publisher` field 5815 + pub struct publisher(()); 5815 5816 ///Marker type for the `published_at` field 5816 5817 pub struct published_at(()); 5818 + ///Marker type for the `cid` field 5819 + pub struct cid(()); 5817 5820 ///Marker type for the `uri` field 5818 5821 pub struct uri(()); 5819 - ///Marker type for the `publisher` field 5820 - pub struct publisher(()); 5821 5822 } 5822 5823 } 5823 5824 ··· 5990 5991 impl<'a, S> PublishedVersionViewBuilder<'a, S> 5991 5992 where 5992 5993 S: published_version_view_state::State, 5993 - S::Cid: published_version_view_state::IsSet, 5994 + S::Publisher: published_version_view_state::IsSet, 5994 5995 S::PublishedAt: published_version_view_state::IsSet, 5996 + S::Cid: published_version_view_state::IsSet, 5995 5997 S::Uri: published_version_view_state::IsSet, 5996 - S::Publisher: published_version_view_state::IsSet, 5997 5998 { 5998 5999 /// Build the final struct 5999 6000 pub fn build(self) -> PublishedVersionView<'a> { ··· 6243 6244 } 6244 6245 /// State trait tracking which required fields have been set 6245 6246 pub trait State: sealed::Sealed { 6246 - type IndexedAt; 6247 6247 type By; 6248 + type IndexedAt; 6248 6249 } 6249 6250 /// Empty state - all required fields are unset 6250 6251 pub struct Empty(()); 6251 6252 impl sealed::Sealed for Empty {} 6252 6253 impl State for Empty { 6254 + type By = Unset; 6253 6255 type IndexedAt = Unset; 6254 - type By = Unset; 6255 - } 6256 - ///State transition - sets the `indexed_at` field to Set 6257 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 6258 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 6259 - impl<S: State> State for SetIndexedAt<S> { 6260 - type IndexedAt = Set<members::indexed_at>; 6261 - type By = S::By; 6262 6256 } 6263 6257 ///State transition - sets the `by` field to Set 6264 6258 pub struct SetBy<S: State = Empty>(PhantomData<fn() -> S>); 6265 6259 impl<S: State> sealed::Sealed for SetBy<S> {} 6266 6260 impl<S: State> State for SetBy<S> { 6267 - type IndexedAt = S::IndexedAt; 6268 6261 type By = Set<members::by>; 6262 + type IndexedAt = S::IndexedAt; 6263 + } 6264 + ///State transition - sets the `indexed_at` field to Set 6265 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 6266 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 6267 + impl<S: State> State for SetIndexedAt<S> { 6268 + type By = S::By; 6269 + type IndexedAt = Set<members::indexed_at>; 6269 6270 } 6270 6271 /// Marker types for field names 6271 6272 #[allow(non_camel_case_types)] 6272 6273 pub mod members { 6274 + ///Marker type for the `by` field 6275 + pub struct by(()); 6273 6276 ///Marker type for the `indexed_at` field 6274 6277 pub struct indexed_at(()); 6275 - ///Marker type for the `by` field 6276 - pub struct by(()); 6277 6278 } 6278 6279 } 6279 6280 ··· 6346 6347 impl<'a, S> ReasonBookmarkBuilder<'a, S> 6347 6348 where 6348 6349 S: reason_bookmark_state::State, 6349 - S::IndexedAt: reason_bookmark_state::IsSet, 6350 6350 S::By: reason_bookmark_state::IsSet, 6351 + S::IndexedAt: reason_bookmark_state::IsSet, 6351 6352 { 6352 6353 /// Build the final struct 6353 6354 pub fn build(self) -> ReasonBookmark<'a> { ··· 6417 6418 } 6418 6419 /// State trait tracking which required fields have been set 6419 6420 pub trait State: sealed::Sealed { 6420 - type IndexedAt; 6421 6421 type By; 6422 + type IndexedAt; 6422 6423 } 6423 6424 /// Empty state - all required fields are unset 6424 6425 pub struct Empty(()); 6425 6426 impl sealed::Sealed for Empty {} 6426 6427 impl State for Empty { 6428 + type By = Unset; 6427 6429 type IndexedAt = Unset; 6428 - type By = Unset; 6430 + } 6431 + ///State transition - sets the `by` field to Set 6432 + pub struct SetBy<S: State = Empty>(PhantomData<fn() -> S>); 6433 + impl<S: State> sealed::Sealed for SetBy<S> {} 6434 + impl<S: State> State for SetBy<S> { 6435 + type By = Set<members::by>; 6436 + type IndexedAt = S::IndexedAt; 6429 6437 } 6430 6438 ///State transition - sets the `indexed_at` field to Set 6431 6439 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 6432 6440 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 6433 6441 impl<S: State> State for SetIndexedAt<S> { 6434 - type IndexedAt = Set<members::indexed_at>; 6435 6442 type By = S::By; 6436 - } 6437 - ///State transition - sets the `by` field to Set 6438 - pub struct SetBy<S: State = Empty>(PhantomData<fn() -> S>); 6439 - impl<S: State> sealed::Sealed for SetBy<S> {} 6440 - impl<S: State> State for SetBy<S> { 6441 - type IndexedAt = S::IndexedAt; 6442 - type By = Set<members::by>; 6443 + type IndexedAt = Set<members::indexed_at>; 6443 6444 } 6444 6445 /// Marker types for field names 6445 6446 #[allow(non_camel_case_types)] 6446 6447 pub mod members { 6448 + ///Marker type for the `by` field 6449 + pub struct by(()); 6447 6450 ///Marker type for the `indexed_at` field 6448 6451 pub struct indexed_at(()); 6449 - ///Marker type for the `by` field 6450 - pub struct by(()); 6451 6452 } 6452 6453 } 6453 6454 ··· 6520 6521 impl<'a, S> ReasonLikeBuilder<'a, S> 6521 6522 where 6522 6523 S: reason_like_state::State, 6523 - S::IndexedAt: reason_like_state::IsSet, 6524 6524 S::By: reason_like_state::IsSet, 6525 + S::IndexedAt: reason_like_state::IsSet, 6525 6526 { 6526 6527 /// Build the final struct 6527 6528 pub fn build(self) -> ReasonLike<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/notebook/chapter.rs
··· 54 54 } 55 55 /// State trait tracking which required fields have been set 56 56 pub trait State: sealed::Sealed { 57 - type EntryList; 58 57 type Notebook; 58 + type EntryList; 59 59 type Authors; 60 60 } 61 61 /// Empty state - all required fields are unset 62 62 pub struct Empty(()); 63 63 impl sealed::Sealed for Empty {} 64 64 impl State for Empty { 65 - type EntryList = Unset; 66 65 type Notebook = Unset; 66 + type EntryList = Unset; 67 67 type Authors = Unset; 68 68 } 69 - ///State transition - sets the `entry_list` field to Set 70 - pub struct SetEntryList<S: State = Empty>(PhantomData<fn() -> S>); 71 - impl<S: State> sealed::Sealed for SetEntryList<S> {} 72 - impl<S: State> State for SetEntryList<S> { 73 - type EntryList = Set<members::entry_list>; 74 - type Notebook = S::Notebook; 75 - type Authors = S::Authors; 76 - } 77 69 ///State transition - sets the `notebook` field to Set 78 70 pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 79 71 impl<S: State> sealed::Sealed for SetNotebook<S> {} 80 72 impl<S: State> State for SetNotebook<S> { 81 - type EntryList = S::EntryList; 82 73 type Notebook = Set<members::notebook>; 74 + type EntryList = S::EntryList; 75 + type Authors = S::Authors; 76 + } 77 + ///State transition - sets the `entry_list` field to Set 78 + pub struct SetEntryList<S: State = Empty>(PhantomData<fn() -> S>); 79 + impl<S: State> sealed::Sealed for SetEntryList<S> {} 80 + impl<S: State> State for SetEntryList<S> { 81 + type Notebook = S::Notebook; 82 + type EntryList = Set<members::entry_list>; 83 83 type Authors = S::Authors; 84 84 } 85 85 ///State transition - sets the `authors` field to Set 86 86 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 87 87 impl<S: State> sealed::Sealed for SetAuthors<S> {} 88 88 impl<S: State> State for SetAuthors<S> { 89 - type EntryList = S::EntryList; 90 89 type Notebook = S::Notebook; 90 + type EntryList = S::EntryList; 91 91 type Authors = Set<members::authors>; 92 92 } 93 93 /// Marker types for field names 94 94 #[allow(non_camel_case_types)] 95 95 pub mod members { 96 + ///Marker type for the `notebook` field 97 + pub struct notebook(()); 96 98 ///Marker type for the `entry_list` field 97 99 pub struct entry_list(()); 98 - ///Marker type for the `notebook` field 99 - pub struct notebook(()); 100 100 ///Marker type for the `authors` field 101 101 pub struct authors(()); 102 102 } ··· 291 291 impl<'a, S> ChapterBuilder<'a, S> 292 292 where 293 293 S: chapter_state::State, 294 - S::EntryList: chapter_state::IsSet, 295 294 S::Notebook: chapter_state::IsSet, 295 + S::EntryList: chapter_state::IsSet, 296 296 S::Authors: chapter_state::IsSet, 297 297 { 298 298 /// Build the final struct
+39 -39
crates/weaver-api/src/sh_weaver/notebook/entry.rs
··· 60 60 } 61 61 /// State trait tracking which required fields have been set 62 62 pub trait State: sealed::Sealed { 63 + type Path; 64 + type Title; 65 + type Content; 63 66 type CreatedAt; 64 - type Content; 65 - type Title; 66 - type Path; 67 67 } 68 68 /// Empty state - all required fields are unset 69 69 pub struct Empty(()); 70 70 impl sealed::Sealed for Empty {} 71 71 impl State for Empty { 72 - type CreatedAt = Unset; 73 - type Content = Unset; 74 - type Title = Unset; 75 72 type Path = Unset; 73 + type Title = Unset; 74 + type Content = Unset; 75 + type CreatedAt = Unset; 76 76 } 77 - ///State transition - sets the `created_at` field to Set 78 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 79 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 80 - impl<S: State> State for SetCreatedAt<S> { 81 - type CreatedAt = Set<members::created_at>; 82 - type Content = S::Content; 77 + ///State transition - sets the `path` field to Set 78 + pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 79 + impl<S: State> sealed::Sealed for SetPath<S> {} 80 + impl<S: State> State for SetPath<S> { 81 + type Path = Set<members::path>; 83 82 type Title = S::Title; 84 - type Path = S::Path; 85 - } 86 - ///State transition - sets the `content` field to Set 87 - pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 88 - impl<S: State> sealed::Sealed for SetContent<S> {} 89 - impl<S: State> State for SetContent<S> { 83 + type Content = S::Content; 90 84 type CreatedAt = S::CreatedAt; 91 - type Content = Set<members::content>; 92 - type Title = S::Title; 93 - type Path = S::Path; 94 85 } 95 86 ///State transition - sets the `title` field to Set 96 87 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 97 88 impl<S: State> sealed::Sealed for SetTitle<S> {} 98 89 impl<S: State> State for SetTitle<S> { 99 - type CreatedAt = S::CreatedAt; 100 - type Content = S::Content; 101 - type Title = Set<members::title>; 102 90 type Path = S::Path; 91 + type Title = Set<members::title>; 92 + type Content = S::Content; 93 + type CreatedAt = S::CreatedAt; 103 94 } 104 - ///State transition - sets the `path` field to Set 105 - pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 106 - impl<S: State> sealed::Sealed for SetPath<S> {} 107 - impl<S: State> State for SetPath<S> { 95 + ///State transition - sets the `content` field to Set 96 + pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 97 + impl<S: State> sealed::Sealed for SetContent<S> {} 98 + impl<S: State> State for SetContent<S> { 99 + type Path = S::Path; 100 + type Title = S::Title; 101 + type Content = Set<members::content>; 108 102 type CreatedAt = S::CreatedAt; 109 - type Content = S::Content; 103 + } 104 + ///State transition - sets the `created_at` field to Set 105 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 106 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 107 + impl<S: State> State for SetCreatedAt<S> { 108 + type Path = S::Path; 110 109 type Title = S::Title; 111 - type Path = Set<members::path>; 110 + type Content = S::Content; 111 + type CreatedAt = Set<members::created_at>; 112 112 } 113 113 /// Marker types for field names 114 114 #[allow(non_camel_case_types)] 115 115 pub mod members { 116 - ///Marker type for the `created_at` field 117 - pub struct created_at(()); 118 - ///Marker type for the `content` field 119 - pub struct content(()); 116 + ///Marker type for the `path` field 117 + pub struct path(()); 120 118 ///Marker type for the `title` field 121 119 pub struct title(()); 122 - ///Marker type for the `path` field 123 - pub struct path(()); 120 + ///Marker type for the `content` field 121 + pub struct content(()); 122 + ///Marker type for the `created_at` field 123 + pub struct created_at(()); 124 124 } 125 125 } 126 126 ··· 358 358 impl<'a, S> EntryBuilder<'a, S> 359 359 where 360 360 S: entry_state::State, 361 - S::CreatedAt: entry_state::IsSet, 362 - S::Content: entry_state::IsSet, 363 - S::Title: entry_state::IsSet, 364 361 S::Path: entry_state::IsSet, 362 + S::Title: entry_state::IsSet, 363 + S::Content: entry_state::IsSet, 364 + S::CreatedAt: entry_state::IsSet, 365 365 { 366 366 /// Build the final struct 367 367 pub fn build(self) -> Entry<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/notebook/get_entry_notebooks.rs
··· 188 188 } 189 189 /// State trait tracking which required fields have been set 190 190 pub trait State: sealed::Sealed { 191 - type Cid; 192 191 type Uri; 192 + type Cid; 193 193 } 194 194 /// Empty state - all required fields are unset 195 195 pub struct Empty(()); 196 196 impl sealed::Sealed for Empty {} 197 197 impl State for Empty { 198 - type Cid = Unset; 199 198 type Uri = Unset; 200 - } 201 - ///State transition - sets the `cid` field to Set 202 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 203 - impl<S: State> sealed::Sealed for SetCid<S> {} 204 - impl<S: State> State for SetCid<S> { 205 - type Cid = Set<members::cid>; 206 - type Uri = S::Uri; 199 + type Cid = Unset; 207 200 } 208 201 ///State transition - sets the `uri` field to Set 209 202 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 210 203 impl<S: State> sealed::Sealed for SetUri<S> {} 211 204 impl<S: State> State for SetUri<S> { 212 - type Cid = S::Cid; 213 205 type Uri = Set<members::uri>; 206 + type Cid = S::Cid; 207 + } 208 + ///State transition - sets the `cid` field to Set 209 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 210 + impl<S: State> sealed::Sealed for SetCid<S> {} 211 + impl<S: State> State for SetCid<S> { 212 + type Uri = S::Uri; 213 + type Cid = Set<members::cid>; 214 214 } 215 215 /// Marker types for field names 216 216 #[allow(non_camel_case_types)] 217 217 pub mod members { 218 - ///Marker type for the `cid` field 219 - pub struct cid(()); 220 218 ///Marker type for the `uri` field 221 219 pub struct uri(()); 220 + ///Marker type for the `cid` field 221 + pub struct cid(()); 222 222 } 223 223 } 224 224 ··· 328 328 impl<'a, S> NotebookRefBuilder<'a, S> 329 329 where 330 330 S: notebook_ref_state::State, 331 - S::Cid: notebook_ref_state::IsSet, 332 331 S::Uri: notebook_ref_state::IsSet, 332 + S::Cid: notebook_ref_state::IsSet, 333 333 { 334 334 /// Build the final struct 335 335 pub fn build(self) -> NotebookRef<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs
··· 32 32 } 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 - type Actor; 36 35 type Title; 36 + type Actor; 37 37 } 38 38 /// Empty state - all required fields are unset 39 39 pub struct Empty(()); 40 40 impl sealed::Sealed for Empty {} 41 41 impl State for Empty { 42 - type Actor = Unset; 43 42 type Title = Unset; 44 - } 45 - ///State transition - sets the `actor` field to Set 46 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetActor<S> {} 48 - impl<S: State> State for SetActor<S> { 49 - type Actor = Set<members::actor>; 50 - type Title = S::Title; 43 + type Actor = Unset; 51 44 } 52 45 ///State transition - sets the `title` field to Set 53 46 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 54 47 impl<S: State> sealed::Sealed for SetTitle<S> {} 55 48 impl<S: State> State for SetTitle<S> { 56 - type Actor = S::Actor; 57 49 type Title = Set<members::title>; 50 + type Actor = S::Actor; 51 + } 52 + ///State transition - sets the `actor` field to Set 53 + pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetActor<S> {} 55 + impl<S: State> State for SetActor<S> { 56 + type Title = S::Title; 57 + type Actor = Set<members::actor>; 58 58 } 59 59 /// Marker types for field names 60 60 #[allow(non_camel_case_types)] 61 61 pub mod members { 62 - ///Marker type for the `actor` field 63 - pub struct actor(()); 64 62 ///Marker type for the `title` field 65 63 pub struct title(()); 64 + ///Marker type for the `actor` field 65 + pub struct actor(()); 66 66 } 67 67 } 68 68 ··· 135 135 impl<'a, S> GetNotebookByTitleBuilder<'a, S> 136 136 where 137 137 S: get_notebook_by_title_state::State, 138 - S::Actor: get_notebook_by_title_state::IsSet, 139 138 S::Title: get_notebook_by_title_state::IsSet, 139 + S::Actor: get_notebook_by_title_state::IsSet, 140 140 { 141 141 /// Build the final struct 142 142 pub fn build(self) -> GetNotebookByTitle<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/notebook/get_reading_history.rs
··· 214 214 } 215 215 /// State trait tracking which required fields have been set 216 216 pub trait State: sealed::Sealed { 217 - type Notebook; 218 217 type Progress; 218 + type Notebook; 219 219 } 220 220 /// Empty state - all required fields are unset 221 221 pub struct Empty(()); 222 222 impl sealed::Sealed for Empty {} 223 223 impl State for Empty { 224 - type Notebook = Unset; 225 224 type Progress = Unset; 226 - } 227 - ///State transition - sets the `notebook` field to Set 228 - pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 229 - impl<S: State> sealed::Sealed for SetNotebook<S> {} 230 - impl<S: State> State for SetNotebook<S> { 231 - type Notebook = Set<members::notebook>; 232 - type Progress = S::Progress; 225 + type Notebook = Unset; 233 226 } 234 227 ///State transition - sets the `progress` field to Set 235 228 pub struct SetProgress<S: State = Empty>(PhantomData<fn() -> S>); 236 229 impl<S: State> sealed::Sealed for SetProgress<S> {} 237 230 impl<S: State> State for SetProgress<S> { 238 - type Notebook = S::Notebook; 239 231 type Progress = Set<members::progress>; 232 + type Notebook = S::Notebook; 233 + } 234 + ///State transition - sets the `notebook` field to Set 235 + pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 236 + impl<S: State> sealed::Sealed for SetNotebook<S> {} 237 + impl<S: State> State for SetNotebook<S> { 238 + type Progress = S::Progress; 239 + type Notebook = Set<members::notebook>; 240 240 } 241 241 /// Marker types for field names 242 242 #[allow(non_camel_case_types)] 243 243 pub mod members { 244 - ///Marker type for the `notebook` field 245 - pub struct notebook(()); 246 244 ///Marker type for the `progress` field 247 245 pub struct progress(()); 246 + ///Marker type for the `notebook` field 247 + pub struct notebook(()); 248 248 } 249 249 } 250 250 ··· 337 337 impl<'a, S> ReadingHistoryItemBuilder<'a, S> 338 338 where 339 339 S: reading_history_item_state::State, 340 - S::Notebook: reading_history_item_state::IsSet, 341 340 S::Progress: reading_history_item_state::IsSet, 341 + S::Notebook: reading_history_item_state::IsSet, 342 342 { 343 343 /// Build the final struct 344 344 pub fn build(self) -> ReadingHistoryItem<'a> {
+24 -24
crates/weaver-api/src/sh_weaver/notebook/page.rs
··· 44 44 } 45 45 /// State trait tracking which required fields have been set 46 46 pub trait State: sealed::Sealed { 47 - type Notebook; 48 - type EntryList; 49 47 type Authors; 48 + type EntryList; 49 + type Notebook; 50 50 } 51 51 /// Empty state - all required fields are unset 52 52 pub struct Empty(()); 53 53 impl sealed::Sealed for Empty {} 54 54 impl State for Empty { 55 + type Authors = Unset; 56 + type EntryList = Unset; 55 57 type Notebook = Unset; 56 - type EntryList = Unset; 57 - type Authors = Unset; 58 58 } 59 - ///State transition - sets the `notebook` field to Set 60 - pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 61 - impl<S: State> sealed::Sealed for SetNotebook<S> {} 62 - impl<S: State> State for SetNotebook<S> { 63 - type Notebook = Set<members::notebook>; 59 + ///State transition - sets the `authors` field to Set 60 + pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 61 + impl<S: State> sealed::Sealed for SetAuthors<S> {} 62 + impl<S: State> State for SetAuthors<S> { 63 + type Authors = Set<members::authors>; 64 64 type EntryList = S::EntryList; 65 - type Authors = S::Authors; 65 + type Notebook = S::Notebook; 66 66 } 67 67 ///State transition - sets the `entry_list` field to Set 68 68 pub struct SetEntryList<S: State = Empty>(PhantomData<fn() -> S>); 69 69 impl<S: State> sealed::Sealed for SetEntryList<S> {} 70 70 impl<S: State> State for SetEntryList<S> { 71 - type Notebook = S::Notebook; 72 - type EntryList = Set<members::entry_list>; 73 71 type Authors = S::Authors; 72 + type EntryList = Set<members::entry_list>; 73 + type Notebook = S::Notebook; 74 74 } 75 - ///State transition - sets the `authors` field to Set 76 - pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 77 - impl<S: State> sealed::Sealed for SetAuthors<S> {} 78 - impl<S: State> State for SetAuthors<S> { 79 - type Notebook = S::Notebook; 75 + ///State transition - sets the `notebook` field to Set 76 + pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetNotebook<S> {} 78 + impl<S: State> State for SetNotebook<S> { 79 + type Authors = S::Authors; 80 80 type EntryList = S::EntryList; 81 - type Authors = Set<members::authors>; 81 + type Notebook = Set<members::notebook>; 82 82 } 83 83 /// Marker types for field names 84 84 #[allow(non_camel_case_types)] 85 85 pub mod members { 86 + ///Marker type for the `authors` field 87 + pub struct authors(()); 88 + ///Marker type for the `entry_list` field 89 + pub struct entry_list(()); 86 90 ///Marker type for the `notebook` field 87 91 pub struct notebook(()); 88 - ///Marker type for the `entry_list` field 89 - pub struct entry_list(()); 90 - ///Marker type for the `authors` field 91 - pub struct authors(()); 92 92 } 93 93 } 94 94 ··· 221 221 impl<'a, S> PageBuilder<'a, S> 222 222 where 223 223 S: page_state::State, 224 - S::Notebook: page_state::IsSet, 225 - S::EntryList: page_state::IsSet, 226 224 S::Authors: page_state::IsSet, 225 + S::EntryList: page_state::IsSet, 226 + S::Notebook: page_state::IsSet, 227 227 { 228 228 /// Build the final struct 229 229 pub fn build(self) -> Page<'a> {
+24 -24
crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Actor; 38 - type Entry; 39 37 type Notebook; 38 + type Entry; 39 + type Actor; 40 40 } 41 41 /// Empty state - all required fields are unset 42 42 pub struct Empty(()); 43 43 impl sealed::Sealed for Empty {} 44 44 impl State for Empty { 45 + type Notebook = Unset; 46 + type Entry = Unset; 45 47 type Actor = Unset; 46 - type Entry = Unset; 47 - type Notebook = Unset; 48 48 } 49 - ///State transition - sets the `actor` field to Set 50 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 51 - impl<S: State> sealed::Sealed for SetActor<S> {} 52 - impl<S: State> State for SetActor<S> { 53 - type Actor = Set<members::actor>; 49 + ///State transition - sets the `notebook` field to Set 50 + pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 51 + impl<S: State> sealed::Sealed for SetNotebook<S> {} 52 + impl<S: State> State for SetNotebook<S> { 53 + type Notebook = Set<members::notebook>; 54 54 type Entry = S::Entry; 55 - type Notebook = S::Notebook; 55 + type Actor = S::Actor; 56 56 } 57 57 ///State transition - sets the `entry` field to Set 58 58 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 59 59 impl<S: State> sealed::Sealed for SetEntry<S> {} 60 60 impl<S: State> State for SetEntry<S> { 61 - type Actor = S::Actor; 62 - type Entry = Set<members::entry>; 63 61 type Notebook = S::Notebook; 62 + type Entry = Set<members::entry>; 63 + type Actor = S::Actor; 64 64 } 65 - ///State transition - sets the `notebook` field to Set 66 - pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 67 - impl<S: State> sealed::Sealed for SetNotebook<S> {} 68 - impl<S: State> State for SetNotebook<S> { 69 - type Actor = S::Actor; 65 + ///State transition - sets the `actor` field to Set 66 + pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 67 + impl<S: State> sealed::Sealed for SetActor<S> {} 68 + impl<S: State> State for SetActor<S> { 69 + type Notebook = S::Notebook; 70 70 type Entry = S::Entry; 71 - type Notebook = Set<members::notebook>; 71 + type Actor = Set<members::actor>; 72 72 } 73 73 /// Marker types for field names 74 74 #[allow(non_camel_case_types)] 75 75 pub mod members { 76 + ///Marker type for the `notebook` field 77 + pub struct notebook(()); 78 + ///Marker type for the `entry` field 79 + pub struct entry(()); 76 80 ///Marker type for the `actor` field 77 81 pub struct actor(()); 78 - ///Marker type for the `entry` field 79 - pub struct entry(()); 80 - ///Marker type for the `notebook` field 81 - pub struct notebook(()); 82 82 } 83 83 } 84 84 ··· 171 171 impl<'a, S> ResolveEntryBuilder<'a, S> 172 172 where 173 173 S: resolve_entry_state::State, 174 - S::Actor: resolve_entry_state::IsSet, 175 - S::Entry: resolve_entry_state::IsSet, 176 174 S::Notebook: resolve_entry_state::IsSet, 175 + S::Entry: resolve_entry_state::IsSet, 176 + S::Actor: resolve_entry_state::IsSet, 177 177 { 178 178 /// Build the final struct 179 179 pub fn build(self) -> ResolveEntry<'a> {
+189
crates/weaver-api/src/sh_weaver/notebook/resolve_global_notebook.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: sh.weaver.notebook.resolveGlobalNotebook 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + #[derive( 9 + serde::Serialize, 10 + serde::Deserialize, 11 + Debug, 12 + Clone, 13 + PartialEq, 14 + Eq, 15 + jacquard_derive::IntoStatic 16 + )] 17 + #[serde(rename_all = "camelCase")] 18 + pub struct ResolveGlobalNotebook<'a> { 19 + #[serde(borrow)] 20 + pub path: jacquard_common::CowStr<'a>, 21 + } 22 + 23 + pub mod resolve_global_notebook_state { 24 + 25 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 26 + #[allow(unused)] 27 + use ::core::marker::PhantomData; 28 + mod sealed { 29 + pub trait Sealed {} 30 + } 31 + /// State trait tracking which required fields have been set 32 + pub trait State: sealed::Sealed { 33 + type Path; 34 + } 35 + /// Empty state - all required fields are unset 36 + pub struct Empty(()); 37 + impl sealed::Sealed for Empty {} 38 + impl State for Empty { 39 + type Path = Unset; 40 + } 41 + ///State transition - sets the `path` field to Set 42 + pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 43 + impl<S: State> sealed::Sealed for SetPath<S> {} 44 + impl<S: State> State for SetPath<S> { 45 + type Path = Set<members::path>; 46 + } 47 + /// Marker types for field names 48 + #[allow(non_camel_case_types)] 49 + pub mod members { 50 + ///Marker type for the `path` field 51 + pub struct path(()); 52 + } 53 + } 54 + 55 + /// Builder for constructing an instance of this type 56 + pub struct ResolveGlobalNotebookBuilder<'a, S: resolve_global_notebook_state::State> { 57 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 58 + __unsafe_private_named: (::core::option::Option<jacquard_common::CowStr<'a>>,), 59 + _phantom: ::core::marker::PhantomData<&'a ()>, 60 + } 61 + 62 + impl<'a> ResolveGlobalNotebook<'a> { 63 + /// Create a new builder for this type 64 + pub fn new() -> ResolveGlobalNotebookBuilder< 65 + 'a, 66 + resolve_global_notebook_state::Empty, 67 + > { 68 + ResolveGlobalNotebookBuilder::new() 69 + } 70 + } 71 + 72 + impl<'a> ResolveGlobalNotebookBuilder<'a, resolve_global_notebook_state::Empty> { 73 + /// Create a new builder with all fields unset 74 + pub fn new() -> Self { 75 + ResolveGlobalNotebookBuilder { 76 + _phantom_state: ::core::marker::PhantomData, 77 + __unsafe_private_named: (None,), 78 + _phantom: ::core::marker::PhantomData, 79 + } 80 + } 81 + } 82 + 83 + impl<'a, S> ResolveGlobalNotebookBuilder<'a, S> 84 + where 85 + S: resolve_global_notebook_state::State, 86 + S::Path: resolve_global_notebook_state::IsUnset, 87 + { 88 + /// Set the `path` field (required) 89 + pub fn path( 90 + mut self, 91 + value: impl Into<jacquard_common::CowStr<'a>>, 92 + ) -> ResolveGlobalNotebookBuilder<'a, resolve_global_notebook_state::SetPath<S>> { 93 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 94 + ResolveGlobalNotebookBuilder { 95 + _phantom_state: ::core::marker::PhantomData, 96 + __unsafe_private_named: self.__unsafe_private_named, 97 + _phantom: ::core::marker::PhantomData, 98 + } 99 + } 100 + } 101 + 102 + impl<'a, S> ResolveGlobalNotebookBuilder<'a, S> 103 + where 104 + S: resolve_global_notebook_state::State, 105 + S::Path: resolve_global_notebook_state::IsSet, 106 + { 107 + /// Build the final struct 108 + pub fn build(self) -> ResolveGlobalNotebook<'a> { 109 + ResolveGlobalNotebook { 110 + path: self.__unsafe_private_named.0.unwrap(), 111 + } 112 + } 113 + } 114 + 115 + #[jacquard_derive::lexicon] 116 + #[derive( 117 + serde::Serialize, 118 + serde::Deserialize, 119 + Debug, 120 + Clone, 121 + PartialEq, 122 + Eq, 123 + jacquard_derive::IntoStatic 124 + )] 125 + #[serde(rename_all = "camelCase")] 126 + pub struct ResolveGlobalNotebookOutput<'a> { 127 + #[serde(borrow)] 128 + pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, 129 + } 130 + 131 + #[jacquard_derive::open_union] 132 + #[derive( 133 + serde::Serialize, 134 + serde::Deserialize, 135 + Debug, 136 + Clone, 137 + PartialEq, 138 + Eq, 139 + thiserror::Error, 140 + miette::Diagnostic, 141 + jacquard_derive::IntoStatic 142 + )] 143 + #[serde(tag = "error", content = "message")] 144 + #[serde(bound(deserialize = "'de: 'a"))] 145 + pub enum ResolveGlobalNotebookError<'a> { 146 + #[serde(rename = "NotFound")] 147 + NotFound(std::option::Option<jacquard_common::CowStr<'a>>), 148 + } 149 + 150 + impl core::fmt::Display for ResolveGlobalNotebookError<'_> { 151 + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 152 + match self { 153 + Self::NotFound(msg) => { 154 + write!(f, "NotFound")?; 155 + if let Some(msg) = msg { 156 + write!(f, ": {}", msg)?; 157 + } 158 + Ok(()) 159 + } 160 + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 161 + } 162 + } 163 + } 164 + 165 + /// Response type for 166 + ///sh.weaver.notebook.resolveGlobalNotebook 167 + pub struct ResolveGlobalNotebookResponse; 168 + impl jacquard_common::xrpc::XrpcResp for ResolveGlobalNotebookResponse { 169 + const NSID: &'static str = "sh.weaver.notebook.resolveGlobalNotebook"; 170 + const ENCODING: &'static str = "application/json"; 171 + type Output<'de> = ResolveGlobalNotebookOutput<'de>; 172 + type Err<'de> = ResolveGlobalNotebookError<'de>; 173 + } 174 + 175 + impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveGlobalNotebook<'a> { 176 + const NSID: &'static str = "sh.weaver.notebook.resolveGlobalNotebook"; 177 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 178 + type Response = ResolveGlobalNotebookResponse; 179 + } 180 + 181 + /// Endpoint type for 182 + ///sh.weaver.notebook.resolveGlobalNotebook 183 + pub struct ResolveGlobalNotebookRequest; 184 + impl jacquard_common::xrpc::XrpcEndpoint for ResolveGlobalNotebookRequest { 185 + const PATH: &'static str = "/xrpc/sh.weaver.notebook.resolveGlobalNotebook"; 186 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 187 + type Request<'de> = ResolveGlobalNotebook<'de>; 188 + type Response = ResolveGlobalNotebookResponse; 189 + }
+13 -13
crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs
··· 38 38 } 39 39 /// State trait tracking which required fields have been set 40 40 pub trait State: sealed::Sealed { 41 - type Name; 42 41 type Actor; 42 + type Name; 43 43 } 44 44 /// Empty state - all required fields are unset 45 45 pub struct Empty(()); 46 46 impl sealed::Sealed for Empty {} 47 47 impl State for Empty { 48 - type Name = Unset; 49 48 type Actor = Unset; 50 - } 51 - ///State transition - sets the `name` field to Set 52 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetName<S> {} 54 - impl<S: State> State for SetName<S> { 55 - type Name = Set<members::name>; 56 - type Actor = S::Actor; 49 + type Name = Unset; 57 50 } 58 51 ///State transition - sets the `actor` field to Set 59 52 pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 60 53 impl<S: State> sealed::Sealed for SetActor<S> {} 61 54 impl<S: State> State for SetActor<S> { 62 - type Name = S::Name; 63 55 type Actor = Set<members::actor>; 56 + type Name = S::Name; 57 + } 58 + ///State transition - sets the `name` field to Set 59 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 60 + impl<S: State> sealed::Sealed for SetName<S> {} 61 + impl<S: State> State for SetName<S> { 62 + type Actor = S::Actor; 63 + type Name = Set<members::name>; 64 64 } 65 65 /// Marker types for field names 66 66 #[allow(non_camel_case_types)] 67 67 pub mod members { 68 - ///Marker type for the `name` field 69 - pub struct name(()); 70 68 ///Marker type for the `actor` field 71 69 pub struct actor(()); 70 + ///Marker type for the `name` field 71 + pub struct name(()); 72 72 } 73 73 } 74 74 ··· 175 175 impl<'a, S> ResolveNotebookBuilder<'a, S> 176 176 where 177 177 S: resolve_notebook_state::State, 178 - S::Name: resolve_notebook_state::IsSet, 179 178 S::Actor: resolve_notebook_state::IsSet, 179 + S::Name: resolve_notebook_state::IsSet, 180 180 { 181 181 /// Build the final struct 182 182 pub fn build(self) -> ResolveNotebook<'a> {
+107 -107
crates/weaver-api/src/sh_weaver/notebook/theme.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Content; 40 39 type Name; 41 40 type Did; 41 + type Content; 42 42 } 43 43 /// Empty state - all required fields are unset 44 44 pub struct Empty(()); 45 45 impl sealed::Sealed for Empty {} 46 46 impl State for Empty { 47 - type Content = Unset; 48 47 type Name = Unset; 49 48 type Did = Unset; 50 - } 51 - ///State transition - sets the `content` field to Set 52 - pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetContent<S> {} 54 - impl<S: State> State for SetContent<S> { 55 - type Content = Set<members::content>; 56 - type Name = S::Name; 57 - type Did = S::Did; 49 + type Content = Unset; 58 50 } 59 51 ///State transition - sets the `name` field to Set 60 52 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 61 53 impl<S: State> sealed::Sealed for SetName<S> {} 62 54 impl<S: State> State for SetName<S> { 63 - type Content = S::Content; 64 55 type Name = Set<members::name>; 65 56 type Did = S::Did; 57 + type Content = S::Content; 66 58 } 67 59 ///State transition - sets the `did` field to Set 68 60 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 69 61 impl<S: State> sealed::Sealed for SetDid<S> {} 70 62 impl<S: State> State for SetDid<S> { 71 - type Content = S::Content; 72 63 type Name = S::Name; 73 64 type Did = Set<members::did>; 65 + type Content = S::Content; 66 + } 67 + ///State transition - sets the `content` field to Set 68 + pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 69 + impl<S: State> sealed::Sealed for SetContent<S> {} 70 + impl<S: State> State for SetContent<S> { 71 + type Name = S::Name; 72 + type Did = S::Did; 73 + type Content = Set<members::content>; 74 74 } 75 75 /// Marker types for field names 76 76 #[allow(non_camel_case_types)] 77 77 pub mod members { 78 - ///Marker type for the `content` field 79 - pub struct content(()); 80 78 ///Marker type for the `name` field 81 79 pub struct name(()); 82 80 ///Marker type for the `did` field 83 81 pub struct did(()); 82 + ///Marker type for the `content` field 83 + pub struct content(()); 84 84 } 85 85 } 86 86 ··· 173 173 impl<'a, S> CodeThemeFileBuilder<'a, S> 174 174 where 175 175 S: code_theme_file_state::State, 176 - S::Content: code_theme_file_state::IsSet, 177 176 S::Name: code_theme_file_state::IsSet, 178 177 S::Did: code_theme_file_state::IsSet, 178 + S::Content: code_theme_file_state::IsSet, 179 179 { 180 180 /// Build the final struct 181 181 pub fn build(self) -> CodeThemeFile<'a> { ··· 838 838 /// State trait tracking which required fields have been set 839 839 pub trait State: sealed::Sealed { 840 840 type Content; 841 - type Did; 842 841 type Name; 842 + type Did; 843 843 } 844 844 /// Empty state - all required fields are unset 845 845 pub struct Empty(()); 846 846 impl sealed::Sealed for Empty {} 847 847 impl State for Empty { 848 848 type Content = Unset; 849 + type Name = Unset; 849 850 type Did = Unset; 850 - type Name = Unset; 851 851 } 852 852 ///State transition - sets the `content` field to Set 853 853 pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 854 854 impl<S: State> sealed::Sealed for SetContent<S> {} 855 855 impl<S: State> State for SetContent<S> { 856 856 type Content = Set<members::content>; 857 - type Did = S::Did; 858 857 type Name = S::Name; 858 + type Did = S::Did; 859 + } 860 + ///State transition - sets the `name` field to Set 861 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 862 + impl<S: State> sealed::Sealed for SetName<S> {} 863 + impl<S: State> State for SetName<S> { 864 + type Content = S::Content; 865 + type Name = Set<members::name>; 866 + type Did = S::Did; 859 867 } 860 868 ///State transition - sets the `did` field to Set 861 869 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 862 870 impl<S: State> sealed::Sealed for SetDid<S> {} 863 871 impl<S: State> State for SetDid<S> { 864 872 type Content = S::Content; 865 - type Did = Set<members::did>; 866 873 type Name = S::Name; 867 - } 868 - ///State transition - sets the `name` field to Set 869 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 870 - impl<S: State> sealed::Sealed for SetName<S> {} 871 - impl<S: State> State for SetName<S> { 872 - type Content = S::Content; 873 - type Did = S::Did; 874 - type Name = Set<members::name>; 874 + type Did = Set<members::did>; 875 875 } 876 876 /// Marker types for field names 877 877 #[allow(non_camel_case_types)] 878 878 pub mod members { 879 879 ///Marker type for the `content` field 880 880 pub struct content(()); 881 + ///Marker type for the `name` field 882 + pub struct name(()); 881 883 ///Marker type for the `did` field 882 884 pub struct did(()); 883 - ///Marker type for the `name` field 884 - pub struct name(()); 885 885 } 886 886 } 887 887 ··· 975 975 where 976 976 S: font_file_state::State, 977 977 S::Content: font_file_state::IsSet, 978 - S::Did: font_file_state::IsSet, 979 978 S::Name: font_file_state::IsSet, 979 + S::Did: font_file_state::IsSet, 980 980 { 981 981 /// Build the final struct 982 982 pub fn build(self) -> FontFile<'a> { ··· 1067 1067 } 1068 1068 /// State trait tracking which required fields have been set 1069 1069 pub trait State: sealed::Sealed { 1070 - type LightScheme; 1071 - type Spacing; 1072 - type LightCodeTheme; 1073 1070 type DarkScheme; 1074 1071 type DarkCodeTheme; 1072 + type Spacing; 1073 + type LightScheme; 1075 1074 type Fonts; 1075 + type LightCodeTheme; 1076 1076 } 1077 1077 /// Empty state - all required fields are unset 1078 1078 pub struct Empty(()); 1079 1079 impl sealed::Sealed for Empty {} 1080 1080 impl State for Empty { 1081 - type LightScheme = Unset; 1082 - type Spacing = Unset; 1083 - type LightCodeTheme = Unset; 1084 1081 type DarkScheme = Unset; 1085 1082 type DarkCodeTheme = Unset; 1083 + type Spacing = Unset; 1084 + type LightScheme = Unset; 1086 1085 type Fonts = Unset; 1086 + type LightCodeTheme = Unset; 1087 1087 } 1088 - ///State transition - sets the `light_scheme` field to Set 1089 - pub struct SetLightScheme<S: State = Empty>(PhantomData<fn() -> S>); 1090 - impl<S: State> sealed::Sealed for SetLightScheme<S> {} 1091 - impl<S: State> State for SetLightScheme<S> { 1092 - type LightScheme = Set<members::light_scheme>; 1088 + ///State transition - sets the `dark_scheme` field to Set 1089 + pub struct SetDarkScheme<S: State = Empty>(PhantomData<fn() -> S>); 1090 + impl<S: State> sealed::Sealed for SetDarkScheme<S> {} 1091 + impl<S: State> State for SetDarkScheme<S> { 1092 + type DarkScheme = Set<members::dark_scheme>; 1093 + type DarkCodeTheme = S::DarkCodeTheme; 1093 1094 type Spacing = S::Spacing; 1095 + type LightScheme = S::LightScheme; 1096 + type Fonts = S::Fonts; 1094 1097 type LightCodeTheme = S::LightCodeTheme; 1098 + } 1099 + ///State transition - sets the `dark_code_theme` field to Set 1100 + pub struct SetDarkCodeTheme<S: State = Empty>(PhantomData<fn() -> S>); 1101 + impl<S: State> sealed::Sealed for SetDarkCodeTheme<S> {} 1102 + impl<S: State> State for SetDarkCodeTheme<S> { 1095 1103 type DarkScheme = S::DarkScheme; 1096 - type DarkCodeTheme = S::DarkCodeTheme; 1104 + type DarkCodeTheme = Set<members::dark_code_theme>; 1105 + type Spacing = S::Spacing; 1106 + type LightScheme = S::LightScheme; 1097 1107 type Fonts = S::Fonts; 1108 + type LightCodeTheme = S::LightCodeTheme; 1098 1109 } 1099 1110 ///State transition - sets the `spacing` field to Set 1100 1111 pub struct SetSpacing<S: State = Empty>(PhantomData<fn() -> S>); 1101 1112 impl<S: State> sealed::Sealed for SetSpacing<S> {} 1102 1113 impl<S: State> State for SetSpacing<S> { 1103 - type LightScheme = S::LightScheme; 1104 - type Spacing = Set<members::spacing>; 1105 - type LightCodeTheme = S::LightCodeTheme; 1106 1114 type DarkScheme = S::DarkScheme; 1107 1115 type DarkCodeTheme = S::DarkCodeTheme; 1116 + type Spacing = Set<members::spacing>; 1117 + type LightScheme = S::LightScheme; 1108 1118 type Fonts = S::Fonts; 1119 + type LightCodeTheme = S::LightCodeTheme; 1109 1120 } 1110 - ///State transition - sets the `light_code_theme` field to Set 1111 - pub struct SetLightCodeTheme<S: State = Empty>(PhantomData<fn() -> S>); 1112 - impl<S: State> sealed::Sealed for SetLightCodeTheme<S> {} 1113 - impl<S: State> State for SetLightCodeTheme<S> { 1114 - type LightScheme = S::LightScheme; 1115 - type Spacing = S::Spacing; 1116 - type LightCodeTheme = Set<members::light_code_theme>; 1121 + ///State transition - sets the `light_scheme` field to Set 1122 + pub struct SetLightScheme<S: State = Empty>(PhantomData<fn() -> S>); 1123 + impl<S: State> sealed::Sealed for SetLightScheme<S> {} 1124 + impl<S: State> State for SetLightScheme<S> { 1117 1125 type DarkScheme = S::DarkScheme; 1118 1126 type DarkCodeTheme = S::DarkCodeTheme; 1119 - type Fonts = S::Fonts; 1120 - } 1121 - ///State transition - sets the `dark_scheme` field to Set 1122 - pub struct SetDarkScheme<S: State = Empty>(PhantomData<fn() -> S>); 1123 - impl<S: State> sealed::Sealed for SetDarkScheme<S> {} 1124 - impl<S: State> State for SetDarkScheme<S> { 1125 - type LightScheme = S::LightScheme; 1126 1127 type Spacing = S::Spacing; 1127 - type LightCodeTheme = S::LightCodeTheme; 1128 - type DarkScheme = Set<members::dark_scheme>; 1129 - type DarkCodeTheme = S::DarkCodeTheme; 1128 + type LightScheme = Set<members::light_scheme>; 1130 1129 type Fonts = S::Fonts; 1131 - } 1132 - ///State transition - sets the `dark_code_theme` field to Set 1133 - pub struct SetDarkCodeTheme<S: State = Empty>(PhantomData<fn() -> S>); 1134 - impl<S: State> sealed::Sealed for SetDarkCodeTheme<S> {} 1135 - impl<S: State> State for SetDarkCodeTheme<S> { 1136 - type LightScheme = S::LightScheme; 1137 - type Spacing = S::Spacing; 1138 1130 type LightCodeTheme = S::LightCodeTheme; 1139 - type DarkScheme = S::DarkScheme; 1140 - type DarkCodeTheme = Set<members::dark_code_theme>; 1141 - type Fonts = S::Fonts; 1142 1131 } 1143 1132 ///State transition - sets the `fonts` field to Set 1144 1133 pub struct SetFonts<S: State = Empty>(PhantomData<fn() -> S>); 1145 1134 impl<S: State> sealed::Sealed for SetFonts<S> {} 1146 1135 impl<S: State> State for SetFonts<S> { 1147 - type LightScheme = S::LightScheme; 1136 + type DarkScheme = S::DarkScheme; 1137 + type DarkCodeTheme = S::DarkCodeTheme; 1148 1138 type Spacing = S::Spacing; 1139 + type LightScheme = S::LightScheme; 1140 + type Fonts = Set<members::fonts>; 1149 1141 type LightCodeTheme = S::LightCodeTheme; 1142 + } 1143 + ///State transition - sets the `light_code_theme` field to Set 1144 + pub struct SetLightCodeTheme<S: State = Empty>(PhantomData<fn() -> S>); 1145 + impl<S: State> sealed::Sealed for SetLightCodeTheme<S> {} 1146 + impl<S: State> State for SetLightCodeTheme<S> { 1150 1147 type DarkScheme = S::DarkScheme; 1151 1148 type DarkCodeTheme = S::DarkCodeTheme; 1152 - type Fonts = Set<members::fonts>; 1149 + type Spacing = S::Spacing; 1150 + type LightScheme = S::LightScheme; 1151 + type Fonts = S::Fonts; 1152 + type LightCodeTheme = Set<members::light_code_theme>; 1153 1153 } 1154 1154 /// Marker types for field names 1155 1155 #[allow(non_camel_case_types)] 1156 1156 pub mod members { 1157 - ///Marker type for the `light_scheme` field 1158 - pub struct light_scheme(()); 1159 - ///Marker type for the `spacing` field 1160 - pub struct spacing(()); 1161 - ///Marker type for the `light_code_theme` field 1162 - pub struct light_code_theme(()); 1163 1157 ///Marker type for the `dark_scheme` field 1164 1158 pub struct dark_scheme(()); 1165 1159 ///Marker type for the `dark_code_theme` field 1166 1160 pub struct dark_code_theme(()); 1161 + ///Marker type for the `spacing` field 1162 + pub struct spacing(()); 1163 + ///Marker type for the `light_scheme` field 1164 + pub struct light_scheme(()); 1167 1165 ///Marker type for the `fonts` field 1168 1166 pub struct fonts(()); 1167 + ///Marker type for the `light_code_theme` field 1168 + pub struct light_code_theme(()); 1169 1169 } 1170 1170 } 1171 1171 ··· 1338 1338 impl<'a, S> ThemeBuilder<'a, S> 1339 1339 where 1340 1340 S: theme_state::State, 1341 - S::LightScheme: theme_state::IsSet, 1342 - S::Spacing: theme_state::IsSet, 1343 - S::LightCodeTheme: theme_state::IsSet, 1344 1341 S::DarkScheme: theme_state::IsSet, 1345 1342 S::DarkCodeTheme: theme_state::IsSet, 1343 + S::Spacing: theme_state::IsSet, 1344 + S::LightScheme: theme_state::IsSet, 1346 1345 S::Fonts: theme_state::IsSet, 1346 + S::LightCodeTheme: theme_state::IsSet, 1347 1347 { 1348 1348 /// Build the final struct 1349 1349 pub fn build(self) -> Theme<'a> { ··· 1442 1442 } 1443 1443 /// State trait tracking which required fields have been set 1444 1444 pub trait State: sealed::Sealed { 1445 - type Body; 1446 - type Heading; 1447 1445 type Monospace; 1446 + type Heading; 1447 + type Body; 1448 1448 } 1449 1449 /// Empty state - all required fields are unset 1450 1450 pub struct Empty(()); 1451 1451 impl sealed::Sealed for Empty {} 1452 1452 impl State for Empty { 1453 + type Monospace = Unset; 1454 + type Heading = Unset; 1453 1455 type Body = Unset; 1454 - type Heading = Unset; 1455 - type Monospace = Unset; 1456 1456 } 1457 - ///State transition - sets the `body` field to Set 1458 - pub struct SetBody<S: State = Empty>(PhantomData<fn() -> S>); 1459 - impl<S: State> sealed::Sealed for SetBody<S> {} 1460 - impl<S: State> State for SetBody<S> { 1461 - type Body = Set<members::body>; 1457 + ///State transition - sets the `monospace` field to Set 1458 + pub struct SetMonospace<S: State = Empty>(PhantomData<fn() -> S>); 1459 + impl<S: State> sealed::Sealed for SetMonospace<S> {} 1460 + impl<S: State> State for SetMonospace<S> { 1461 + type Monospace = Set<members::monospace>; 1462 1462 type Heading = S::Heading; 1463 - type Monospace = S::Monospace; 1463 + type Body = S::Body; 1464 1464 } 1465 1465 ///State transition - sets the `heading` field to Set 1466 1466 pub struct SetHeading<S: State = Empty>(PhantomData<fn() -> S>); 1467 1467 impl<S: State> sealed::Sealed for SetHeading<S> {} 1468 1468 impl<S: State> State for SetHeading<S> { 1469 + type Monospace = S::Monospace; 1470 + type Heading = Set<members::heading>; 1469 1471 type Body = S::Body; 1470 - type Heading = Set<members::heading>; 1471 - type Monospace = S::Monospace; 1472 1472 } 1473 - ///State transition - sets the `monospace` field to Set 1474 - pub struct SetMonospace<S: State = Empty>(PhantomData<fn() -> S>); 1475 - impl<S: State> sealed::Sealed for SetMonospace<S> {} 1476 - impl<S: State> State for SetMonospace<S> { 1477 - type Body = S::Body; 1473 + ///State transition - sets the `body` field to Set 1474 + pub struct SetBody<S: State = Empty>(PhantomData<fn() -> S>); 1475 + impl<S: State> sealed::Sealed for SetBody<S> {} 1476 + impl<S: State> State for SetBody<S> { 1477 + type Monospace = S::Monospace; 1478 1478 type Heading = S::Heading; 1479 - type Monospace = Set<members::monospace>; 1479 + type Body = Set<members::body>; 1480 1480 } 1481 1481 /// Marker types for field names 1482 1482 #[allow(non_camel_case_types)] 1483 1483 pub mod members { 1484 + ///Marker type for the `monospace` field 1485 + pub struct monospace(()); 1486 + ///Marker type for the `heading` field 1487 + pub struct heading(()); 1484 1488 ///Marker type for the `body` field 1485 1489 pub struct body(()); 1486 - ///Marker type for the `heading` field 1487 - pub struct heading(()); 1488 - ///Marker type for the `monospace` field 1489 - pub struct monospace(()); 1490 1490 } 1491 1491 } 1492 1492 ··· 1579 1579 impl<'a, S> ThemeFontsBuilder<'a, S> 1580 1580 where 1581 1581 S: theme_fonts_state::State, 1582 - S::Body: theme_fonts_state::IsSet, 1583 - S::Heading: theme_fonts_state::IsSet, 1584 1582 S::Monospace: theme_fonts_state::IsSet, 1583 + S::Heading: theme_fonts_state::IsSet, 1584 + S::Body: theme_fonts_state::IsSet, 1585 1585 { 1586 1586 /// Build the final struct 1587 1587 pub fn build(self) -> ThemeFonts<'a> {
+111 -111
crates/weaver-api/src/sh_weaver/notification.rs
··· 52 52 } 53 53 /// State trait tracking which required fields have been set 54 54 pub trait State: sealed::Sealed { 55 + type Reason; 56 + type Uri; 55 57 type Cid; 58 + type Author; 56 59 type IndexedAt; 57 60 type IsRead; 58 - type Author; 59 - type Reason; 60 - type Uri; 61 61 } 62 62 /// Empty state - all required fields are unset 63 63 pub struct Empty(()); 64 64 impl sealed::Sealed for Empty {} 65 65 impl State for Empty { 66 + type Reason = Unset; 67 + type Uri = Unset; 66 68 type Cid = Unset; 69 + type Author = Unset; 67 70 type IndexedAt = Unset; 68 71 type IsRead = Unset; 69 - type Author = Unset; 70 - type Reason = Unset; 71 - type Uri = Unset; 72 + } 73 + ///State transition - sets the `reason` field to Set 74 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 75 + impl<S: State> sealed::Sealed for SetReason<S> {} 76 + impl<S: State> State for SetReason<S> { 77 + type Reason = Set<members::reason>; 78 + type Uri = S::Uri; 79 + type Cid = S::Cid; 80 + type Author = S::Author; 81 + type IndexedAt = S::IndexedAt; 82 + type IsRead = S::IsRead; 83 + } 84 + ///State transition - sets the `uri` field to Set 85 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 86 + impl<S: State> sealed::Sealed for SetUri<S> {} 87 + impl<S: State> State for SetUri<S> { 88 + type Reason = S::Reason; 89 + type Uri = Set<members::uri>; 90 + type Cid = S::Cid; 91 + type Author = S::Author; 92 + type IndexedAt = S::IndexedAt; 93 + type IsRead = S::IsRead; 72 94 } 73 95 ///State transition - sets the `cid` field to Set 74 96 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 75 97 impl<S: State> sealed::Sealed for SetCid<S> {} 76 98 impl<S: State> State for SetCid<S> { 99 + type Reason = S::Reason; 100 + type Uri = S::Uri; 77 101 type Cid = Set<members::cid>; 102 + type Author = S::Author; 78 103 type IndexedAt = S::IndexedAt; 79 104 type IsRead = S::IsRead; 80 - type Author = S::Author; 105 + } 106 + ///State transition - sets the `author` field to Set 107 + pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 108 + impl<S: State> sealed::Sealed for SetAuthor<S> {} 109 + impl<S: State> State for SetAuthor<S> { 81 110 type Reason = S::Reason; 82 111 type Uri = S::Uri; 112 + type Cid = S::Cid; 113 + type Author = Set<members::author>; 114 + type IndexedAt = S::IndexedAt; 115 + type IsRead = S::IsRead; 83 116 } 84 117 ///State transition - sets the `indexed_at` field to Set 85 118 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 86 119 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 87 120 impl<S: State> State for SetIndexedAt<S> { 121 + type Reason = S::Reason; 122 + type Uri = S::Uri; 88 123 type Cid = S::Cid; 124 + type Author = S::Author; 89 125 type IndexedAt = Set<members::indexed_at>; 90 126 type IsRead = S::IsRead; 91 - type Author = S::Author; 92 - type Reason = S::Reason; 93 - type Uri = S::Uri; 94 127 } 95 128 ///State transition - sets the `is_read` field to Set 96 129 pub struct SetIsRead<S: State = Empty>(PhantomData<fn() -> S>); 97 130 impl<S: State> sealed::Sealed for SetIsRead<S> {} 98 131 impl<S: State> State for SetIsRead<S> { 99 - type Cid = S::Cid; 100 - type IndexedAt = S::IndexedAt; 101 - type IsRead = Set<members::is_read>; 102 - type Author = S::Author; 103 132 type Reason = S::Reason; 104 133 type Uri = S::Uri; 105 - } 106 - ///State transition - sets the `author` field to Set 107 - pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 108 - impl<S: State> sealed::Sealed for SetAuthor<S> {} 109 - impl<S: State> State for SetAuthor<S> { 110 134 type Cid = S::Cid; 111 - type IndexedAt = S::IndexedAt; 112 - type IsRead = S::IsRead; 113 - type Author = Set<members::author>; 114 - type Reason = S::Reason; 115 - type Uri = S::Uri; 116 - } 117 - ///State transition - sets the `reason` field to Set 118 - pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 119 - impl<S: State> sealed::Sealed for SetReason<S> {} 120 - impl<S: State> State for SetReason<S> { 121 - type Cid = S::Cid; 122 - type IndexedAt = S::IndexedAt; 123 - type IsRead = S::IsRead; 124 135 type Author = S::Author; 125 - type Reason = Set<members::reason>; 126 - type Uri = S::Uri; 127 - } 128 - ///State transition - sets the `uri` field to Set 129 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 130 - impl<S: State> sealed::Sealed for SetUri<S> {} 131 - impl<S: State> State for SetUri<S> { 132 - type Cid = S::Cid; 133 136 type IndexedAt = S::IndexedAt; 134 - type IsRead = S::IsRead; 135 - type Author = S::Author; 136 - type Reason = S::Reason; 137 - type Uri = Set<members::uri>; 137 + type IsRead = Set<members::is_read>; 138 138 } 139 139 /// Marker types for field names 140 140 #[allow(non_camel_case_types)] 141 141 pub mod members { 142 + ///Marker type for the `reason` field 143 + pub struct reason(()); 144 + ///Marker type for the `uri` field 145 + pub struct uri(()); 142 146 ///Marker type for the `cid` field 143 147 pub struct cid(()); 148 + ///Marker type for the `author` field 149 + pub struct author(()); 144 150 ///Marker type for the `indexed_at` field 145 151 pub struct indexed_at(()); 146 152 ///Marker type for the `is_read` field 147 153 pub struct is_read(()); 148 - ///Marker type for the `author` field 149 - pub struct author(()); 150 - ///Marker type for the `reason` field 151 - pub struct reason(()); 152 - ///Marker type for the `uri` field 153 - pub struct uri(()); 154 154 } 155 155 } 156 156 ··· 343 343 impl<'a, S> NotificationBuilder<'a, S> 344 344 where 345 345 S: notification_state::State, 346 + S::Reason: notification_state::IsSet, 347 + S::Uri: notification_state::IsSet, 346 348 S::Cid: notification_state::IsSet, 349 + S::Author: notification_state::IsSet, 347 350 S::IndexedAt: notification_state::IsSet, 348 351 S::IsRead: notification_state::IsSet, 349 - S::Author: notification_state::IsSet, 350 - S::Reason: notification_state::IsSet, 351 - S::Uri: notification_state::IsSet, 352 352 { 353 353 /// Build the final struct 354 354 pub fn build(self) -> Notification<'a> { ··· 801 801 } 802 802 /// State trait tracking which required fields have been set 803 803 pub trait State: sealed::Sealed { 804 - type Reason; 804 + type Subject; 805 805 type Actors; 806 - type Subject; 807 - type Count; 808 806 type MostRecentAt; 807 + type Reason; 808 + type Count; 809 809 } 810 810 /// Empty state - all required fields are unset 811 811 pub struct Empty(()); 812 812 impl sealed::Sealed for Empty {} 813 813 impl State for Empty { 814 + type Subject = Unset; 815 + type Actors = Unset; 816 + type MostRecentAt = Unset; 814 817 type Reason = Unset; 815 - type Actors = Unset; 816 - type Subject = Unset; 817 818 type Count = Unset; 818 - type MostRecentAt = Unset; 819 819 } 820 - ///State transition - sets the `reason` field to Set 821 - pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 822 - impl<S: State> sealed::Sealed for SetReason<S> {} 823 - impl<S: State> State for SetReason<S> { 824 - type Reason = Set<members::reason>; 820 + ///State transition - sets the `subject` field to Set 821 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 822 + impl<S: State> sealed::Sealed for SetSubject<S> {} 823 + impl<S: State> State for SetSubject<S> { 824 + type Subject = Set<members::subject>; 825 825 type Actors = S::Actors; 826 - type Subject = S::Subject; 826 + type MostRecentAt = S::MostRecentAt; 827 + type Reason = S::Reason; 827 828 type Count = S::Count; 828 - type MostRecentAt = S::MostRecentAt; 829 829 } 830 830 ///State transition - sets the `actors` field to Set 831 831 pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>); 832 832 impl<S: State> sealed::Sealed for SetActors<S> {} 833 833 impl<S: State> State for SetActors<S> { 834 - type Reason = S::Reason; 835 - type Actors = Set<members::actors>; 836 834 type Subject = S::Subject; 837 - type Count = S::Count; 835 + type Actors = Set<members::actors>; 838 836 type MostRecentAt = S::MostRecentAt; 839 - } 840 - ///State transition - sets the `subject` field to Set 841 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 842 - impl<S: State> sealed::Sealed for SetSubject<S> {} 843 - impl<S: State> State for SetSubject<S> { 844 837 type Reason = S::Reason; 838 + type Count = S::Count; 839 + } 840 + ///State transition - sets the `most_recent_at` field to Set 841 + pub struct SetMostRecentAt<S: State = Empty>(PhantomData<fn() -> S>); 842 + impl<S: State> sealed::Sealed for SetMostRecentAt<S> {} 843 + impl<S: State> State for SetMostRecentAt<S> { 844 + type Subject = S::Subject; 845 845 type Actors = S::Actors; 846 - type Subject = Set<members::subject>; 846 + type MostRecentAt = Set<members::most_recent_at>; 847 + type Reason = S::Reason; 847 848 type Count = S::Count; 849 + } 850 + ///State transition - sets the `reason` field to Set 851 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 852 + impl<S: State> sealed::Sealed for SetReason<S> {} 853 + impl<S: State> State for SetReason<S> { 854 + type Subject = S::Subject; 855 + type Actors = S::Actors; 848 856 type MostRecentAt = S::MostRecentAt; 857 + type Reason = Set<members::reason>; 858 + type Count = S::Count; 849 859 } 850 860 ///State transition - sets the `count` field to Set 851 861 pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 852 862 impl<S: State> sealed::Sealed for SetCount<S> {} 853 863 impl<S: State> State for SetCount<S> { 854 - type Reason = S::Reason; 855 - type Actors = S::Actors; 856 864 type Subject = S::Subject; 857 - type Count = Set<members::count>; 865 + type Actors = S::Actors; 858 866 type MostRecentAt = S::MostRecentAt; 859 - } 860 - ///State transition - sets the `most_recent_at` field to Set 861 - pub struct SetMostRecentAt<S: State = Empty>(PhantomData<fn() -> S>); 862 - impl<S: State> sealed::Sealed for SetMostRecentAt<S> {} 863 - impl<S: State> State for SetMostRecentAt<S> { 864 867 type Reason = S::Reason; 865 - type Actors = S::Actors; 866 - type Subject = S::Subject; 867 - type Count = S::Count; 868 - type MostRecentAt = Set<members::most_recent_at>; 868 + type Count = Set<members::count>; 869 869 } 870 870 /// Marker types for field names 871 871 #[allow(non_camel_case_types)] 872 872 pub mod members { 873 + ///Marker type for the `subject` field 874 + pub struct subject(()); 875 + ///Marker type for the `actors` field 876 + pub struct actors(()); 877 + ///Marker type for the `most_recent_at` field 878 + pub struct most_recent_at(()); 873 879 ///Marker type for the `reason` field 874 880 pub struct reason(()); 875 - ///Marker type for the `actors` field 876 - pub struct actors(()); 877 - ///Marker type for the `subject` field 878 - pub struct subject(()); 879 881 ///Marker type for the `count` field 880 882 pub struct count(()); 881 - ///Marker type for the `most_recent_at` field 882 - pub struct most_recent_at(()); 883 883 } 884 884 } 885 885 ··· 1026 1026 impl<'a, S> NotificationGroupBuilder<'a, S> 1027 1027 where 1028 1028 S: notification_group_state::State, 1029 - S::Reason: notification_group_state::IsSet, 1030 - S::Actors: notification_group_state::IsSet, 1031 1029 S::Subject: notification_group_state::IsSet, 1032 - S::Count: notification_group_state::IsSet, 1030 + S::Actors: notification_group_state::IsSet, 1033 1031 S::MostRecentAt: notification_group_state::IsSet, 1032 + S::Reason: notification_group_state::IsSet, 1033 + S::Count: notification_group_state::IsSet, 1034 1034 { 1035 1035 /// Build the final struct 1036 1036 pub fn build(self) -> NotificationGroup<'a> { ··· 1293 1293 /// State trait tracking which required fields have been set 1294 1294 pub trait State: sealed::Sealed { 1295 1295 type NewEntries; 1296 - type Notebook; 1297 1296 type UpdatedAt; 1297 + type Notebook; 1298 1298 } 1299 1299 /// Empty state - all required fields are unset 1300 1300 pub struct Empty(()); 1301 1301 impl sealed::Sealed for Empty {} 1302 1302 impl State for Empty { 1303 1303 type NewEntries = Unset; 1304 + type UpdatedAt = Unset; 1304 1305 type Notebook = Unset; 1305 - type UpdatedAt = Unset; 1306 1306 } 1307 1307 ///State transition - sets the `new_entries` field to Set 1308 1308 pub struct SetNewEntries<S: State = Empty>(PhantomData<fn() -> S>); 1309 1309 impl<S: State> sealed::Sealed for SetNewEntries<S> {} 1310 1310 impl<S: State> State for SetNewEntries<S> { 1311 1311 type NewEntries = Set<members::new_entries>; 1312 + type UpdatedAt = S::UpdatedAt; 1312 1313 type Notebook = S::Notebook; 1313 - type UpdatedAt = S::UpdatedAt; 1314 + } 1315 + ///State transition - sets the `updated_at` field to Set 1316 + pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1317 + impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 1318 + impl<S: State> State for SetUpdatedAt<S> { 1319 + type NewEntries = S::NewEntries; 1320 + type UpdatedAt = Set<members::updated_at>; 1321 + type Notebook = S::Notebook; 1314 1322 } 1315 1323 ///State transition - sets the `notebook` field to Set 1316 1324 pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 1317 1325 impl<S: State> sealed::Sealed for SetNotebook<S> {} 1318 1326 impl<S: State> State for SetNotebook<S> { 1319 1327 type NewEntries = S::NewEntries; 1320 - type Notebook = Set<members::notebook>; 1321 1328 type UpdatedAt = S::UpdatedAt; 1322 - } 1323 - ///State transition - sets the `updated_at` field to Set 1324 - pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1325 - impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 1326 - impl<S: State> State for SetUpdatedAt<S> { 1327 - type NewEntries = S::NewEntries; 1328 - type Notebook = S::Notebook; 1329 - type UpdatedAt = Set<members::updated_at>; 1329 + type Notebook = Set<members::notebook>; 1330 1330 } 1331 1331 /// Marker types for field names 1332 1332 #[allow(non_camel_case_types)] 1333 1333 pub mod members { 1334 1334 ///Marker type for the `new_entries` field 1335 1335 pub struct new_entries(()); 1336 - ///Marker type for the `notebook` field 1337 - pub struct notebook(()); 1338 1336 ///Marker type for the `updated_at` field 1339 1337 pub struct updated_at(()); 1338 + ///Marker type for the `notebook` field 1339 + pub struct notebook(()); 1340 1340 } 1341 1341 } 1342 1342 ··· 1462 1462 where 1463 1463 S: subscription_update_view_state::State, 1464 1464 S::NewEntries: subscription_update_view_state::IsSet, 1465 - S::Notebook: subscription_update_view_state::IsSet, 1466 1465 S::UpdatedAt: subscription_update_view_state::IsSet, 1466 + S::Notebook: subscription_update_view_state::IsSet, 1467 1467 { 1468 1468 /// Build the final struct 1469 1469 pub fn build(self) -> SubscriptionUpdateView<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/publish/blob.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Path; 40 39 type Upload; 40 + type Path; 41 41 } 42 42 /// Empty state - all required fields are unset 43 43 pub struct Empty(()); 44 44 impl sealed::Sealed for Empty {} 45 45 impl State for Empty { 46 - type Path = Unset; 47 46 type Upload = Unset; 48 - } 49 - ///State transition - sets the `path` field to Set 50 - pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 51 - impl<S: State> sealed::Sealed for SetPath<S> {} 52 - impl<S: State> State for SetPath<S> { 53 - type Path = Set<members::path>; 54 - type Upload = S::Upload; 47 + type Path = Unset; 55 48 } 56 49 ///State transition - sets the `upload` field to Set 57 50 pub struct SetUpload<S: State = Empty>(PhantomData<fn() -> S>); 58 51 impl<S: State> sealed::Sealed for SetUpload<S> {} 59 52 impl<S: State> State for SetUpload<S> { 60 - type Path = S::Path; 61 53 type Upload = Set<members::upload>; 54 + type Path = S::Path; 55 + } 56 + ///State transition - sets the `path` field to Set 57 + pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetPath<S> {} 59 + impl<S: State> State for SetPath<S> { 60 + type Upload = S::Upload; 61 + type Path = Set<members::path>; 62 62 } 63 63 /// Marker types for field names 64 64 #[allow(non_camel_case_types)] 65 65 pub mod members { 66 - ///Marker type for the `path` field 67 - pub struct path(()); 68 66 ///Marker type for the `upload` field 69 67 pub struct upload(()); 68 + ///Marker type for the `path` field 69 + pub struct path(()); 70 70 } 71 71 } 72 72 ··· 139 139 impl<'a, S> BlobBuilder<'a, S> 140 140 where 141 141 S: blob_state::State, 142 - S::Path: blob_state::IsSet, 143 142 S::Upload: blob_state::IsSet, 143 + S::Path: blob_state::IsSet, 144 144 { 145 145 /// Build the final struct 146 146 pub fn build(self) -> Blob<'a> {
+24 -24
crates/weaver-api/src/site_standard/document.rs
··· 60 60 } 61 61 /// State trait tracking which required fields have been set 62 62 pub trait State: sealed::Sealed { 63 - type Title; 64 - type Publication; 65 63 type PublishedAt; 64 + type Publication; 65 + type Title; 66 66 } 67 67 /// Empty state - all required fields are unset 68 68 pub struct Empty(()); 69 69 impl sealed::Sealed for Empty {} 70 70 impl State for Empty { 71 + type PublishedAt = Unset; 72 + type Publication = Unset; 71 73 type Title = Unset; 72 - type Publication = Unset; 73 - type PublishedAt = Unset; 74 74 } 75 - ///State transition - sets the `title` field to Set 76 - pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 77 - impl<S: State> sealed::Sealed for SetTitle<S> {} 78 - impl<S: State> State for SetTitle<S> { 79 - type Title = Set<members::title>; 75 + ///State transition - sets the `published_at` field to Set 76 + pub struct SetPublishedAt<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetPublishedAt<S> {} 78 + impl<S: State> State for SetPublishedAt<S> { 79 + type PublishedAt = Set<members::published_at>; 80 80 type Publication = S::Publication; 81 - type PublishedAt = S::PublishedAt; 81 + type Title = S::Title; 82 82 } 83 83 ///State transition - sets the `publication` field to Set 84 84 pub struct SetPublication<S: State = Empty>(PhantomData<fn() -> S>); 85 85 impl<S: State> sealed::Sealed for SetPublication<S> {} 86 86 impl<S: State> State for SetPublication<S> { 87 - type Title = S::Title; 88 - type Publication = Set<members::publication>; 89 87 type PublishedAt = S::PublishedAt; 88 + type Publication = Set<members::publication>; 89 + type Title = S::Title; 90 90 } 91 - ///State transition - sets the `published_at` field to Set 92 - pub struct SetPublishedAt<S: State = Empty>(PhantomData<fn() -> S>); 93 - impl<S: State> sealed::Sealed for SetPublishedAt<S> {} 94 - impl<S: State> State for SetPublishedAt<S> { 95 - type Title = S::Title; 91 + ///State transition - sets the `title` field to Set 92 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 93 + impl<S: State> sealed::Sealed for SetTitle<S> {} 94 + impl<S: State> State for SetTitle<S> { 95 + type PublishedAt = S::PublishedAt; 96 96 type Publication = S::Publication; 97 - type PublishedAt = Set<members::published_at>; 97 + type Title = Set<members::title>; 98 98 } 99 99 /// Marker types for field names 100 100 #[allow(non_camel_case_types)] 101 101 pub mod members { 102 + ///Marker type for the `published_at` field 103 + pub struct published_at(()); 104 + ///Marker type for the `publication` field 105 + pub struct publication(()); 102 106 ///Marker type for the `title` field 103 107 pub struct title(()); 104 - ///Marker type for the `publication` field 105 - pub struct publication(()); 106 - ///Marker type for the `published_at` field 107 - pub struct published_at(()); 108 108 } 109 109 } 110 110 ··· 366 366 impl<'a, S> DocumentBuilder<'a, S> 367 367 where 368 368 S: document_state::State, 369 - S::Title: document_state::IsSet, 370 - S::Publication: document_state::IsSet, 371 369 S::PublishedAt: document_state::IsSet, 370 + S::Publication: document_state::IsSet, 371 + S::Title: document_state::IsSet, 372 372 { 373 373 /// Build the final struct 374 374 pub fn build(self) -> Document<'a> {
+31 -31
crates/weaver-api/src/site_standard/theme/basic.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 + type AccentForeground; 41 + type Accent; 40 42 type Background; 41 43 type Foreground; 42 - type AccentForeground; 43 - type Accent; 44 44 } 45 45 /// Empty state - all required fields are unset 46 46 pub struct Empty(()); 47 47 impl sealed::Sealed for Empty {} 48 48 impl State for Empty { 49 + type AccentForeground = Unset; 50 + type Accent = Unset; 49 51 type Background = Unset; 50 52 type Foreground = Unset; 51 - type AccentForeground = Unset; 52 - type Accent = Unset; 53 - } 54 - ///State transition - sets the `background` field to Set 55 - pub struct SetBackground<S: State = Empty>(PhantomData<fn() -> S>); 56 - impl<S: State> sealed::Sealed for SetBackground<S> {} 57 - impl<S: State> State for SetBackground<S> { 58 - type Background = Set<members::background>; 59 - type Foreground = S::Foreground; 60 - type AccentForeground = S::AccentForeground; 61 - type Accent = S::Accent; 62 - } 63 - ///State transition - sets the `foreground` field to Set 64 - pub struct SetForeground<S: State = Empty>(PhantomData<fn() -> S>); 65 - impl<S: State> sealed::Sealed for SetForeground<S> {} 66 - impl<S: State> State for SetForeground<S> { 67 - type Background = S::Background; 68 - type Foreground = Set<members::foreground>; 69 - type AccentForeground = S::AccentForeground; 70 - type Accent = S::Accent; 71 53 } 72 54 ///State transition - sets the `accent_foreground` field to Set 73 55 pub struct SetAccentForeground<S: State = Empty>(PhantomData<fn() -> S>); 74 56 impl<S: State> sealed::Sealed for SetAccentForeground<S> {} 75 57 impl<S: State> State for SetAccentForeground<S> { 76 - type Background = S::Background; 77 - type Foreground = S::Foreground; 78 58 type AccentForeground = Set<members::accent_foreground>; 79 59 type Accent = S::Accent; 60 + type Background = S::Background; 61 + type Foreground = S::Foreground; 80 62 } 81 63 ///State transition - sets the `accent` field to Set 82 64 pub struct SetAccent<S: State = Empty>(PhantomData<fn() -> S>); 83 65 impl<S: State> sealed::Sealed for SetAccent<S> {} 84 66 impl<S: State> State for SetAccent<S> { 67 + type AccentForeground = S::AccentForeground; 68 + type Accent = Set<members::accent>; 85 69 type Background = S::Background; 86 70 type Foreground = S::Foreground; 71 + } 72 + ///State transition - sets the `background` field to Set 73 + pub struct SetBackground<S: State = Empty>(PhantomData<fn() -> S>); 74 + impl<S: State> sealed::Sealed for SetBackground<S> {} 75 + impl<S: State> State for SetBackground<S> { 87 76 type AccentForeground = S::AccentForeground; 88 - type Accent = Set<members::accent>; 77 + type Accent = S::Accent; 78 + type Background = Set<members::background>; 79 + type Foreground = S::Foreground; 80 + } 81 + ///State transition - sets the `foreground` field to Set 82 + pub struct SetForeground<S: State = Empty>(PhantomData<fn() -> S>); 83 + impl<S: State> sealed::Sealed for SetForeground<S> {} 84 + impl<S: State> State for SetForeground<S> { 85 + type AccentForeground = S::AccentForeground; 86 + type Accent = S::Accent; 87 + type Background = S::Background; 88 + type Foreground = Set<members::foreground>; 89 89 } 90 90 /// Marker types for field names 91 91 #[allow(non_camel_case_types)] 92 92 pub mod members { 93 - ///Marker type for the `background` field 94 - pub struct background(()); 95 - ///Marker type for the `foreground` field 96 - pub struct foreground(()); 97 93 ///Marker type for the `accent_foreground` field 98 94 pub struct accent_foreground(()); 99 95 ///Marker type for the `accent` field 100 96 pub struct accent(()); 97 + ///Marker type for the `background` field 98 + pub struct background(()); 99 + ///Marker type for the `foreground` field 100 + pub struct foreground(()); 101 101 } 102 102 } 103 103 ··· 210 210 impl<'a, S> BasicBuilder<'a, S> 211 211 where 212 212 S: basic_state::State, 213 + S::AccentForeground: basic_state::IsSet, 214 + S::Accent: basic_state::IsSet, 213 215 S::Background: basic_state::IsSet, 214 216 S::Foreground: basic_state::IsSet, 215 - S::AccentForeground: basic_state::IsSet, 216 - S::Accent: basic_state::IsSet, 217 217 { 218 218 /// Build the final struct 219 219 pub fn build(self) -> Basic<'a> {
+28 -28
crates/weaver-api/src/site_standard/theme/color.rs
··· 438 438 } 439 439 /// State trait tracking which required fields have been set 440 440 pub trait State: sealed::Sealed { 441 - type A; 441 + type G; 442 442 type R; 443 + type A; 443 444 type B; 444 - type G; 445 445 } 446 446 /// Empty state - all required fields are unset 447 447 pub struct Empty(()); 448 448 impl sealed::Sealed for Empty {} 449 449 impl State for Empty { 450 + type G = Unset; 451 + type R = Unset; 450 452 type A = Unset; 451 - type R = Unset; 452 453 type B = Unset; 453 - type G = Unset; 454 454 } 455 - ///State transition - sets the `a` field to Set 456 - pub struct SetA<S: State = Empty>(PhantomData<fn() -> S>); 457 - impl<S: State> sealed::Sealed for SetA<S> {} 458 - impl<S: State> State for SetA<S> { 459 - type A = Set<members::a>; 455 + ///State transition - sets the `g` field to Set 456 + pub struct SetG<S: State = Empty>(PhantomData<fn() -> S>); 457 + impl<S: State> sealed::Sealed for SetG<S> {} 458 + impl<S: State> State for SetG<S> { 459 + type G = Set<members::g>; 460 460 type R = S::R; 461 + type A = S::A; 461 462 type B = S::B; 462 - type G = S::G; 463 463 } 464 464 ///State transition - sets the `r` field to Set 465 465 pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>); 466 466 impl<S: State> sealed::Sealed for SetR<S> {} 467 467 impl<S: State> State for SetR<S> { 468 + type G = S::G; 469 + type R = Set<members::r>; 468 470 type A = S::A; 469 - type R = Set<members::r>; 470 471 type B = S::B; 472 + } 473 + ///State transition - sets the `a` field to Set 474 + pub struct SetA<S: State = Empty>(PhantomData<fn() -> S>); 475 + impl<S: State> sealed::Sealed for SetA<S> {} 476 + impl<S: State> State for SetA<S> { 471 477 type G = S::G; 478 + type R = S::R; 479 + type A = Set<members::a>; 480 + type B = S::B; 472 481 } 473 482 ///State transition - sets the `b` field to Set 474 483 pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>); 475 484 impl<S: State> sealed::Sealed for SetB<S> {} 476 485 impl<S: State> State for SetB<S> { 477 - type A = S::A; 478 - type R = S::R; 479 - type B = Set<members::b>; 480 486 type G = S::G; 481 - } 482 - ///State transition - sets the `g` field to Set 483 - pub struct SetG<S: State = Empty>(PhantomData<fn() -> S>); 484 - impl<S: State> sealed::Sealed for SetG<S> {} 485 - impl<S: State> State for SetG<S> { 486 - type A = S::A; 487 487 type R = S::R; 488 - type B = S::B; 489 - type G = Set<members::g>; 488 + type A = S::A; 489 + type B = Set<members::b>; 490 490 } 491 491 /// Marker types for field names 492 492 #[allow(non_camel_case_types)] 493 493 pub mod members { 494 - ///Marker type for the `a` field 495 - pub struct a(()); 494 + ///Marker type for the `g` field 495 + pub struct g(()); 496 496 ///Marker type for the `r` field 497 497 pub struct r(()); 498 + ///Marker type for the `a` field 499 + pub struct a(()); 498 500 ///Marker type for the `b` field 499 501 pub struct b(()); 500 - ///Marker type for the `g` field 501 - pub struct g(()); 502 502 } 503 503 } 504 504 ··· 599 599 impl<'a, S> RgbaBuilder<'a, S> 600 600 where 601 601 S: rgba_state::State, 602 - S::A: rgba_state::IsSet, 602 + S::G: rgba_state::IsSet, 603 603 S::R: rgba_state::IsSet, 604 + S::A: rgba_state::IsSet, 604 605 S::B: rgba_state::IsSet, 605 - S::G: rgba_state::IsSet, 606 606 { 607 607 /// Build the final struct 608 608 pub fn build(self) -> Rgba<'a> {
+67 -67
crates/weaver-api/src/tools_ozone/communication.rs
··· 55 55 } 56 56 /// State trait tracking which required fields have been set 57 57 pub trait State: sealed::Sealed { 58 - type CreatedAt; 59 58 type ContentMarkdown; 60 - type Id; 59 + type Disabled; 61 60 type LastUpdatedBy; 62 - type UpdatedAt; 61 + type CreatedAt; 63 62 type Name; 64 - type Disabled; 63 + type UpdatedAt; 64 + type Id; 65 65 } 66 66 /// Empty state - all required fields are unset 67 67 pub struct Empty(()); 68 68 impl sealed::Sealed for Empty {} 69 69 impl State for Empty { 70 - type CreatedAt = Unset; 71 70 type ContentMarkdown = Unset; 72 - type Id = Unset; 71 + type Disabled = Unset; 73 72 type LastUpdatedBy = Unset; 74 - type UpdatedAt = Unset; 73 + type CreatedAt = Unset; 75 74 type Name = Unset; 76 - type Disabled = Unset; 77 - } 78 - ///State transition - sets the `created_at` field to Set 79 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 80 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 81 - impl<S: State> State for SetCreatedAt<S> { 82 - type CreatedAt = Set<members::created_at>; 83 - type ContentMarkdown = S::ContentMarkdown; 84 - type Id = S::Id; 85 - type LastUpdatedBy = S::LastUpdatedBy; 86 - type UpdatedAt = S::UpdatedAt; 87 - type Name = S::Name; 88 - type Disabled = S::Disabled; 75 + type UpdatedAt = Unset; 76 + type Id = Unset; 89 77 } 90 78 ///State transition - sets the `content_markdown` field to Set 91 79 pub struct SetContentMarkdown<S: State = Empty>(PhantomData<fn() -> S>); 92 80 impl<S: State> sealed::Sealed for SetContentMarkdown<S> {} 93 81 impl<S: State> State for SetContentMarkdown<S> { 94 - type CreatedAt = S::CreatedAt; 95 82 type ContentMarkdown = Set<members::content_markdown>; 96 - type Id = S::Id; 83 + type Disabled = S::Disabled; 97 84 type LastUpdatedBy = S::LastUpdatedBy; 98 - type UpdatedAt = S::UpdatedAt; 85 + type CreatedAt = S::CreatedAt; 99 86 type Name = S::Name; 100 - type Disabled = S::Disabled; 87 + type UpdatedAt = S::UpdatedAt; 88 + type Id = S::Id; 101 89 } 102 - ///State transition - sets the `id` field to Set 103 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 104 - impl<S: State> sealed::Sealed for SetId<S> {} 105 - impl<S: State> State for SetId<S> { 106 - type CreatedAt = S::CreatedAt; 90 + ///State transition - sets the `disabled` field to Set 91 + pub struct SetDisabled<S: State = Empty>(PhantomData<fn() -> S>); 92 + impl<S: State> sealed::Sealed for SetDisabled<S> {} 93 + impl<S: State> State for SetDisabled<S> { 107 94 type ContentMarkdown = S::ContentMarkdown; 108 - type Id = Set<members::id>; 95 + type Disabled = Set<members::disabled>; 109 96 type LastUpdatedBy = S::LastUpdatedBy; 110 - type UpdatedAt = S::UpdatedAt; 97 + type CreatedAt = S::CreatedAt; 111 98 type Name = S::Name; 112 - type Disabled = S::Disabled; 99 + type UpdatedAt = S::UpdatedAt; 100 + type Id = S::Id; 113 101 } 114 102 ///State transition - sets the `last_updated_by` field to Set 115 103 pub struct SetLastUpdatedBy<S: State = Empty>(PhantomData<fn() -> S>); 116 104 impl<S: State> sealed::Sealed for SetLastUpdatedBy<S> {} 117 105 impl<S: State> State for SetLastUpdatedBy<S> { 118 - type CreatedAt = S::CreatedAt; 119 106 type ContentMarkdown = S::ContentMarkdown; 120 - type Id = S::Id; 107 + type Disabled = S::Disabled; 121 108 type LastUpdatedBy = Set<members::last_updated_by>; 122 - type UpdatedAt = S::UpdatedAt; 109 + type CreatedAt = S::CreatedAt; 123 110 type Name = S::Name; 124 - type Disabled = S::Disabled; 111 + type UpdatedAt = S::UpdatedAt; 112 + type Id = S::Id; 125 113 } 126 - ///State transition - sets the `updated_at` field to Set 127 - pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 128 - impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 129 - impl<S: State> State for SetUpdatedAt<S> { 130 - type CreatedAt = S::CreatedAt; 114 + ///State transition - sets the `created_at` field to Set 115 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 116 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 117 + impl<S: State> State for SetCreatedAt<S> { 131 118 type ContentMarkdown = S::ContentMarkdown; 132 - type Id = S::Id; 119 + type Disabled = S::Disabled; 133 120 type LastUpdatedBy = S::LastUpdatedBy; 134 - type UpdatedAt = Set<members::updated_at>; 121 + type CreatedAt = Set<members::created_at>; 135 122 type Name = S::Name; 136 - type Disabled = S::Disabled; 123 + type UpdatedAt = S::UpdatedAt; 124 + type Id = S::Id; 137 125 } 138 126 ///State transition - sets the `name` field to Set 139 127 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 140 128 impl<S: State> sealed::Sealed for SetName<S> {} 141 129 impl<S: State> State for SetName<S> { 142 - type CreatedAt = S::CreatedAt; 143 130 type ContentMarkdown = S::ContentMarkdown; 144 - type Id = S::Id; 131 + type Disabled = S::Disabled; 145 132 type LastUpdatedBy = S::LastUpdatedBy; 146 - type UpdatedAt = S::UpdatedAt; 133 + type CreatedAt = S::CreatedAt; 147 134 type Name = Set<members::name>; 135 + type UpdatedAt = S::UpdatedAt; 136 + type Id = S::Id; 137 + } 138 + ///State transition - sets the `updated_at` field to Set 139 + pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 140 + impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 141 + impl<S: State> State for SetUpdatedAt<S> { 142 + type ContentMarkdown = S::ContentMarkdown; 148 143 type Disabled = S::Disabled; 144 + type LastUpdatedBy = S::LastUpdatedBy; 145 + type CreatedAt = S::CreatedAt; 146 + type Name = S::Name; 147 + type UpdatedAt = Set<members::updated_at>; 148 + type Id = S::Id; 149 149 } 150 - ///State transition - sets the `disabled` field to Set 151 - pub struct SetDisabled<S: State = Empty>(PhantomData<fn() -> S>); 152 - impl<S: State> sealed::Sealed for SetDisabled<S> {} 153 - impl<S: State> State for SetDisabled<S> { 154 - type CreatedAt = S::CreatedAt; 150 + ///State transition - sets the `id` field to Set 151 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 152 + impl<S: State> sealed::Sealed for SetId<S> {} 153 + impl<S: State> State for SetId<S> { 155 154 type ContentMarkdown = S::ContentMarkdown; 156 - type Id = S::Id; 155 + type Disabled = S::Disabled; 157 156 type LastUpdatedBy = S::LastUpdatedBy; 158 - type UpdatedAt = S::UpdatedAt; 157 + type CreatedAt = S::CreatedAt; 159 158 type Name = S::Name; 160 - type Disabled = Set<members::disabled>; 159 + type UpdatedAt = S::UpdatedAt; 160 + type Id = Set<members::id>; 161 161 } 162 162 /// Marker types for field names 163 163 #[allow(non_camel_case_types)] 164 164 pub mod members { 165 - ///Marker type for the `created_at` field 166 - pub struct created_at(()); 167 165 ///Marker type for the `content_markdown` field 168 166 pub struct content_markdown(()); 169 - ///Marker type for the `id` field 170 - pub struct id(()); 167 + ///Marker type for the `disabled` field 168 + pub struct disabled(()); 171 169 ///Marker type for the `last_updated_by` field 172 170 pub struct last_updated_by(()); 171 + ///Marker type for the `created_at` field 172 + pub struct created_at(()); 173 + ///Marker type for the `name` field 174 + pub struct name(()); 173 175 ///Marker type for the `updated_at` field 174 176 pub struct updated_at(()); 175 - ///Marker type for the `name` field 176 - pub struct name(()); 177 - ///Marker type for the `disabled` field 178 - pub struct disabled(()); 177 + ///Marker type for the `id` field 178 + pub struct id(()); 179 179 } 180 180 } 181 181 ··· 395 395 impl<'a, S> TemplateViewBuilder<'a, S> 396 396 where 397 397 S: template_view_state::State, 398 - S::CreatedAt: template_view_state::IsSet, 399 398 S::ContentMarkdown: template_view_state::IsSet, 400 - S::Id: template_view_state::IsSet, 399 + S::Disabled: template_view_state::IsSet, 401 400 S::LastUpdatedBy: template_view_state::IsSet, 402 - S::UpdatedAt: template_view_state::IsSet, 401 + S::CreatedAt: template_view_state::IsSet, 403 402 S::Name: template_view_state::IsSet, 404 - S::Disabled: template_view_state::IsSet, 403 + S::UpdatedAt: template_view_state::IsSet, 404 + S::Id: template_view_state::IsSet, 405 405 { 406 406 /// Build the final struct 407 407 pub fn build(self) -> TemplateView<'a> {
+617 -617
crates/weaver-api/src/tools_ozone/moderation.rs
··· 5307 5307 } 5308 5308 /// State trait tracking which required fields have been set 5309 5309 pub trait State: sealed::Sealed { 5310 - type AttemptId; 5311 - type Status; 5312 5310 type CreatedAt; 5311 + type Status; 5312 + type AttemptId; 5313 5313 } 5314 5314 /// Empty state - all required fields are unset 5315 5315 pub struct Empty(()); 5316 5316 impl sealed::Sealed for Empty {} 5317 5317 impl State for Empty { 5318 + type CreatedAt = Unset; 5319 + type Status = Unset; 5318 5320 type AttemptId = Unset; 5319 - type Status = Unset; 5320 - type CreatedAt = Unset; 5321 5321 } 5322 - ///State transition - sets the `attempt_id` field to Set 5323 - pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 5324 - impl<S: State> sealed::Sealed for SetAttemptId<S> {} 5325 - impl<S: State> State for SetAttemptId<S> { 5326 - type AttemptId = Set<members::attempt_id>; 5322 + ///State transition - sets the `created_at` field to Set 5323 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 5324 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 5325 + impl<S: State> State for SetCreatedAt<S> { 5326 + type CreatedAt = Set<members::created_at>; 5327 5327 type Status = S::Status; 5328 - type CreatedAt = S::CreatedAt; 5328 + type AttemptId = S::AttemptId; 5329 5329 } 5330 5330 ///State transition - sets the `status` field to Set 5331 5331 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 5332 5332 impl<S: State> sealed::Sealed for SetStatus<S> {} 5333 5333 impl<S: State> State for SetStatus<S> { 5334 - type AttemptId = S::AttemptId; 5335 - type Status = Set<members::status>; 5336 5334 type CreatedAt = S::CreatedAt; 5335 + type Status = Set<members::status>; 5336 + type AttemptId = S::AttemptId; 5337 5337 } 5338 - ///State transition - sets the `created_at` field to Set 5339 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 5340 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 5341 - impl<S: State> State for SetCreatedAt<S> { 5342 - type AttemptId = S::AttemptId; 5338 + ///State transition - sets the `attempt_id` field to Set 5339 + pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 5340 + impl<S: State> sealed::Sealed for SetAttemptId<S> {} 5341 + impl<S: State> State for SetAttemptId<S> { 5342 + type CreatedAt = S::CreatedAt; 5343 5343 type Status = S::Status; 5344 - type CreatedAt = Set<members::created_at>; 5344 + type AttemptId = Set<members::attempt_id>; 5345 5345 } 5346 5346 /// Marker types for field names 5347 5347 #[allow(non_camel_case_types)] 5348 5348 pub mod members { 5349 + ///Marker type for the `created_at` field 5350 + pub struct created_at(()); 5351 + ///Marker type for the `status` field 5352 + pub struct status(()); 5349 5353 ///Marker type for the `attempt_id` field 5350 5354 pub struct attempt_id(()); 5351 - ///Marker type for the `status` field 5352 - pub struct status(()); 5353 - ///Marker type for the `created_at` field 5354 - pub struct created_at(()); 5355 5355 } 5356 5356 } 5357 5357 ··· 5589 5589 impl<'a, S> AgeAssuranceEventBuilder<'a, S> 5590 5590 where 5591 5591 S: age_assurance_event_state::State, 5592 - S::AttemptId: age_assurance_event_state::IsSet, 5593 - S::Status: age_assurance_event_state::IsSet, 5594 5592 S::CreatedAt: age_assurance_event_state::IsSet, 5593 + S::Status: age_assurance_event_state::IsSet, 5594 + S::AttemptId: age_assurance_event_state::IsSet, 5595 5595 { 5596 5596 /// Build the final struct 5597 5597 pub fn build(self) -> AgeAssuranceEvent<'a> { ··· 5926 5926 } 5927 5927 /// State trait tracking which required fields have been set 5928 5928 pub trait State: sealed::Sealed { 5929 - type Cid; 5930 - type MimeType; 5931 5929 type Size; 5930 + type MimeType; 5931 + type Cid; 5932 5932 type CreatedAt; 5933 5933 } 5934 5934 /// Empty state - all required fields are unset 5935 5935 pub struct Empty(()); 5936 5936 impl sealed::Sealed for Empty {} 5937 5937 impl State for Empty { 5938 - type Cid = Unset; 5939 - type MimeType = Unset; 5940 5938 type Size = Unset; 5939 + type MimeType = Unset; 5940 + type Cid = Unset; 5941 5941 type CreatedAt = Unset; 5942 5942 } 5943 - ///State transition - sets the `cid` field to Set 5944 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 5945 - impl<S: State> sealed::Sealed for SetCid<S> {} 5946 - impl<S: State> State for SetCid<S> { 5947 - type Cid = Set<members::cid>; 5943 + ///State transition - sets the `size` field to Set 5944 + pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>); 5945 + impl<S: State> sealed::Sealed for SetSize<S> {} 5946 + impl<S: State> State for SetSize<S> { 5947 + type Size = Set<members::size>; 5948 5948 type MimeType = S::MimeType; 5949 - type Size = S::Size; 5949 + type Cid = S::Cid; 5950 5950 type CreatedAt = S::CreatedAt; 5951 5951 } 5952 5952 ///State transition - sets the `mime_type` field to Set 5953 5953 pub struct SetMimeType<S: State = Empty>(PhantomData<fn() -> S>); 5954 5954 impl<S: State> sealed::Sealed for SetMimeType<S> {} 5955 5955 impl<S: State> State for SetMimeType<S> { 5956 + type Size = S::Size; 5957 + type MimeType = Set<members::mime_type>; 5956 5958 type Cid = S::Cid; 5957 - type MimeType = Set<members::mime_type>; 5958 - type Size = S::Size; 5959 5959 type CreatedAt = S::CreatedAt; 5960 5960 } 5961 - ///State transition - sets the `size` field to Set 5962 - pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>); 5963 - impl<S: State> sealed::Sealed for SetSize<S> {} 5964 - impl<S: State> State for SetSize<S> { 5965 - type Cid = S::Cid; 5961 + ///State transition - sets the `cid` field to Set 5962 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 5963 + impl<S: State> sealed::Sealed for SetCid<S> {} 5964 + impl<S: State> State for SetCid<S> { 5965 + type Size = S::Size; 5966 5966 type MimeType = S::MimeType; 5967 - type Size = Set<members::size>; 5967 + type Cid = Set<members::cid>; 5968 5968 type CreatedAt = S::CreatedAt; 5969 5969 } 5970 5970 ///State transition - sets the `created_at` field to Set 5971 5971 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 5972 5972 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 5973 5973 impl<S: State> State for SetCreatedAt<S> { 5974 - type Cid = S::Cid; 5974 + type Size = S::Size; 5975 5975 type MimeType = S::MimeType; 5976 - type Size = S::Size; 5976 + type Cid = S::Cid; 5977 5977 type CreatedAt = Set<members::created_at>; 5978 5978 } 5979 5979 /// Marker types for field names 5980 5980 #[allow(non_camel_case_types)] 5981 5981 pub mod members { 5982 + ///Marker type for the `size` field 5983 + pub struct size(()); 5984 + ///Marker type for the `mime_type` field 5985 + pub struct mime_type(()); 5982 5986 ///Marker type for the `cid` field 5983 5987 pub struct cid(()); 5984 - ///Marker type for the `mime_type` field 5985 - pub struct mime_type(()); 5986 - ///Marker type for the `size` field 5987 - pub struct size(()); 5988 5988 ///Marker type for the `created_at` field 5989 5989 pub struct created_at(()); 5990 5990 } ··· 6133 6133 impl<'a, S> BlobViewBuilder<'a, S> 6134 6134 where 6135 6135 S: blob_view_state::State, 6136 - S::Cid: blob_view_state::IsSet, 6137 - S::MimeType: blob_view_state::IsSet, 6138 6136 S::Size: blob_view_state::IsSet, 6137 + S::MimeType: blob_view_state::IsSet, 6138 + S::Cid: blob_view_state::IsSet, 6139 6139 S::CreatedAt: blob_view_state::IsSet, 6140 6140 { 6141 6141 /// Build the final struct ··· 6496 6496 } 6497 6497 /// State trait tracking which required fields have been set 6498 6498 pub trait State: sealed::Sealed { 6499 - type Height; 6500 6499 type Width; 6500 + type Height; 6501 6501 } 6502 6502 /// Empty state - all required fields are unset 6503 6503 pub struct Empty(()); 6504 6504 impl sealed::Sealed for Empty {} 6505 6505 impl State for Empty { 6506 + type Width = Unset; 6506 6507 type Height = Unset; 6507 - type Width = Unset; 6508 + } 6509 + ///State transition - sets the `width` field to Set 6510 + pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 6511 + impl<S: State> sealed::Sealed for SetWidth<S> {} 6512 + impl<S: State> State for SetWidth<S> { 6513 + type Width = Set<members::width>; 6514 + type Height = S::Height; 6508 6515 } 6509 6516 ///State transition - sets the `height` field to Set 6510 6517 pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 6511 6518 impl<S: State> sealed::Sealed for SetHeight<S> {} 6512 6519 impl<S: State> State for SetHeight<S> { 6513 - type Height = Set<members::height>; 6514 6520 type Width = S::Width; 6515 - } 6516 - ///State transition - sets the `width` field to Set 6517 - pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 6518 - impl<S: State> sealed::Sealed for SetWidth<S> {} 6519 - impl<S: State> State for SetWidth<S> { 6520 - type Height = S::Height; 6521 - type Width = Set<members::width>; 6521 + type Height = Set<members::height>; 6522 6522 } 6523 6523 /// Marker types for field names 6524 6524 #[allow(non_camel_case_types)] 6525 6525 pub mod members { 6526 + ///Marker type for the `width` field 6527 + pub struct width(()); 6526 6528 ///Marker type for the `height` field 6527 6529 pub struct height(()); 6528 - ///Marker type for the `width` field 6529 - pub struct width(()); 6530 6530 } 6531 6531 } 6532 6532 ··· 6596 6596 impl<'a, S> ImageDetailsBuilder<'a, S> 6597 6597 where 6598 6598 S: image_details_state::State, 6599 - S::Height: image_details_state::IsSet, 6600 6599 S::Width: image_details_state::IsSet, 6600 + S::Height: image_details_state::IsSet, 6601 6601 { 6602 6602 /// Build the final struct 6603 6603 pub fn build(self) -> ImageDetails<'a> { ··· 6896 6896 } 6897 6897 /// State trait tracking which required fields have been set 6898 6898 pub trait State: sealed::Sealed { 6899 - type NegateLabelVals; 6900 6899 type CreateLabelVals; 6900 + type NegateLabelVals; 6901 6901 } 6902 6902 /// Empty state - all required fields are unset 6903 6903 pub struct Empty(()); 6904 6904 impl sealed::Sealed for Empty {} 6905 6905 impl State for Empty { 6906 - type NegateLabelVals = Unset; 6907 6906 type CreateLabelVals = Unset; 6908 - } 6909 - ///State transition - sets the `negate_label_vals` field to Set 6910 - pub struct SetNegateLabelVals<S: State = Empty>(PhantomData<fn() -> S>); 6911 - impl<S: State> sealed::Sealed for SetNegateLabelVals<S> {} 6912 - impl<S: State> State for SetNegateLabelVals<S> { 6913 - type NegateLabelVals = Set<members::negate_label_vals>; 6914 - type CreateLabelVals = S::CreateLabelVals; 6907 + type NegateLabelVals = Unset; 6915 6908 } 6916 6909 ///State transition - sets the `create_label_vals` field to Set 6917 6910 pub struct SetCreateLabelVals<S: State = Empty>(PhantomData<fn() -> S>); 6918 6911 impl<S: State> sealed::Sealed for SetCreateLabelVals<S> {} 6919 6912 impl<S: State> State for SetCreateLabelVals<S> { 6920 - type NegateLabelVals = S::NegateLabelVals; 6921 6913 type CreateLabelVals = Set<members::create_label_vals>; 6914 + type NegateLabelVals = S::NegateLabelVals; 6915 + } 6916 + ///State transition - sets the `negate_label_vals` field to Set 6917 + pub struct SetNegateLabelVals<S: State = Empty>(PhantomData<fn() -> S>); 6918 + impl<S: State> sealed::Sealed for SetNegateLabelVals<S> {} 6919 + impl<S: State> State for SetNegateLabelVals<S> { 6920 + type CreateLabelVals = S::CreateLabelVals; 6921 + type NegateLabelVals = Set<members::negate_label_vals>; 6922 6922 } 6923 6923 /// Marker types for field names 6924 6924 #[allow(non_camel_case_types)] 6925 6925 pub mod members { 6926 - ///Marker type for the `negate_label_vals` field 6927 - pub struct negate_label_vals(()); 6928 6926 ///Marker type for the `create_label_vals` field 6929 6927 pub struct create_label_vals(()); 6928 + ///Marker type for the `negate_label_vals` field 6929 + pub struct negate_label_vals(()); 6930 6930 } 6931 6931 } 6932 6932 ··· 7030 7030 impl<'a, S> ModEventLabelBuilder<'a, S> 7031 7031 where 7032 7032 S: mod_event_label_state::State, 7033 - S::NegateLabelVals: mod_event_label_state::IsSet, 7034 7033 S::CreateLabelVals: mod_event_label_state::IsSet, 7034 + S::NegateLabelVals: mod_event_label_state::IsSet, 7035 7035 { 7036 7036 /// Build the final struct 7037 7037 pub fn build(self) -> ModEventLabel<'a> { ··· 7777 7777 } 7778 7778 /// State trait tracking which required fields have been set 7779 7779 pub trait State: sealed::Sealed { 7780 - type Remove; 7781 7780 type Add; 7781 + type Remove; 7782 7782 } 7783 7783 /// Empty state - all required fields are unset 7784 7784 pub struct Empty(()); 7785 7785 impl sealed::Sealed for Empty {} 7786 7786 impl State for Empty { 7787 + type Add = Unset; 7787 7788 type Remove = Unset; 7788 - type Add = Unset; 7789 + } 7790 + ///State transition - sets the `add` field to Set 7791 + pub struct SetAdd<S: State = Empty>(PhantomData<fn() -> S>); 7792 + impl<S: State> sealed::Sealed for SetAdd<S> {} 7793 + impl<S: State> State for SetAdd<S> { 7794 + type Add = Set<members::add>; 7795 + type Remove = S::Remove; 7789 7796 } 7790 7797 ///State transition - sets the `remove` field to Set 7791 7798 pub struct SetRemove<S: State = Empty>(PhantomData<fn() -> S>); 7792 7799 impl<S: State> sealed::Sealed for SetRemove<S> {} 7793 7800 impl<S: State> State for SetRemove<S> { 7794 - type Remove = Set<members::remove>; 7795 7801 type Add = S::Add; 7796 - } 7797 - ///State transition - sets the `add` field to Set 7798 - pub struct SetAdd<S: State = Empty>(PhantomData<fn() -> S>); 7799 - impl<S: State> sealed::Sealed for SetAdd<S> {} 7800 - impl<S: State> State for SetAdd<S> { 7801 - type Remove = S::Remove; 7802 - type Add = Set<members::add>; 7802 + type Remove = Set<members::remove>; 7803 7803 } 7804 7804 /// Marker types for field names 7805 7805 #[allow(non_camel_case_types)] 7806 7806 pub mod members { 7807 + ///Marker type for the `add` field 7808 + pub struct add(()); 7807 7809 ///Marker type for the `remove` field 7808 7810 pub struct remove(()); 7809 - ///Marker type for the `add` field 7810 - pub struct add(()); 7811 7811 } 7812 7812 } 7813 7813 ··· 7897 7897 impl<'a, S> ModEventTagBuilder<'a, S> 7898 7898 where 7899 7899 S: mod_event_tag_state::State, 7900 - S::Remove: mod_event_tag_state::IsSet, 7901 7900 S::Add: mod_event_tag_state::IsSet, 7901 + S::Remove: mod_event_tag_state::IsSet, 7902 7902 { 7903 7903 /// Build the final struct 7904 7904 pub fn build(self) -> ModEventTag<'a> { ··· 8132 8132 } 8133 8133 /// State trait tracking which required fields have been set 8134 8134 pub trait State: sealed::Sealed { 8135 - type Event; 8136 - type Subject; 8137 8135 type SubjectBlobCids; 8136 + type CreatedBy; 8137 + type CreatedAt; 8138 8138 type Id; 8139 - type CreatedAt; 8140 - type CreatedBy; 8139 + type Event; 8140 + type Subject; 8141 8141 } 8142 8142 /// Empty state - all required fields are unset 8143 8143 pub struct Empty(()); 8144 8144 impl sealed::Sealed for Empty {} 8145 8145 impl State for Empty { 8146 - type Event = Unset; 8147 - type Subject = Unset; 8148 8146 type SubjectBlobCids = Unset; 8149 - type Id = Unset; 8150 - type CreatedAt = Unset; 8151 8147 type CreatedBy = Unset; 8152 - } 8153 - ///State transition - sets the `event` field to Set 8154 - pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 8155 - impl<S: State> sealed::Sealed for SetEvent<S> {} 8156 - impl<S: State> State for SetEvent<S> { 8157 - type Event = Set<members::event>; 8158 - type Subject = S::Subject; 8159 - type SubjectBlobCids = S::SubjectBlobCids; 8160 - type Id = S::Id; 8161 - type CreatedAt = S::CreatedAt; 8162 - type CreatedBy = S::CreatedBy; 8163 - } 8164 - ///State transition - sets the `subject` field to Set 8165 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 8166 - impl<S: State> sealed::Sealed for SetSubject<S> {} 8167 - impl<S: State> State for SetSubject<S> { 8168 - type Event = S::Event; 8169 - type Subject = Set<members::subject>; 8170 - type SubjectBlobCids = S::SubjectBlobCids; 8171 - type Id = S::Id; 8172 - type CreatedAt = S::CreatedAt; 8173 - type CreatedBy = S::CreatedBy; 8148 + type CreatedAt = Unset; 8149 + type Id = Unset; 8150 + type Event = Unset; 8151 + type Subject = Unset; 8174 8152 } 8175 8153 ///State transition - sets the `subject_blob_cids` field to Set 8176 8154 pub struct SetSubjectBlobCids<S: State = Empty>(PhantomData<fn() -> S>); 8177 8155 impl<S: State> sealed::Sealed for SetSubjectBlobCids<S> {} 8178 8156 impl<S: State> State for SetSubjectBlobCids<S> { 8179 - type Event = S::Event; 8180 - type Subject = S::Subject; 8181 8157 type SubjectBlobCids = Set<members::subject_blob_cids>; 8182 - type Id = S::Id; 8158 + type CreatedBy = S::CreatedBy; 8183 8159 type CreatedAt = S::CreatedAt; 8184 - type CreatedBy = S::CreatedBy; 8185 - } 8186 - ///State transition - sets the `id` field to Set 8187 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 8188 - impl<S: State> sealed::Sealed for SetId<S> {} 8189 - impl<S: State> State for SetId<S> { 8160 + type Id = S::Id; 8190 8161 type Event = S::Event; 8191 8162 type Subject = S::Subject; 8163 + } 8164 + ///State transition - sets the `created_by` field to Set 8165 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 8166 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 8167 + impl<S: State> State for SetCreatedBy<S> { 8192 8168 type SubjectBlobCids = S::SubjectBlobCids; 8193 - type Id = Set<members::id>; 8169 + type CreatedBy = Set<members::created_by>; 8194 8170 type CreatedAt = S::CreatedAt; 8195 - type CreatedBy = S::CreatedBy; 8171 + type Id = S::Id; 8172 + type Event = S::Event; 8173 + type Subject = S::Subject; 8196 8174 } 8197 8175 ///State transition - sets the `created_at` field to Set 8198 8176 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 8199 8177 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 8200 8178 impl<S: State> State for SetCreatedAt<S> { 8179 + type SubjectBlobCids = S::SubjectBlobCids; 8180 + type CreatedBy = S::CreatedBy; 8181 + type CreatedAt = Set<members::created_at>; 8182 + type Id = S::Id; 8201 8183 type Event = S::Event; 8202 8184 type Subject = S::Subject; 8185 + } 8186 + ///State transition - sets the `id` field to Set 8187 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 8188 + impl<S: State> sealed::Sealed for SetId<S> {} 8189 + impl<S: State> State for SetId<S> { 8203 8190 type SubjectBlobCids = S::SubjectBlobCids; 8204 - type Id = S::Id; 8205 - type CreatedAt = Set<members::created_at>; 8206 8191 type CreatedBy = S::CreatedBy; 8207 - } 8208 - ///State transition - sets the `created_by` field to Set 8209 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 8210 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 8211 - impl<S: State> State for SetCreatedBy<S> { 8192 + type CreatedAt = S::CreatedAt; 8193 + type Id = Set<members::id>; 8212 8194 type Event = S::Event; 8213 8195 type Subject = S::Subject; 8196 + } 8197 + ///State transition - sets the `event` field to Set 8198 + pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 8199 + impl<S: State> sealed::Sealed for SetEvent<S> {} 8200 + impl<S: State> State for SetEvent<S> { 8214 8201 type SubjectBlobCids = S::SubjectBlobCids; 8202 + type CreatedBy = S::CreatedBy; 8203 + type CreatedAt = S::CreatedAt; 8215 8204 type Id = S::Id; 8205 + type Event = Set<members::event>; 8206 + type Subject = S::Subject; 8207 + } 8208 + ///State transition - sets the `subject` field to Set 8209 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 8210 + impl<S: State> sealed::Sealed for SetSubject<S> {} 8211 + impl<S: State> State for SetSubject<S> { 8212 + type SubjectBlobCids = S::SubjectBlobCids; 8213 + type CreatedBy = S::CreatedBy; 8216 8214 type CreatedAt = S::CreatedAt; 8217 - type CreatedBy = Set<members::created_by>; 8215 + type Id = S::Id; 8216 + type Event = S::Event; 8217 + type Subject = Set<members::subject>; 8218 8218 } 8219 8219 /// Marker types for field names 8220 8220 #[allow(non_camel_case_types)] 8221 8221 pub mod members { 8222 - ///Marker type for the `event` field 8223 - pub struct event(()); 8224 - ///Marker type for the `subject` field 8225 - pub struct subject(()); 8226 8222 ///Marker type for the `subject_blob_cids` field 8227 8223 pub struct subject_blob_cids(()); 8224 + ///Marker type for the `created_by` field 8225 + pub struct created_by(()); 8226 + ///Marker type for the `created_at` field 8227 + pub struct created_at(()); 8228 8228 ///Marker type for the `id` field 8229 8229 pub struct id(()); 8230 - ///Marker type for the `created_at` field 8231 - pub struct created_at(()); 8232 - ///Marker type for the `created_by` field 8233 - pub struct created_by(()); 8230 + ///Marker type for the `event` field 8231 + pub struct event(()); 8232 + ///Marker type for the `subject` field 8233 + pub struct subject(()); 8234 8234 } 8235 8235 } 8236 8236 ··· 8453 8453 impl<'a, S> ModEventViewBuilder<'a, S> 8454 8454 where 8455 8455 S: mod_event_view_state::State, 8456 - S::Event: mod_event_view_state::IsSet, 8457 - S::Subject: mod_event_view_state::IsSet, 8458 8456 S::SubjectBlobCids: mod_event_view_state::IsSet, 8459 - S::Id: mod_event_view_state::IsSet, 8460 - S::CreatedAt: mod_event_view_state::IsSet, 8461 8457 S::CreatedBy: mod_event_view_state::IsSet, 8458 + S::CreatedAt: mod_event_view_state::IsSet, 8459 + S::Id: mod_event_view_state::IsSet, 8460 + S::Event: mod_event_view_state::IsSet, 8461 + S::Subject: mod_event_view_state::IsSet, 8462 8462 { 8463 8463 /// Build the final struct 8464 8464 pub fn build(self) -> ModEventView<'a> { ··· 8652 8652 } 8653 8653 /// State trait tracking which required fields have been set 8654 8654 pub trait State: sealed::Sealed { 8655 + type CreatedBy; 8656 + type CreatedAt; 8657 + type Id; 8655 8658 type Subject; 8656 8659 type Event; 8657 - type Id; 8658 8660 type SubjectBlobs; 8659 - type CreatedAt; 8660 - type CreatedBy; 8661 8661 } 8662 8662 /// Empty state - all required fields are unset 8663 8663 pub struct Empty(()); 8664 8664 impl sealed::Sealed for Empty {} 8665 8665 impl State for Empty { 8666 + type CreatedBy = Unset; 8667 + type CreatedAt = Unset; 8668 + type Id = Unset; 8666 8669 type Subject = Unset; 8667 8670 type Event = Unset; 8668 - type Id = Unset; 8669 8671 type SubjectBlobs = Unset; 8670 - type CreatedAt = Unset; 8671 - type CreatedBy = Unset; 8672 + } 8673 + ///State transition - sets the `created_by` field to Set 8674 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 8675 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 8676 + impl<S: State> State for SetCreatedBy<S> { 8677 + type CreatedBy = Set<members::created_by>; 8678 + type CreatedAt = S::CreatedAt; 8679 + type Id = S::Id; 8680 + type Subject = S::Subject; 8681 + type Event = S::Event; 8682 + type SubjectBlobs = S::SubjectBlobs; 8683 + } 8684 + ///State transition - sets the `created_at` field to Set 8685 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 8686 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 8687 + impl<S: State> State for SetCreatedAt<S> { 8688 + type CreatedBy = S::CreatedBy; 8689 + type CreatedAt = Set<members::created_at>; 8690 + type Id = S::Id; 8691 + type Subject = S::Subject; 8692 + type Event = S::Event; 8693 + type SubjectBlobs = S::SubjectBlobs; 8694 + } 8695 + ///State transition - sets the `id` field to Set 8696 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 8697 + impl<S: State> sealed::Sealed for SetId<S> {} 8698 + impl<S: State> State for SetId<S> { 8699 + type CreatedBy = S::CreatedBy; 8700 + type CreatedAt = S::CreatedAt; 8701 + type Id = Set<members::id>; 8702 + type Subject = S::Subject; 8703 + type Event = S::Event; 8704 + type SubjectBlobs = S::SubjectBlobs; 8672 8705 } 8673 8706 ///State transition - sets the `subject` field to Set 8674 8707 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 8675 8708 impl<S: State> sealed::Sealed for SetSubject<S> {} 8676 8709 impl<S: State> State for SetSubject<S> { 8710 + type CreatedBy = S::CreatedBy; 8711 + type CreatedAt = S::CreatedAt; 8712 + type Id = S::Id; 8677 8713 type Subject = Set<members::subject>; 8678 8714 type Event = S::Event; 8679 - type Id = S::Id; 8680 8715 type SubjectBlobs = S::SubjectBlobs; 8681 - type CreatedAt = S::CreatedAt; 8682 - type CreatedBy = S::CreatedBy; 8683 8716 } 8684 8717 ///State transition - sets the `event` field to Set 8685 8718 pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 8686 8719 impl<S: State> sealed::Sealed for SetEvent<S> {} 8687 8720 impl<S: State> State for SetEvent<S> { 8721 + type CreatedBy = S::CreatedBy; 8722 + type CreatedAt = S::CreatedAt; 8723 + type Id = S::Id; 8688 8724 type Subject = S::Subject; 8689 8725 type Event = Set<members::event>; 8690 - type Id = S::Id; 8691 8726 type SubjectBlobs = S::SubjectBlobs; 8692 - type CreatedAt = S::CreatedAt; 8693 - type CreatedBy = S::CreatedBy; 8694 - } 8695 - ///State transition - sets the `id` field to Set 8696 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 8697 - impl<S: State> sealed::Sealed for SetId<S> {} 8698 - impl<S: State> State for SetId<S> { 8699 - type Subject = S::Subject; 8700 - type Event = S::Event; 8701 - type Id = Set<members::id>; 8702 - type SubjectBlobs = S::SubjectBlobs; 8703 - type CreatedAt = S::CreatedAt; 8704 - type CreatedBy = S::CreatedBy; 8705 8727 } 8706 8728 ///State transition - sets the `subject_blobs` field to Set 8707 8729 pub struct SetSubjectBlobs<S: State = Empty>(PhantomData<fn() -> S>); 8708 8730 impl<S: State> sealed::Sealed for SetSubjectBlobs<S> {} 8709 8731 impl<S: State> State for SetSubjectBlobs<S> { 8710 - type Subject = S::Subject; 8711 - type Event = S::Event; 8712 - type Id = S::Id; 8713 - type SubjectBlobs = Set<members::subject_blobs>; 8714 - type CreatedAt = S::CreatedAt; 8715 8732 type CreatedBy = S::CreatedBy; 8716 - } 8717 - ///State transition - sets the `created_at` field to Set 8718 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 8719 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 8720 - impl<S: State> State for SetCreatedAt<S> { 8721 - type Subject = S::Subject; 8722 - type Event = S::Event; 8733 + type CreatedAt = S::CreatedAt; 8723 8734 type Id = S::Id; 8724 - type SubjectBlobs = S::SubjectBlobs; 8725 - type CreatedAt = Set<members::created_at>; 8726 - type CreatedBy = S::CreatedBy; 8727 - } 8728 - ///State transition - sets the `created_by` field to Set 8729 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 8730 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 8731 - impl<S: State> State for SetCreatedBy<S> { 8732 8735 type Subject = S::Subject; 8733 8736 type Event = S::Event; 8734 - type Id = S::Id; 8735 - type SubjectBlobs = S::SubjectBlobs; 8736 - type CreatedAt = S::CreatedAt; 8737 - type CreatedBy = Set<members::created_by>; 8737 + type SubjectBlobs = Set<members::subject_blobs>; 8738 8738 } 8739 8739 /// Marker types for field names 8740 8740 #[allow(non_camel_case_types)] 8741 8741 pub mod members { 8742 + ///Marker type for the `created_by` field 8743 + pub struct created_by(()); 8744 + ///Marker type for the `created_at` field 8745 + pub struct created_at(()); 8746 + ///Marker type for the `id` field 8747 + pub struct id(()); 8742 8748 ///Marker type for the `subject` field 8743 8749 pub struct subject(()); 8744 8750 ///Marker type for the `event` field 8745 8751 pub struct event(()); 8746 - ///Marker type for the `id` field 8747 - pub struct id(()); 8748 8752 ///Marker type for the `subject_blobs` field 8749 8753 pub struct subject_blobs(()); 8750 - ///Marker type for the `created_at` field 8751 - pub struct created_at(()); 8752 - ///Marker type for the `created_by` field 8753 - pub struct created_by(()); 8754 8754 } 8755 8755 } 8756 8756 ··· 8923 8923 impl<'a, S> ModEventViewDetailBuilder<'a, S> 8924 8924 where 8925 8925 S: mod_event_view_detail_state::State, 8926 + S::CreatedBy: mod_event_view_detail_state::IsSet, 8927 + S::CreatedAt: mod_event_view_detail_state::IsSet, 8928 + S::Id: mod_event_view_detail_state::IsSet, 8926 8929 S::Subject: mod_event_view_detail_state::IsSet, 8927 8930 S::Event: mod_event_view_detail_state::IsSet, 8928 - S::Id: mod_event_view_detail_state::IsSet, 8929 8931 S::SubjectBlobs: mod_event_view_detail_state::IsSet, 8930 - S::CreatedAt: mod_event_view_detail_state::IsSet, 8931 - S::CreatedBy: mod_event_view_detail_state::IsSet, 8932 8932 { 8933 8933 /// Build the final struct 8934 8934 pub fn build(self) -> ModEventViewDetail<'a> { ··· 9677 9677 } 9678 9678 /// State trait tracking which required fields have been set 9679 9679 pub trait State: sealed::Sealed { 9680 - type Cid; 9681 - type Moderation; 9682 9680 type Repo; 9683 9681 type Uri; 9682 + type Moderation; 9683 + type IndexedAt; 9684 + type Cid; 9684 9685 type BlobCids; 9685 - type IndexedAt; 9686 9686 type Value; 9687 9687 } 9688 9688 /// Empty state - all required fields are unset 9689 9689 pub struct Empty(()); 9690 9690 impl sealed::Sealed for Empty {} 9691 9691 impl State for Empty { 9692 - type Cid = Unset; 9693 - type Moderation = Unset; 9694 9692 type Repo = Unset; 9695 9693 type Uri = Unset; 9696 - type BlobCids = Unset; 9694 + type Moderation = Unset; 9697 9695 type IndexedAt = Unset; 9696 + type Cid = Unset; 9697 + type BlobCids = Unset; 9698 9698 type Value = Unset; 9699 9699 } 9700 - ///State transition - sets the `cid` field to Set 9701 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 9702 - impl<S: State> sealed::Sealed for SetCid<S> {} 9703 - impl<S: State> State for SetCid<S> { 9704 - type Cid = Set<members::cid>; 9705 - type Moderation = S::Moderation; 9706 - type Repo = S::Repo; 9707 - type Uri = S::Uri; 9708 - type BlobCids = S::BlobCids; 9709 - type IndexedAt = S::IndexedAt; 9710 - type Value = S::Value; 9711 - } 9712 - ///State transition - sets the `moderation` field to Set 9713 - pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 9714 - impl<S: State> sealed::Sealed for SetModeration<S> {} 9715 - impl<S: State> State for SetModeration<S> { 9716 - type Cid = S::Cid; 9717 - type Moderation = Set<members::moderation>; 9718 - type Repo = S::Repo; 9719 - type Uri = S::Uri; 9720 - type BlobCids = S::BlobCids; 9721 - type IndexedAt = S::IndexedAt; 9722 - type Value = S::Value; 9723 - } 9724 9700 ///State transition - sets the `repo` field to Set 9725 9701 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 9726 9702 impl<S: State> sealed::Sealed for SetRepo<S> {} 9727 9703 impl<S: State> State for SetRepo<S> { 9728 - type Cid = S::Cid; 9729 - type Moderation = S::Moderation; 9730 9704 type Repo = Set<members::repo>; 9731 9705 type Uri = S::Uri; 9706 + type Moderation = S::Moderation; 9707 + type IndexedAt = S::IndexedAt; 9708 + type Cid = S::Cid; 9732 9709 type BlobCids = S::BlobCids; 9733 - type IndexedAt = S::IndexedAt; 9734 9710 type Value = S::Value; 9735 9711 } 9736 9712 ///State transition - sets the `uri` field to Set 9737 9713 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 9738 9714 impl<S: State> sealed::Sealed for SetUri<S> {} 9739 9715 impl<S: State> State for SetUri<S> { 9740 - type Cid = S::Cid; 9741 - type Moderation = S::Moderation; 9742 9716 type Repo = S::Repo; 9743 9717 type Uri = Set<members::uri>; 9744 - type BlobCids = S::BlobCids; 9718 + type Moderation = S::Moderation; 9745 9719 type IndexedAt = S::IndexedAt; 9720 + type Cid = S::Cid; 9721 + type BlobCids = S::BlobCids; 9746 9722 type Value = S::Value; 9747 9723 } 9748 - ///State transition - sets the `blob_cids` field to Set 9749 - pub struct SetBlobCids<S: State = Empty>(PhantomData<fn() -> S>); 9750 - impl<S: State> sealed::Sealed for SetBlobCids<S> {} 9751 - impl<S: State> State for SetBlobCids<S> { 9752 - type Cid = S::Cid; 9753 - type Moderation = S::Moderation; 9724 + ///State transition - sets the `moderation` field to Set 9725 + pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 9726 + impl<S: State> sealed::Sealed for SetModeration<S> {} 9727 + impl<S: State> State for SetModeration<S> { 9754 9728 type Repo = S::Repo; 9755 9729 type Uri = S::Uri; 9756 - type BlobCids = Set<members::blob_cids>; 9730 + type Moderation = Set<members::moderation>; 9757 9731 type IndexedAt = S::IndexedAt; 9732 + type Cid = S::Cid; 9733 + type BlobCids = S::BlobCids; 9758 9734 type Value = S::Value; 9759 9735 } 9760 9736 ///State transition - sets the `indexed_at` field to Set 9761 9737 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 9762 9738 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 9763 9739 impl<S: State> State for SetIndexedAt<S> { 9740 + type Repo = S::Repo; 9741 + type Uri = S::Uri; 9742 + type Moderation = S::Moderation; 9743 + type IndexedAt = Set<members::indexed_at>; 9764 9744 type Cid = S::Cid; 9745 + type BlobCids = S::BlobCids; 9746 + type Value = S::Value; 9747 + } 9748 + ///State transition - sets the `cid` field to Set 9749 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 9750 + impl<S: State> sealed::Sealed for SetCid<S> {} 9751 + impl<S: State> State for SetCid<S> { 9752 + type Repo = S::Repo; 9753 + type Uri = S::Uri; 9765 9754 type Moderation = S::Moderation; 9755 + type IndexedAt = S::IndexedAt; 9756 + type Cid = Set<members::cid>; 9757 + type BlobCids = S::BlobCids; 9758 + type Value = S::Value; 9759 + } 9760 + ///State transition - sets the `blob_cids` field to Set 9761 + pub struct SetBlobCids<S: State = Empty>(PhantomData<fn() -> S>); 9762 + impl<S: State> sealed::Sealed for SetBlobCids<S> {} 9763 + impl<S: State> State for SetBlobCids<S> { 9766 9764 type Repo = S::Repo; 9767 9765 type Uri = S::Uri; 9768 - type BlobCids = S::BlobCids; 9769 - type IndexedAt = Set<members::indexed_at>; 9766 + type Moderation = S::Moderation; 9767 + type IndexedAt = S::IndexedAt; 9768 + type Cid = S::Cid; 9769 + type BlobCids = Set<members::blob_cids>; 9770 9770 type Value = S::Value; 9771 9771 } 9772 9772 ///State transition - sets the `value` field to Set 9773 9773 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 9774 9774 impl<S: State> sealed::Sealed for SetValue<S> {} 9775 9775 impl<S: State> State for SetValue<S> { 9776 - type Cid = S::Cid; 9777 - type Moderation = S::Moderation; 9778 9776 type Repo = S::Repo; 9779 9777 type Uri = S::Uri; 9778 + type Moderation = S::Moderation; 9779 + type IndexedAt = S::IndexedAt; 9780 + type Cid = S::Cid; 9780 9781 type BlobCids = S::BlobCids; 9781 - type IndexedAt = S::IndexedAt; 9782 9782 type Value = Set<members::value>; 9783 9783 } 9784 9784 /// Marker types for field names 9785 9785 #[allow(non_camel_case_types)] 9786 9786 pub mod members { 9787 - ///Marker type for the `cid` field 9788 - pub struct cid(()); 9789 - ///Marker type for the `moderation` field 9790 - pub struct moderation(()); 9791 9787 ///Marker type for the `repo` field 9792 9788 pub struct repo(()); 9793 9789 ///Marker type for the `uri` field 9794 9790 pub struct uri(()); 9791 + ///Marker type for the `moderation` field 9792 + pub struct moderation(()); 9793 + ///Marker type for the `indexed_at` field 9794 + pub struct indexed_at(()); 9795 + ///Marker type for the `cid` field 9796 + pub struct cid(()); 9795 9797 ///Marker type for the `blob_cids` field 9796 9798 pub struct blob_cids(()); 9797 - ///Marker type for the `indexed_at` field 9798 - pub struct indexed_at(()); 9799 9799 ///Marker type for the `value` field 9800 9800 pub struct value(()); 9801 9801 } ··· 9970 9970 impl<'a, S> RecordViewBuilder<'a, S> 9971 9971 where 9972 9972 S: record_view_state::State, 9973 - S::Cid: record_view_state::IsSet, 9974 - S::Moderation: record_view_state::IsSet, 9975 9973 S::Repo: record_view_state::IsSet, 9976 9974 S::Uri: record_view_state::IsSet, 9977 - S::BlobCids: record_view_state::IsSet, 9975 + S::Moderation: record_view_state::IsSet, 9978 9976 S::IndexedAt: record_view_state::IsSet, 9977 + S::Cid: record_view_state::IsSet, 9978 + S::BlobCids: record_view_state::IsSet, 9979 9979 S::Value: record_view_state::IsSet, 9980 9980 { 9981 9981 /// Build the final struct ··· 10069 10069 } 10070 10070 /// State trait tracking which required fields have been set 10071 10071 pub trait State: sealed::Sealed { 10072 - type Value; 10073 - type Repo; 10074 10072 type Blobs; 10075 - type Uri; 10076 - type Cid; 10077 10073 type IndexedAt; 10074 + type Repo; 10075 + type Value; 10078 10076 type Moderation; 10077 + type Uri; 10078 + type Cid; 10079 10079 } 10080 10080 /// Empty state - all required fields are unset 10081 10081 pub struct Empty(()); 10082 10082 impl sealed::Sealed for Empty {} 10083 10083 impl State for Empty { 10084 - type Value = Unset; 10085 - type Repo = Unset; 10086 10084 type Blobs = Unset; 10087 - type Uri = Unset; 10088 - type Cid = Unset; 10089 10085 type IndexedAt = Unset; 10086 + type Repo = Unset; 10087 + type Value = Unset; 10090 10088 type Moderation = Unset; 10089 + type Uri = Unset; 10090 + type Cid = Unset; 10091 10091 } 10092 - ///State transition - sets the `value` field to Set 10093 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 10094 - impl<S: State> sealed::Sealed for SetValue<S> {} 10095 - impl<S: State> State for SetValue<S> { 10096 - type Value = Set<members::value>; 10092 + ///State transition - sets the `blobs` field to Set 10093 + pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>); 10094 + impl<S: State> sealed::Sealed for SetBlobs<S> {} 10095 + impl<S: State> State for SetBlobs<S> { 10096 + type Blobs = Set<members::blobs>; 10097 + type IndexedAt = S::IndexedAt; 10097 10098 type Repo = S::Repo; 10099 + type Value = S::Value; 10100 + type Moderation = S::Moderation; 10101 + type Uri = S::Uri; 10102 + type Cid = S::Cid; 10103 + } 10104 + ///State transition - sets the `indexed_at` field to Set 10105 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 10106 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 10107 + impl<S: State> State for SetIndexedAt<S> { 10098 10108 type Blobs = S::Blobs; 10109 + type IndexedAt = Set<members::indexed_at>; 10110 + type Repo = S::Repo; 10111 + type Value = S::Value; 10112 + type Moderation = S::Moderation; 10099 10113 type Uri = S::Uri; 10100 10114 type Cid = S::Cid; 10101 - type IndexedAt = S::IndexedAt; 10102 - type Moderation = S::Moderation; 10103 10115 } 10104 10116 ///State transition - sets the `repo` field to Set 10105 10117 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 10106 10118 impl<S: State> sealed::Sealed for SetRepo<S> {} 10107 10119 impl<S: State> State for SetRepo<S> { 10120 + type Blobs = S::Blobs; 10121 + type IndexedAt = S::IndexedAt; 10122 + type Repo = Set<members::repo>; 10108 10123 type Value = S::Value; 10109 - type Repo = Set<members::repo>; 10110 - type Blobs = S::Blobs; 10124 + type Moderation = S::Moderation; 10111 10125 type Uri = S::Uri; 10112 10126 type Cid = S::Cid; 10127 + } 10128 + ///State transition - sets the `value` field to Set 10129 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 10130 + impl<S: State> sealed::Sealed for SetValue<S> {} 10131 + impl<S: State> State for SetValue<S> { 10132 + type Blobs = S::Blobs; 10113 10133 type IndexedAt = S::IndexedAt; 10134 + type Repo = S::Repo; 10135 + type Value = Set<members::value>; 10114 10136 type Moderation = S::Moderation; 10137 + type Uri = S::Uri; 10138 + type Cid = S::Cid; 10115 10139 } 10116 - ///State transition - sets the `blobs` field to Set 10117 - pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>); 10118 - impl<S: State> sealed::Sealed for SetBlobs<S> {} 10119 - impl<S: State> State for SetBlobs<S> { 10140 + ///State transition - sets the `moderation` field to Set 10141 + pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 10142 + impl<S: State> sealed::Sealed for SetModeration<S> {} 10143 + impl<S: State> State for SetModeration<S> { 10144 + type Blobs = S::Blobs; 10145 + type IndexedAt = S::IndexedAt; 10146 + type Repo = S::Repo; 10120 10147 type Value = S::Value; 10121 - type Repo = S::Repo; 10122 - type Blobs = Set<members::blobs>; 10148 + type Moderation = Set<members::moderation>; 10123 10149 type Uri = S::Uri; 10124 10150 type Cid = S::Cid; 10125 - type IndexedAt = S::IndexedAt; 10126 - type Moderation = S::Moderation; 10127 10151 } 10128 10152 ///State transition - sets the `uri` field to Set 10129 10153 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 10130 10154 impl<S: State> sealed::Sealed for SetUri<S> {} 10131 10155 impl<S: State> State for SetUri<S> { 10132 - type Value = S::Value; 10133 - type Repo = S::Repo; 10134 10156 type Blobs = S::Blobs; 10135 - type Uri = Set<members::uri>; 10136 - type Cid = S::Cid; 10137 10157 type IndexedAt = S::IndexedAt; 10158 + type Repo = S::Repo; 10159 + type Value = S::Value; 10138 10160 type Moderation = S::Moderation; 10161 + type Uri = Set<members::uri>; 10162 + type Cid = S::Cid; 10139 10163 } 10140 10164 ///State transition - sets the `cid` field to Set 10141 10165 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 10142 10166 impl<S: State> sealed::Sealed for SetCid<S> {} 10143 10167 impl<S: State> State for SetCid<S> { 10144 - type Value = S::Value; 10145 - type Repo = S::Repo; 10146 10168 type Blobs = S::Blobs; 10147 - type Uri = S::Uri; 10148 - type Cid = Set<members::cid>; 10149 10169 type IndexedAt = S::IndexedAt; 10150 - type Moderation = S::Moderation; 10151 - } 10152 - ///State transition - sets the `indexed_at` field to Set 10153 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 10154 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 10155 - impl<S: State> State for SetIndexedAt<S> { 10156 - type Value = S::Value; 10157 10170 type Repo = S::Repo; 10158 - type Blobs = S::Blobs; 10159 - type Uri = S::Uri; 10160 - type Cid = S::Cid; 10161 - type IndexedAt = Set<members::indexed_at>; 10162 - type Moderation = S::Moderation; 10163 - } 10164 - ///State transition - sets the `moderation` field to Set 10165 - pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 10166 - impl<S: State> sealed::Sealed for SetModeration<S> {} 10167 - impl<S: State> State for SetModeration<S> { 10168 10171 type Value = S::Value; 10169 - type Repo = S::Repo; 10170 - type Blobs = S::Blobs; 10172 + type Moderation = S::Moderation; 10171 10173 type Uri = S::Uri; 10172 - type Cid = S::Cid; 10173 - type IndexedAt = S::IndexedAt; 10174 - type Moderation = Set<members::moderation>; 10174 + type Cid = Set<members::cid>; 10175 10175 } 10176 10176 /// Marker types for field names 10177 10177 #[allow(non_camel_case_types)] 10178 10178 pub mod members { 10179 + ///Marker type for the `blobs` field 10180 + pub struct blobs(()); 10181 + ///Marker type for the `indexed_at` field 10182 + pub struct indexed_at(()); 10183 + ///Marker type for the `repo` field 10184 + pub struct repo(()); 10179 10185 ///Marker type for the `value` field 10180 10186 pub struct value(()); 10181 - ///Marker type for the `repo` field 10182 - pub struct repo(()); 10183 - ///Marker type for the `blobs` field 10184 - pub struct blobs(()); 10187 + ///Marker type for the `moderation` field 10188 + pub struct moderation(()); 10185 10189 ///Marker type for the `uri` field 10186 10190 pub struct uri(()); 10187 10191 ///Marker type for the `cid` field 10188 10192 pub struct cid(()); 10189 - ///Marker type for the `indexed_at` field 10190 - pub struct indexed_at(()); 10191 - ///Marker type for the `moderation` field 10192 - pub struct moderation(()); 10193 10193 } 10194 10194 } 10195 10195 ··· 10382 10382 impl<'a, S> RecordViewDetailBuilder<'a, S> 10383 10383 where 10384 10384 S: record_view_detail_state::State, 10385 - S::Value: record_view_detail_state::IsSet, 10386 - S::Repo: record_view_detail_state::IsSet, 10387 10385 S::Blobs: record_view_detail_state::IsSet, 10388 - S::Uri: record_view_detail_state::IsSet, 10389 - S::Cid: record_view_detail_state::IsSet, 10390 10386 S::IndexedAt: record_view_detail_state::IsSet, 10387 + S::Repo: record_view_detail_state::IsSet, 10388 + S::Value: record_view_detail_state::IsSet, 10391 10389 S::Moderation: record_view_detail_state::IsSet, 10390 + S::Uri: record_view_detail_state::IsSet, 10391 + S::Cid: record_view_detail_state::IsSet, 10392 10392 { 10393 10393 /// Build the final struct 10394 10394 pub fn build(self) -> RecordViewDetail<'a> { ··· 10689 10689 } 10690 10690 /// State trait tracking which required fields have been set 10691 10691 pub trait State: sealed::Sealed { 10692 + type RelatedRecords; 10692 10693 type Handle; 10693 - type Did; 10694 10694 type IndexedAt; 10695 10695 type Moderation; 10696 - type RelatedRecords; 10696 + type Did; 10697 10697 } 10698 10698 /// Empty state - all required fields are unset 10699 10699 pub struct Empty(()); 10700 10700 impl sealed::Sealed for Empty {} 10701 10701 impl State for Empty { 10702 + type RelatedRecords = Unset; 10702 10703 type Handle = Unset; 10703 - type Did = Unset; 10704 10704 type IndexedAt = Unset; 10705 10705 type Moderation = Unset; 10706 - type RelatedRecords = Unset; 10706 + type Did = Unset; 10707 + } 10708 + ///State transition - sets the `related_records` field to Set 10709 + pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>); 10710 + impl<S: State> sealed::Sealed for SetRelatedRecords<S> {} 10711 + impl<S: State> State for SetRelatedRecords<S> { 10712 + type RelatedRecords = Set<members::related_records>; 10713 + type Handle = S::Handle; 10714 + type IndexedAt = S::IndexedAt; 10715 + type Moderation = S::Moderation; 10716 + type Did = S::Did; 10707 10717 } 10708 10718 ///State transition - sets the `handle` field to Set 10709 10719 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 10710 10720 impl<S: State> sealed::Sealed for SetHandle<S> {} 10711 10721 impl<S: State> State for SetHandle<S> { 10722 + type RelatedRecords = S::RelatedRecords; 10712 10723 type Handle = Set<members::handle>; 10713 - type Did = S::Did; 10714 10724 type IndexedAt = S::IndexedAt; 10715 10725 type Moderation = S::Moderation; 10716 - type RelatedRecords = S::RelatedRecords; 10717 - } 10718 - ///State transition - sets the `did` field to Set 10719 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 10720 - impl<S: State> sealed::Sealed for SetDid<S> {} 10721 - impl<S: State> State for SetDid<S> { 10722 - type Handle = S::Handle; 10723 - type Did = Set<members::did>; 10724 - type IndexedAt = S::IndexedAt; 10725 - type Moderation = S::Moderation; 10726 - type RelatedRecords = S::RelatedRecords; 10726 + type Did = S::Did; 10727 10727 } 10728 10728 ///State transition - sets the `indexed_at` field to Set 10729 10729 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 10730 10730 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 10731 10731 impl<S: State> State for SetIndexedAt<S> { 10732 + type RelatedRecords = S::RelatedRecords; 10732 10733 type Handle = S::Handle; 10733 - type Did = S::Did; 10734 10734 type IndexedAt = Set<members::indexed_at>; 10735 10735 type Moderation = S::Moderation; 10736 - type RelatedRecords = S::RelatedRecords; 10736 + type Did = S::Did; 10737 10737 } 10738 10738 ///State transition - sets the `moderation` field to Set 10739 10739 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 10740 10740 impl<S: State> sealed::Sealed for SetModeration<S> {} 10741 10741 impl<S: State> State for SetModeration<S> { 10742 + type RelatedRecords = S::RelatedRecords; 10742 10743 type Handle = S::Handle; 10743 - type Did = S::Did; 10744 10744 type IndexedAt = S::IndexedAt; 10745 10745 type Moderation = Set<members::moderation>; 10746 + type Did = S::Did; 10747 + } 10748 + ///State transition - sets the `did` field to Set 10749 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 10750 + impl<S: State> sealed::Sealed for SetDid<S> {} 10751 + impl<S: State> State for SetDid<S> { 10746 10752 type RelatedRecords = S::RelatedRecords; 10747 - } 10748 - ///State transition - sets the `related_records` field to Set 10749 - pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>); 10750 - impl<S: State> sealed::Sealed for SetRelatedRecords<S> {} 10751 - impl<S: State> State for SetRelatedRecords<S> { 10752 10753 type Handle = S::Handle; 10753 - type Did = S::Did; 10754 10754 type IndexedAt = S::IndexedAt; 10755 10755 type Moderation = S::Moderation; 10756 - type RelatedRecords = Set<members::related_records>; 10756 + type Did = Set<members::did>; 10757 10757 } 10758 10758 /// Marker types for field names 10759 10759 #[allow(non_camel_case_types)] 10760 10760 pub mod members { 10761 + ///Marker type for the `related_records` field 10762 + pub struct related_records(()); 10761 10763 ///Marker type for the `handle` field 10762 10764 pub struct handle(()); 10763 - ///Marker type for the `did` field 10764 - pub struct did(()); 10765 10765 ///Marker type for the `indexed_at` field 10766 10766 pub struct indexed_at(()); 10767 10767 ///Marker type for the `moderation` field 10768 10768 pub struct moderation(()); 10769 - ///Marker type for the `related_records` field 10770 - pub struct related_records(()); 10769 + ///Marker type for the `did` field 10770 + pub struct did(()); 10771 10771 } 10772 10772 } 10773 10773 ··· 11023 11023 impl<'a, S> RepoViewBuilder<'a, S> 11024 11024 where 11025 11025 S: repo_view_state::State, 11026 + S::RelatedRecords: repo_view_state::IsSet, 11026 11027 S::Handle: repo_view_state::IsSet, 11027 - S::Did: repo_view_state::IsSet, 11028 11028 S::IndexedAt: repo_view_state::IsSet, 11029 11029 S::Moderation: repo_view_state::IsSet, 11030 - S::RelatedRecords: repo_view_state::IsSet, 11030 + S::Did: repo_view_state::IsSet, 11031 11031 { 11032 11032 /// Build the final struct 11033 11033 pub fn build(self) -> RepoView<'a> { ··· 11149 11149 } 11150 11150 /// State trait tracking which required fields have been set 11151 11151 pub trait State: sealed::Sealed { 11152 - type RelatedRecords; 11153 11152 type IndexedAt; 11154 - type Handle; 11155 - type Did; 11153 + type RelatedRecords; 11156 11154 type Moderation; 11155 + type Did; 11156 + type Handle; 11157 11157 } 11158 11158 /// Empty state - all required fields are unset 11159 11159 pub struct Empty(()); 11160 11160 impl sealed::Sealed for Empty {} 11161 11161 impl State for Empty { 11162 - type RelatedRecords = Unset; 11163 11162 type IndexedAt = Unset; 11164 - type Handle = Unset; 11165 - type Did = Unset; 11163 + type RelatedRecords = Unset; 11166 11164 type Moderation = Unset; 11167 - } 11168 - ///State transition - sets the `related_records` field to Set 11169 - pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>); 11170 - impl<S: State> sealed::Sealed for SetRelatedRecords<S> {} 11171 - impl<S: State> State for SetRelatedRecords<S> { 11172 - type RelatedRecords = Set<members::related_records>; 11173 - type IndexedAt = S::IndexedAt; 11174 - type Handle = S::Handle; 11175 - type Did = S::Did; 11176 - type Moderation = S::Moderation; 11165 + type Did = Unset; 11166 + type Handle = Unset; 11177 11167 } 11178 11168 ///State transition - sets the `indexed_at` field to Set 11179 11169 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 11180 11170 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 11181 11171 impl<S: State> State for SetIndexedAt<S> { 11182 - type RelatedRecords = S::RelatedRecords; 11183 11172 type IndexedAt = Set<members::indexed_at>; 11184 - type Handle = S::Handle; 11173 + type RelatedRecords = S::RelatedRecords; 11174 + type Moderation = S::Moderation; 11185 11175 type Did = S::Did; 11176 + type Handle = S::Handle; 11177 + } 11178 + ///State transition - sets the `related_records` field to Set 11179 + pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>); 11180 + impl<S: State> sealed::Sealed for SetRelatedRecords<S> {} 11181 + impl<S: State> State for SetRelatedRecords<S> { 11182 + type IndexedAt = S::IndexedAt; 11183 + type RelatedRecords = Set<members::related_records>; 11186 11184 type Moderation = S::Moderation; 11185 + type Did = S::Did; 11186 + type Handle = S::Handle; 11187 11187 } 11188 - ///State transition - sets the `handle` field to Set 11189 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 11190 - impl<S: State> sealed::Sealed for SetHandle<S> {} 11191 - impl<S: State> State for SetHandle<S> { 11192 - type RelatedRecords = S::RelatedRecords; 11188 + ///State transition - sets the `moderation` field to Set 11189 + pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 11190 + impl<S: State> sealed::Sealed for SetModeration<S> {} 11191 + impl<S: State> State for SetModeration<S> { 11193 11192 type IndexedAt = S::IndexedAt; 11194 - type Handle = Set<members::handle>; 11193 + type RelatedRecords = S::RelatedRecords; 11194 + type Moderation = Set<members::moderation>; 11195 11195 type Did = S::Did; 11196 - type Moderation = S::Moderation; 11196 + type Handle = S::Handle; 11197 11197 } 11198 11198 ///State transition - sets the `did` field to Set 11199 11199 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 11200 11200 impl<S: State> sealed::Sealed for SetDid<S> {} 11201 11201 impl<S: State> State for SetDid<S> { 11202 + type IndexedAt = S::IndexedAt; 11202 11203 type RelatedRecords = S::RelatedRecords; 11203 - type IndexedAt = S::IndexedAt; 11204 + type Moderation = S::Moderation; 11205 + type Did = Set<members::did>; 11204 11206 type Handle = S::Handle; 11205 - type Did = Set<members::did>; 11206 - type Moderation = S::Moderation; 11207 11207 } 11208 - ///State transition - sets the `moderation` field to Set 11209 - pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 11210 - impl<S: State> sealed::Sealed for SetModeration<S> {} 11211 - impl<S: State> State for SetModeration<S> { 11212 - type RelatedRecords = S::RelatedRecords; 11208 + ///State transition - sets the `handle` field to Set 11209 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 11210 + impl<S: State> sealed::Sealed for SetHandle<S> {} 11211 + impl<S: State> State for SetHandle<S> { 11213 11212 type IndexedAt = S::IndexedAt; 11214 - type Handle = S::Handle; 11213 + type RelatedRecords = S::RelatedRecords; 11214 + type Moderation = S::Moderation; 11215 11215 type Did = S::Did; 11216 - type Moderation = Set<members::moderation>; 11216 + type Handle = Set<members::handle>; 11217 11217 } 11218 11218 /// Marker types for field names 11219 11219 #[allow(non_camel_case_types)] 11220 11220 pub mod members { 11221 + ///Marker type for the `indexed_at` field 11222 + pub struct indexed_at(()); 11221 11223 ///Marker type for the `related_records` field 11222 11224 pub struct related_records(()); 11223 - ///Marker type for the `indexed_at` field 11224 - pub struct indexed_at(()); 11225 - ///Marker type for the `handle` field 11226 - pub struct handle(()); 11225 + ///Marker type for the `moderation` field 11226 + pub struct moderation(()); 11227 11227 ///Marker type for the `did` field 11228 11228 pub struct did(()); 11229 - ///Marker type for the `moderation` field 11230 - pub struct moderation(()); 11229 + ///Marker type for the `handle` field 11230 + pub struct handle(()); 11231 11231 } 11232 11232 } 11233 11233 ··· 11546 11546 impl<'a, S> RepoViewDetailBuilder<'a, S> 11547 11547 where 11548 11548 S: repo_view_detail_state::State, 11549 + S::IndexedAt: repo_view_detail_state::IsSet, 11549 11550 S::RelatedRecords: repo_view_detail_state::IsSet, 11550 - S::IndexedAt: repo_view_detail_state::IsSet, 11551 + S::Moderation: repo_view_detail_state::IsSet, 11552 + S::Did: repo_view_detail_state::IsSet, 11551 11553 S::Handle: repo_view_detail_state::IsSet, 11552 - S::Did: repo_view_detail_state::IsSet, 11553 - S::Moderation: repo_view_detail_state::IsSet, 11554 11554 { 11555 11555 /// Build the final struct 11556 11556 pub fn build(self) -> RepoViewDetail<'a> { ··· 11797 11797 } 11798 11798 /// State trait tracking which required fields have been set 11799 11799 pub trait State: sealed::Sealed { 11800 - type ReportedRecordCount; 11800 + type Did; 11801 + type LabeledRecordCount; 11802 + type ReportedAccountCount; 11801 11803 type RecordReportCount; 11804 + type ReportedRecordCount; 11805 + type LabeledAccountCount; 11806 + type AccountReportCount; 11802 11807 type TakendownRecordCount; 11803 11808 type TakendownAccountCount; 11804 - type ReportedAccountCount; 11805 - type LabeledRecordCount; 11806 - type Did; 11807 - type LabeledAccountCount; 11808 - type AccountReportCount; 11809 11809 } 11810 11810 /// Empty state - all required fields are unset 11811 11811 pub struct Empty(()); 11812 11812 impl sealed::Sealed for Empty {} 11813 11813 impl State for Empty { 11814 - type ReportedRecordCount = Unset; 11814 + type Did = Unset; 11815 + type LabeledRecordCount = Unset; 11816 + type ReportedAccountCount = Unset; 11815 11817 type RecordReportCount = Unset; 11818 + type ReportedRecordCount = Unset; 11819 + type LabeledAccountCount = Unset; 11820 + type AccountReportCount = Unset; 11816 11821 type TakendownRecordCount = Unset; 11817 11822 type TakendownAccountCount = Unset; 11818 - type ReportedAccountCount = Unset; 11819 - type LabeledRecordCount = Unset; 11820 - type Did = Unset; 11821 - type LabeledAccountCount = Unset; 11822 - type AccountReportCount = Unset; 11823 11823 } 11824 - ///State transition - sets the `reported_record_count` field to Set 11825 - pub struct SetReportedRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11826 - impl<S: State> sealed::Sealed for SetReportedRecordCount<S> {} 11827 - impl<S: State> State for SetReportedRecordCount<S> { 11828 - type ReportedRecordCount = Set<members::reported_record_count>; 11829 - type RecordReportCount = S::RecordReportCount; 11830 - type TakendownRecordCount = S::TakendownRecordCount; 11831 - type TakendownAccountCount = S::TakendownAccountCount; 11832 - type ReportedAccountCount = S::ReportedAccountCount; 11824 + ///State transition - sets the `did` field to Set 11825 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 11826 + impl<S: State> sealed::Sealed for SetDid<S> {} 11827 + impl<S: State> State for SetDid<S> { 11828 + type Did = Set<members::did>; 11833 11829 type LabeledRecordCount = S::LabeledRecordCount; 11834 - type Did = S::Did; 11830 + type ReportedAccountCount = S::ReportedAccountCount; 11831 + type RecordReportCount = S::RecordReportCount; 11832 + type ReportedRecordCount = S::ReportedRecordCount; 11835 11833 type LabeledAccountCount = S::LabeledAccountCount; 11836 11834 type AccountReportCount = S::AccountReportCount; 11837 - } 11838 - ///State transition - sets the `record_report_count` field to Set 11839 - pub struct SetRecordReportCount<S: State = Empty>(PhantomData<fn() -> S>); 11840 - impl<S: State> sealed::Sealed for SetRecordReportCount<S> {} 11841 - impl<S: State> State for SetRecordReportCount<S> { 11842 - type ReportedRecordCount = S::ReportedRecordCount; 11843 - type RecordReportCount = Set<members::record_report_count>; 11844 11835 type TakendownRecordCount = S::TakendownRecordCount; 11845 11836 type TakendownAccountCount = S::TakendownAccountCount; 11837 + } 11838 + ///State transition - sets the `labeled_record_count` field to Set 11839 + pub struct SetLabeledRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11840 + impl<S: State> sealed::Sealed for SetLabeledRecordCount<S> {} 11841 + impl<S: State> State for SetLabeledRecordCount<S> { 11842 + type Did = S::Did; 11843 + type LabeledRecordCount = Set<members::labeled_record_count>; 11846 11844 type ReportedAccountCount = S::ReportedAccountCount; 11847 - type LabeledRecordCount = S::LabeledRecordCount; 11848 - type Did = S::Did; 11849 - type LabeledAccountCount = S::LabeledAccountCount; 11850 - type AccountReportCount = S::AccountReportCount; 11851 - } 11852 - ///State transition - sets the `takendown_record_count` field to Set 11853 - pub struct SetTakendownRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11854 - impl<S: State> sealed::Sealed for SetTakendownRecordCount<S> {} 11855 - impl<S: State> State for SetTakendownRecordCount<S> { 11845 + type RecordReportCount = S::RecordReportCount; 11856 11846 type ReportedRecordCount = S::ReportedRecordCount; 11857 - type RecordReportCount = S::RecordReportCount; 11858 - type TakendownRecordCount = Set<members::takendown_record_count>; 11859 - type TakendownAccountCount = S::TakendownAccountCount; 11860 - type ReportedAccountCount = S::ReportedAccountCount; 11861 - type LabeledRecordCount = S::LabeledRecordCount; 11862 - type Did = S::Did; 11863 11847 type LabeledAccountCount = S::LabeledAccountCount; 11864 11848 type AccountReportCount = S::AccountReportCount; 11865 - } 11866 - ///State transition - sets the `takendown_account_count` field to Set 11867 - pub struct SetTakendownAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11868 - impl<S: State> sealed::Sealed for SetTakendownAccountCount<S> {} 11869 - impl<S: State> State for SetTakendownAccountCount<S> { 11870 - type ReportedRecordCount = S::ReportedRecordCount; 11871 - type RecordReportCount = S::RecordReportCount; 11872 11849 type TakendownRecordCount = S::TakendownRecordCount; 11873 - type TakendownAccountCount = Set<members::takendown_account_count>; 11874 - type ReportedAccountCount = S::ReportedAccountCount; 11875 - type LabeledRecordCount = S::LabeledRecordCount; 11876 - type Did = S::Did; 11877 - type LabeledAccountCount = S::LabeledAccountCount; 11878 - type AccountReportCount = S::AccountReportCount; 11850 + type TakendownAccountCount = S::TakendownAccountCount; 11879 11851 } 11880 11852 ///State transition - sets the `reported_account_count` field to Set 11881 11853 pub struct SetReportedAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11882 11854 impl<S: State> sealed::Sealed for SetReportedAccountCount<S> {} 11883 11855 impl<S: State> State for SetReportedAccountCount<S> { 11856 + type Did = S::Did; 11857 + type LabeledRecordCount = S::LabeledRecordCount; 11858 + type ReportedAccountCount = Set<members::reported_account_count>; 11859 + type RecordReportCount = S::RecordReportCount; 11884 11860 type ReportedRecordCount = S::ReportedRecordCount; 11885 - type RecordReportCount = S::RecordReportCount; 11861 + type LabeledAccountCount = S::LabeledAccountCount; 11862 + type AccountReportCount = S::AccountReportCount; 11886 11863 type TakendownRecordCount = S::TakendownRecordCount; 11887 11864 type TakendownAccountCount = S::TakendownAccountCount; 11888 - type ReportedAccountCount = Set<members::reported_account_count>; 11889 - type LabeledRecordCount = S::LabeledRecordCount; 11865 + } 11866 + ///State transition - sets the `record_report_count` field to Set 11867 + pub struct SetRecordReportCount<S: State = Empty>(PhantomData<fn() -> S>); 11868 + impl<S: State> sealed::Sealed for SetRecordReportCount<S> {} 11869 + impl<S: State> State for SetRecordReportCount<S> { 11890 11870 type Did = S::Did; 11871 + type LabeledRecordCount = S::LabeledRecordCount; 11872 + type ReportedAccountCount = S::ReportedAccountCount; 11873 + type RecordReportCount = Set<members::record_report_count>; 11874 + type ReportedRecordCount = S::ReportedRecordCount; 11891 11875 type LabeledAccountCount = S::LabeledAccountCount; 11892 11876 type AccountReportCount = S::AccountReportCount; 11893 - } 11894 - ///State transition - sets the `labeled_record_count` field to Set 11895 - pub struct SetLabeledRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11896 - impl<S: State> sealed::Sealed for SetLabeledRecordCount<S> {} 11897 - impl<S: State> State for SetLabeledRecordCount<S> { 11898 - type ReportedRecordCount = S::ReportedRecordCount; 11899 - type RecordReportCount = S::RecordReportCount; 11900 11877 type TakendownRecordCount = S::TakendownRecordCount; 11901 11878 type TakendownAccountCount = S::TakendownAccountCount; 11902 - type ReportedAccountCount = S::ReportedAccountCount; 11903 - type LabeledRecordCount = Set<members::labeled_record_count>; 11879 + } 11880 + ///State transition - sets the `reported_record_count` field to Set 11881 + pub struct SetReportedRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11882 + impl<S: State> sealed::Sealed for SetReportedRecordCount<S> {} 11883 + impl<S: State> State for SetReportedRecordCount<S> { 11904 11884 type Did = S::Did; 11885 + type LabeledRecordCount = S::LabeledRecordCount; 11886 + type ReportedAccountCount = S::ReportedAccountCount; 11887 + type RecordReportCount = S::RecordReportCount; 11888 + type ReportedRecordCount = Set<members::reported_record_count>; 11905 11889 type LabeledAccountCount = S::LabeledAccountCount; 11906 11890 type AccountReportCount = S::AccountReportCount; 11907 - } 11908 - ///State transition - sets the `did` field to Set 11909 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 11910 - impl<S: State> sealed::Sealed for SetDid<S> {} 11911 - impl<S: State> State for SetDid<S> { 11912 - type ReportedRecordCount = S::ReportedRecordCount; 11913 - type RecordReportCount = S::RecordReportCount; 11914 11891 type TakendownRecordCount = S::TakendownRecordCount; 11915 11892 type TakendownAccountCount = S::TakendownAccountCount; 11916 - type ReportedAccountCount = S::ReportedAccountCount; 11917 - type LabeledRecordCount = S::LabeledRecordCount; 11918 - type Did = Set<members::did>; 11919 - type LabeledAccountCount = S::LabeledAccountCount; 11920 - type AccountReportCount = S::AccountReportCount; 11921 11893 } 11922 11894 ///State transition - sets the `labeled_account_count` field to Set 11923 11895 pub struct SetLabeledAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11924 11896 impl<S: State> sealed::Sealed for SetLabeledAccountCount<S> {} 11925 11897 impl<S: State> State for SetLabeledAccountCount<S> { 11926 - type ReportedRecordCount = S::ReportedRecordCount; 11898 + type Did = S::Did; 11899 + type LabeledRecordCount = S::LabeledRecordCount; 11900 + type ReportedAccountCount = S::ReportedAccountCount; 11927 11901 type RecordReportCount = S::RecordReportCount; 11902 + type ReportedRecordCount = S::ReportedRecordCount; 11903 + type LabeledAccountCount = Set<members::labeled_account_count>; 11904 + type AccountReportCount = S::AccountReportCount; 11928 11905 type TakendownRecordCount = S::TakendownRecordCount; 11929 11906 type TakendownAccountCount = S::TakendownAccountCount; 11930 - type ReportedAccountCount = S::ReportedAccountCount; 11931 - type LabeledRecordCount = S::LabeledRecordCount; 11932 - type Did = S::Did; 11933 - type LabeledAccountCount = Set<members::labeled_account_count>; 11934 - type AccountReportCount = S::AccountReportCount; 11935 11907 } 11936 11908 ///State transition - sets the `account_report_count` field to Set 11937 11909 pub struct SetAccountReportCount<S: State = Empty>(PhantomData<fn() -> S>); 11938 11910 impl<S: State> sealed::Sealed for SetAccountReportCount<S> {} 11939 11911 impl<S: State> State for SetAccountReportCount<S> { 11940 - type ReportedRecordCount = S::ReportedRecordCount; 11912 + type Did = S::Did; 11913 + type LabeledRecordCount = S::LabeledRecordCount; 11914 + type ReportedAccountCount = S::ReportedAccountCount; 11941 11915 type RecordReportCount = S::RecordReportCount; 11916 + type ReportedRecordCount = S::ReportedRecordCount; 11917 + type LabeledAccountCount = S::LabeledAccountCount; 11918 + type AccountReportCount = Set<members::account_report_count>; 11942 11919 type TakendownRecordCount = S::TakendownRecordCount; 11943 11920 type TakendownAccountCount = S::TakendownAccountCount; 11921 + } 11922 + ///State transition - sets the `takendown_record_count` field to Set 11923 + pub struct SetTakendownRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11924 + impl<S: State> sealed::Sealed for SetTakendownRecordCount<S> {} 11925 + impl<S: State> State for SetTakendownRecordCount<S> { 11926 + type Did = S::Did; 11927 + type LabeledRecordCount = S::LabeledRecordCount; 11944 11928 type ReportedAccountCount = S::ReportedAccountCount; 11945 - type LabeledRecordCount = S::LabeledRecordCount; 11929 + type RecordReportCount = S::RecordReportCount; 11930 + type ReportedRecordCount = S::ReportedRecordCount; 11931 + type LabeledAccountCount = S::LabeledAccountCount; 11932 + type AccountReportCount = S::AccountReportCount; 11933 + type TakendownRecordCount = Set<members::takendown_record_count>; 11934 + type TakendownAccountCount = S::TakendownAccountCount; 11935 + } 11936 + ///State transition - sets the `takendown_account_count` field to Set 11937 + pub struct SetTakendownAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11938 + impl<S: State> sealed::Sealed for SetTakendownAccountCount<S> {} 11939 + impl<S: State> State for SetTakendownAccountCount<S> { 11946 11940 type Did = S::Did; 11941 + type LabeledRecordCount = S::LabeledRecordCount; 11942 + type ReportedAccountCount = S::ReportedAccountCount; 11943 + type RecordReportCount = S::RecordReportCount; 11944 + type ReportedRecordCount = S::ReportedRecordCount; 11947 11945 type LabeledAccountCount = S::LabeledAccountCount; 11948 - type AccountReportCount = Set<members::account_report_count>; 11946 + type AccountReportCount = S::AccountReportCount; 11947 + type TakendownRecordCount = S::TakendownRecordCount; 11948 + type TakendownAccountCount = Set<members::takendown_account_count>; 11949 11949 } 11950 11950 /// Marker types for field names 11951 11951 #[allow(non_camel_case_types)] 11952 11952 pub mod members { 11953 - ///Marker type for the `reported_record_count` field 11954 - pub struct reported_record_count(()); 11955 - ///Marker type for the `record_report_count` field 11956 - pub struct record_report_count(()); 11957 - ///Marker type for the `takendown_record_count` field 11958 - pub struct takendown_record_count(()); 11959 - ///Marker type for the `takendown_account_count` field 11960 - pub struct takendown_account_count(()); 11961 - ///Marker type for the `reported_account_count` field 11962 - pub struct reported_account_count(()); 11963 - ///Marker type for the `labeled_record_count` field 11964 - pub struct labeled_record_count(()); 11965 11953 ///Marker type for the `did` field 11966 11954 pub struct did(()); 11955 + ///Marker type for the `labeled_record_count` field 11956 + pub struct labeled_record_count(()); 11957 + ///Marker type for the `reported_account_count` field 11958 + pub struct reported_account_count(()); 11959 + ///Marker type for the `record_report_count` field 11960 + pub struct record_report_count(()); 11961 + ///Marker type for the `reported_record_count` field 11962 + pub struct reported_record_count(()); 11967 11963 ///Marker type for the `labeled_account_count` field 11968 11964 pub struct labeled_account_count(()); 11969 11965 ///Marker type for the `account_report_count` field 11970 11966 pub struct account_report_count(()); 11967 + ///Marker type for the `takendown_record_count` field 11968 + pub struct takendown_record_count(()); 11969 + ///Marker type for the `takendown_account_count` field 11970 + pub struct takendown_account_count(()); 11971 11971 } 11972 11972 } 11973 11973 ··· 12190 12190 impl<'a, S> ReporterStatsBuilder<'a, S> 12191 12191 where 12192 12192 S: reporter_stats_state::State, 12193 - S::ReportedRecordCount: reporter_stats_state::IsSet, 12194 - S::RecordReportCount: reporter_stats_state::IsSet, 12195 - S::TakendownRecordCount: reporter_stats_state::IsSet, 12196 - S::TakendownAccountCount: reporter_stats_state::IsSet, 12197 - S::ReportedAccountCount: reporter_stats_state::IsSet, 12198 - S::LabeledRecordCount: reporter_stats_state::IsSet, 12199 12193 S::Did: reporter_stats_state::IsSet, 12194 + S::LabeledRecordCount: reporter_stats_state::IsSet, 12195 + S::ReportedAccountCount: reporter_stats_state::IsSet, 12196 + S::RecordReportCount: reporter_stats_state::IsSet, 12197 + S::ReportedRecordCount: reporter_stats_state::IsSet, 12200 12198 S::LabeledAccountCount: reporter_stats_state::IsSet, 12201 12199 S::AccountReportCount: reporter_stats_state::IsSet, 12200 + S::TakendownRecordCount: reporter_stats_state::IsSet, 12201 + S::TakendownAccountCount: reporter_stats_state::IsSet, 12202 12202 { 12203 12203 /// Build the final struct 12204 12204 pub fn build(self) -> ReporterStats<'a> { ··· 12476 12476 } 12477 12477 /// State trait tracking which required fields have been set 12478 12478 pub trait State: sealed::Sealed { 12479 - type Id; 12479 + type CreatedBy; 12480 12480 type CreatedAt; 12481 12481 type Status; 12482 + type Id; 12483 + type Did; 12482 12484 type Action; 12483 - type Did; 12484 - type CreatedBy; 12485 12485 } 12486 12486 /// Empty state - all required fields are unset 12487 12487 pub struct Empty(()); 12488 12488 impl sealed::Sealed for Empty {} 12489 12489 impl State for Empty { 12490 - type Id = Unset; 12490 + type CreatedBy = Unset; 12491 12491 type CreatedAt = Unset; 12492 12492 type Status = Unset; 12493 - type Action = Unset; 12493 + type Id = Unset; 12494 12494 type Did = Unset; 12495 - type CreatedBy = Unset; 12495 + type Action = Unset; 12496 12496 } 12497 - ///State transition - sets the `id` field to Set 12498 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 12499 - impl<S: State> sealed::Sealed for SetId<S> {} 12500 - impl<S: State> State for SetId<S> { 12501 - type Id = Set<members::id>; 12497 + ///State transition - sets the `created_by` field to Set 12498 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 12499 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 12500 + impl<S: State> State for SetCreatedBy<S> { 12501 + type CreatedBy = Set<members::created_by>; 12502 12502 type CreatedAt = S::CreatedAt; 12503 12503 type Status = S::Status; 12504 + type Id = S::Id; 12505 + type Did = S::Did; 12504 12506 type Action = S::Action; 12505 - type Did = S::Did; 12506 - type CreatedBy = S::CreatedBy; 12507 12507 } 12508 12508 ///State transition - sets the `created_at` field to Set 12509 12509 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 12510 12510 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 12511 12511 impl<S: State> State for SetCreatedAt<S> { 12512 - type Id = S::Id; 12512 + type CreatedBy = S::CreatedBy; 12513 12513 type CreatedAt = Set<members::created_at>; 12514 12514 type Status = S::Status; 12515 - type Action = S::Action; 12515 + type Id = S::Id; 12516 12516 type Did = S::Did; 12517 - type CreatedBy = S::CreatedBy; 12517 + type Action = S::Action; 12518 12518 } 12519 12519 ///State transition - sets the `status` field to Set 12520 12520 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 12521 12521 impl<S: State> sealed::Sealed for SetStatus<S> {} 12522 12522 impl<S: State> State for SetStatus<S> { 12523 - type Id = S::Id; 12523 + type CreatedBy = S::CreatedBy; 12524 12524 type CreatedAt = S::CreatedAt; 12525 12525 type Status = Set<members::status>; 12526 + type Id = S::Id; 12527 + type Did = S::Did; 12526 12528 type Action = S::Action; 12527 - type Did = S::Did; 12528 - type CreatedBy = S::CreatedBy; 12529 12529 } 12530 - ///State transition - sets the `action` field to Set 12531 - pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 12532 - impl<S: State> sealed::Sealed for SetAction<S> {} 12533 - impl<S: State> State for SetAction<S> { 12534 - type Id = S::Id; 12530 + ///State transition - sets the `id` field to Set 12531 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 12532 + impl<S: State> sealed::Sealed for SetId<S> {} 12533 + impl<S: State> State for SetId<S> { 12534 + type CreatedBy = S::CreatedBy; 12535 12535 type CreatedAt = S::CreatedAt; 12536 12536 type Status = S::Status; 12537 - type Action = Set<members::action>; 12537 + type Id = Set<members::id>; 12538 12538 type Did = S::Did; 12539 - type CreatedBy = S::CreatedBy; 12539 + type Action = S::Action; 12540 12540 } 12541 12541 ///State transition - sets the `did` field to Set 12542 12542 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 12543 12543 impl<S: State> sealed::Sealed for SetDid<S> {} 12544 12544 impl<S: State> State for SetDid<S> { 12545 - type Id = S::Id; 12545 + type CreatedBy = S::CreatedBy; 12546 12546 type CreatedAt = S::CreatedAt; 12547 12547 type Status = S::Status; 12548 - type Action = S::Action; 12548 + type Id = S::Id; 12549 12549 type Did = Set<members::did>; 12550 - type CreatedBy = S::CreatedBy; 12550 + type Action = S::Action; 12551 12551 } 12552 - ///State transition - sets the `created_by` field to Set 12553 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 12554 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 12555 - impl<S: State> State for SetCreatedBy<S> { 12556 - type Id = S::Id; 12552 + ///State transition - sets the `action` field to Set 12553 + pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 12554 + impl<S: State> sealed::Sealed for SetAction<S> {} 12555 + impl<S: State> State for SetAction<S> { 12556 + type CreatedBy = S::CreatedBy; 12557 12557 type CreatedAt = S::CreatedAt; 12558 12558 type Status = S::Status; 12559 - type Action = S::Action; 12559 + type Id = S::Id; 12560 12560 type Did = S::Did; 12561 - type CreatedBy = Set<members::created_by>; 12561 + type Action = Set<members::action>; 12562 12562 } 12563 12563 /// Marker types for field names 12564 12564 #[allow(non_camel_case_types)] 12565 12565 pub mod members { 12566 - ///Marker type for the `id` field 12567 - pub struct id(()); 12566 + ///Marker type for the `created_by` field 12567 + pub struct created_by(()); 12568 12568 ///Marker type for the `created_at` field 12569 12569 pub struct created_at(()); 12570 12570 ///Marker type for the `status` field 12571 12571 pub struct status(()); 12572 - ///Marker type for the `action` field 12573 - pub struct action(()); 12572 + ///Marker type for the `id` field 12573 + pub struct id(()); 12574 12574 ///Marker type for the `did` field 12575 12575 pub struct did(()); 12576 - ///Marker type for the `created_by` field 12577 - pub struct created_by(()); 12576 + ///Marker type for the `action` field 12577 + pub struct action(()); 12578 12578 } 12579 12579 } 12580 12580 ··· 12911 12911 impl<'a, S> ScheduledActionViewBuilder<'a, S> 12912 12912 where 12913 12913 S: scheduled_action_view_state::State, 12914 - S::Id: scheduled_action_view_state::IsSet, 12914 + S::CreatedBy: scheduled_action_view_state::IsSet, 12915 12915 S::CreatedAt: scheduled_action_view_state::IsSet, 12916 12916 S::Status: scheduled_action_view_state::IsSet, 12917 - S::Action: scheduled_action_view_state::IsSet, 12917 + S::Id: scheduled_action_view_state::IsSet, 12918 12918 S::Did: scheduled_action_view_state::IsSet, 12919 - S::CreatedBy: scheduled_action_view_state::IsSet, 12919 + S::Action: scheduled_action_view_state::IsSet, 12920 12920 { 12921 12921 /// Build the final struct 12922 12922 pub fn build(self) -> ScheduledActionView<'a> { ··· 13401 13401 } 13402 13402 /// State trait tracking which required fields have been set 13403 13403 pub trait State: sealed::Sealed { 13404 - type CreatedAt; 13404 + type Id; 13405 + type Subject; 13405 13406 type UpdatedAt; 13406 - type Subject; 13407 13407 type ReviewState; 13408 - type Id; 13408 + type CreatedAt; 13409 13409 } 13410 13410 /// Empty state - all required fields are unset 13411 13411 pub struct Empty(()); 13412 13412 impl sealed::Sealed for Empty {} 13413 13413 impl State for Empty { 13414 - type CreatedAt = Unset; 13415 - type UpdatedAt = Unset; 13414 + type Id = Unset; 13416 13415 type Subject = Unset; 13416 + type UpdatedAt = Unset; 13417 13417 type ReviewState = Unset; 13418 - type Id = Unset; 13418 + type CreatedAt = Unset; 13419 13419 } 13420 - ///State transition - sets the `created_at` field to Set 13421 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 13422 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 13423 - impl<S: State> State for SetCreatedAt<S> { 13424 - type CreatedAt = Set<members::created_at>; 13420 + ///State transition - sets the `id` field to Set 13421 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 13422 + impl<S: State> sealed::Sealed for SetId<S> {} 13423 + impl<S: State> State for SetId<S> { 13424 + type Id = Set<members::id>; 13425 + type Subject = S::Subject; 13425 13426 type UpdatedAt = S::UpdatedAt; 13426 - type Subject = S::Subject; 13427 13427 type ReviewState = S::ReviewState; 13428 - type Id = S::Id; 13429 - } 13430 - ///State transition - sets the `updated_at` field to Set 13431 - pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 13432 - impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 13433 - impl<S: State> State for SetUpdatedAt<S> { 13434 13428 type CreatedAt = S::CreatedAt; 13435 - type UpdatedAt = Set<members::updated_at>; 13436 - type Subject = S::Subject; 13437 - type ReviewState = S::ReviewState; 13438 - type Id = S::Id; 13439 13429 } 13440 13430 ///State transition - sets the `subject` field to Set 13441 13431 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 13442 13432 impl<S: State> sealed::Sealed for SetSubject<S> {} 13443 13433 impl<S: State> State for SetSubject<S> { 13444 - type CreatedAt = S::CreatedAt; 13445 - type UpdatedAt = S::UpdatedAt; 13434 + type Id = S::Id; 13446 13435 type Subject = Set<members::subject>; 13436 + type UpdatedAt = S::UpdatedAt; 13447 13437 type ReviewState = S::ReviewState; 13438 + type CreatedAt = S::CreatedAt; 13439 + } 13440 + ///State transition - sets the `updated_at` field to Set 13441 + pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 13442 + impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 13443 + impl<S: State> State for SetUpdatedAt<S> { 13448 13444 type Id = S::Id; 13445 + type Subject = S::Subject; 13446 + type UpdatedAt = Set<members::updated_at>; 13447 + type ReviewState = S::ReviewState; 13448 + type CreatedAt = S::CreatedAt; 13449 13449 } 13450 13450 ///State transition - sets the `review_state` field to Set 13451 13451 pub struct SetReviewState<S: State = Empty>(PhantomData<fn() -> S>); 13452 13452 impl<S: State> sealed::Sealed for SetReviewState<S> {} 13453 13453 impl<S: State> State for SetReviewState<S> { 13454 - type CreatedAt = S::CreatedAt; 13454 + type Id = S::Id; 13455 + type Subject = S::Subject; 13455 13456 type UpdatedAt = S::UpdatedAt; 13456 - type Subject = S::Subject; 13457 13457 type ReviewState = Set<members::review_state>; 13458 - type Id = S::Id; 13458 + type CreatedAt = S::CreatedAt; 13459 13459 } 13460 - ///State transition - sets the `id` field to Set 13461 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 13462 - impl<S: State> sealed::Sealed for SetId<S> {} 13463 - impl<S: State> State for SetId<S> { 13464 - type CreatedAt = S::CreatedAt; 13460 + ///State transition - sets the `created_at` field to Set 13461 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 13462 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 13463 + impl<S: State> State for SetCreatedAt<S> { 13464 + type Id = S::Id; 13465 + type Subject = S::Subject; 13465 13466 type UpdatedAt = S::UpdatedAt; 13466 - type Subject = S::Subject; 13467 13467 type ReviewState = S::ReviewState; 13468 - type Id = Set<members::id>; 13468 + type CreatedAt = Set<members::created_at>; 13469 13469 } 13470 13470 /// Marker types for field names 13471 13471 #[allow(non_camel_case_types)] 13472 13472 pub mod members { 13473 - ///Marker type for the `created_at` field 13474 - pub struct created_at(()); 13475 - ///Marker type for the `updated_at` field 13476 - pub struct updated_at(()); 13473 + ///Marker type for the `id` field 13474 + pub struct id(()); 13477 13475 ///Marker type for the `subject` field 13478 13476 pub struct subject(()); 13477 + ///Marker type for the `updated_at` field 13478 + pub struct updated_at(()); 13479 13479 ///Marker type for the `review_state` field 13480 13480 pub struct review_state(()); 13481 - ///Marker type for the `id` field 13482 - pub struct id(()); 13481 + ///Marker type for the `created_at` field 13482 + pub struct created_at(()); 13483 13483 } 13484 13484 } 13485 13485 ··· 14014 14014 impl<'a, S> SubjectStatusViewBuilder<'a, S> 14015 14015 where 14016 14016 S: subject_status_view_state::State, 14017 - S::CreatedAt: subject_status_view_state::IsSet, 14018 - S::UpdatedAt: subject_status_view_state::IsSet, 14017 + S::Id: subject_status_view_state::IsSet, 14019 14018 S::Subject: subject_status_view_state::IsSet, 14019 + S::UpdatedAt: subject_status_view_state::IsSet, 14020 14020 S::ReviewState: subject_status_view_state::IsSet, 14021 - S::Id: subject_status_view_state::IsSet, 14021 + S::CreatedAt: subject_status_view_state::IsSet, 14022 14022 { 14023 14023 /// Build the final struct 14024 14024 pub fn build(self) -> SubjectStatusView<'a> { ··· 14741 14741 } 14742 14742 /// State trait tracking which required fields have been set 14743 14743 pub trait State: sealed::Sealed { 14744 - type Width; 14745 14744 type Length; 14745 + type Width; 14746 14746 type Height; 14747 14747 } 14748 14748 /// Empty state - all required fields are unset 14749 14749 pub struct Empty(()); 14750 14750 impl sealed::Sealed for Empty {} 14751 14751 impl State for Empty { 14752 - type Width = Unset; 14753 14752 type Length = Unset; 14753 + type Width = Unset; 14754 14754 type Height = Unset; 14755 14755 } 14756 - ///State transition - sets the `width` field to Set 14757 - pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 14758 - impl<S: State> sealed::Sealed for SetWidth<S> {} 14759 - impl<S: State> State for SetWidth<S> { 14760 - type Width = Set<members::width>; 14761 - type Length = S::Length; 14762 - type Height = S::Height; 14763 - } 14764 14756 ///State transition - sets the `length` field to Set 14765 14757 pub struct SetLength<S: State = Empty>(PhantomData<fn() -> S>); 14766 14758 impl<S: State> sealed::Sealed for SetLength<S> {} 14767 14759 impl<S: State> State for SetLength<S> { 14768 - type Width = S::Width; 14769 14760 type Length = Set<members::length>; 14761 + type Width = S::Width; 14762 + type Height = S::Height; 14763 + } 14764 + ///State transition - sets the `width` field to Set 14765 + pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 14766 + impl<S: State> sealed::Sealed for SetWidth<S> {} 14767 + impl<S: State> State for SetWidth<S> { 14768 + type Length = S::Length; 14769 + type Width = Set<members::width>; 14770 14770 type Height = S::Height; 14771 14771 } 14772 14772 ///State transition - sets the `height` field to Set 14773 14773 pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 14774 14774 impl<S: State> sealed::Sealed for SetHeight<S> {} 14775 14775 impl<S: State> State for SetHeight<S> { 14776 - type Width = S::Width; 14777 14776 type Length = S::Length; 14777 + type Width = S::Width; 14778 14778 type Height = Set<members::height>; 14779 14779 } 14780 14780 /// Marker types for field names 14781 14781 #[allow(non_camel_case_types)] 14782 14782 pub mod members { 14783 + ///Marker type for the `length` field 14784 + pub struct length(()); 14783 14785 ///Marker type for the `width` field 14784 14786 pub struct width(()); 14785 - ///Marker type for the `length` field 14786 - pub struct length(()); 14787 14787 ///Marker type for the `height` field 14788 14788 pub struct height(()); 14789 14789 } ··· 14878 14878 impl<'a, S> VideoDetailsBuilder<'a, S> 14879 14879 where 14880 14880 S: video_details_state::State, 14881 - S::Width: video_details_state::IsSet, 14882 14881 S::Length: video_details_state::IsSet, 14882 + S::Width: video_details_state::IsSet, 14883 14883 S::Height: video_details_state::IsSet, 14884 14884 { 14885 14885 /// Build the final struct
+15 -15
crates/weaver-api/src/tools_ozone/moderation/emit_event.rs
··· 47 47 } 48 48 /// State trait tracking which required fields have been set 49 49 pub trait State: sealed::Sealed { 50 + type Event; 50 51 type Subject; 51 52 type CreatedBy; 52 - type Event; 53 53 } 54 54 /// Empty state - all required fields are unset 55 55 pub struct Empty(()); 56 56 impl sealed::Sealed for Empty {} 57 57 impl State for Empty { 58 + type Event = Unset; 58 59 type Subject = Unset; 59 60 type CreatedBy = Unset; 60 - type Event = Unset; 61 + } 62 + ///State transition - sets the `event` field to Set 63 + pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetEvent<S> {} 65 + impl<S: State> State for SetEvent<S> { 66 + type Event = Set<members::event>; 67 + type Subject = S::Subject; 68 + type CreatedBy = S::CreatedBy; 61 69 } 62 70 ///State transition - sets the `subject` field to Set 63 71 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 64 72 impl<S: State> sealed::Sealed for SetSubject<S> {} 65 73 impl<S: State> State for SetSubject<S> { 74 + type Event = S::Event; 66 75 type Subject = Set<members::subject>; 67 76 type CreatedBy = S::CreatedBy; 68 - type Event = S::Event; 69 77 } 70 78 ///State transition - sets the `created_by` field to Set 71 79 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 72 80 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 73 81 impl<S: State> State for SetCreatedBy<S> { 74 - type Subject = S::Subject; 75 - type CreatedBy = Set<members::created_by>; 76 82 type Event = S::Event; 77 - } 78 - ///State transition - sets the `event` field to Set 79 - pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 80 - impl<S: State> sealed::Sealed for SetEvent<S> {} 81 - impl<S: State> State for SetEvent<S> { 82 83 type Subject = S::Subject; 83 - type CreatedBy = S::CreatedBy; 84 - type Event = Set<members::event>; 84 + type CreatedBy = Set<members::created_by>; 85 85 } 86 86 /// Marker types for field names 87 87 #[allow(non_camel_case_types)] 88 88 pub mod members { 89 + ///Marker type for the `event` field 90 + pub struct event(()); 89 91 ///Marker type for the `subject` field 90 92 pub struct subject(()); 91 93 ///Marker type for the `created_by` field 92 94 pub struct created_by(()); 93 - ///Marker type for the `event` field 94 - pub struct event(()); 95 95 } 96 96 } 97 97 ··· 244 244 impl<'a, S> EmitEventBuilder<'a, S> 245 245 where 246 246 S: emit_event_state::State, 247 + S::Event: emit_event_state::IsSet, 247 248 S::Subject: emit_event_state::IsSet, 248 249 S::CreatedBy: emit_event_state::IsSet, 249 - S::Event: emit_event_state::IsSet, 250 250 { 251 251 /// Build the final struct 252 252 pub fn build(self) -> EmitEvent<'a> {
+28 -28
crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs
··· 219 219 } 220 220 /// State trait tracking which required fields have been set 221 221 pub trait State: sealed::Sealed { 222 - type Summary; 223 222 type Day; 223 + type Summary; 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 Summary = Unset; 230 229 type Day = Unset; 231 - } 232 - ///State transition - sets the `summary` field to Set 233 - pub struct SetSummary<S: State = Empty>(PhantomData<fn() -> S>); 234 - impl<S: State> sealed::Sealed for SetSummary<S> {} 235 - impl<S: State> State for SetSummary<S> { 236 - type Summary = Set<members::summary>; 237 - type Day = S::Day; 230 + type Summary = Unset; 238 231 } 239 232 ///State transition - sets the `day` field to Set 240 233 pub struct SetDay<S: State = Empty>(PhantomData<fn() -> S>); 241 234 impl<S: State> sealed::Sealed for SetDay<S> {} 242 235 impl<S: State> State for SetDay<S> { 243 - type Summary = S::Summary; 244 236 type Day = Set<members::day>; 237 + type Summary = S::Summary; 238 + } 239 + ///State transition - sets the `summary` field to Set 240 + pub struct SetSummary<S: State = Empty>(PhantomData<fn() -> S>); 241 + impl<S: State> sealed::Sealed for SetSummary<S> {} 242 + impl<S: State> State for SetSummary<S> { 243 + type Day = S::Day; 244 + type Summary = Set<members::summary>; 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 `summary` field 250 - pub struct summary(()); 251 249 ///Marker type for the `day` field 252 250 pub struct day(()); 251 + ///Marker type for the `summary` field 252 + pub struct summary(()); 253 253 } 254 254 } 255 255 ··· 334 334 impl<'a, S> TimelineItemBuilder<'a, S> 335 335 where 336 336 S: timeline_item_state::State, 337 - S::Summary: timeline_item_state::IsSet, 338 337 S::Day: timeline_item_state::IsSet, 338 + S::Summary: timeline_item_state::IsSet, 339 339 { 340 340 /// Build the final struct 341 341 pub fn build(self) -> TimelineItem<'a> { ··· 575 575 } 576 576 /// State trait tracking which required fields have been set 577 577 pub trait State: sealed::Sealed { 578 - type Count; 579 578 type EventSubjectType; 580 579 type EventType; 580 + type Count; 581 581 } 582 582 /// Empty state - all required fields are unset 583 583 pub struct Empty(()); 584 584 impl sealed::Sealed for Empty {} 585 585 impl State for Empty { 586 - type Count = Unset; 587 586 type EventSubjectType = Unset; 588 587 type EventType = Unset; 589 - } 590 - ///State transition - sets the `count` field to Set 591 - pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 592 - impl<S: State> sealed::Sealed for SetCount<S> {} 593 - impl<S: State> State for SetCount<S> { 594 - type Count = Set<members::count>; 595 - type EventSubjectType = S::EventSubjectType; 596 - type EventType = S::EventType; 588 + type Count = Unset; 597 589 } 598 590 ///State transition - sets the `event_subject_type` field to Set 599 591 pub struct SetEventSubjectType<S: State = Empty>(PhantomData<fn() -> S>); 600 592 impl<S: State> sealed::Sealed for SetEventSubjectType<S> {} 601 593 impl<S: State> State for SetEventSubjectType<S> { 602 - type Count = S::Count; 603 594 type EventSubjectType = Set<members::event_subject_type>; 604 595 type EventType = S::EventType; 596 + type Count = S::Count; 605 597 } 606 598 ///State transition - sets the `event_type` field to Set 607 599 pub struct SetEventType<S: State = Empty>(PhantomData<fn() -> S>); 608 600 impl<S: State> sealed::Sealed for SetEventType<S> {} 609 601 impl<S: State> State for SetEventType<S> { 610 - type Count = S::Count; 611 602 type EventSubjectType = S::EventSubjectType; 612 603 type EventType = Set<members::event_type>; 604 + type Count = S::Count; 605 + } 606 + ///State transition - sets the `count` field to Set 607 + pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 608 + impl<S: State> sealed::Sealed for SetCount<S> {} 609 + impl<S: State> State for SetCount<S> { 610 + type EventSubjectType = S::EventSubjectType; 611 + type EventType = S::EventType; 612 + type Count = Set<members::count>; 613 613 } 614 614 /// Marker types for field names 615 615 #[allow(non_camel_case_types)] 616 616 pub mod members { 617 - ///Marker type for the `count` field 618 - pub struct count(()); 619 617 ///Marker type for the `event_subject_type` field 620 618 pub struct event_subject_type(()); 621 619 ///Marker type for the `event_type` field 622 620 pub struct event_type(()); 621 + ///Marker type for the `count` field 622 + pub struct count(()); 623 623 } 624 624 } 625 625 ··· 715 715 impl<'a, S> TimelineItemSummaryBuilder<'a, S> 716 716 where 717 717 S: timeline_item_summary_state::State, 718 - S::Count: timeline_item_summary_state::IsSet, 719 718 S::EventSubjectType: timeline_item_summary_state::IsSet, 720 719 S::EventType: timeline_item_summary_state::IsSet, 720 + S::Count: timeline_item_summary_state::IsSet, 721 721 { 722 722 /// Build the final struct 723 723 pub fn build(self) -> TimelineItemSummary<'a> {
+44 -44
crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs
··· 761 761 } 762 762 /// State trait tracking which required fields have been set 763 763 pub trait State: sealed::Sealed { 764 - type Subjects; 765 - type CreatedBy; 766 764 type Action; 767 765 type Scheduling; 766 + type Subjects; 767 + type CreatedBy; 768 768 } 769 769 /// Empty state - all required fields are unset 770 770 pub struct Empty(()); 771 771 impl sealed::Sealed for Empty {} 772 772 impl State for Empty { 773 - type Subjects = Unset; 774 - type CreatedBy = Unset; 775 773 type Action = Unset; 776 774 type Scheduling = Unset; 777 - } 778 - ///State transition - sets the `subjects` field to Set 779 - pub struct SetSubjects<S: State = Empty>(PhantomData<fn() -> S>); 780 - impl<S: State> sealed::Sealed for SetSubjects<S> {} 781 - impl<S: State> State for SetSubjects<S> { 782 - type Subjects = Set<members::subjects>; 783 - type CreatedBy = S::CreatedBy; 784 - type Action = S::Action; 785 - type Scheduling = S::Scheduling; 786 - } 787 - ///State transition - sets the `created_by` field to Set 788 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 789 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 790 - impl<S: State> State for SetCreatedBy<S> { 791 - type Subjects = S::Subjects; 792 - type CreatedBy = Set<members::created_by>; 793 - type Action = S::Action; 794 - type Scheduling = S::Scheduling; 775 + type Subjects = Unset; 776 + type CreatedBy = Unset; 795 777 } 796 778 ///State transition - sets the `action` field to Set 797 779 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 798 780 impl<S: State> sealed::Sealed for SetAction<S> {} 799 781 impl<S: State> State for SetAction<S> { 782 + type Action = Set<members::action>; 783 + type Scheduling = S::Scheduling; 800 784 type Subjects = S::Subjects; 801 785 type CreatedBy = S::CreatedBy; 802 - type Action = Set<members::action>; 803 - type Scheduling = S::Scheduling; 804 786 } 805 787 ///State transition - sets the `scheduling` field to Set 806 788 pub struct SetScheduling<S: State = Empty>(PhantomData<fn() -> S>); 807 789 impl<S: State> sealed::Sealed for SetScheduling<S> {} 808 790 impl<S: State> State for SetScheduling<S> { 791 + type Action = S::Action; 792 + type Scheduling = Set<members::scheduling>; 809 793 type Subjects = S::Subjects; 810 794 type CreatedBy = S::CreatedBy; 795 + } 796 + ///State transition - sets the `subjects` field to Set 797 + pub struct SetSubjects<S: State = Empty>(PhantomData<fn() -> S>); 798 + impl<S: State> sealed::Sealed for SetSubjects<S> {} 799 + impl<S: State> State for SetSubjects<S> { 811 800 type Action = S::Action; 812 - type Scheduling = Set<members::scheduling>; 801 + type Scheduling = S::Scheduling; 802 + type Subjects = Set<members::subjects>; 803 + type CreatedBy = S::CreatedBy; 804 + } 805 + ///State transition - sets the `created_by` field to Set 806 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 807 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 808 + impl<S: State> State for SetCreatedBy<S> { 809 + type Action = S::Action; 810 + type Scheduling = S::Scheduling; 811 + type Subjects = S::Subjects; 812 + type CreatedBy = Set<members::created_by>; 813 813 } 814 814 /// Marker types for field names 815 815 #[allow(non_camel_case_types)] 816 816 pub mod members { 817 - ///Marker type for the `subjects` field 818 - pub struct subjects(()); 819 - ///Marker type for the `created_by` field 820 - pub struct created_by(()); 821 817 ///Marker type for the `action` field 822 818 pub struct action(()); 823 819 ///Marker type for the `scheduling` field 824 820 pub struct scheduling(()); 821 + ///Marker type for the `subjects` field 822 + pub struct subjects(()); 823 + ///Marker type for the `created_by` field 824 + pub struct created_by(()); 825 825 } 826 826 } 827 827 ··· 960 960 impl<'a, S> ScheduleActionBuilder<'a, S> 961 961 where 962 962 S: schedule_action_state::State, 963 + S::Action: schedule_action_state::IsSet, 964 + S::Scheduling: schedule_action_state::IsSet, 963 965 S::Subjects: schedule_action_state::IsSet, 964 966 S::CreatedBy: schedule_action_state::IsSet, 965 - S::Action: schedule_action_state::IsSet, 966 - S::Scheduling: schedule_action_state::IsSet, 967 967 { 968 968 /// Build the final struct 969 969 pub fn build(self) -> ScheduleAction<'a> { ··· 1072 1072 } 1073 1073 /// State trait tracking which required fields have been set 1074 1074 pub trait State: sealed::Sealed { 1075 - type Succeeded; 1076 1075 type Failed; 1076 + type Succeeded; 1077 1077 } 1078 1078 /// Empty state - all required fields are unset 1079 1079 pub struct Empty(()); 1080 1080 impl sealed::Sealed for Empty {} 1081 1081 impl State for Empty { 1082 - type Succeeded = Unset; 1083 1082 type Failed = Unset; 1084 - } 1085 - ///State transition - sets the `succeeded` field to Set 1086 - pub struct SetSucceeded<S: State = Empty>(PhantomData<fn() -> S>); 1087 - impl<S: State> sealed::Sealed for SetSucceeded<S> {} 1088 - impl<S: State> State for SetSucceeded<S> { 1089 - type Succeeded = Set<members::succeeded>; 1090 - type Failed = S::Failed; 1083 + type Succeeded = Unset; 1091 1084 } 1092 1085 ///State transition - sets the `failed` field to Set 1093 1086 pub struct SetFailed<S: State = Empty>(PhantomData<fn() -> S>); 1094 1087 impl<S: State> sealed::Sealed for SetFailed<S> {} 1095 1088 impl<S: State> State for SetFailed<S> { 1096 - type Succeeded = S::Succeeded; 1097 1089 type Failed = Set<members::failed>; 1090 + type Succeeded = S::Succeeded; 1091 + } 1092 + ///State transition - sets the `succeeded` field to Set 1093 + pub struct SetSucceeded<S: State = Empty>(PhantomData<fn() -> S>); 1094 + impl<S: State> sealed::Sealed for SetSucceeded<S> {} 1095 + impl<S: State> State for SetSucceeded<S> { 1096 + type Failed = S::Failed; 1097 + type Succeeded = Set<members::succeeded>; 1098 1098 } 1099 1099 /// Marker types for field names 1100 1100 #[allow(non_camel_case_types)] 1101 1101 pub mod members { 1102 + ///Marker type for the `failed` field 1103 + pub struct failed(()); 1102 1104 ///Marker type for the `succeeded` field 1103 1105 pub struct succeeded(()); 1104 - ///Marker type for the `failed` field 1105 - pub struct failed(()); 1106 1106 } 1107 1107 } 1108 1108 ··· 1188 1188 impl<'a, S> ScheduledActionResultsBuilder<'a, S> 1189 1189 where 1190 1190 S: scheduled_action_results_state::State, 1191 - S::Succeeded: scheduled_action_results_state::IsSet, 1192 1191 S::Failed: scheduled_action_results_state::IsSet, 1192 + S::Succeeded: scheduled_action_results_state::IsSet, 1193 1193 { 1194 1194 /// Build the final struct 1195 1195 pub fn build(self) -> ScheduledActionResults<'a> {
+140 -140
crates/weaver-api/src/tools_ozone/safelink.rs
··· 144 144 } 145 145 /// State trait tracking which required fields have been set 146 146 pub trait State: sealed::Sealed { 147 - type Pattern; 148 - type Url; 149 - type CreatedAt; 147 + type CreatedBy; 150 148 type Action; 151 149 type Id; 150 + type CreatedAt; 152 151 type EventType; 152 + type Url; 153 153 type Reason; 154 - type CreatedBy; 154 + type Pattern; 155 155 } 156 156 /// Empty state - all required fields are unset 157 157 pub struct Empty(()); 158 158 impl sealed::Sealed for Empty {} 159 159 impl State for Empty { 160 - type Pattern = Unset; 161 - type Url = Unset; 162 - type CreatedAt = Unset; 160 + type CreatedBy = Unset; 163 161 type Action = Unset; 164 162 type Id = Unset; 163 + type CreatedAt = Unset; 165 164 type EventType = Unset; 165 + type Url = Unset; 166 166 type Reason = Unset; 167 - type CreatedBy = Unset; 167 + type Pattern = Unset; 168 168 } 169 - ///State transition - sets the `pattern` field to Set 170 - pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 171 - impl<S: State> sealed::Sealed for SetPattern<S> {} 172 - impl<S: State> State for SetPattern<S> { 173 - type Pattern = Set<members::pattern>; 174 - type Url = S::Url; 175 - type CreatedAt = S::CreatedAt; 169 + ///State transition - sets the `created_by` field to Set 170 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 171 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 172 + impl<S: State> State for SetCreatedBy<S> { 173 + type CreatedBy = Set<members::created_by>; 176 174 type Action = S::Action; 177 175 type Id = S::Id; 178 - type EventType = S::EventType; 179 - type Reason = S::Reason; 180 - type CreatedBy = S::CreatedBy; 181 - } 182 - ///State transition - sets the `url` field to Set 183 - pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 184 - impl<S: State> sealed::Sealed for SetUrl<S> {} 185 - impl<S: State> State for SetUrl<S> { 186 - type Pattern = S::Pattern; 187 - type Url = Set<members::url>; 188 176 type CreatedAt = S::CreatedAt; 189 - type Action = S::Action; 190 - type Id = S::Id; 191 177 type EventType = S::EventType; 192 - type Reason = S::Reason; 193 - type CreatedBy = S::CreatedBy; 194 - } 195 - ///State transition - sets the `created_at` field to Set 196 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 197 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 198 - impl<S: State> State for SetCreatedAt<S> { 199 - type Pattern = S::Pattern; 200 178 type Url = S::Url; 201 - type CreatedAt = Set<members::created_at>; 202 - type Action = S::Action; 203 - type Id = S::Id; 204 - type EventType = S::EventType; 205 179 type Reason = S::Reason; 206 - type CreatedBy = S::CreatedBy; 180 + type Pattern = S::Pattern; 207 181 } 208 182 ///State transition - sets the `action` field to Set 209 183 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 210 184 impl<S: State> sealed::Sealed for SetAction<S> {} 211 185 impl<S: State> State for SetAction<S> { 212 - type Pattern = S::Pattern; 213 - type Url = S::Url; 214 - type CreatedAt = S::CreatedAt; 186 + type CreatedBy = S::CreatedBy; 215 187 type Action = Set<members::action>; 216 188 type Id = S::Id; 189 + type CreatedAt = S::CreatedAt; 217 190 type EventType = S::EventType; 191 + type Url = S::Url; 218 192 type Reason = S::Reason; 219 - type CreatedBy = S::CreatedBy; 193 + type Pattern = S::Pattern; 220 194 } 221 195 ///State transition - sets the `id` field to Set 222 196 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 223 197 impl<S: State> sealed::Sealed for SetId<S> {} 224 198 impl<S: State> State for SetId<S> { 225 - type Pattern = S::Pattern; 226 - type Url = S::Url; 227 - type CreatedAt = S::CreatedAt; 199 + type CreatedBy = S::CreatedBy; 228 200 type Action = S::Action; 229 201 type Id = Set<members::id>; 202 + type CreatedAt = S::CreatedAt; 230 203 type EventType = S::EventType; 204 + type Url = S::Url; 231 205 type Reason = S::Reason; 206 + type Pattern = S::Pattern; 207 + } 208 + ///State transition - sets the `created_at` field to Set 209 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 210 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 211 + impl<S: State> State for SetCreatedAt<S> { 232 212 type CreatedBy = S::CreatedBy; 213 + type Action = S::Action; 214 + type Id = S::Id; 215 + type CreatedAt = Set<members::created_at>; 216 + type EventType = S::EventType; 217 + type Url = S::Url; 218 + type Reason = S::Reason; 219 + type Pattern = S::Pattern; 233 220 } 234 221 ///State transition - sets the `event_type` field to Set 235 222 pub struct SetEventType<S: State = Empty>(PhantomData<fn() -> S>); 236 223 impl<S: State> sealed::Sealed for SetEventType<S> {} 237 224 impl<S: State> State for SetEventType<S> { 238 - type Pattern = S::Pattern; 239 - type Url = S::Url; 240 - type CreatedAt = S::CreatedAt; 225 + type CreatedBy = S::CreatedBy; 241 226 type Action = S::Action; 242 227 type Id = S::Id; 228 + type CreatedAt = S::CreatedAt; 243 229 type EventType = Set<members::event_type>; 230 + type Url = S::Url; 244 231 type Reason = S::Reason; 232 + type Pattern = S::Pattern; 233 + } 234 + ///State transition - sets the `url` field to Set 235 + pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 236 + impl<S: State> sealed::Sealed for SetUrl<S> {} 237 + impl<S: State> State for SetUrl<S> { 245 238 type CreatedBy = S::CreatedBy; 239 + type Action = S::Action; 240 + type Id = S::Id; 241 + type CreatedAt = S::CreatedAt; 242 + type EventType = S::EventType; 243 + type Url = Set<members::url>; 244 + type Reason = S::Reason; 245 + type Pattern = S::Pattern; 246 246 } 247 247 ///State transition - sets the `reason` field to Set 248 248 pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 249 249 impl<S: State> sealed::Sealed for SetReason<S> {} 250 250 impl<S: State> State for SetReason<S> { 251 - type Pattern = S::Pattern; 252 - type Url = S::Url; 253 - type CreatedAt = S::CreatedAt; 251 + type CreatedBy = S::CreatedBy; 254 252 type Action = S::Action; 255 253 type Id = S::Id; 254 + type CreatedAt = S::CreatedAt; 256 255 type EventType = S::EventType; 256 + type Url = S::Url; 257 257 type Reason = Set<members::reason>; 258 - type CreatedBy = S::CreatedBy; 259 - } 260 - ///State transition - sets the `created_by` field to Set 261 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 262 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 263 - impl<S: State> State for SetCreatedBy<S> { 264 258 type Pattern = S::Pattern; 265 - type Url = S::Url; 266 - type CreatedAt = S::CreatedAt; 259 + } 260 + ///State transition - sets the `pattern` field to Set 261 + pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 262 + impl<S: State> sealed::Sealed for SetPattern<S> {} 263 + impl<S: State> State for SetPattern<S> { 264 + type CreatedBy = S::CreatedBy; 267 265 type Action = S::Action; 268 266 type Id = S::Id; 267 + type CreatedAt = S::CreatedAt; 269 268 type EventType = S::EventType; 269 + type Url = S::Url; 270 270 type Reason = S::Reason; 271 - type CreatedBy = Set<members::created_by>; 271 + type Pattern = Set<members::pattern>; 272 272 } 273 273 /// Marker types for field names 274 274 #[allow(non_camel_case_types)] 275 275 pub mod members { 276 - ///Marker type for the `pattern` field 277 - pub struct pattern(()); 278 - ///Marker type for the `url` field 279 - pub struct url(()); 280 - ///Marker type for the `created_at` field 281 - pub struct created_at(()); 276 + ///Marker type for the `created_by` field 277 + pub struct created_by(()); 282 278 ///Marker type for the `action` field 283 279 pub struct action(()); 284 280 ///Marker type for the `id` field 285 281 pub struct id(()); 282 + ///Marker type for the `created_at` field 283 + pub struct created_at(()); 286 284 ///Marker type for the `event_type` field 287 285 pub struct event_type(()); 286 + ///Marker type for the `url` field 287 + pub struct url(()); 288 288 ///Marker type for the `reason` field 289 289 pub struct reason(()); 290 - ///Marker type for the `created_by` field 291 - pub struct created_by(()); 290 + ///Marker type for the `pattern` field 291 + pub struct pattern(()); 292 292 } 293 293 } 294 294 ··· 508 508 impl<'a, S> EventBuilder<'a, S> 509 509 where 510 510 S: event_state::State, 511 - S::Pattern: event_state::IsSet, 512 - S::Url: event_state::IsSet, 513 - S::CreatedAt: event_state::IsSet, 511 + S::CreatedBy: event_state::IsSet, 514 512 S::Action: event_state::IsSet, 515 513 S::Id: event_state::IsSet, 514 + S::CreatedAt: event_state::IsSet, 516 515 S::EventType: event_state::IsSet, 516 + S::Url: event_state::IsSet, 517 517 S::Reason: event_state::IsSet, 518 - S::CreatedBy: event_state::IsSet, 518 + S::Pattern: event_state::IsSet, 519 519 { 520 520 /// Build the final struct 521 521 pub fn build(self) -> Event<'a> { ··· 1257 1257 } 1258 1258 /// State trait tracking which required fields have been set 1259 1259 pub trait State: sealed::Sealed { 1260 - type Url; 1261 - type CreatedBy; 1262 - type CreatedAt; 1263 - type Pattern; 1264 1260 type Reason; 1261 + type CreatedBy; 1265 1262 type UpdatedAt; 1263 + type CreatedAt; 1264 + type Url; 1266 1265 type Action; 1266 + type Pattern; 1267 1267 } 1268 1268 /// Empty state - all required fields are unset 1269 1269 pub struct Empty(()); 1270 1270 impl sealed::Sealed for Empty {} 1271 1271 impl State for Empty { 1272 - type Url = Unset; 1273 - type CreatedBy = Unset; 1274 - type CreatedAt = Unset; 1275 - type Pattern = Unset; 1276 1272 type Reason = Unset; 1273 + type CreatedBy = Unset; 1277 1274 type UpdatedAt = Unset; 1275 + type CreatedAt = Unset; 1276 + type Url = Unset; 1278 1277 type Action = Unset; 1278 + type Pattern = Unset; 1279 1279 } 1280 - ///State transition - sets the `url` field to Set 1281 - pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 1282 - impl<S: State> sealed::Sealed for SetUrl<S> {} 1283 - impl<S: State> State for SetUrl<S> { 1284 - type Url = Set<members::url>; 1280 + ///State transition - sets the `reason` field to Set 1281 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 1282 + impl<S: State> sealed::Sealed for SetReason<S> {} 1283 + impl<S: State> State for SetReason<S> { 1284 + type Reason = Set<members::reason>; 1285 1285 type CreatedBy = S::CreatedBy; 1286 + type UpdatedAt = S::UpdatedAt; 1286 1287 type CreatedAt = S::CreatedAt; 1287 - type Pattern = S::Pattern; 1288 - type Reason = S::Reason; 1289 - type UpdatedAt = S::UpdatedAt; 1288 + type Url = S::Url; 1290 1289 type Action = S::Action; 1290 + type Pattern = S::Pattern; 1291 1291 } 1292 1292 ///State transition - sets the `created_by` field to Set 1293 1293 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 1294 1294 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 1295 1295 impl<S: State> State for SetCreatedBy<S> { 1296 - type Url = S::Url; 1296 + type Reason = S::Reason; 1297 1297 type CreatedBy = Set<members::created_by>; 1298 + type UpdatedAt = S::UpdatedAt; 1298 1299 type CreatedAt = S::CreatedAt; 1300 + type Url = S::Url; 1301 + type Action = S::Action; 1299 1302 type Pattern = S::Pattern; 1303 + } 1304 + ///State transition - sets the `updated_at` field to Set 1305 + pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1306 + impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 1307 + impl<S: State> State for SetUpdatedAt<S> { 1300 1308 type Reason = S::Reason; 1301 - type UpdatedAt = S::UpdatedAt; 1309 + type CreatedBy = S::CreatedBy; 1310 + type UpdatedAt = Set<members::updated_at>; 1311 + type CreatedAt = S::CreatedAt; 1312 + type Url = S::Url; 1302 1313 type Action = S::Action; 1314 + type Pattern = S::Pattern; 1303 1315 } 1304 1316 ///State transition - sets the `created_at` field to Set 1305 1317 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1306 1318 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1307 1319 impl<S: State> State for SetCreatedAt<S> { 1308 - type Url = S::Url; 1309 - type CreatedBy = S::CreatedBy; 1310 - type CreatedAt = Set<members::created_at>; 1311 - type Pattern = S::Pattern; 1312 1320 type Reason = S::Reason; 1313 - type UpdatedAt = S::UpdatedAt; 1314 - type Action = S::Action; 1315 - } 1316 - ///State transition - sets the `pattern` field to Set 1317 - pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 1318 - impl<S: State> sealed::Sealed for SetPattern<S> {} 1319 - impl<S: State> State for SetPattern<S> { 1320 - type Url = S::Url; 1321 1321 type CreatedBy = S::CreatedBy; 1322 - type CreatedAt = S::CreatedAt; 1323 - type Pattern = Set<members::pattern>; 1324 - type Reason = S::Reason; 1325 1322 type UpdatedAt = S::UpdatedAt; 1323 + type CreatedAt = Set<members::created_at>; 1324 + type Url = S::Url; 1326 1325 type Action = S::Action; 1326 + type Pattern = S::Pattern; 1327 1327 } 1328 - ///State transition - sets the `reason` field to Set 1329 - pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 1330 - impl<S: State> sealed::Sealed for SetReason<S> {} 1331 - impl<S: State> State for SetReason<S> { 1332 - type Url = S::Url; 1328 + ///State transition - sets the `url` field to Set 1329 + pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 1330 + impl<S: State> sealed::Sealed for SetUrl<S> {} 1331 + impl<S: State> State for SetUrl<S> { 1332 + type Reason = S::Reason; 1333 1333 type CreatedBy = S::CreatedBy; 1334 + type UpdatedAt = S::UpdatedAt; 1334 1335 type CreatedAt = S::CreatedAt; 1335 - type Pattern = S::Pattern; 1336 - type Reason = Set<members::reason>; 1337 - type UpdatedAt = S::UpdatedAt; 1336 + type Url = Set<members::url>; 1338 1337 type Action = S::Action; 1339 - } 1340 - ///State transition - sets the `updated_at` field to Set 1341 - pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1342 - impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 1343 - impl<S: State> State for SetUpdatedAt<S> { 1344 - type Url = S::Url; 1345 - type CreatedBy = S::CreatedBy; 1346 - type CreatedAt = S::CreatedAt; 1347 1338 type Pattern = S::Pattern; 1348 - type Reason = S::Reason; 1349 - type UpdatedAt = Set<members::updated_at>; 1350 - type Action = S::Action; 1351 1339 } 1352 1340 ///State transition - sets the `action` field to Set 1353 1341 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 1354 1342 impl<S: State> sealed::Sealed for SetAction<S> {} 1355 1343 impl<S: State> State for SetAction<S> { 1356 - type Url = S::Url; 1344 + type Reason = S::Reason; 1357 1345 type CreatedBy = S::CreatedBy; 1346 + type UpdatedAt = S::UpdatedAt; 1358 1347 type CreatedAt = S::CreatedAt; 1348 + type Url = S::Url; 1349 + type Action = Set<members::action>; 1359 1350 type Pattern = S::Pattern; 1351 + } 1352 + ///State transition - sets the `pattern` field to Set 1353 + pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 1354 + impl<S: State> sealed::Sealed for SetPattern<S> {} 1355 + impl<S: State> State for SetPattern<S> { 1360 1356 type Reason = S::Reason; 1357 + type CreatedBy = S::CreatedBy; 1361 1358 type UpdatedAt = S::UpdatedAt; 1362 - type Action = Set<members::action>; 1359 + type CreatedAt = S::CreatedAt; 1360 + type Url = S::Url; 1361 + type Action = S::Action; 1362 + type Pattern = Set<members::pattern>; 1363 1363 } 1364 1364 /// Marker types for field names 1365 1365 #[allow(non_camel_case_types)] 1366 1366 pub mod members { 1367 - ///Marker type for the `url` field 1368 - pub struct url(()); 1367 + ///Marker type for the `reason` field 1368 + pub struct reason(()); 1369 1369 ///Marker type for the `created_by` field 1370 1370 pub struct created_by(()); 1371 + ///Marker type for the `updated_at` field 1372 + pub struct updated_at(()); 1371 1373 ///Marker type for the `created_at` field 1372 1374 pub struct created_at(()); 1375 + ///Marker type for the `url` field 1376 + pub struct url(()); 1377 + ///Marker type for the `action` field 1378 + pub struct action(()); 1373 1379 ///Marker type for the `pattern` field 1374 1380 pub struct pattern(()); 1375 - ///Marker type for the `reason` field 1376 - pub struct reason(()); 1377 - ///Marker type for the `updated_at` field 1378 - pub struct updated_at(()); 1379 - ///Marker type for the `action` field 1380 - pub struct action(()); 1381 1381 } 1382 1382 } 1383 1383 ··· 1567 1567 impl<'a, S> UrlRuleBuilder<'a, S> 1568 1568 where 1569 1569 S: url_rule_state::State, 1570 - S::Url: url_rule_state::IsSet, 1571 - S::CreatedBy: url_rule_state::IsSet, 1572 - S::CreatedAt: url_rule_state::IsSet, 1573 - S::Pattern: url_rule_state::IsSet, 1574 1570 S::Reason: url_rule_state::IsSet, 1571 + S::CreatedBy: url_rule_state::IsSet, 1575 1572 S::UpdatedAt: url_rule_state::IsSet, 1573 + S::CreatedAt: url_rule_state::IsSet, 1574 + S::Url: url_rule_state::IsSet, 1576 1575 S::Action: url_rule_state::IsSet, 1576 + S::Pattern: url_rule_state::IsSet, 1577 1577 { 1578 1578 /// Build the final struct 1579 1579 pub fn build(self) -> UrlRule<'a> {
+28 -28
crates/weaver-api/src/tools_ozone/safelink/add_rule.rs
··· 46 46 } 47 47 /// State trait tracking which required fields have been set 48 48 pub trait State: sealed::Sealed { 49 - type Action; 49 + type Reason; 50 50 type Url; 51 + type Action; 51 52 type Pattern; 52 - type Reason; 53 53 } 54 54 /// Empty state - all required fields are unset 55 55 pub struct Empty(()); 56 56 impl sealed::Sealed for Empty {} 57 57 impl State for Empty { 58 + type Reason = Unset; 59 + type Url = Unset; 58 60 type Action = Unset; 59 - type Url = Unset; 60 61 type Pattern = Unset; 61 - type Reason = Unset; 62 62 } 63 - ///State transition - sets the `action` field to Set 64 - pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 65 - impl<S: State> sealed::Sealed for SetAction<S> {} 66 - impl<S: State> State for SetAction<S> { 67 - type Action = Set<members::action>; 63 + ///State transition - sets the `reason` field to Set 64 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetReason<S> {} 66 + impl<S: State> State for SetReason<S> { 67 + type Reason = Set<members::reason>; 68 68 type Url = S::Url; 69 + type Action = S::Action; 69 70 type Pattern = S::Pattern; 70 - type Reason = S::Reason; 71 71 } 72 72 ///State transition - sets the `url` field to Set 73 73 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 74 74 impl<S: State> sealed::Sealed for SetUrl<S> {} 75 75 impl<S: State> State for SetUrl<S> { 76 + type Reason = S::Reason; 77 + type Url = Set<members::url>; 76 78 type Action = S::Action; 77 - type Url = Set<members::url>; 78 79 type Pattern = S::Pattern; 80 + } 81 + ///State transition - sets the `action` field to Set 82 + pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 83 + impl<S: State> sealed::Sealed for SetAction<S> {} 84 + impl<S: State> State for SetAction<S> { 79 85 type Reason = S::Reason; 86 + type Url = S::Url; 87 + type Action = Set<members::action>; 88 + type Pattern = S::Pattern; 80 89 } 81 90 ///State transition - sets the `pattern` field to Set 82 91 pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 83 92 impl<S: State> sealed::Sealed for SetPattern<S> {} 84 93 impl<S: State> State for SetPattern<S> { 85 - type Action = S::Action; 86 - type Url = S::Url; 87 - type Pattern = Set<members::pattern>; 88 94 type Reason = S::Reason; 89 - } 90 - ///State transition - sets the `reason` field to Set 91 - pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 92 - impl<S: State> sealed::Sealed for SetReason<S> {} 93 - impl<S: State> State for SetReason<S> { 94 - type Action = S::Action; 95 95 type Url = S::Url; 96 - type Pattern = S::Pattern; 97 - type Reason = Set<members::reason>; 96 + type Action = S::Action; 97 + type Pattern = Set<members::pattern>; 98 98 } 99 99 /// Marker types for field names 100 100 #[allow(non_camel_case_types)] 101 101 pub mod members { 102 - ///Marker type for the `action` field 103 - pub struct action(()); 102 + ///Marker type for the `reason` field 103 + pub struct reason(()); 104 104 ///Marker type for the `url` field 105 105 pub struct url(()); 106 + ///Marker type for the `action` field 107 + pub struct action(()); 106 108 ///Marker type for the `pattern` field 107 109 pub struct pattern(()); 108 - ///Marker type for the `reason` field 109 - pub struct reason(()); 110 110 } 111 111 } 112 112 ··· 256 256 impl<'a, S> AddRuleBuilder<'a, S> 257 257 where 258 258 S: add_rule_state::State, 259 - S::Action: add_rule_state::IsSet, 259 + S::Reason: add_rule_state::IsSet, 260 260 S::Url: add_rule_state::IsSet, 261 + S::Action: add_rule_state::IsSet, 261 262 S::Pattern: add_rule_state::IsSet, 262 - S::Reason: add_rule_state::IsSet, 263 263 { 264 264 /// Build the final struct 265 265 pub fn build(self) -> AddRule<'a> {
+17 -17
crates/weaver-api/src/tools_ozone/safelink/update_rule.rs
··· 48 48 pub trait State: sealed::Sealed { 49 49 type Action; 50 50 type Pattern; 51 - type Reason; 52 51 type Url; 52 + type Reason; 53 53 } 54 54 /// Empty state - all required fields are unset 55 55 pub struct Empty(()); ··· 57 57 impl State for Empty { 58 58 type Action = Unset; 59 59 type Pattern = Unset; 60 - type Reason = Unset; 61 60 type Url = Unset; 61 + type Reason = Unset; 62 62 } 63 63 ///State transition - sets the `action` field to Set 64 64 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); ··· 66 66 impl<S: State> State for SetAction<S> { 67 67 type Action = Set<members::action>; 68 68 type Pattern = S::Pattern; 69 - type Reason = S::Reason; 70 69 type Url = S::Url; 70 + type Reason = S::Reason; 71 71 } 72 72 ///State transition - sets the `pattern` field to Set 73 73 pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); ··· 75 75 impl<S: State> State for SetPattern<S> { 76 76 type Action = S::Action; 77 77 type Pattern = Set<members::pattern>; 78 - type Reason = S::Reason; 79 - type Url = S::Url; 80 - } 81 - ///State transition - sets the `reason` field to Set 82 - pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 83 - impl<S: State> sealed::Sealed for SetReason<S> {} 84 - impl<S: State> State for SetReason<S> { 85 - type Action = S::Action; 86 - type Pattern = S::Pattern; 87 - type Reason = Set<members::reason>; 88 78 type Url = S::Url; 79 + type Reason = S::Reason; 89 80 } 90 81 ///State transition - sets the `url` field to Set 91 82 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); ··· 93 84 impl<S: State> State for SetUrl<S> { 94 85 type Action = S::Action; 95 86 type Pattern = S::Pattern; 96 - type Reason = S::Reason; 97 87 type Url = Set<members::url>; 88 + type Reason = S::Reason; 89 + } 90 + ///State transition - sets the `reason` field to Set 91 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 92 + impl<S: State> sealed::Sealed for SetReason<S> {} 93 + impl<S: State> State for SetReason<S> { 94 + type Action = S::Action; 95 + type Pattern = S::Pattern; 96 + type Url = S::Url; 97 + type Reason = Set<members::reason>; 98 98 } 99 99 /// Marker types for field names 100 100 #[allow(non_camel_case_types)] ··· 103 103 pub struct action(()); 104 104 ///Marker type for the `pattern` field 105 105 pub struct pattern(()); 106 + ///Marker type for the `url` field 107 + pub struct url(()); 106 108 ///Marker type for the `reason` field 107 109 pub struct reason(()); 108 - ///Marker type for the `url` field 109 - pub struct url(()); 110 110 } 111 111 } 112 112 ··· 258 258 S: update_rule_state::State, 259 259 S::Action: update_rule_state::IsSet, 260 260 S::Pattern: update_rule_state::IsSet, 261 - S::Reason: update_rule_state::IsSet, 262 261 S::Url: update_rule_state::IsSet, 262 + S::Reason: update_rule_state::IsSet, 263 263 { 264 264 /// Build the final struct 265 265 pub fn build(self) -> UpdateRule<'a> {
+29 -29
crates/weaver-api/src/tools_ozone/set.rs
··· 300 300 } 301 301 /// State trait tracking which required fields have been set 302 302 pub trait State: sealed::Sealed { 303 - type SetSize; 304 303 type Name; 305 - type UpdatedAt; 304 + type SetSize; 306 305 type CreatedAt; 306 + type UpdatedAt; 307 307 } 308 308 /// Empty state - all required fields are unset 309 309 pub struct Empty(()); 310 310 impl sealed::Sealed for Empty {} 311 311 impl State for Empty { 312 - type SetSize = Unset; 313 312 type Name = Unset; 314 - type UpdatedAt = Unset; 313 + type SetSize = Unset; 315 314 type CreatedAt = Unset; 316 - } 317 - ///State transition - sets the `set_size` field to Set 318 - pub struct SetSetSize<S: State = Empty>(PhantomData<fn() -> S>); 319 - impl<S: State> sealed::Sealed for SetSetSize<S> {} 320 - impl<S: State> State for SetSetSize<S> { 321 - type SetSize = Set<members::set_size>; 322 - type Name = S::Name; 323 - type UpdatedAt = S::UpdatedAt; 324 - type CreatedAt = S::CreatedAt; 315 + type UpdatedAt = Unset; 325 316 } 326 317 ///State transition - sets the `name` field to Set 327 318 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 328 319 impl<S: State> sealed::Sealed for SetName<S> {} 329 320 impl<S: State> State for SetName<S> { 321 + type Name = Set<members::name>; 330 322 type SetSize = S::SetSize; 331 - type Name = Set<members::name>; 323 + type CreatedAt = S::CreatedAt; 332 324 type UpdatedAt = S::UpdatedAt; 333 - type CreatedAt = S::CreatedAt; 334 325 } 335 - ///State transition - sets the `updated_at` field to Set 336 - pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 337 - impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 338 - impl<S: State> State for SetUpdatedAt<S> { 339 - type SetSize = S::SetSize; 326 + ///State transition - sets the `set_size` field to Set 327 + pub struct SetSetSize<S: State = Empty>(PhantomData<fn() -> S>); 328 + impl<S: State> sealed::Sealed for SetSetSize<S> {} 329 + impl<S: State> State for SetSetSize<S> { 340 330 type Name = S::Name; 341 - type UpdatedAt = Set<members::updated_at>; 331 + type SetSize = Set<members::set_size>; 342 332 type CreatedAt = S::CreatedAt; 333 + type UpdatedAt = S::UpdatedAt; 343 334 } 344 335 ///State transition - sets the `created_at` field to Set 345 336 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 346 337 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 347 338 impl<S: State> State for SetCreatedAt<S> { 339 + type Name = S::Name; 348 340 type SetSize = S::SetSize; 341 + type CreatedAt = Set<members::created_at>; 342 + type UpdatedAt = S::UpdatedAt; 343 + } 344 + ///State transition - sets the `updated_at` field to Set 345 + pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 346 + impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 347 + impl<S: State> State for SetUpdatedAt<S> { 349 348 type Name = S::Name; 350 - type UpdatedAt = S::UpdatedAt; 351 - type CreatedAt = Set<members::created_at>; 349 + type SetSize = S::SetSize; 350 + type CreatedAt = S::CreatedAt; 351 + type UpdatedAt = Set<members::updated_at>; 352 352 } 353 353 /// Marker types for field names 354 354 #[allow(non_camel_case_types)] 355 355 pub mod members { 356 + ///Marker type for the `name` field 357 + pub struct name(()); 356 358 ///Marker type for the `set_size` field 357 359 pub struct set_size(()); 358 - ///Marker type for the `name` field 359 - pub struct name(()); 360 - ///Marker type for the `updated_at` field 361 - pub struct updated_at(()); 362 360 ///Marker type for the `created_at` field 363 361 pub struct created_at(()); 362 + ///Marker type for the `updated_at` field 363 + pub struct updated_at(()); 364 364 } 365 365 } 366 366 ··· 493 493 impl<'a, S> SetViewBuilder<'a, S> 494 494 where 495 495 S: set_view_state::State, 496 - S::SetSize: set_view_state::IsSet, 497 496 S::Name: set_view_state::IsSet, 498 - S::UpdatedAt: set_view_state::IsSet, 497 + S::SetSize: set_view_state::IsSet, 499 498 S::CreatedAt: set_view_state::IsSet, 499 + S::UpdatedAt: set_view_state::IsSet, 500 500 { 501 501 /// Build the final struct 502 502 pub fn build(self) -> SetView<'a> {
+13 -13
crates/weaver-api/src/tools_ozone/set/add_values.rs
··· 35 35 } 36 36 /// State trait tracking which required fields have been set 37 37 pub trait State: sealed::Sealed { 38 - type Name; 39 38 type Values; 39 + type Name; 40 40 } 41 41 /// Empty state - all required fields are unset 42 42 pub struct Empty(()); 43 43 impl sealed::Sealed for Empty {} 44 44 impl State for Empty { 45 - type Name = Unset; 46 45 type Values = Unset; 47 - } 48 - ///State transition - sets the `name` field to Set 49 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetName<S> {} 51 - impl<S: State> State for SetName<S> { 52 - type Name = Set<members::name>; 53 - type Values = S::Values; 46 + type Name = Unset; 54 47 } 55 48 ///State transition - sets the `values` field to Set 56 49 pub struct SetValues<S: State = Empty>(PhantomData<fn() -> S>); 57 50 impl<S: State> sealed::Sealed for SetValues<S> {} 58 51 impl<S: State> State for SetValues<S> { 59 - type Name = S::Name; 60 52 type Values = Set<members::values>; 53 + type Name = S::Name; 54 + } 55 + ///State transition - sets the `name` field to Set 56 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetName<S> {} 58 + impl<S: State> State for SetName<S> { 59 + type Values = S::Values; 60 + type Name = Set<members::name>; 61 61 } 62 62 /// Marker types for field names 63 63 #[allow(non_camel_case_types)] 64 64 pub mod members { 65 - ///Marker type for the `name` field 66 - pub struct name(()); 67 65 ///Marker type for the `values` field 68 66 pub struct values(()); 67 + ///Marker type for the `name` field 68 + pub struct name(()); 69 69 } 70 70 } 71 71 ··· 138 138 impl<'a, S> AddValuesBuilder<'a, S> 139 139 where 140 140 S: add_values_state::State, 141 - S::Name: add_values_state::IsSet, 142 141 S::Values: add_values_state::IsSet, 142 + S::Name: add_values_state::IsSet, 143 143 { 144 144 /// Build the final struct 145 145 pub fn build(self) -> AddValues<'a> {
+48 -48
crates/weaver-api/src/tools_ozone/setting.rs
··· 55 55 } 56 56 /// State trait tracking which required fields have been set 57 57 pub trait State: sealed::Sealed { 58 - type Scope; 58 + type LastUpdatedBy; 59 59 type Key; 60 + type Value; 60 61 type Did; 61 - type LastUpdatedBy; 62 + type Scope; 62 63 type CreatedBy; 63 - type Value; 64 64 } 65 65 /// Empty state - all required fields are unset 66 66 pub struct Empty(()); 67 67 impl sealed::Sealed for Empty {} 68 68 impl State for Empty { 69 - type Scope = Unset; 69 + type LastUpdatedBy = Unset; 70 70 type Key = Unset; 71 + type Value = Unset; 71 72 type Did = Unset; 72 - type LastUpdatedBy = Unset; 73 + type Scope = Unset; 73 74 type CreatedBy = Unset; 74 - type Value = Unset; 75 75 } 76 - ///State transition - sets the `scope` field to Set 77 - pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 78 - impl<S: State> sealed::Sealed for SetScope<S> {} 79 - impl<S: State> State for SetScope<S> { 80 - type Scope = Set<members::scope>; 76 + ///State transition - sets the `last_updated_by` field to Set 77 + pub struct SetLastUpdatedBy<S: State = Empty>(PhantomData<fn() -> S>); 78 + impl<S: State> sealed::Sealed for SetLastUpdatedBy<S> {} 79 + impl<S: State> State for SetLastUpdatedBy<S> { 80 + type LastUpdatedBy = Set<members::last_updated_by>; 81 81 type Key = S::Key; 82 + type Value = S::Value; 82 83 type Did = S::Did; 83 - type LastUpdatedBy = S::LastUpdatedBy; 84 + type Scope = S::Scope; 84 85 type CreatedBy = S::CreatedBy; 85 - type Value = S::Value; 86 86 } 87 87 ///State transition - sets the `key` field to Set 88 88 pub struct SetKey<S: State = Empty>(PhantomData<fn() -> S>); 89 89 impl<S: State> sealed::Sealed for SetKey<S> {} 90 90 impl<S: State> State for SetKey<S> { 91 - type Scope = S::Scope; 91 + type LastUpdatedBy = S::LastUpdatedBy; 92 92 type Key = Set<members::key>; 93 + type Value = S::Value; 93 94 type Did = S::Did; 95 + type Scope = S::Scope; 96 + type CreatedBy = S::CreatedBy; 97 + } 98 + ///State transition - sets the `value` field to Set 99 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 100 + impl<S: State> sealed::Sealed for SetValue<S> {} 101 + impl<S: State> State for SetValue<S> { 94 102 type LastUpdatedBy = S::LastUpdatedBy; 103 + type Key = S::Key; 104 + type Value = Set<members::value>; 105 + type Did = S::Did; 106 + type Scope = S::Scope; 95 107 type CreatedBy = S::CreatedBy; 96 - type Value = S::Value; 97 108 } 98 109 ///State transition - sets the `did` field to Set 99 110 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 100 111 impl<S: State> sealed::Sealed for SetDid<S> {} 101 112 impl<S: State> State for SetDid<S> { 102 - type Scope = S::Scope; 113 + type LastUpdatedBy = S::LastUpdatedBy; 103 114 type Key = S::Key; 115 + type Value = S::Value; 104 116 type Did = Set<members::did>; 105 - type LastUpdatedBy = S::LastUpdatedBy; 117 + type Scope = S::Scope; 106 118 type CreatedBy = S::CreatedBy; 107 - type Value = S::Value; 108 119 } 109 - ///State transition - sets the `last_updated_by` field to Set 110 - pub struct SetLastUpdatedBy<S: State = Empty>(PhantomData<fn() -> S>); 111 - impl<S: State> sealed::Sealed for SetLastUpdatedBy<S> {} 112 - impl<S: State> State for SetLastUpdatedBy<S> { 113 - type Scope = S::Scope; 120 + ///State transition - sets the `scope` field to Set 121 + pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 122 + impl<S: State> sealed::Sealed for SetScope<S> {} 123 + impl<S: State> State for SetScope<S> { 124 + type LastUpdatedBy = S::LastUpdatedBy; 114 125 type Key = S::Key; 126 + type Value = S::Value; 115 127 type Did = S::Did; 116 - type LastUpdatedBy = Set<members::last_updated_by>; 128 + type Scope = Set<members::scope>; 117 129 type CreatedBy = S::CreatedBy; 118 - type Value = S::Value; 119 130 } 120 131 ///State transition - sets the `created_by` field to Set 121 132 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 122 133 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 123 134 impl<S: State> State for SetCreatedBy<S> { 124 - type Scope = S::Scope; 135 + type LastUpdatedBy = S::LastUpdatedBy; 125 136 type Key = S::Key; 137 + type Value = S::Value; 126 138 type Did = S::Did; 127 - type LastUpdatedBy = S::LastUpdatedBy; 139 + type Scope = S::Scope; 128 140 type CreatedBy = Set<members::created_by>; 129 - type Value = S::Value; 130 - } 131 - ///State transition - sets the `value` field to Set 132 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 133 - impl<S: State> sealed::Sealed for SetValue<S> {} 134 - impl<S: State> State for SetValue<S> { 135 - type Scope = S::Scope; 136 - type Key = S::Key; 137 - type Did = S::Did; 138 - type LastUpdatedBy = S::LastUpdatedBy; 139 - type CreatedBy = S::CreatedBy; 140 - type Value = Set<members::value>; 141 141 } 142 142 /// Marker types for field names 143 143 #[allow(non_camel_case_types)] 144 144 pub mod members { 145 - ///Marker type for the `scope` field 146 - pub struct scope(()); 145 + ///Marker type for the `last_updated_by` field 146 + pub struct last_updated_by(()); 147 147 ///Marker type for the `key` field 148 148 pub struct key(()); 149 + ///Marker type for the `value` field 150 + pub struct value(()); 149 151 ///Marker type for the `did` field 150 152 pub struct did(()); 151 - ///Marker type for the `last_updated_by` field 152 - pub struct last_updated_by(()); 153 + ///Marker type for the `scope` field 154 + pub struct scope(()); 153 155 ///Marker type for the `created_by` field 154 156 pub struct created_by(()); 155 - ///Marker type for the `value` field 156 - pub struct value(()); 157 157 } 158 158 } 159 159 ··· 397 397 impl<'a, S> DefsOptionBuilder<'a, S> 398 398 where 399 399 S: defs_option_state::State, 400 - S::Scope: defs_option_state::IsSet, 400 + S::LastUpdatedBy: defs_option_state::IsSet, 401 401 S::Key: defs_option_state::IsSet, 402 + S::Value: defs_option_state::IsSet, 402 403 S::Did: defs_option_state::IsSet, 403 - S::LastUpdatedBy: defs_option_state::IsSet, 404 + S::Scope: defs_option_state::IsSet, 404 405 S::CreatedBy: defs_option_state::IsSet, 405 - S::Value: defs_option_state::IsSet, 406 406 { 407 407 /// Build the final struct 408 408 pub fn build(self) -> DefsOption<'a> {
+15 -15
crates/weaver-api/src/tools_ozone/setting/upsert_option.rs
··· 41 41 } 42 42 /// State trait tracking which required fields have been set 43 43 pub trait State: sealed::Sealed { 44 + type Value; 44 45 type Key; 45 46 type Scope; 46 - type Value; 47 47 } 48 48 /// Empty state - all required fields are unset 49 49 pub struct Empty(()); 50 50 impl sealed::Sealed for Empty {} 51 51 impl State for Empty { 52 + type Value = Unset; 52 53 type Key = Unset; 53 54 type Scope = Unset; 54 - type Value = Unset; 55 + } 56 + ///State transition - sets the `value` field to Set 57 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetValue<S> {} 59 + impl<S: State> State for SetValue<S> { 60 + type Value = Set<members::value>; 61 + type Key = S::Key; 62 + type Scope = S::Scope; 55 63 } 56 64 ///State transition - sets the `key` field to Set 57 65 pub struct SetKey<S: State = Empty>(PhantomData<fn() -> S>); 58 66 impl<S: State> sealed::Sealed for SetKey<S> {} 59 67 impl<S: State> State for SetKey<S> { 68 + type Value = S::Value; 60 69 type Key = Set<members::key>; 61 70 type Scope = S::Scope; 62 - type Value = S::Value; 63 71 } 64 72 ///State transition - sets the `scope` field to Set 65 73 pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 66 74 impl<S: State> sealed::Sealed for SetScope<S> {} 67 75 impl<S: State> State for SetScope<S> { 68 - type Key = S::Key; 69 - type Scope = Set<members::scope>; 70 76 type Value = S::Value; 71 - } 72 - ///State transition - sets the `value` field to Set 73 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 74 - impl<S: State> sealed::Sealed for SetValue<S> {} 75 - impl<S: State> State for SetValue<S> { 76 77 type Key = S::Key; 77 - type Scope = S::Scope; 78 - type Value = Set<members::value>; 78 + type Scope = Set<members::scope>; 79 79 } 80 80 /// Marker types for field names 81 81 #[allow(non_camel_case_types)] 82 82 pub mod members { 83 + ///Marker type for the `value` field 84 + pub struct value(()); 83 85 ///Marker type for the `key` field 84 86 pub struct key(()); 85 87 ///Marker type for the `scope` field 86 88 pub struct scope(()); 87 - ///Marker type for the `value` field 88 - pub struct value(()); 89 89 } 90 90 } 91 91 ··· 218 218 impl<'a, S> UpsertOptionBuilder<'a, S> 219 219 where 220 220 S: upsert_option_state::State, 221 + S::Value: upsert_option_state::IsSet, 221 222 S::Key: upsert_option_state::IsSet, 222 223 S::Scope: upsert_option_state::IsSet, 223 - S::Value: upsert_option_state::IsSet, 224 224 { 225 225 /// Build the final struct 226 226 pub fn build(self) -> UpsertOption<'a> {
+13 -13
crates/weaver-api/src/tools_ozone/team/add_member.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Did; 37 36 type Role; 37 + type Did; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Did = Unset; 44 43 type Role = Unset; 45 - } 46 - ///State transition - sets the `did` field to Set 47 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetDid<S> {} 49 - impl<S: State> State for SetDid<S> { 50 - type Did = Set<members::did>; 51 - type Role = S::Role; 44 + type Did = Unset; 52 45 } 53 46 ///State transition - sets the `role` field to Set 54 47 pub struct SetRole<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetRole<S> {} 56 49 impl<S: State> State for SetRole<S> { 57 - type Did = S::Did; 58 50 type Role = Set<members::role>; 51 + type Did = S::Did; 52 + } 53 + ///State transition - sets the `did` field to Set 54 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetDid<S> {} 56 + impl<S: State> State for SetDid<S> { 57 + type Role = S::Role; 58 + type Did = Set<members::did>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `did` field 64 - pub struct did(()); 65 63 ///Marker type for the `role` field 66 64 pub struct role(()); 65 + ///Marker type for the `did` field 66 + pub struct did(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> AddMemberBuilder<'a, S> 137 137 where 138 138 S: add_member_state::State, 139 - S::Did: add_member_state::IsSet, 140 139 S::Role: add_member_state::IsSet, 140 + S::Did: add_member_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> AddMember<'a> {
+48 -48
crates/weaver-api/src/tools_ozone/verification.rs
··· 74 74 } 75 75 /// State trait tracking which required fields have been set 76 76 pub trait State: sealed::Sealed { 77 + type Issuer; 77 78 type Subject; 78 - type Handle; 79 - type Uri; 80 79 type DisplayName; 81 - type Issuer; 80 + type Uri; 81 + type Handle; 82 82 type CreatedAt; 83 83 } 84 84 /// Empty state - all required fields are unset 85 85 pub struct Empty(()); 86 86 impl sealed::Sealed for Empty {} 87 87 impl State for Empty { 88 + type Issuer = Unset; 88 89 type Subject = Unset; 89 - type Handle = Unset; 90 - type Uri = Unset; 91 90 type DisplayName = Unset; 92 - type Issuer = Unset; 91 + type Uri = Unset; 92 + type Handle = Unset; 93 93 type CreatedAt = Unset; 94 + } 95 + ///State transition - sets the `issuer` field to Set 96 + pub struct SetIssuer<S: State = Empty>(PhantomData<fn() -> S>); 97 + impl<S: State> sealed::Sealed for SetIssuer<S> {} 98 + impl<S: State> State for SetIssuer<S> { 99 + type Issuer = Set<members::issuer>; 100 + type Subject = S::Subject; 101 + type DisplayName = S::DisplayName; 102 + type Uri = S::Uri; 103 + type Handle = S::Handle; 104 + type CreatedAt = S::CreatedAt; 94 105 } 95 106 ///State transition - sets the `subject` field to Set 96 107 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 97 108 impl<S: State> sealed::Sealed for SetSubject<S> {} 98 109 impl<S: State> State for SetSubject<S> { 110 + type Issuer = S::Issuer; 99 111 type Subject = Set<members::subject>; 100 - type Handle = S::Handle; 101 - type Uri = S::Uri; 102 112 type DisplayName = S::DisplayName; 103 - type Issuer = S::Issuer; 113 + type Uri = S::Uri; 114 + type Handle = S::Handle; 104 115 type CreatedAt = S::CreatedAt; 105 116 } 106 - ///State transition - sets the `handle` field to Set 107 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 108 - impl<S: State> sealed::Sealed for SetHandle<S> {} 109 - impl<S: State> State for SetHandle<S> { 117 + ///State transition - sets the `display_name` field to Set 118 + pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 119 + impl<S: State> sealed::Sealed for SetDisplayName<S> {} 120 + impl<S: State> State for SetDisplayName<S> { 121 + type Issuer = S::Issuer; 110 122 type Subject = S::Subject; 111 - type Handle = Set<members::handle>; 123 + type DisplayName = Set<members::display_name>; 112 124 type Uri = S::Uri; 113 - type DisplayName = S::DisplayName; 114 - type Issuer = S::Issuer; 125 + type Handle = S::Handle; 115 126 type CreatedAt = S::CreatedAt; 116 127 } 117 128 ///State transition - sets the `uri` field to Set 118 129 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 119 130 impl<S: State> sealed::Sealed for SetUri<S> {} 120 131 impl<S: State> State for SetUri<S> { 121 - type Subject = S::Subject; 122 - type Handle = S::Handle; 123 - type Uri = Set<members::uri>; 124 - type DisplayName = S::DisplayName; 125 132 type Issuer = S::Issuer; 126 - type CreatedAt = S::CreatedAt; 127 - } 128 - ///State transition - sets the `display_name` field to Set 129 - pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 130 - impl<S: State> sealed::Sealed for SetDisplayName<S> {} 131 - impl<S: State> State for SetDisplayName<S> { 132 133 type Subject = S::Subject; 134 + type DisplayName = S::DisplayName; 135 + type Uri = Set<members::uri>; 133 136 type Handle = S::Handle; 134 - type Uri = S::Uri; 135 - type DisplayName = Set<members::display_name>; 136 - type Issuer = S::Issuer; 137 137 type CreatedAt = S::CreatedAt; 138 138 } 139 - ///State transition - sets the `issuer` field to Set 140 - pub struct SetIssuer<S: State = Empty>(PhantomData<fn() -> S>); 141 - impl<S: State> sealed::Sealed for SetIssuer<S> {} 142 - impl<S: State> State for SetIssuer<S> { 139 + ///State transition - sets the `handle` field to Set 140 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 141 + impl<S: State> sealed::Sealed for SetHandle<S> {} 142 + impl<S: State> State for SetHandle<S> { 143 + type Issuer = S::Issuer; 143 144 type Subject = S::Subject; 144 - type Handle = S::Handle; 145 + type DisplayName = S::DisplayName; 145 146 type Uri = S::Uri; 146 - type DisplayName = S::DisplayName; 147 - type Issuer = Set<members::issuer>; 147 + type Handle = Set<members::handle>; 148 148 type CreatedAt = S::CreatedAt; 149 149 } 150 150 ///State transition - sets the `created_at` field to Set 151 151 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 152 152 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 153 153 impl<S: State> State for SetCreatedAt<S> { 154 + type Issuer = S::Issuer; 154 155 type Subject = S::Subject; 155 - type Handle = S::Handle; 156 + type DisplayName = S::DisplayName; 156 157 type Uri = S::Uri; 157 - type DisplayName = S::DisplayName; 158 - type Issuer = S::Issuer; 158 + type Handle = S::Handle; 159 159 type CreatedAt = Set<members::created_at>; 160 160 } 161 161 /// Marker types for field names 162 162 #[allow(non_camel_case_types)] 163 163 pub mod members { 164 + ///Marker type for the `issuer` field 165 + pub struct issuer(()); 164 166 ///Marker type for the `subject` field 165 167 pub struct subject(()); 168 + ///Marker type for the `display_name` field 169 + pub struct display_name(()); 170 + ///Marker type for the `uri` field 171 + pub struct uri(()); 166 172 ///Marker type for the `handle` field 167 173 pub struct handle(()); 168 - ///Marker type for the `uri` field 169 - pub struct uri(()); 170 - ///Marker type for the `display_name` field 171 - pub struct display_name(()); 172 - ///Marker type for the `issuer` field 173 - pub struct issuer(()); 174 174 ///Marker type for the `created_at` field 175 175 pub struct created_at(()); 176 176 } ··· 479 479 impl<'a, S> VerificationViewBuilder<'a, S> 480 480 where 481 481 S: verification_view_state::State, 482 + S::Issuer: verification_view_state::IsSet, 482 483 S::Subject: verification_view_state::IsSet, 483 - S::Handle: verification_view_state::IsSet, 484 - S::Uri: verification_view_state::IsSet, 485 484 S::DisplayName: verification_view_state::IsSet, 486 - S::Issuer: verification_view_state::IsSet, 485 + S::Uri: verification_view_state::IsSet, 486 + S::Handle: verification_view_state::IsSet, 487 487 S::CreatedAt: verification_view_state::IsSet, 488 488 { 489 489 /// Build the final struct
+37 -37
crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Error; 40 39 type Subject; 40 + type Error; 41 41 } 42 42 /// Empty state - all required fields are unset 43 43 pub struct Empty(()); 44 44 impl sealed::Sealed for Empty {} 45 45 impl State for Empty { 46 - type Error = Unset; 47 46 type Subject = Unset; 48 - } 49 - ///State transition - sets the `error` field to Set 50 - pub struct SetError<S: State = Empty>(PhantomData<fn() -> S>); 51 - impl<S: State> sealed::Sealed for SetError<S> {} 52 - impl<S: State> State for SetError<S> { 53 - type Error = Set<members::error>; 54 - type Subject = S::Subject; 47 + type Error = Unset; 55 48 } 56 49 ///State transition - sets the `subject` field to Set 57 50 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 58 51 impl<S: State> sealed::Sealed for SetSubject<S> {} 59 52 impl<S: State> State for SetSubject<S> { 60 - type Error = S::Error; 61 53 type Subject = Set<members::subject>; 54 + type Error = S::Error; 55 + } 56 + ///State transition - sets the `error` field to Set 57 + pub struct SetError<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetError<S> {} 59 + impl<S: State> State for SetError<S> { 60 + type Subject = S::Subject; 61 + type Error = Set<members::error>; 62 62 } 63 63 /// Marker types for field names 64 64 #[allow(non_camel_case_types)] 65 65 pub mod members { 66 - ///Marker type for the `error` field 67 - pub struct error(()); 68 66 ///Marker type for the `subject` field 69 67 pub struct subject(()); 68 + ///Marker type for the `error` field 69 + pub struct error(()); 70 70 } 71 71 } 72 72 ··· 139 139 impl<'a, S> GrantErrorBuilder<'a, S> 140 140 where 141 141 S: grant_error_state::State, 142 - S::Error: grant_error_state::IsSet, 143 142 S::Subject: grant_error_state::IsSet, 143 + S::Error: grant_error_state::IsSet, 144 144 { 145 145 /// Build the final struct 146 146 pub fn build(self) -> GrantError<'a> { ··· 640 640 } 641 641 /// State trait tracking which required fields have been set 642 642 pub trait State: sealed::Sealed { 643 - type Subject; 644 - type DisplayName; 645 643 type Handle; 644 + type DisplayName; 645 + type Subject; 646 646 } 647 647 /// Empty state - all required fields are unset 648 648 pub struct Empty(()); 649 649 impl sealed::Sealed for Empty {} 650 650 impl State for Empty { 651 + type Handle = Unset; 652 + type DisplayName = Unset; 651 653 type Subject = Unset; 652 - type DisplayName = Unset; 653 - type Handle = Unset; 654 654 } 655 - ///State transition - sets the `subject` field to Set 656 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 657 - impl<S: State> sealed::Sealed for SetSubject<S> {} 658 - impl<S: State> State for SetSubject<S> { 659 - type Subject = Set<members::subject>; 655 + ///State transition - sets the `handle` field to Set 656 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 657 + impl<S: State> sealed::Sealed for SetHandle<S> {} 658 + impl<S: State> State for SetHandle<S> { 659 + type Handle = Set<members::handle>; 660 660 type DisplayName = S::DisplayName; 661 - type Handle = S::Handle; 661 + type Subject = S::Subject; 662 662 } 663 663 ///State transition - sets the `display_name` field to Set 664 664 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 665 665 impl<S: State> sealed::Sealed for SetDisplayName<S> {} 666 666 impl<S: State> State for SetDisplayName<S> { 667 - type Subject = S::Subject; 668 - type DisplayName = Set<members::display_name>; 669 667 type Handle = S::Handle; 668 + type DisplayName = Set<members::display_name>; 669 + type Subject = S::Subject; 670 670 } 671 - ///State transition - sets the `handle` field to Set 672 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 673 - impl<S: State> sealed::Sealed for SetHandle<S> {} 674 - impl<S: State> State for SetHandle<S> { 675 - type Subject = S::Subject; 671 + ///State transition - sets the `subject` field to Set 672 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 673 + impl<S: State> sealed::Sealed for SetSubject<S> {} 674 + impl<S: State> State for SetSubject<S> { 675 + type Handle = S::Handle; 676 676 type DisplayName = S::DisplayName; 677 - type Handle = Set<members::handle>; 677 + type Subject = Set<members::subject>; 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 `handle` field 683 + pub struct handle(()); 684 + ///Marker type for the `display_name` field 685 + pub struct display_name(()); 682 686 ///Marker type for the `subject` field 683 687 pub struct subject(()); 684 - ///Marker type for the `display_name` field 685 - pub struct display_name(()); 686 - ///Marker type for the `handle` field 687 - pub struct handle(()); 688 688 } 689 689 } 690 690 ··· 797 797 impl<'a, S> VerificationInputBuilder<'a, S> 798 798 where 799 799 S: verification_input_state::State, 800 - S::Subject: verification_input_state::IsSet, 801 - S::DisplayName: verification_input_state::IsSet, 802 800 S::Handle: verification_input_state::IsSet, 801 + S::DisplayName: verification_input_state::IsSet, 802 + S::Subject: verification_input_state::IsSet, 803 803 { 804 804 /// Build the final struct 805 805 pub fn build(self) -> VerificationInput<'a> {
+13 -13
crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs
··· 236 236 } 237 237 /// State trait tracking which required fields have been set 238 238 pub trait State: sealed::Sealed { 239 - type Error; 240 239 type Uri; 240 + type Error; 241 241 } 242 242 /// Empty state - all required fields are unset 243 243 pub struct Empty(()); 244 244 impl sealed::Sealed for Empty {} 245 245 impl State for Empty { 246 - type Error = Unset; 247 246 type Uri = Unset; 248 - } 249 - ///State transition - sets the `error` field to Set 250 - pub struct SetError<S: State = Empty>(PhantomData<fn() -> S>); 251 - impl<S: State> sealed::Sealed for SetError<S> {} 252 - impl<S: State> State for SetError<S> { 253 - type Error = Set<members::error>; 254 - type Uri = S::Uri; 247 + type Error = Unset; 255 248 } 256 249 ///State transition - sets the `uri` field to Set 257 250 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 258 251 impl<S: State> sealed::Sealed for SetUri<S> {} 259 252 impl<S: State> State for SetUri<S> { 260 - type Error = S::Error; 261 253 type Uri = Set<members::uri>; 254 + type Error = S::Error; 255 + } 256 + ///State transition - sets the `error` field to Set 257 + pub struct SetError<S: State = Empty>(PhantomData<fn() -> S>); 258 + impl<S: State> sealed::Sealed for SetError<S> {} 259 + impl<S: State> State for SetError<S> { 260 + type Uri = S::Uri; 261 + type Error = Set<members::error>; 262 262 } 263 263 /// Marker types for field names 264 264 #[allow(non_camel_case_types)] 265 265 pub mod members { 266 - ///Marker type for the `error` field 267 - pub struct error(()); 268 266 ///Marker type for the `uri` field 269 267 pub struct uri(()); 268 + ///Marker type for the `error` field 269 + pub struct error(()); 270 270 } 271 271 } 272 272 ··· 339 339 impl<'a, S> RevokeErrorBuilder<'a, S> 340 340 where 341 341 S: revoke_error_state::State, 342 - S::Error: revoke_error_state::IsSet, 343 342 S::Uri: revoke_error_state::IsSet, 343 + S::Error: revoke_error_state::IsSet, 344 344 { 345 345 /// Build the final struct 346 346 pub fn build(self) -> RevokeError<'a> {
+5 -5
crates/weaver-app/.env-prod
··· 1 1 WEAVER_APP_ENV="prod" 2 - WEAVER_APP_HOST="https://alpha.weaver.sh" 3 - WEAVER_APP_DOMAIN="https://alpha.weaver.sh" 2 + WEAVER_APP_HOST="https://weaver.sh" 3 + WEAVER_APP_DOMAIN="weaver.sh" 4 4 WEAVER_PORT=8080 5 5 WEAVER_APP_SCOPES="atproto transition:generic" 6 6 WEAVER_CLIENT_NAME="Weaver" 7 7 8 - WEAVER_LOGO_URI="https://alpha.weaver.sh/favicon.ico" 9 - WEAVER_TOS_URI="https://alpha.weaver.sh/tos" 10 - WEAVER_PRIVACY_POLICY_URI="https://alpha.weaver.sh/privacy" 8 + WEAVER_LOGO_URI="https://weaver.sh/favicon.ico" 9 + WEAVER_TOS_URI="https://weaver.sh/tos" 10 + WEAVER_PRIVACY_POLICY_URI="https://weaver.sh/privacy" 11 11 WEAVER_OWNER_DID="did:plc:yfvwmnlztr4dwkb7hwz55r2g" 12 12 WEAVER_INDEXER_URL="https://index.weaver.sh" 13 13 WEAVER_INDEXER_DID="did:web:index.weaver.sh"
+4 -2
crates/weaver-app/Cargo.toml
··· 39 39 web = ["dioxus/web", "dioxus-primitives/web"] 40 40 desktop = ["dioxus/desktop"] 41 41 mobile = ["dioxus/mobile"] 42 - server = [ "dioxus/server", "dep:jacquard-axum", "dep:axum", "dep:resvg", "dep:usvg", "dep:tiny-skia", "dep:textwrap", "dep:askama", "dep:fontdb", "dep:lightningcss"] 42 + server = [ "dioxus/server", "dep:jacquard-axum", "dep:axum", "dep:axum-extra", "dep:tower", "dep:resvg", "dep:usvg", "dep:tiny-skia", "dep:textwrap", "dep:askama", "dep:fontdb", "dep:lightningcss"] 43 43 collab-worker = ["weaver-common/iroh"] 44 44 45 45 ··· 60 60 weaver-renderer = { path = "../weaver-renderer" } 61 61 n0-future = { workspace = true } 62 62 dioxus-primitives = { git = "https://github.com/DioxusLabs/components", version = "0.0.1", default-features = false, features = ["router"] } 63 - axum = {version = "0.8.6", optional = true} 63 + axum = { version = "0.8.6", optional = true } 64 + axum-extra = { version = "0.10", optional = true, features = ["typed-header"] } 65 + tower = { version = "0.5", optional = true } 64 66 mime-sniffer = {version = "^0.1"} 65 67 chrono = { version = "0.4" } 66 68 serde = { version = "1.0" }
+6 -6
crates/weaver-app/assets/styling/layouts.css
··· 94 94 .notebook-layout { 95 95 display: grid; 96 96 grid-template-columns: 97 - minmax(280px, 1fr) 98 - minmax(0, 90rem) 99 - minmax(280px, 1fr); 100 - gap: 2rem; 101 - max-width: calc(90rem + 560px + 4rem); 97 + minmax(240px, 1fr) 98 + minmax(0, 95ch) 99 + minmax(240px, 1fr); 100 + gap: 1rem; 101 + max-width: calc(95ch + 480px + 4rem); 102 102 margin: 0 auto; 103 103 padding: 2.5rem 1.25rem 2.5rem 0; 104 104 } ··· 119 119 120 120 @media (max-width: 1400px) { 121 121 .notebook-layout { 122 - grid-template-columns: minmax(1rem, 1fr) minmax(0, 90rem) minmax(1rem, 1fr) !important; 122 + grid-template-columns: minmax(1rem, 1fr) minmax(0, 95ch) minmax(1rem, 1fr) !important; 123 123 gap: 0 !important; 124 124 max-width: 100vw !important; 125 125 box-sizing: border-box !important;
+339
crates/weaver-app/src/components/app_link.rs
··· 1 + //! Router-agnostic link and navigation for shared components. 2 + //! 3 + //! AppLink dispatches to either `Link<Route>` or `Link<SubdomainRoute>` based on 4 + //! the current LinkMode context, preserving proper client-side navigation semantics. 5 + //! 6 + //! AppNavigate provides programmatic navigation that dispatches similarly. 7 + 8 + use crate::env::WEAVER_APP_HOST; 9 + use crate::host_mode::LinkMode; 10 + use crate::{Route, SubdomainRoute}; 11 + use dioxus::prelude::*; 12 + use jacquard::smol_str::SmolStr; 13 + use jacquard::types::string::AtIdentifier; 14 + 15 + /// Target for router-agnostic links. 16 + #[derive(Clone, PartialEq)] 17 + pub enum AppLinkTarget { 18 + /// Entry by title path: /:ident/:book/:title or /:title 19 + Entry { 20 + ident: AtIdentifier<'static>, 21 + book_title: SmolStr, 22 + entry_path: SmolStr, 23 + }, 24 + /// Entry by rkey: /:ident/:book/e/:rkey or /e/:rkey 25 + EntryByRkey { 26 + ident: AtIdentifier<'static>, 27 + book_title: SmolStr, 28 + rkey: SmolStr, 29 + }, 30 + /// Entry edit: /:ident/:book/e/:rkey/edit or /e/:rkey/edit 31 + EntryEdit { 32 + ident: AtIdentifier<'static>, 33 + book_title: SmolStr, 34 + rkey: SmolStr, 35 + }, 36 + /// Notebook index: /:ident/:book or / 37 + Notebook { 38 + ident: AtIdentifier<'static>, 39 + book_title: SmolStr, 40 + }, 41 + /// Profile/repository: /:ident or /u/:ident 42 + Profile { ident: AtIdentifier<'static> }, 43 + /// Standalone entry: /:ident/e/:rkey (always main domain in subdomain mode) 44 + StandaloneEntry { 45 + ident: AtIdentifier<'static>, 46 + rkey: SmolStr, 47 + }, 48 + /// Standalone entry edit: /:ident/e/:rkey/edit 49 + StandaloneEntryEdit { 50 + ident: AtIdentifier<'static>, 51 + rkey: SmolStr, 52 + }, 53 + /// New draft: /:ident/new?notebook=... 54 + NewDraft { 55 + ident: AtIdentifier<'static>, 56 + notebook: Option<SmolStr>, 57 + }, 58 + /// Drafts list: /:ident/drafts 59 + Drafts { ident: AtIdentifier<'static> }, 60 + /// Invites page: /:ident/invites 61 + Invites { ident: AtIdentifier<'static> }, 62 + } 63 + 64 + #[derive(Props, Clone, PartialEq)] 65 + pub struct AppLinkProps { 66 + pub to: AppLinkTarget, 67 + #[props(default)] 68 + pub class: Option<String>, 69 + pub children: Element, 70 + } 71 + 72 + /// Router-agnostic link component. 73 + /// 74 + /// Renders the appropriate `Link<Route>` or `Link<SubdomainRoute>` based on LinkMode context. 75 + #[component] 76 + pub fn AppLink(props: AppLinkProps) -> Element { 77 + let link_mode = use_context::<LinkMode>(); 78 + let class = props.class.clone().unwrap_or_default(); 79 + 80 + match link_mode { 81 + LinkMode::MainDomain => { 82 + let route = match props.to.clone() { 83 + AppLinkTarget::Entry { 84 + ident, 85 + book_title, 86 + entry_path, 87 + } => Route::EntryPage { 88 + ident, 89 + book_title, 90 + title: entry_path, 91 + }, 92 + AppLinkTarget::EntryByRkey { 93 + ident, 94 + book_title, 95 + rkey, 96 + } => Route::NotebookEntryByRkey { 97 + ident, 98 + book_title, 99 + rkey, 100 + }, 101 + AppLinkTarget::EntryEdit { 102 + ident, 103 + book_title, 104 + rkey, 105 + } => Route::NotebookEntryEdit { 106 + ident, 107 + book_title, 108 + rkey, 109 + }, 110 + AppLinkTarget::Notebook { ident, book_title } => { 111 + Route::NotebookIndex { ident, book_title } 112 + } 113 + AppLinkTarget::Profile { ident } => Route::RepositoryIndex { ident }, 114 + AppLinkTarget::StandaloneEntry { ident, rkey } => { 115 + Route::StandaloneEntry { ident, rkey } 116 + } 117 + AppLinkTarget::StandaloneEntryEdit { ident, rkey } => { 118 + Route::StandaloneEntryEdit { ident, rkey } 119 + } 120 + AppLinkTarget::NewDraft { ident, notebook } => Route::NewDraft { ident, notebook }, 121 + AppLinkTarget::Drafts { ident } => Route::DraftsList { ident }, 122 + AppLinkTarget::Invites { ident } => Route::InvitesPage { ident }, 123 + }; 124 + rsx! { 125 + Link { to: route, class: "{class}", {props.children} } 126 + } 127 + } 128 + LinkMode::Subdomain => { 129 + // For subdomain mode, some links go to SubdomainRoute, others to main domain 130 + match props.to.clone() { 131 + AppLinkTarget::Entry { entry_path, .. } => { 132 + let route = SubdomainRoute::SubdomainEntry { title: entry_path }; 133 + rsx! { 134 + Link { to: route, class: "{class}", {props.children} } 135 + } 136 + } 137 + AppLinkTarget::EntryByRkey { rkey, .. } => { 138 + let route = SubdomainRoute::SubdomainEntryByRkey { rkey }; 139 + rsx! { 140 + Link { to: route, class: "{class}", {props.children} } 141 + } 142 + } 143 + AppLinkTarget::EntryEdit { rkey, .. } => { 144 + let route = SubdomainRoute::SubdomainEntryEdit { rkey }; 145 + rsx! { 146 + Link { to: route, class: "{class}", {props.children} } 147 + } 148 + } 149 + AppLinkTarget::Notebook { .. } => { 150 + let route = SubdomainRoute::SubdomainLanding {}; 151 + rsx! { 152 + Link { to: route, class: "{class}", {props.children} } 153 + } 154 + } 155 + AppLinkTarget::Profile { ident } => { 156 + let route = SubdomainRoute::SubdomainProfile { ident }; 157 + rsx! { 158 + Link { to: route, class: "{class}", {props.children} } 159 + } 160 + } 161 + // These go to main domain in subdomain mode 162 + AppLinkTarget::StandaloneEntry { ident, rkey } => { 163 + let href = format!("{}/{}/e/{}", WEAVER_APP_HOST, ident, rkey); 164 + rsx! { 165 + a { href: "{href}", class: "{class}", {props.children} } 166 + } 167 + } 168 + AppLinkTarget::StandaloneEntryEdit { ident, rkey } => { 169 + let href = format!("{}/{}/e/{}/edit", WEAVER_APP_HOST, ident, rkey); 170 + rsx! { 171 + a { href: "{href}", class: "{class}", {props.children} } 172 + } 173 + } 174 + AppLinkTarget::NewDraft { ident, notebook } => { 175 + let href = match notebook { 176 + Some(nb) => format!("{}/{}/new?notebook={}", WEAVER_APP_HOST, ident, nb), 177 + None => format!("{}/{}/new", WEAVER_APP_HOST, ident), 178 + }; 179 + rsx! { 180 + a { href: "{href}", class: "{class}", {props.children} } 181 + } 182 + } 183 + AppLinkTarget::Drafts { ident } => { 184 + let href = format!("{}/{}/drafts", WEAVER_APP_HOST, ident); 185 + rsx! { 186 + a { href: "{href}", class: "{class}", {props.children} } 187 + } 188 + } 189 + AppLinkTarget::Invites { ident } => { 190 + let href = format!("{}/{}/invites", WEAVER_APP_HOST, ident); 191 + rsx! { 192 + a { href: "{href}", class: "{class}", {props.children} } 193 + } 194 + } 195 + } 196 + } 197 + } 198 + } 199 + 200 + /// Navigation function type for programmatic routing. 201 + pub type NavigateFn = std::rc::Rc<dyn Fn(AppLinkTarget)>; 202 + 203 + /// Hook to get the app-wide navigation function. 204 + /// Must be used with AppNavigatorProvider in context. 205 + pub fn use_app_navigate() -> NavigateFn { 206 + use_context::<NavigateFn>() 207 + } 208 + 209 + /// Provides the main domain navigation function. 210 + /// Call this in App to set up navigation context. 211 + pub fn use_main_navigator_provider() { 212 + let navigator = use_navigator(); 213 + use_context_provider(move || { 214 + let navigator = navigator.clone(); 215 + std::rc::Rc::new(move |target: AppLinkTarget| { 216 + let route = match target { 217 + AppLinkTarget::Entry { 218 + ident, 219 + book_title, 220 + entry_path, 221 + } => Route::EntryPage { 222 + ident, 223 + book_title, 224 + title: entry_path, 225 + }, 226 + AppLinkTarget::EntryByRkey { 227 + ident, 228 + book_title, 229 + rkey, 230 + } => Route::NotebookEntryByRkey { 231 + ident, 232 + book_title, 233 + rkey, 234 + }, 235 + AppLinkTarget::EntryEdit { 236 + ident, 237 + book_title, 238 + rkey, 239 + } => Route::NotebookEntryEdit { 240 + ident, 241 + book_title, 242 + rkey, 243 + }, 244 + AppLinkTarget::Notebook { ident, book_title } => { 245 + Route::NotebookIndex { ident, book_title } 246 + } 247 + AppLinkTarget::Profile { ident } => Route::RepositoryIndex { ident }, 248 + AppLinkTarget::StandaloneEntry { ident, rkey } => { 249 + Route::StandaloneEntry { ident, rkey } 250 + } 251 + AppLinkTarget::StandaloneEntryEdit { ident, rkey } => { 252 + Route::StandaloneEntryEdit { ident, rkey } 253 + } 254 + AppLinkTarget::NewDraft { ident, notebook } => Route::NewDraft { ident, notebook }, 255 + AppLinkTarget::Drafts { ident } => Route::DraftsList { ident }, 256 + AppLinkTarget::Invites { ident } => Route::InvitesPage { ident }, 257 + }; 258 + navigator.push(route); 259 + }) as NavigateFn 260 + }); 261 + } 262 + 263 + /// Provides the subdomain navigation function. 264 + /// Call this in SubdomainApp to set up navigation context. 265 + pub fn use_subdomain_navigator_provider() { 266 + let navigator = use_navigator(); 267 + use_context_provider(move || { 268 + let navigator = navigator.clone(); 269 + std::rc::Rc::new(move |target: AppLinkTarget| { 270 + match target { 271 + // These navigate within subdomain 272 + AppLinkTarget::Entry { entry_path, .. } => { 273 + navigator.push(SubdomainRoute::SubdomainEntry { title: entry_path }); 274 + } 275 + AppLinkTarget::EntryByRkey { rkey, .. } => { 276 + navigator.push(SubdomainRoute::SubdomainEntryByRkey { rkey }); 277 + } 278 + AppLinkTarget::EntryEdit { rkey, .. } => { 279 + navigator.push(SubdomainRoute::SubdomainEntryEdit { rkey }); 280 + } 281 + AppLinkTarget::Notebook { .. } => { 282 + navigator.push(SubdomainRoute::SubdomainLanding {}); 283 + } 284 + AppLinkTarget::Profile { ident } => { 285 + navigator.push(SubdomainRoute::SubdomainProfile { ident }); 286 + } 287 + // These go to main domain - use window.location 288 + AppLinkTarget::StandaloneEntry { ident, rkey } 289 + | AppLinkTarget::StandaloneEntryEdit { ident, rkey } => { 290 + #[cfg(target_arch = "wasm32")] 291 + if let Some(window) = web_sys::window() { 292 + let path = format!("{}/{}/e/{}", WEAVER_APP_HOST, ident, rkey); 293 + let _ = window.location().set_href(&path); 294 + } 295 + #[cfg(not(target_arch = "wasm32"))] 296 + { 297 + let _ = ident; 298 + let _ = rkey; 299 + } 300 + } 301 + AppLinkTarget::NewDraft { ident, notebook } => { 302 + #[cfg(target_arch = "wasm32")] 303 + if let Some(window) = web_sys::window() { 304 + let path = match notebook { 305 + Some(nb) => { 306 + format!("{}/{}/new?notebook={}", WEAVER_APP_HOST, ident, nb) 307 + } 308 + None => format!("{}/{}/new", WEAVER_APP_HOST, ident), 309 + }; 310 + let _ = window.location().set_href(&path); 311 + } 312 + #[cfg(not(target_arch = "wasm32"))] 313 + { 314 + let _ = notebook; 315 + let _ = ident; 316 + } 317 + } 318 + AppLinkTarget::Drafts { ident } => { 319 + #[cfg(target_arch = "wasm32")] 320 + if let Some(window) = web_sys::window() { 321 + let path = format!("{}/{}/drafts", WEAVER_APP_HOST, ident); 322 + let _ = window.location().set_href(&path); 323 + } 324 + #[cfg(not(target_arch = "wasm32"))] 325 + let _ = ident; 326 + } 327 + AppLinkTarget::Invites { ident } => { 328 + #[cfg(target_arch = "wasm32")] 329 + if let Some(window) = web_sys::window() { 330 + let path = format!("{}/{}/invites", WEAVER_APP_HOST, ident); 331 + let _ = window.location().set_href(&path); 332 + } 333 + #[cfg(not(target_arch = "wasm32"))] 334 + let _ = ident; 335 + } 336 + } 337 + }) as NavigateFn 338 + }); 339 + }
+7 -7
crates/weaver-app/src/components/author_list/component.rs
··· 1 1 //! AuthorList component for displaying multiple authors with progressive disclosure. 2 2 3 - use crate::Route; 3 + use crate::components::{AppLink, AppLinkTarget}; 4 4 use dioxus::prelude::*; 5 5 use jacquard::IntoStatic; 6 6 use jacquard::types::ident::AtIdentifier; ··· 210 210 let handle_display = info.handle.as_ref(); 211 211 212 212 rsx! { 213 - Link { 214 - to: Route::RepositoryIndex { 213 + AppLink { 214 + to: AppLinkTarget::Profile { 215 215 ident: AtIdentifier::Handle(info.handle.clone()) 216 216 }, 217 - class: "embed-author author-block", 217 + class: Some("embed-author author-block".to_string()), 218 218 if let Some(ref avatar) = info.avatar_url { 219 219 img { 220 220 class: "embed-avatar", ··· 241 241 .unwrap_or_else(|| info.handle.as_ref()); 242 242 243 243 rsx! { 244 - Link { 245 - to: Route::RepositoryIndex { 244 + AppLink { 245 + to: AppLinkTarget::Profile { 246 246 ident: AtIdentifier::Handle(info.handle.clone()) 247 247 }, 248 - class: "author-inline", 248 + class: Some("author-inline".to_string()), 249 249 "{display}" 250 250 } 251 251 }
+17 -16
crates/weaver-app/src/components/entry.rs
··· 1 1 #![allow(non_snake_case)] 2 2 3 + use crate::components::{AppLink, AppLinkTarget}; 3 4 use crate::Route; 4 5 #[cfg(feature = "server")] 5 6 use crate::blobcache::BlobCache; ··· 305 306 author_count: usize, 306 307 ident: AtIdentifier<'static>, 307 308 ) -> Element { 308 - use crate::Route; 309 309 use crate::auth::AuthState; 310 310 use jacquard::from_data; 311 311 use weaver_api::sh_weaver::notebook::entry::Entry; ··· 384 384 div { class: "entry-card", 385 385 div { class: "entry-card-meta", 386 386 div { class: "entry-card-header", 387 - Link { 388 - to: Route::EntryPage { 387 + AppLink { 388 + to: AppLinkTarget::Entry { 389 389 ident: ident.clone(), 390 390 book_title: book_title.clone(), 391 - title: entry_path.clone().into() 391 + entry_path: entry_path.clone().into(), 392 392 }, 393 - class: "entry-card-title-link", 393 + class: Some("entry-card-title-link".to_string()), 394 394 h3 { class: "entry-card-title", "{title}" } 395 395 } 396 396 div { class: "entry-card-date", ··· 453 453 profile_ident: Option<AtIdentifier<'static>>, 454 454 #[props(default)] on_pinned_changed: Option<EventHandler<bool>>, 455 455 ) -> Element { 456 - use crate::Route; 457 456 use crate::auth::AuthState; 458 457 459 458 let title = entry_view ··· 517 516 div { class: "entry-card feed-entry-card", 518 517 // Header: title (and date if no author) 519 518 div { class: "entry-card-header", 520 - Link { 521 - to: Route::StandaloneEntry { 519 + AppLink { 520 + to: AppLinkTarget::StandaloneEntry { 522 521 ident: ident.clone(), 523 - rkey: rkey.clone().into() 522 + rkey: rkey.clone(), 524 523 }, 525 - class: "entry-card-title-link", 524 + class: Some("entry-card-title-link".to_string()), 526 525 h3 { class: "entry-card-title", "{title}" } 527 526 } 528 527 // Date inline with title when no author shown ··· 588 587 #[props(default)] word_count: Option<usize>, 589 588 #[props(default)] reading_time_mins: Option<usize>, 590 589 ) -> Element { 591 - let navigator = use_navigator(); 590 + use crate::components::use_app_navigate; 591 + 592 + let navigate = use_app_navigate(); 592 593 593 594 let title = entry_view 594 595 .title ··· 603 604 let nav_ident = ident.clone(); 604 605 let on_removed = move |_| { 605 606 if let Some(ref title) = nav_book_title { 606 - navigator.push(Route::NotebookIndex { 607 + navigate(AppLinkTarget::Notebook { 607 608 ident: nav_ident.clone(), 608 609 book_title: title.clone(), 609 610 }); ··· 697 698 }; 698 699 699 700 rsx! { 700 - Link { 701 - to: Route::EntryPage { 701 + AppLink { 702 + to: AppLinkTarget::Entry { 702 703 ident: ident.clone(), 703 704 book_title: book_title.clone(), 704 - title: entry_path.into() 705 + entry_path: entry_path.into(), 705 706 }, 706 - class: "nav-button nav-button-{direction}", 707 + class: Some(format!("nav-button nav-button-{}", direction)), 707 708 if title_first { 708 709 span { class: "nav-title", "{entry_title}" } 709 710 span { class: "nav-arrow", "{arrow}" }
+21 -17
crates/weaver-app/src/components/entry_actions.rs
··· 1 1 //! Action buttons for entries (edit, delete, remove from notebook, pin/unpin). 2 2 3 - use crate::Route; 3 + use crate::components::{AppLink, AppLinkTarget, use_app_navigate}; 4 4 use crate::auth::AuthState; 5 5 use crate::components::button::{Button, ButtonVariant}; 6 6 use crate::components::dialog::{DialogContent, DialogDescription, DialogRoot, DialogTitle}; ··· 52 52 pub fn EntryActions(props: EntryActionsProps) -> Element { 53 53 let auth_state = use_context::<Signal<AuthState>>(); 54 54 let fetcher = use_context::<Fetcher>(); 55 - let navigator = use_navigator(); 56 55 57 56 let mut show_delete_confirm = use_signal(|| false); 58 57 let mut show_remove_confirm = use_signal(|| false); ··· 90 89 None => return rsx! {}, // Can't edit without rkey 91 90 }; 92 91 93 - // Build edit route based on whether entry is in a notebook 92 + // Build edit link target based on whether entry is in a notebook 94 93 let ident = props.entry_uri.authority().clone(); 95 - let edit_route = if props.in_notebook { 94 + let edit_target = if props.in_notebook { 96 95 if let Some(ref notebook) = props.notebook_title { 97 - Route::NotebookEntryEdit { 98 - ident: ident.into_static(), 96 + AppLinkTarget::EntryEdit { 97 + ident: ident.clone().into_static(), 99 98 book_title: notebook.clone(), 100 99 rkey: rkey.clone().into(), 101 100 } 102 101 } else { 103 - Route::StandaloneEntryEdit { 104 - ident: ident.into_static(), 102 + AppLinkTarget::StandaloneEntryEdit { 103 + ident: ident.clone().into_static(), 105 104 rkey: rkey.clone().into(), 106 105 } 107 106 } 108 107 } else { 109 - Route::StandaloneEntryEdit { 110 - ident: ident.into_static(), 108 + AppLinkTarget::StandaloneEntryEdit { 109 + ident: ident.clone().into_static(), 111 110 rkey: rkey.clone().into(), 112 111 } 113 112 }; 114 113 114 + // Get navigation function for post-delete redirect 115 + let navigate = use_app_navigate(); 116 + 115 117 let entry_uri_for_delete = props.entry_uri.clone(); 116 118 let entry_title = props.entry_title.clone(); 117 119 ··· 119 121 let handle_delete = move |_| { 120 122 let fetcher = delete_fetcher.clone(); 121 123 let uri = entry_uri_for_delete.clone(); 122 - let navigator = navigator.clone(); 124 + let navigate = navigate.clone(); 123 125 124 126 spawn(async move { 125 127 use jacquard::prelude::*; ··· 142 144 }; 143 145 144 146 let request = DeleteRecord::new() 145 - .repo(AtIdentifier::Did(did)) 147 + .repo(AtIdentifier::Did(did.clone())) 146 148 .collection(collection.clone()) 147 149 .rkey(rkey.clone()) 148 150 .build(); ··· 150 152 match client.send(request).await { 151 153 Ok(_) => { 152 154 show_delete_confirm.set(false); 153 - // Navigate back to home after delete 154 - navigator.push(Route::Home {}); 155 + // Navigate to profile after delete 156 + navigate(AppLinkTarget::Profile { 157 + ident: AtIdentifier::Did(did), 158 + }); 155 159 } 156 160 Err(e) => { 157 161 error.set(Some(format!("Delete failed: {:?}", e))); ··· 435 439 436 440 div { class: "entry-actions", 437 441 // Edit button (always visible for owner) 438 - Link { 439 - to: edit_route, 440 - class: "entry-action-link", 442 + AppLink { 443 + to: edit_target, 444 + class: Some("entry-action-link".to_string()), 441 445 Button { 442 446 variant: ButtonVariant::Ghost, 443 447 "Edit"
+6
crates/weaver-app/src/components/mod.rs
··· 2 2 //! They can be used to defined common UI elements like buttons, forms, and modals. In this template, we define a Hero 3 3 //! component and an Echo component for fullstack apps to be used in our app. 4 4 5 + pub mod app_link; 6 + pub use app_link::{ 7 + AppLink, AppLinkTarget, use_app_navigate, use_main_navigator_provider, 8 + use_subdomain_navigator_provider, 9 + }; 10 + 5 11 pub mod css; 6 12 pub use css::NotebookCss; 7 13
+4 -4
crates/weaver-app/src/components/notebook_cover.rs
··· 1 1 #![allow(non_snake_case)] 2 2 3 - use crate::Route; 3 + use crate::components::{AppLink, AppLinkTarget}; 4 4 use crate::components::AuthorList; 5 5 use crate::components::button::{Button, ButtonVariant}; 6 6 use dioxus::prelude::*; ··· 93 93 if is_owner { 94 94 if let Some(ref owner_ident) = ident { 95 95 div { class: "notebook-cover-actions", 96 - Link { 97 - to: Route::NewDraft { 96 + AppLink { 97 + to: AppLinkTarget::NewDraft { 98 98 ident: owner_ident.clone(), 99 99 notebook: Some(SmolStr::from(title.as_str())) 100 100 }, 101 - class: "notebook-cover-action-link", 101 + class: Some("notebook-cover-action-link".to_string()), 102 102 Button { 103 103 variant: ButtonVariant::Outline, 104 104 "+ Add Entry"
+2 -2
crates/weaver-app/src/components/record_editor.rs
··· 1327 1327 Ok(response) => { 1328 1328 if let Ok(output) = response.into_output() { 1329 1329 tracing::info!("Record created: {}", output.uri); 1330 - let link = format!("{}/record/{}", crate::env::WEAVER_APP_DOMAIN, output.uri); 1330 + let link = format!("{}/record/{}", crate::env::WEAVER_APP_HOST, output.uri); 1331 1331 nav.push(link); 1332 1332 } 1333 1333 } ··· 1378 1378 } 1379 1379 1380 1380 tracing::info!("Record replaced: {}", create_output.uri); 1381 - let link = format!("{}/record/{}", crate::env::WEAVER_APP_DOMAIN, create_output.uri); 1381 + let link = format!("{}/record/{}", crate::env::WEAVER_APP_HOST, create_output.uri); 1382 1382 nav.push(link); 1383 1383 } 1384 1384 }
+1 -1
crates/weaver-app/src/components/record_view.rs
··· 398 398 #[component] 399 399 pub fn HighlightedUri(uri: AtUri<'static>) -> Element { 400 400 let s = uri.as_str(); 401 - let link = format!("{}/record/{}", crate::env::WEAVER_APP_DOMAIN, s); 401 + let link = format!("{}/record/{}", crate::env::WEAVER_APP_HOST, s); 402 402 403 403 if let Some(rest) = s.strip_prefix("at://") { 404 404 let parts: Vec<&str> = rest.splitn(3, '/').collect();
+160
crates/weaver-app/src/host_mode.rs
··· 1 + //! Host mode context for subdomain and custom domain routing. 2 + 3 + use crate::env::WEAVER_APP_HOST; 4 + use jacquard::smol_str::{SmolStr, format_smolstr}; 5 + use jacquard::types::string::AtIdentifier; 6 + use serde::{Deserialize, Serialize}; 7 + 8 + /// Context for subdomain routing - identifies the notebook being served. 9 + #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] 10 + #[serde(bound(deserialize = ""))] 11 + pub struct SubdomainContext { 12 + /// DID of the notebook owner. 13 + #[serde(deserialize_with = "deserialize_static_ident")] 14 + pub owner: AtIdentifier<'static>, 15 + /// Notebook path (same as subdomain). 16 + pub notebook_path: SmolStr, 17 + 18 + /// Notebook title. 19 + pub notebook_title: SmolStr, 20 + /// Notebook rkey for direct lookups. 21 + pub notebook_rkey: SmolStr, 22 + } 23 + 24 + fn deserialize_static_ident<'de, D>(deserializer: D) -> Result<AtIdentifier<'static>, D::Error> 25 + where 26 + D: serde::Deserializer<'de>, 27 + { 28 + use jacquard::IntoStatic; 29 + let did: AtIdentifier<'de> = Deserialize::deserialize(deserializer)?; 30 + Ok(did.into_static()) 31 + } 32 + 33 + impl SubdomainContext { 34 + /// Get the owner as an AtIdentifier for route parameters. 35 + pub fn owner_ident(&self) -> AtIdentifier<'static> { 36 + self.owner.clone() 37 + } 38 + } 39 + 40 + /// Link mode for generating appropriate URLs based on host context. 41 + /// 42 + /// Components use this context to generate links that work on both 43 + /// the main domain and subdomain hosting. 44 + #[derive(Clone, Debug, Default, PartialEq, Eq)] 45 + pub enum LinkMode { 46 + /// Main domain - full paths with /:ident/:notebook/:entry 47 + #[default] 48 + MainDomain, 49 + /// Subdomain - simplified paths like /:entry 50 + Subdomain, 51 + } 52 + 53 + impl LinkMode { 54 + /// Check if we're in subdomain mode. 55 + pub fn is_subdomain(&self) -> bool { 56 + matches!(self, LinkMode::Subdomain) 57 + } 58 + 59 + /// Generate link to a notebook entry by title. 60 + pub fn entry_link( 61 + &self, 62 + ident: &AtIdentifier<'_>, 63 + book_title: &str, 64 + entry_title: &str, 65 + ) -> SmolStr { 66 + match self { 67 + LinkMode::MainDomain => format_smolstr!("/{}/{}/{}", ident, book_title, entry_title), 68 + LinkMode::Subdomain => format_smolstr!("/{}", entry_title), 69 + } 70 + } 71 + 72 + /// Generate link to a notebook entry by rkey. 73 + pub fn entry_rkey_link( 74 + &self, 75 + ident: &AtIdentifier<'_>, 76 + book_title: &str, 77 + rkey: &str, 78 + ) -> SmolStr { 79 + match self { 80 + LinkMode::MainDomain => format_smolstr!("/{}/{}/e/{}", ident, book_title, rkey), 81 + LinkMode::Subdomain => format_smolstr!("/e/{}", rkey), 82 + } 83 + } 84 + 85 + /// Generate link to edit a notebook entry by rkey. 86 + pub fn entry_edit_link( 87 + &self, 88 + ident: &AtIdentifier<'_>, 89 + book_title: &str, 90 + rkey: &str, 91 + ) -> SmolStr { 92 + match self { 93 + LinkMode::MainDomain => format_smolstr!("/{}/{}/e/{}/edit", ident, book_title, rkey), 94 + LinkMode::Subdomain => format_smolstr!("/e/{}/edit", rkey), 95 + } 96 + } 97 + 98 + /// Generate link to a notebook index. 99 + pub fn notebook_link(&self, ident: &AtIdentifier<'_>, book_title: &str) -> SmolStr { 100 + match self { 101 + LinkMode::MainDomain => format_smolstr!("/{}/{}", ident, book_title), 102 + LinkMode::Subdomain => SmolStr::new_static("/"), 103 + } 104 + } 105 + 106 + /// Generate link to a profile/repository. 107 + pub fn profile_link(&self, ident: &AtIdentifier<'_>) -> SmolStr { 108 + match self { 109 + LinkMode::MainDomain => format_smolstr!("/{}", ident), 110 + LinkMode::Subdomain => format_smolstr!("/u/{}", ident), 111 + } 112 + } 113 + 114 + /// Generate link to a standalone entry. 115 + pub fn standalone_entry_link(&self, ident: &AtIdentifier<'_>, rkey: &str) -> SmolStr { 116 + match self { 117 + LinkMode::MainDomain => format_smolstr!("/{}/e/{}", ident, rkey), 118 + // Standalone entries don't exist in subdomain mode - link to main domain 119 + LinkMode::Subdomain => format_smolstr!("{}/{}/e/{}", WEAVER_APP_HOST, ident, rkey), 120 + } 121 + } 122 + 123 + /// Generate link to edit a standalone entry. 124 + pub fn standalone_entry_edit_link(&self, ident: &AtIdentifier<'_>, rkey: &str) -> SmolStr { 125 + match self { 126 + LinkMode::MainDomain => format_smolstr!("/{}/e/{}/edit", ident, rkey), 127 + // Edit on main domain 128 + LinkMode::Subdomain => format_smolstr!("{}/{}/e/{}/edit", WEAVER_APP_HOST, ident, rkey), 129 + } 130 + } 131 + 132 + /// Generate link to create a new draft. 133 + pub fn new_draft_link(&self, ident: &AtIdentifier<'_>, notebook: Option<&str>) -> SmolStr { 134 + match (self, notebook) { 135 + (LinkMode::MainDomain, Some(nb)) => format_smolstr!("/{}/new?notebook={}", ident, nb), 136 + (LinkMode::MainDomain, None) => format_smolstr!("/{}/new", ident), 137 + // Drafts are on main domain 138 + (LinkMode::Subdomain, Some(nb)) => { 139 + format_smolstr!("{}/{}/new?notebook={}", WEAVER_APP_HOST, ident, nb) 140 + } 141 + (LinkMode::Subdomain, None) => format_smolstr!("{}/{}/new", WEAVER_APP_HOST, ident), 142 + } 143 + } 144 + 145 + /// Generate link to drafts list. 146 + pub fn drafts_link(&self, ident: &AtIdentifier<'_>) -> SmolStr { 147 + match self { 148 + LinkMode::MainDomain => format_smolstr!("/{}/drafts", ident), 149 + LinkMode::Subdomain => format_smolstr!("{}/{}/drafts", WEAVER_APP_HOST, ident), 150 + } 151 + } 152 + 153 + /// Generate link to invites page. 154 + pub fn invites_link(&self, ident: &AtIdentifier<'_>) -> SmolStr { 155 + match self { 156 + LinkMode::MainDomain => format_smolstr!("/{}/invites", ident), 157 + LinkMode::Subdomain => format_smolstr!("{}/{}/invites", WEAVER_APP_HOST, ident), 158 + } 159 + } 160 + }
+91
crates/weaver-app/src/lib.rs
··· 22 22 pub mod data; 23 23 pub mod env; 24 24 pub mod fetch; 25 + pub mod host_mode; 25 26 #[cfg(feature = "server")] 26 27 pub mod og; 27 28 pub mod perf; 28 29 pub mod record_utils; 29 30 pub mod service_worker; 31 + 32 + pub mod subdomain_app; 30 33 pub mod views; 31 34 35 + pub use host_mode::{LinkMode, SubdomainContext}; 36 + pub use subdomain_app::SubdomainApp; 37 + pub use subdomain_app::SubdomainRoute; 38 + 32 39 use auth::{AuthState, AuthStore}; 33 40 use components::{EntryPage, Repository, RepositoryIndex}; 34 41 use config::{Config, OAuthConfig}; ··· 39 46 NotebookIndex, NotebookPage, PcktEntry, PcktEntryBlogNsid, PcktEntryNsid, PrivacyPage, 40 47 RecordIndex, RecordPage, StandaloneEntry, StandaloneEntryEdit, StandaloneEntryNsid, TermsPage, 41 48 WhiteWindEntry, WhiteWindEntryNsid, 49 + }; 50 + 51 + use crate::{ 52 + env::WEAVER_APP_DOMAIN, 53 + subdomain_app::{extract_subdomain, lookup_subdomain_context}, 42 54 }; 43 55 44 56 #[derive(Debug, Clone, Routable, PartialEq)] ··· 133 145 ClientData::new_public(CONFIG.oauth.clone()), 134 146 )) 135 147 }); 148 + 149 + #[cfg(feature = "fullstack-server")] 150 + let ctx_resource = use_server_future({ 151 + let fetcher = fetcher.clone(); 152 + move || { 153 + let fetcher = fetcher.clone(); 154 + async move { 155 + use dioxus::fullstack::FullstackContext; 156 + use http::header::HOST; 157 + 158 + // Get host header from request 159 + let Some(ctx) = FullstackContext::current() else { 160 + tracing::warn!("No FullstackContext available"); 161 + return None; 162 + }; 163 + let parts = ctx.parts_mut(); 164 + 165 + let Some(host_header) = parts.headers.get(HOST) else { 166 + tracing::warn!("No Host header in request"); 167 + return None; 168 + }; 169 + let Ok(host) = host_header.to_str() else { 170 + tracing::warn!("Host header not valid UTF-8"); 171 + return None; 172 + }; 173 + tracing::info!(host, "Subdomain detection: got host"); 174 + 175 + let host_str = host.split(':').next().unwrap_or(host); 176 + let Some(subdomain) = extract_subdomain(host_str, WEAVER_APP_DOMAIN) else { 177 + tracing::info!(host_str, domain = WEAVER_APP_DOMAIN, "Not a subdomain request"); 178 + return None; 179 + }; 180 + tracing::info!(subdomain, "Subdomain detection: extracted subdomain"); 181 + 182 + // Look up notebook by global path 183 + let result = lookup_subdomain_context(&fetcher, &subdomain).await; 184 + if result.is_none() { 185 + tracing::warn!(subdomain, "Notebook lookup failed for subdomain"); 186 + } 187 + result 188 + } 189 + } 190 + })?; 191 + 192 + #[cfg(feature = "fullstack-server")] 193 + let ctx = match &*ctx_resource.read() { 194 + Some(ctx) => ctx.clone(), 195 + None => return rsx! { div { "Loading..." } }, 196 + }; 197 + 198 + #[cfg(not(feature = "fullstack-server"))] 199 + let ctx = None::<SubdomainContext>; 200 + 136 201 let auth_state = use_signal(|| AuthState::default()); 137 202 #[allow(unused)] 138 203 let auth_state = use_context_provider(|| auth_state); 204 + 205 + // Provide link mode for router-agnostic link generation (subdomain mode) 206 + let sub = use_context_provider(|| { 207 + if ctx.is_some() { 208 + LinkMode::Subdomain 209 + } else { 210 + LinkMode::MainDomain 211 + } 212 + }); 213 + 139 214 #[cfg(all(target_family = "wasm", target_os = "unknown"))] 140 215 let restore_result = { 141 216 let fetcher = fetcher.clone(); ··· 152 227 use_effect(move || { 153 228 let fetcher = fetcher.clone(); 154 229 spawn(async move { 230 + use crate::service_worker; 231 + 155 232 tracing::info!("Registering service worker"); 156 233 let _ = service_worker::register_service_worker().await; 157 234 }); ··· 161 238 #[cfg(all(target_family = "wasm", target_os = "unknown"))] 162 239 use_context_provider(|| restore_result); 163 240 241 + if sub == LinkMode::Subdomain { 242 + use_context_provider(|| ctx.unwrap()); 243 + rsx! { 244 + SubdomainApp {} 245 + } 246 + } else { 247 + rsx! { 248 + MainDomainApp {} 249 + } 250 + } 251 + } 252 + 253 + #[component] 254 + pub fn MainDomainApp() -> Element { 164 255 rsx! { 165 256 document::Link { rel: "icon", href: FAVICON } 166 257 // Preconnect for external fonts (before loading them)
+81 -9
crates/weaver-app/src/main.rs
··· 1 1 //! Weaver App main binary. 2 2 3 3 use dioxus::prelude::*; 4 + 5 + #[cfg(feature = "server")] 4 6 use std::sync::Arc; 5 7 6 - use weaver_app::{App, CONFIG, components, fetch}; 8 + #[cfg(feature = "server")] 9 + use tower::Service; 10 + 11 + #[cfg(feature = "server")] 12 + use weaver_app::{App, CONFIG, SubdomainApp, SubdomainContext, fetch}; 13 + 14 + #[cfg(not(feature = "server"))] 15 + use weaver_app::{App, SubdomainApp}; 7 16 8 17 #[cfg(target_arch = "wasm32")] 9 18 use lol_alloc::{FreeListAllocator, LockedAllocator}; ··· 12 21 #[global_allocator] 13 22 static ALLOCATOR: LockedAllocator<FreeListAllocator> = 14 23 LockedAllocator::new(FreeListAllocator::new()); 24 + 25 + /// Base domain for subdomain extraction. 26 + #[cfg(feature = "server")] 27 + const BASE_DOMAIN: &str = weaver_app::env::WEAVER_APP_DOMAIN; 28 + 29 + /// Reserved subdomains that should not be used for notebooks. 30 + #[cfg(feature = "server")] 31 + const RESERVED_SUBDOMAINS: &[&str] = &[ 32 + "www", "api", "admin", "app", "auth", "cdn", "alpha", "beta", "staging", "index", 33 + ]; 15 34 16 35 fn main() { 17 36 // Set up better panic messages for wasm ··· 49 68 let reg = Registry::default() 50 69 .with(filter) 51 70 .with(wasm_layer) 52 - .with(components::editor::LogCaptureLayer); 71 + .with(weaver_app::components::editor::LogCaptureLayer); 53 72 54 73 let _ = set_global_default(reg); 55 74 } ··· 62 81 // Run `serve()` on the server only 63 82 #[cfg(feature = "server")] 64 83 dioxus::serve(|| async move { 65 - use axum::{ 66 - extract::{Extension, Request}, 67 - middleware, 68 - middleware::Next, 69 - routing::get, 70 - }; 84 + #[cfg(feature = "fullstack-server")] 85 + use axum::middleware; 86 + use axum::middleware::Next; 87 + use axum::{Router, body::Body, extract::Request, response::Response, routing::get}; 88 + use axum_extra::extract::Host; 71 89 use jacquard::oauth::{client::OAuthClient, session::ClientData}; 72 90 use std::convert::Infallible; 73 91 use weaver_app::auth::AuthStore; 74 92 use weaver_app::blobcache::BlobCache; 75 93 76 94 #[cfg(not(feature = "fullstack-server"))] 77 - let router = { axum::Router::new().merge(dioxus::server::router(App)) }; 95 + let router = { Router::new().merge(dioxus::server::router(App)) }; 78 96 79 97 #[cfg(feature = "fullstack-server")] 80 98 let router = { ··· 107 125 #[cfg(not(feature = "server"))] 108 126 dioxus::launch(App); 109 127 } 128 + 129 + /// Extract subdomain from host if it matches base domain pattern. 130 + #[cfg(feature = "server")] 131 + fn extract_subdomain<'a>(host: &'a str, base: &str) -> Option<&'a str> { 132 + let suffix = format!(".{}", base); 133 + if host.ends_with(&suffix) && host.len() > suffix.len() { 134 + Some(&host[..host.len() - suffix.len()]) 135 + } else { 136 + None 137 + } 138 + } 139 + 140 + /// Look up notebook by global path. 141 + /// 142 + /// Returns SubdomainContext if a notebook with publishGlobal=true exists for this path. 143 + #[cfg(feature = "server")] 144 + async fn lookup_global_notebook( 145 + fetcher: &Arc<fetch::Fetcher>, 146 + path: &str, 147 + ) -> Option<SubdomainContext> { 148 + use jacquard::IntoStatic; 149 + use jacquard::smol_str::SmolStr; 150 + use jacquard::smol_str::ToSmolStr; 151 + use jacquard::types::string::Did; 152 + use jacquard::xrpc::XrpcClient; 153 + use weaver_api::sh_weaver::notebook::resolve_global_notebook::ResolveGlobalNotebook; 154 + 155 + let request = ResolveGlobalNotebook::new().path(path).build(); 156 + 157 + match fetcher.send(request).await { 158 + Ok(response) => { 159 + let output = response.into_output().ok()?; 160 + let notebook = output.notebook; 161 + 162 + let owner = notebook.uri.authority().clone().into_static(); 163 + let rkey = notebook.uri.rkey()?.0.to_smolstr(); 164 + let notebook_path = notebook 165 + .path 166 + .map(|p| SmolStr::new(p.as_ref())) 167 + .unwrap_or_else(|| SmolStr::new(path)); 168 + 169 + Some(SubdomainContext { 170 + owner, 171 + notebook_path, 172 + notebook_rkey: rkey, 173 + notebook_title: notebook.title.clone().unwrap_or_default().to_smolstr(), 174 + }) 175 + } 176 + Err(e) => { 177 + tracing::debug!(path = path, error = %e, "Global notebook lookup failed"); 178 + None 179 + } 180 + } 181 + }
+6
crates/weaver-app/src/record_utils.rs
··· 82 82 StructuralError::UnresolvedRef { path, .. } => Some(path), 83 83 StructuralError::RefCycle { path, .. } => Some(path), 84 84 StructuralError::MaxDepthExceeded { path, .. } => Some(path), 85 + 86 + _ => None, 85 87 }, 86 88 ValidationError::Constraint(c) => match c { 87 89 ConstraintError::MaxLength { path, .. } => Some(path), ··· 90 92 ConstraintError::MinGraphemes { path, .. } => Some(path), 91 93 ConstraintError::Maximum { path, .. } => Some(path), 92 94 ConstraintError::Minimum { path, .. } => Some(path), 95 + 96 + _ => None, 93 97 }, 98 + 99 + _ => None, 94 100 }; 95 101 96 102 if let Some(path) = validation_path {
+199
crates/weaver-app/src/subdomain_app.rs
··· 1 + //! Subdomain Dioxus application. 2 + //! 3 + //! Separate router for subdomain hosting with simpler route structure. 4 + 5 + use dioxus::prelude::*; 6 + use jacquard::oauth::client::OAuthClient; 7 + use jacquard::oauth::session::ClientData; 8 + use jacquard::smol_str::{SmolStr, ToSmolStr}; 9 + use jacquard::types::string::AtIdentifier; 10 + 11 + use crate::auth; 12 + use crate::auth::{AuthState, AuthStore}; 13 + use crate::components::identity::RepositoryIndex; 14 + use crate::components::{EntryPage, NotebookCss}; 15 + use crate::host_mode::{LinkMode, SubdomainContext}; 16 + use crate::views::{NotebookEntryByRkey, NotebookEntryEdit, NotebookIndex, SubdomainNavbar}; 17 + use crate::{CONFIG, fetch}; 18 + 19 + /// Subdomain route enum - simpler paths without /:ident/:notebook prefix. 20 + #[derive(Debug, Clone, Routable, PartialEq)] 21 + #[rustfmt::skip] 22 + pub enum SubdomainRoute { 23 + #[layout(SubdomainNavbar)] 24 + /// Landing page - custom entry or notebook index. 25 + #[route("/")] 26 + SubdomainLanding {}, 27 + /// Explicit notebook index. 28 + #[route("/index")] 29 + SubdomainIndexPage {}, 30 + /// Entry by title. 31 + #[route("/:title")] 32 + SubdomainEntry { title: SmolStr }, 33 + /// Entry by rkey. 34 + #[route("/e/:rkey")] 35 + SubdomainEntryByRkey { rkey: SmolStr }, 36 + /// Entry edit by rkey. 37 + #[route("/e/:rkey/edit")] 38 + SubdomainEntryEdit { rkey: SmolStr }, 39 + /// Profile/repository view. 40 + #[route("/u/:ident")] 41 + SubdomainProfile { ident: AtIdentifier<'static> }, 42 + } 43 + 44 + /// Look up notebook by global path and build SubdomainContext. 45 + pub async fn lookup_subdomain_context( 46 + fetcher: &crate::fetch::Fetcher, 47 + path: &str, 48 + ) -> Option<SubdomainContext> { 49 + use jacquard::IntoStatic; 50 + use jacquard::smol_str::SmolStr; 51 + use jacquard::xrpc::XrpcClient; 52 + use weaver_api::sh_weaver::notebook::resolve_global_notebook::ResolveGlobalNotebook; 53 + 54 + let request = ResolveGlobalNotebook::new().path(path).build(); 55 + 56 + match fetcher.send(request).await { 57 + Ok(response) => { 58 + let output = response.into_output().ok()?; 59 + let notebook = output.notebook; 60 + 61 + let owner = notebook.uri.authority().clone().into_static(); 62 + let rkey = notebook.uri.rkey()?.0.to_smolstr(); 63 + let notebook_path = notebook 64 + .path 65 + .map(|p| SmolStr::new(p.as_ref())) 66 + .unwrap_or_else(|| SmolStr::new(path)); 67 + 68 + Some(SubdomainContext { 69 + owner, 70 + notebook_path, 71 + notebook_rkey: rkey, 72 + notebook_title: notebook.title.clone().unwrap_or_default().to_smolstr(), 73 + }) 74 + } 75 + Err(e) => { 76 + tracing::debug!(path = path, error = %e, "Global notebook lookup failed"); 77 + None 78 + } 79 + } 80 + } 81 + 82 + /// Extract subdomain from host if it matches base domain pattern. 83 + pub fn extract_subdomain(host: &str, base: &str) -> Option<String> { 84 + let suffix = format!(".{}", base); 85 + if host.ends_with(&suffix) && host.len() > suffix.len() { 86 + Some(host[..host.len() - suffix.len()].to_string()) 87 + } else { 88 + None 89 + } 90 + } 91 + 92 + const ENTRY_CSS: Asset = asset!("/assets/styling/entry.css"); 93 + const LAYOUTS_CSS: Asset = asset!("/assets/styling/layouts.css"); 94 + 95 + /// Root component for subdomain app. 96 + #[component] 97 + pub fn SubdomainApp() -> Element { 98 + rsx! { 99 + document::Link { rel: "icon", href: crate::FAVICON } 100 + document::Link { rel: "preconnect", href: "https://fonts.googleapis.com" } 101 + document::Link { rel: "preconnect", href: "https://fonts.gstatic.com" } 102 + document::Link { rel: "stylesheet", href: crate::THEME_DEFAULTS_CSS } 103 + document::Link { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&family=IBM+Plex+Serif:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700&display=swap" } 104 + document::Link { rel: "stylesheet", href: crate::MAIN_CSS } 105 + document::Link { rel: "stylesheet", href: LAYOUTS_CSS } 106 + document::Link { rel: "stylesheet", href: ENTRY_CSS } 107 + crate::components::toast::ToastProvider { 108 + Router::<SubdomainRoute> {} 109 + } 110 + } 111 + } 112 + 113 + /// Landing page - check for custom "/" entry, else show notebook index. 114 + #[component] 115 + fn SubdomainLanding() -> Element { 116 + let ctx = use_context::<SubdomainContext>(); 117 + 118 + // TODO: Check for entry with custom path "/" for this notebook. 119 + // For now, just render the notebook index. 120 + rsx! { 121 + 122 + NotebookCss { ident: ctx.owner_ident().to_smolstr(), notebook: ctx.notebook_path.clone() } 123 + NotebookIndex { 124 + ident: ctx.owner_ident(), 125 + book_title: ctx.notebook_title.clone(), 126 + } 127 + } 128 + } 129 + 130 + /// Explicit notebook index route. 131 + #[component] 132 + fn SubdomainIndexPage() -> Element { 133 + let ctx = use_context::<SubdomainContext>(); 134 + 135 + rsx! { 136 + 137 + NotebookCss { ident: ctx.owner_ident().to_smolstr(), notebook: ctx.notebook_path.clone() } 138 + NotebookIndex { 139 + ident: ctx.owner_ident(), 140 + book_title: ctx.notebook_title.clone(), 141 + } 142 + } 143 + } 144 + 145 + /// Entry by title. 146 + #[component] 147 + fn SubdomainEntry(title: SmolStr) -> Element { 148 + let ctx = use_context::<SubdomainContext>(); 149 + 150 + rsx! { 151 + 152 + NotebookCss { ident: ctx.owner_ident().to_smolstr(), notebook: ctx.notebook_path.clone() } 153 + EntryPage { 154 + ident: ctx.owner_ident(), 155 + book_title: ctx.notebook_title.clone(), 156 + title: title, 157 + } 158 + } 159 + } 160 + 161 + /// Entry by rkey. 162 + #[component] 163 + fn SubdomainEntryByRkey(rkey: SmolStr) -> Element { 164 + let ctx = use_context::<SubdomainContext>(); 165 + 166 + rsx! { 167 + 168 + NotebookCss { ident: ctx.owner_ident().to_smolstr(), notebook: ctx.notebook_path.clone() } 169 + NotebookEntryByRkey { 170 + ident: ctx.owner_ident(), 171 + book_title: ctx.notebook_title.clone(), 172 + rkey: rkey, 173 + } 174 + } 175 + } 176 + 177 + /// Entry edit by rkey. 178 + #[component] 179 + fn SubdomainEntryEdit(rkey: SmolStr) -> Element { 180 + let ctx = use_context::<SubdomainContext>(); 181 + 182 + rsx! { 183 + 184 + NotebookCss { ident: ctx.owner_ident().to_smolstr(), notebook: ctx.notebook_path.clone() } 185 + NotebookEntryEdit { 186 + ident: ctx.owner_ident(), 187 + book_title: ctx.notebook_title.clone(), 188 + rkey: rkey, 189 + } 190 + } 191 + } 192 + 193 + /// Profile/repository view for an identity. 194 + #[component] 195 + fn SubdomainProfile(ident: AtIdentifier<'static>) -> Element { 196 + rsx! { 197 + RepositoryIndex { ident } 198 + } 199 + }
+3
crates/weaver-app/src/views/mod.rs
··· 49 49 LeafletEntry, LeafletEntryNsid, PcktEntry, PcktEntryBlogNsid, PcktEntryNsid, WhiteWindEntry, 50 50 WhiteWindEntryNsid, 51 51 }; 52 + 53 + mod subdomain_navbar; 54 + pub use subdomain_navbar::{SubdomainErrorLayout, SubdomainNavbar};
+3
crates/weaver-app/src/views/navbar.rs
··· 22 22 /// routes will be rendered under the outlet inside this component 23 23 #[component] 24 24 pub fn Navbar() -> Element { 25 + // Provide navigator for programmatic navigation in shared components 26 + crate::components::use_main_navigator_provider(); 27 + 25 28 let route = use_route::<Route>(); 26 29 tracing::trace!("Route: {:?}", route); 27 30
+1 -1
crates/weaver-app/src/views/record.rs
··· 24 24 let input_uri = uri_input.read().clone(); 25 25 if !input_uri.is_empty() { 26 26 if let Ok(parsed) = AtUri::new(&input_uri) { 27 - let link = format!("{}/record/{}", crate::env::WEAVER_APP_DOMAIN, parsed); 27 + let link = format!("{}/record/{}", crate::env::WEAVER_APP_HOST, parsed); 28 28 navigator.push(link); 29 29 } 30 30 }
+201
crates/weaver-app/src/views/subdomain_navbar.rs
··· 1 + //! Subdomain navbar component with auth support. 2 + 3 + use dioxus::prelude::*; 4 + use jacquard::types::string::{AtIdentifier, Did}; 5 + 6 + use crate::SubdomainRoute; 7 + use crate::auth::{AuthState, RestoreResult}; 8 + use crate::components::button::{Button, ButtonVariant}; 9 + use crate::components::login::LoginModal; 10 + use crate::data::{use_get_handle, use_handle}; 11 + use crate::fetch::Fetcher; 12 + use crate::host_mode::SubdomainContext; 13 + use crate::views::Footer; 14 + 15 + #[cfg(feature = "fullstack-server")] 16 + use {dioxus::fullstack::FullstackContext, http::StatusCode}; 17 + 18 + const NAVBAR_CSS: Asset = asset!("/assets/styling/navbar.css"); 19 + const BUTTON_CSS: Asset = asset!("/assets/styling/button.css"); 20 + const CARDS_BASE_CSS: Asset = asset!("/assets/styling/cards-base.css"); 21 + const ENTRY_CARD_CSS: Asset = asset!("/assets/styling/entry-card.css"); 22 + const NOTEBOOK_CARD_CSS: Asset = asset!("/assets/styling/notebook-card.css"); 23 + 24 + #[component] 25 + pub fn SubdomainNavbar() -> Element { 26 + let ctx = use_context::<SubdomainContext>(); 27 + let route = use_route::<SubdomainRoute>(); 28 + let auth_state = use_context::<Signal<AuthState>>(); 29 + let fetcher = use_context::<Fetcher>(); 30 + let mut show_login_modal = use_signal(|| false); 31 + 32 + // Show toast if session expired 33 + #[cfg(all(target_family = "wasm", target_os = "unknown"))] 34 + { 35 + use dioxus_primitives::toast::{ToastOptions, use_toast}; 36 + 37 + let restore_result = use_context::<Resource<RestoreResult>>(); 38 + let toast = use_toast(); 39 + let mut shown = use_signal(|| false); 40 + 41 + if !shown() && restore_result() == Some(RestoreResult::SessionExpired) { 42 + shown.set(true); 43 + toast.warning( 44 + "Session Expired".to_string(), 45 + ToastOptions::new().description("Please sign in again"), 46 + ); 47 + } 48 + } 49 + 50 + // Provide navigator for programmatic navigation in shared components 51 + crate::components::use_subdomain_navigator_provider(); 52 + 53 + rsx! { 54 + document::Link { rel: "stylesheet", href: NAVBAR_CSS } 55 + document::Link { rel: "stylesheet", href: BUTTON_CSS } 56 + document::Link { rel: "stylesheet", href: CARDS_BASE_CSS } 57 + document::Link { rel: "stylesheet", href: ENTRY_CARD_CSS } 58 + document::Link { rel: "stylesheet", href: NOTEBOOK_CARD_CSS } 59 + 60 + div { class: "app-shell", 61 + div { 62 + id: "navbar", 63 + nav { class: "breadcrumbs", 64 + // Notebook title links to index 65 + Link { 66 + to: SubdomainRoute::SubdomainLanding {}, 67 + class: "breadcrumb", 68 + "{ctx.notebook_title}" 69 + } 70 + 71 + // Show current location breadcrumb based on route 72 + match &route { 73 + SubdomainRoute::SubdomainLanding {} | SubdomainRoute::SubdomainIndexPage {} => { 74 + rsx! {} 75 + } 76 + SubdomainRoute::SubdomainEntry { title } => { 77 + rsx! { 78 + span { class: "breadcrumb-separator", " > " } 79 + span { class: "breadcrumb breadcrumb-current", "{title}" } 80 + } 81 + } 82 + SubdomainRoute::SubdomainEntryByRkey { rkey } => { 83 + rsx! { 84 + span { class: "breadcrumb-separator", " > " } 85 + span { class: "breadcrumb breadcrumb-current", "{rkey}" } 86 + } 87 + } 88 + SubdomainRoute::SubdomainEntryEdit { rkey } => { 89 + rsx! { 90 + span { class: "breadcrumb-separator", " > " } 91 + Link { 92 + to: SubdomainRoute::SubdomainEntryByRkey { rkey: rkey.clone() }, 93 + class: "breadcrumb", 94 + "{rkey}" 95 + } 96 + span { class: "breadcrumb-separator", " > " } 97 + span { class: "breadcrumb breadcrumb-current", "Edit" } 98 + } 99 + } 100 + SubdomainRoute::SubdomainProfile { ident } => { 101 + rsx! { 102 + span { class: "breadcrumb-separator", " > " } 103 + span { class: "breadcrumb breadcrumb-current", "@{ident}" } 104 + } 105 + } 106 + } 107 + } 108 + 109 + // Author profile link 110 + nav { class: "nav-tools", 111 + AuthorProfileLink { ident: ctx.owner.clone() } 112 + } 113 + 114 + // Auth button 115 + if auth_state.read().is_authenticated() { 116 + if let Some(did) = &auth_state.read().did { 117 + SubdomainAuthButton { did: did.clone() } 118 + } 119 + } else { 120 + div { 121 + class: "auth-button", 122 + Button { 123 + variant: ButtonVariant::Ghost, 124 + onclick: move |_| show_login_modal.set(true), 125 + span { class: "auth-handle", "Sign In" } 126 + } 127 + } 128 + LoginModal { 129 + open: show_login_modal 130 + } 131 + } 132 + } 133 + 134 + main { class: "app-main", 135 + Outlet::<SubdomainRoute> {} 136 + } 137 + 138 + Footer {} 139 + } 140 + } 141 + } 142 + 143 + #[component] 144 + pub fn SubdomainErrorLayout() -> Element { 145 + rsx! { 146 + ErrorBoundary { 147 + handle_error: move |_err: ErrorContext| { 148 + #[cfg(feature = "fullstack-server")] 149 + { 150 + let http_error = FullstackContext::commit_error_status(_err.error().unwrap()); 151 + match http_error.status { 152 + StatusCode::NOT_FOUND => rsx! { div { "404 - Page not found" } }, 153 + _ => rsx! { div { "An unknown error occurred" } }, 154 + } 155 + } 156 + #[cfg(not(feature = "fullstack-server"))] 157 + { 158 + rsx! { div { "An error occurred" } } 159 + } 160 + }, 161 + Outlet::<SubdomainRoute> {} 162 + } 163 + } 164 + } 165 + 166 + #[component] 167 + fn SubdomainAuthButton(did: Did<'static>) -> Element { 168 + let auth_handle = use_get_handle(did); 169 + let fetcher = use_context::<Fetcher>(); 170 + let mut auth_state = use_context::<Signal<AuthState>>(); 171 + 172 + rsx! { 173 + Button { 174 + variant: ButtonVariant::Ghost, 175 + onclick: move |_| { 176 + let fetcher = fetcher.clone(); 177 + auth_state.write().clear(); 178 + async move { 179 + fetcher.downgrade_to_unauthenticated().await; 180 + } 181 + }, 182 + span { class: "auth-handle", "@{auth_handle()}" } 183 + } 184 + } 185 + } 186 + 187 + #[component] 188 + fn AuthorProfileLink(ident: ReadSignal<AtIdentifier<'static>>) -> Element { 189 + let (handle_res, handle) = use_handle(ident); 190 + 191 + #[cfg(feature = "fullstack-server")] 192 + let mut handle_res = handle_res?; 193 + 194 + rsx! { 195 + Link { 196 + to: SubdomainRoute::SubdomainProfile { ident: ident() }, 197 + class: "nav-tool-link", 198 + "@{handle()}" 199 + } 200 + } 201 + }
+329
crates/weaver-index/package-lock.json
··· 1 + { 2 + "name": "weaver-index", 3 + "lockfileVersion": 3, 4 + "requires": true, 5 + "packages": { 6 + "": { 7 + "dependencies": { 8 + "@anthropic-ai/claude-agent-sdk": "^0.2.3" 9 + } 10 + }, 11 + "node_modules/@anthropic-ai/claude-agent-sdk": { 12 + "version": "0.2.3", 13 + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.2.3.tgz", 14 + "integrity": "sha512-6h54MzD4R5S15esMiK7sPKwotwoYd3qxXdqzRWqSkYo96IwvtSoK5yb0jbWEdDKSW71jjEctFJZBkonGalmTAQ==", 15 + "license": "SEE LICENSE IN README.md", 16 + "engines": { 17 + "node": ">=18.0.0" 18 + }, 19 + "optionalDependencies": { 20 + "@img/sharp-darwin-arm64": "^0.33.5", 21 + "@img/sharp-darwin-x64": "^0.33.5", 22 + "@img/sharp-linux-arm": "^0.33.5", 23 + "@img/sharp-linux-arm64": "^0.33.5", 24 + "@img/sharp-linux-x64": "^0.33.5", 25 + "@img/sharp-linuxmusl-arm64": "^0.33.5", 26 + "@img/sharp-linuxmusl-x64": "^0.33.5", 27 + "@img/sharp-win32-x64": "^0.33.5" 28 + }, 29 + "peerDependencies": { 30 + "zod": "^4.0.0" 31 + } 32 + }, 33 + "node_modules/@img/sharp-darwin-arm64": { 34 + "version": "0.33.5", 35 + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", 36 + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", 37 + "cpu": [ 38 + "arm64" 39 + ], 40 + "license": "Apache-2.0", 41 + "optional": true, 42 + "os": [ 43 + "darwin" 44 + ], 45 + "engines": { 46 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 47 + }, 48 + "funding": { 49 + "url": "https://opencollective.com/libvips" 50 + }, 51 + "optionalDependencies": { 52 + "@img/sharp-libvips-darwin-arm64": "1.0.4" 53 + } 54 + }, 55 + "node_modules/@img/sharp-darwin-x64": { 56 + "version": "0.33.5", 57 + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", 58 + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", 59 + "cpu": [ 60 + "x64" 61 + ], 62 + "license": "Apache-2.0", 63 + "optional": true, 64 + "os": [ 65 + "darwin" 66 + ], 67 + "engines": { 68 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 69 + }, 70 + "funding": { 71 + "url": "https://opencollective.com/libvips" 72 + }, 73 + "optionalDependencies": { 74 + "@img/sharp-libvips-darwin-x64": "1.0.4" 75 + } 76 + }, 77 + "node_modules/@img/sharp-libvips-darwin-arm64": { 78 + "version": "1.0.4", 79 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", 80 + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", 81 + "cpu": [ 82 + "arm64" 83 + ], 84 + "license": "LGPL-3.0-or-later", 85 + "optional": true, 86 + "os": [ 87 + "darwin" 88 + ], 89 + "funding": { 90 + "url": "https://opencollective.com/libvips" 91 + } 92 + }, 93 + "node_modules/@img/sharp-libvips-darwin-x64": { 94 + "version": "1.0.4", 95 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", 96 + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", 97 + "cpu": [ 98 + "x64" 99 + ], 100 + "license": "LGPL-3.0-or-later", 101 + "optional": true, 102 + "os": [ 103 + "darwin" 104 + ], 105 + "funding": { 106 + "url": "https://opencollective.com/libvips" 107 + } 108 + }, 109 + "node_modules/@img/sharp-libvips-linux-arm": { 110 + "version": "1.0.5", 111 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", 112 + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", 113 + "cpu": [ 114 + "arm" 115 + ], 116 + "license": "LGPL-3.0-or-later", 117 + "optional": true, 118 + "os": [ 119 + "linux" 120 + ], 121 + "funding": { 122 + "url": "https://opencollective.com/libvips" 123 + } 124 + }, 125 + "node_modules/@img/sharp-libvips-linux-arm64": { 126 + "version": "1.0.4", 127 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", 128 + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", 129 + "cpu": [ 130 + "arm64" 131 + ], 132 + "license": "LGPL-3.0-or-later", 133 + "optional": true, 134 + "os": [ 135 + "linux" 136 + ], 137 + "funding": { 138 + "url": "https://opencollective.com/libvips" 139 + } 140 + }, 141 + "node_modules/@img/sharp-libvips-linux-x64": { 142 + "version": "1.0.4", 143 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", 144 + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", 145 + "cpu": [ 146 + "x64" 147 + ], 148 + "license": "LGPL-3.0-or-later", 149 + "optional": true, 150 + "os": [ 151 + "linux" 152 + ], 153 + "funding": { 154 + "url": "https://opencollective.com/libvips" 155 + } 156 + }, 157 + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { 158 + "version": "1.0.4", 159 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", 160 + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", 161 + "cpu": [ 162 + "arm64" 163 + ], 164 + "license": "LGPL-3.0-or-later", 165 + "optional": true, 166 + "os": [ 167 + "linux" 168 + ], 169 + "funding": { 170 + "url": "https://opencollective.com/libvips" 171 + } 172 + }, 173 + "node_modules/@img/sharp-libvips-linuxmusl-x64": { 174 + "version": "1.0.4", 175 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", 176 + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", 177 + "cpu": [ 178 + "x64" 179 + ], 180 + "license": "LGPL-3.0-or-later", 181 + "optional": true, 182 + "os": [ 183 + "linux" 184 + ], 185 + "funding": { 186 + "url": "https://opencollective.com/libvips" 187 + } 188 + }, 189 + "node_modules/@img/sharp-linux-arm": { 190 + "version": "0.33.5", 191 + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", 192 + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", 193 + "cpu": [ 194 + "arm" 195 + ], 196 + "license": "Apache-2.0", 197 + "optional": true, 198 + "os": [ 199 + "linux" 200 + ], 201 + "engines": { 202 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 203 + }, 204 + "funding": { 205 + "url": "https://opencollective.com/libvips" 206 + }, 207 + "optionalDependencies": { 208 + "@img/sharp-libvips-linux-arm": "1.0.5" 209 + } 210 + }, 211 + "node_modules/@img/sharp-linux-arm64": { 212 + "version": "0.33.5", 213 + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", 214 + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", 215 + "cpu": [ 216 + "arm64" 217 + ], 218 + "license": "Apache-2.0", 219 + "optional": true, 220 + "os": [ 221 + "linux" 222 + ], 223 + "engines": { 224 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 225 + }, 226 + "funding": { 227 + "url": "https://opencollective.com/libvips" 228 + }, 229 + "optionalDependencies": { 230 + "@img/sharp-libvips-linux-arm64": "1.0.4" 231 + } 232 + }, 233 + "node_modules/@img/sharp-linux-x64": { 234 + "version": "0.33.5", 235 + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", 236 + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", 237 + "cpu": [ 238 + "x64" 239 + ], 240 + "license": "Apache-2.0", 241 + "optional": true, 242 + "os": [ 243 + "linux" 244 + ], 245 + "engines": { 246 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 247 + }, 248 + "funding": { 249 + "url": "https://opencollective.com/libvips" 250 + }, 251 + "optionalDependencies": { 252 + "@img/sharp-libvips-linux-x64": "1.0.4" 253 + } 254 + }, 255 + "node_modules/@img/sharp-linuxmusl-arm64": { 256 + "version": "0.33.5", 257 + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", 258 + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", 259 + "cpu": [ 260 + "arm64" 261 + ], 262 + "license": "Apache-2.0", 263 + "optional": true, 264 + "os": [ 265 + "linux" 266 + ], 267 + "engines": { 268 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 269 + }, 270 + "funding": { 271 + "url": "https://opencollective.com/libvips" 272 + }, 273 + "optionalDependencies": { 274 + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" 275 + } 276 + }, 277 + "node_modules/@img/sharp-linuxmusl-x64": { 278 + "version": "0.33.5", 279 + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", 280 + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", 281 + "cpu": [ 282 + "x64" 283 + ], 284 + "license": "Apache-2.0", 285 + "optional": true, 286 + "os": [ 287 + "linux" 288 + ], 289 + "engines": { 290 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 291 + }, 292 + "funding": { 293 + "url": "https://opencollective.com/libvips" 294 + }, 295 + "optionalDependencies": { 296 + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" 297 + } 298 + }, 299 + "node_modules/@img/sharp-win32-x64": { 300 + "version": "0.33.5", 301 + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", 302 + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", 303 + "cpu": [ 304 + "x64" 305 + ], 306 + "license": "Apache-2.0 AND LGPL-3.0-or-later", 307 + "optional": true, 308 + "os": [ 309 + "win32" 310 + ], 311 + "engines": { 312 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 313 + }, 314 + "funding": { 315 + "url": "https://opencollective.com/libvips" 316 + } 317 + }, 318 + "node_modules/zod": { 319 + "version": "4.3.5", 320 + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.5.tgz", 321 + "integrity": "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==", 322 + "license": "MIT", 323 + "peer": true, 324 + "funding": { 325 + "url": "https://github.com/sponsors/colinhacks" 326 + } 327 + } 328 + } 329 + }
+5
crates/weaver-index/package.json
··· 1 + { 2 + "dependencies": { 3 + "@anthropic-ai/claude-agent-sdk": "^0.2.3" 4 + } 5 + }
+43
crates/weaver-index/src/clickhouse/queries/notebooks.rs
··· 774 774 Ok(current.map(|c| (c, prev, next))) 775 775 } 776 776 } 777 + 778 + /// Resolve a notebook by global path (for publishGlobal notebooks). 779 + /// 780 + /// Returns the winning notebook when multiple claim the same path. 781 + /// Winner is determined by: created_at ASC, then TID rkey ASC. 782 + pub async fn resolve_notebook_by_global_path( 783 + &self, 784 + path: &str, 785 + ) -> Result<Option<NotebookRow>, IndexError> { 786 + let query = r#" 787 + SELECT 788 + did, 789 + rkey, 790 + cid, 791 + uri, 792 + title, 793 + path, 794 + tags, 795 + author_dids, 796 + created_at, 797 + indexed_at, 798 + record 799 + FROM notebooks FINAL 800 + WHERE path = ? 801 + AND deleted_at = toDateTime64(0, 3) 802 + AND publish_global = 1 803 + ORDER BY created_at ASC, rkey ASC 804 + LIMIT 1 805 + "#; 806 + 807 + let row = self 808 + .inner() 809 + .query(query) 810 + .bind(path) 811 + .fetch_optional::<NotebookRow>() 812 + .await 813 + .map_err(|e| ClickHouseError::Query { 814 + message: "failed to resolve notebook by global path".into(), 815 + source: e, 816 + })?; 817 + 818 + Ok(row) 819 + } 777 820 }
+84
crates/weaver-index/src/endpoints/notebook.rs
··· 21 21 get_notebook::{GetNotebookOutput, GetNotebookRequest}, 22 22 get_notebook_feed::{GetNotebookFeedOutput, GetNotebookFeedRequest}, 23 23 resolve_entry::{ResolveEntryOutput, ResolveEntryRequest}, 24 + resolve_global_notebook::{ResolveGlobalNotebookOutput, ResolveGlobalNotebookRequest}, 24 25 resolve_notebook::{ResolveNotebookOutput, ResolveNotebookRequest}, 25 26 }; 26 27 ··· 1150 1151 .into_static(), 1151 1152 )) 1152 1153 } 1154 + 1155 + /// Handle sh.weaver.notebook.resolveGlobalNotebook 1156 + /// 1157 + /// Resolves a notebook by global path for subdomain routing. 1158 + pub async fn resolve_global_notebook( 1159 + State(state): State<AppState>, 1160 + ExtractXrpc(args): ExtractXrpc<ResolveGlobalNotebookRequest>, 1161 + ) -> Result<Json<ResolveGlobalNotebookOutput<'static>>, XrpcErrorResponse> { 1162 + let path = args.path.as_ref(); 1163 + 1164 + let notebook_row = state 1165 + .clickhouse 1166 + .resolve_notebook_by_global_path(path) 1167 + .await 1168 + .map_err(|e| { 1169 + tracing::error!("Failed to resolve global notebook: {}", e); 1170 + XrpcErrorResponse::internal_error("Database query failed") 1171 + })? 1172 + .ok_or_else(|| XrpcErrorResponse::not_found("Notebook not found"))?; 1173 + 1174 + // Fetch contributors for author hydration 1175 + let notebook_contributors = state 1176 + .clickhouse 1177 + .get_notebook_contributors(&notebook_row.did, &notebook_row.rkey) 1178 + .await 1179 + .map_err(|e| { 1180 + tracing::error!("Failed to get notebook contributors: {}", e); 1181 + XrpcErrorResponse::internal_error("Database query failed") 1182 + })?; 1183 + 1184 + // Collect author DIDs 1185 + let mut all_author_dids: HashSet<&str> = 1186 + notebook_contributors.iter().map(|s| s.as_str()).collect(); 1187 + for did in &notebook_row.author_dids { 1188 + all_author_dids.insert(did.as_str()); 1189 + } 1190 + 1191 + // Batch fetch profiles 1192 + let author_dids_vec: Vec<&str> = all_author_dids.into_iter().collect(); 1193 + let profiles = state 1194 + .clickhouse 1195 + .get_profiles_batch(&author_dids_vec) 1196 + .await 1197 + .map_err(|e| { 1198 + tracing::error!("Failed to batch fetch profiles: {}", e); 1199 + XrpcErrorResponse::internal_error("Database query failed") 1200 + })?; 1201 + 1202 + let profile_map: HashMap<&str, &ProfileRow> = 1203 + profiles.iter().map(|p| (p.did.as_str(), p)).collect(); 1204 + 1205 + // Build NotebookView 1206 + let notebook_uri = AtUri::new(&notebook_row.uri).map_err(|e| { 1207 + tracing::error!("Invalid notebook URI in db: {}", e); 1208 + XrpcErrorResponse::internal_error("Invalid URI stored") 1209 + })?; 1210 + 1211 + let notebook_cid = Cid::new(notebook_row.cid.as_bytes()).map_err(|e| { 1212 + tracing::error!("Invalid notebook CID in db: {}", e); 1213 + XrpcErrorResponse::internal_error("Invalid CID stored") 1214 + })?; 1215 + 1216 + let authors = hydrate_authors(&notebook_contributors, &profile_map)?; 1217 + let record = parse_record_json(&notebook_row.record)?; 1218 + 1219 + let notebook = NotebookView::new() 1220 + .uri(notebook_uri.into_static()) 1221 + .cid(notebook_cid.into_static()) 1222 + .authors(authors) 1223 + .record(record) 1224 + .indexed_at(notebook_row.indexed_at.fixed_offset()) 1225 + .maybe_title(non_empty_cowstr(&notebook_row.title)) 1226 + .maybe_path(non_empty_cowstr(&notebook_row.path)) 1227 + .build(); 1228 + 1229 + Ok(Json( 1230 + ResolveGlobalNotebookOutput { 1231 + notebook, 1232 + extra_data: None, 1233 + } 1234 + .into_static(), 1235 + )) 1236 + }
+5 -1
crates/weaver-index/src/server.rs
··· 39 39 get_book_entry::GetBookEntryRequest, get_entry::GetEntryRequest, 40 40 get_entry_feed::GetEntryFeedRequest, get_entry_notebooks::GetEntryNotebooksRequest, 41 41 get_notebook::GetNotebookRequest, get_notebook_feed::GetNotebookFeedRequest, 42 - resolve_entry::ResolveEntryRequest, resolve_notebook::ResolveNotebookRequest, 42 + resolve_entry::ResolveEntryRequest, 43 + resolve_global_notebook::ResolveGlobalNotebookRequest, resolve_notebook::ResolveNotebookRequest, 43 44 }; 44 45 45 46 use crate::clickhouse::Client; ··· 135 136 .merge(GetBookEntryRequest::into_router(notebook::get_book_entry)) 136 137 .merge(GetEntryNotebooksRequest::into_router( 137 138 notebook::get_entry_notebooks, 139 + )) 140 + .merge(ResolveGlobalNotebookRequest::into_router( 141 + notebook::resolve_global_notebook, 138 142 )) 139 143 // sh.weaver.collab.* endpoints 140 144 .merge(GetResourceParticipantsRequest::into_router(