atproto blogging

custom domain routing

Orual 4453cdd3 85733a97

+10420 -5578
+1 -1
crates/weaver-api/Cargo.toml
··· 37 37 com_deckbelcher = ["com_atproto"] 38 38 com_whtwnd = [] 39 39 pub_leaflet = ["com_atproto"] 40 - sh_weaver = ["app_bsky", "com_atproto"] 40 + sh_weaver = ["app_bsky", "com_atproto", "site_standard"] 41 41 site_standard = ["com_atproto"] 42 42 tools_ozone = ["app_bsky", "chat_bsky", "com_atproto"]
+23
crates/weaver-api/lexicons/blog_pckt_content.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "blog.pckt.content", 4 + "defs": { 5 + "main": { 6 + "type": "object", 7 + "required": [ 8 + "items" 9 + ], 10 + "properties": { 11 + "items": { 12 + "type": "array", 13 + "description": "Array of content blocks", 14 + "items": { 15 + "type": "union", 16 + "refs": [], 17 + "closed": false 18 + } 19 + } 20 + } 21 + } 22 + } 23 + }
+105
crates/weaver-api/lexicons/sh_weaver_domain_defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.weaver.domain.defs", 4 + "defs": { 5 + "documentView": { 6 + "type": "object", 7 + "description": "Hydrated view of a document with re-hydrated content.", 8 + "required": [ 9 + "uri", 10 + "cid", 11 + "did", 12 + "rkey", 13 + "title", 14 + "path", 15 + "record", 16 + "indexedAt" 17 + ], 18 + "properties": { 19 + "cid": { 20 + "type": "string", 21 + "format": "cid" 22 + }, 23 + "did": { 24 + "type": "string", 25 + "format": "did" 26 + }, 27 + "entryIndex": { 28 + "type": "integer" 29 + }, 30 + "entryUri": { 31 + "type": "string", 32 + "format": "at-uri" 33 + }, 34 + "indexedAt": { 35 + "type": "string", 36 + "format": "datetime" 37 + }, 38 + "path": { 39 + "type": "string" 40 + }, 41 + "record": { 42 + "type": "unknown" 43 + }, 44 + "rkey": { 45 + "type": "string" 46 + }, 47 + "title": { 48 + "type": "string" 49 + }, 50 + "uri": { 51 + "type": "string", 52 + "format": "at-uri" 53 + } 54 + } 55 + }, 56 + "publicationView": { 57 + "type": "object", 58 + "description": "Hydrated view of a publication with domain info.", 59 + "required": [ 60 + "uri", 61 + "cid", 62 + "did", 63 + "rkey", 64 + "name", 65 + "domain", 66 + "record", 67 + "indexedAt" 68 + ], 69 + "properties": { 70 + "cid": { 71 + "type": "string", 72 + "format": "cid" 73 + }, 74 + "did": { 75 + "type": "string", 76 + "format": "did" 77 + }, 78 + "domain": { 79 + "type": "string" 80 + }, 81 + "indexedAt": { 82 + "type": "string", 83 + "format": "datetime" 84 + }, 85 + "name": { 86 + "type": "string" 87 + }, 88 + "notebookUri": { 89 + "type": "string", 90 + "format": "at-uri" 91 + }, 92 + "record": { 93 + "type": "unknown" 94 + }, 95 + "rkey": { 96 + "type": "string" 97 + }, 98 + "uri": { 99 + "type": "string", 100 + "format": "at-uri" 101 + } 102 + } 103 + } 104 + } 105 + }
+60
crates/weaver-api/lexicons/sh_weaver_domain_generateDocument.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.weaver.domain.generateDocument", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Generate a site.standard.document record from a weaver entry. Returns a ready-to-write record with fully hydrated BookEntryView in content.", 8 + "parameters": { 9 + "type": "params", 10 + "required": [ 11 + "entry", 12 + "publication", 13 + "path" 14 + ], 15 + "properties": { 16 + "entry": { 17 + "type": "string", 18 + "description": "AT-URI of the sh.weaver.notebook.entry to convert.", 19 + "format": "at-uri" 20 + }, 21 + "path": { 22 + "type": "string", 23 + "description": "URL path for the document." 24 + }, 25 + "publication": { 26 + "type": "string", 27 + "description": "AT-URI of the site.standard.publication this document belongs to.", 28 + "format": "at-uri" 29 + } 30 + } 31 + }, 32 + "output": { 33 + "encoding": "application/json", 34 + "schema": { 35 + "type": "object", 36 + "required": [ 37 + "record" 38 + ], 39 + "properties": { 40 + "record": { 41 + "type": "ref", 42 + "ref": "site.standard.document" 43 + } 44 + } 45 + } 46 + }, 47 + "errors": [ 48 + { 49 + "name": "PublicationNotFound" 50 + }, 51 + { 52 + "name": "EntryNotFound" 53 + }, 54 + { 55 + "name": "NotebookNotLinked" 56 + } 57 + ] 58 + } 59 + } 60 + }
+42
crates/weaver-api/lexicons/sh_weaver_domain_resolveByDomain.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.weaver.domain.resolveByDomain", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Resolve a publication by its custom domain.", 8 + "parameters": { 9 + "type": "params", 10 + "required": [ 11 + "domain" 12 + ], 13 + "properties": { 14 + "domain": { 15 + "type": "string", 16 + "description": "The custom domain to resolve (e.g., myblog.com)." 17 + } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": [ 25 + "publication" 26 + ], 27 + "properties": { 28 + "publication": { 29 + "type": "ref", 30 + "ref": "sh.weaver.domain.defs#publicationView" 31 + } 32 + } 33 + } 34 + }, 35 + "errors": [ 36 + { 37 + "name": "DomainNotFound" 38 + } 39 + ] 40 + } 41 + } 42 + }
+51
crates/weaver-api/lexicons/sh_weaver_domain_resolveDocument.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.weaver.domain.resolveDocument", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Resolve a document by path within a publication. Returns re-hydrated content for weaver-backed documents.", 8 + "parameters": { 9 + "type": "params", 10 + "required": [ 11 + "publication", 12 + "path" 13 + ], 14 + "properties": { 15 + "path": { 16 + "type": "string", 17 + "description": "URL path within the publication (e.g., /posts/my-first-post)." 18 + }, 19 + "publication": { 20 + "type": "string", 21 + "description": "AT-URI of the publication.", 22 + "format": "at-uri" 23 + } 24 + } 25 + }, 26 + "output": { 27 + "encoding": "application/json", 28 + "schema": { 29 + "type": "object", 30 + "required": [ 31 + "document" 32 + ], 33 + "properties": { 34 + "document": { 35 + "type": "ref", 36 + "ref": "sh.weaver.domain.defs#documentView" 37 + } 38 + } 39 + } 40 + }, 41 + "errors": [ 42 + { 43 + "name": "PublicationNotFound" 44 + }, 45 + { 46 + "name": "DocumentNotFound" 47 + } 48 + ] 49 + } 50 + } 51 + }
+69 -57
crates/weaver-api/lexicons/site_standard_document.json
··· 3 3 "id": "site.standard.document", 4 4 "defs": { 5 5 "main": { 6 - "type": "object", 7 - "required": [ 8 - "publication", 9 - "title", 10 - "publishedAt" 11 - ], 12 - "properties": { 13 - "bskyPostRef": { 14 - "type": "ref", 15 - "ref": "com.atproto.repo.strongRef" 16 - }, 17 - "content": { 18 - "type": "array", 19 - "items": { 6 + "type": "record", 7 + "description": "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "site", 13 + "title", 14 + "publishedAt" 15 + ], 16 + "properties": { 17 + "bskyPostRef": { 18 + "type": "ref", 19 + "description": "Strong reference to a Bluesky post. Useful to keep track of comments off-platform.", 20 + "ref": "com.atproto.repo.strongRef" 21 + }, 22 + "content": { 20 23 "type": "union", 24 + "description": "Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats.", 21 25 "refs": [], 22 26 "closed": false 23 - } 24 - }, 25 - "coverImage": { 26 - "type": "blob", 27 - "accept": [ 28 - "image/*" 29 - ], 30 - "maxSize": 1000000 31 - }, 32 - "description": { 33 - "type": "string", 34 - "maxLength": 3000, 35 - "maxGraphemes": 300 36 - }, 37 - "path": { 38 - "type": "string", 39 - "description": "combined with the publications url to construct a full url to the document" 40 - }, 41 - "publication": { 42 - "type": "string", 43 - "format": "at-uri" 44 - }, 45 - "publishedAt": { 46 - "type": "string", 47 - "format": "datetime" 48 - }, 49 - "tags": { 50 - "type": "array", 51 - "items": { 27 + }, 28 + "coverImage": { 29 + "type": "blob", 30 + "description": "Image to used for thumbnail or cover image. Less than 1MB is size.", 31 + "accept": [ 32 + "image/*" 33 + ], 34 + "maxSize": 1000000 35 + }, 36 + "description": { 52 37 "type": "string", 53 - "maxLength": 100, 54 - "maxGraphemes": 50 38 + "description": "A brief description or excerpt from the document.", 39 + "maxLength": 3000, 40 + "maxGraphemes": 300 41 + }, 42 + "path": { 43 + "type": "string", 44 + "description": "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash." 45 + }, 46 + "publishedAt": { 47 + "type": "string", 48 + "description": "Timestamp of the documents publish time.", 49 + "format": "datetime" 50 + }, 51 + "site": { 52 + "type": "string", 53 + "description": "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes.", 54 + "format": "uri" 55 + }, 56 + "tags": { 57 + "type": "array", 58 + "description": "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags.", 59 + "items": { 60 + "type": "string", 61 + "maxLength": 100, 62 + "maxGraphemes": 50 63 + } 64 + }, 65 + "textContent": { 66 + "type": "string", 67 + "description": "Plaintext representation of the documents contents. Should not contain markdown or other formatting." 68 + }, 69 + "title": { 70 + "type": "string", 71 + "description": "Title of the document.", 72 + "maxLength": 1280, 73 + "maxGraphemes": 128 74 + }, 75 + "updatedAt": { 76 + "type": "string", 77 + "description": "Timestamp of the documents last edit.", 78 + "format": "datetime" 55 79 } 56 - }, 57 - "textContent": { 58 - "type": "string" 59 - }, 60 - "title": { 61 - "type": "string", 62 - "maxLength": 1280, 63 - "maxGraphemes": 128 64 - }, 65 - "updatedAt": { 66 - "type": "string", 67 - "format": "datetime" 68 80 } 69 81 } 70 82 }
+24
crates/weaver-api/lexicons/site_standard_graph_subscription.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "site.standard.graph.subscription", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record declaring a subscription to a publication", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "publication" 13 + ], 14 + "properties": { 15 + "publication": { 16 + "type": "string", 17 + "description": "AT-URI reference to the publication record being subscribed to (ex: at://did:plc:abc123/site.standard.publication/xyz789).", 18 + "format": "at-uri" 19 + } 20 + } 21 + } 22 + } 23 + } 24 + }
+47 -34
crates/weaver-api/lexicons/site_standard_publication.json
··· 3 3 "id": "site.standard.publication", 4 4 "defs": { 5 5 "main": { 6 - "type": "object", 7 - "required": [ 8 - "url", 9 - "name" 10 - ], 11 - "properties": { 12 - "basicTheme": { 13 - "type": "ref", 14 - "ref": "site.standard.theme.basic" 15 - }, 16 - "description": { 17 - "type": "string", 18 - "maxLength": 3000, 19 - "maxGraphemes": 300 20 - }, 21 - "icon": { 22 - "type": "blob", 23 - "accept": [ 24 - "image/*" 25 - ], 26 - "maxSize": 1000000 27 - }, 28 - "name": { 29 - "type": "string", 30 - "maxLength": 1280, 31 - "maxGraphemes": 128 32 - }, 33 - "preferences": { 34 - "type": "ref", 35 - "ref": "#preferences" 36 - }, 37 - "url": { 38 - "type": "string", 39 - "format": "uri" 6 + "type": "record", 7 + "description": "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "url", 13 + "name" 14 + ], 15 + "properties": { 16 + "basicTheme": { 17 + "type": "ref", 18 + "description": "Simplified publication theme for tools and apps to utilize when displaying content.", 19 + "ref": "site.standard.theme.basic" 20 + }, 21 + "description": { 22 + "type": "string", 23 + "description": "Brief description of the publication.", 24 + "maxLength": 3000, 25 + "maxGraphemes": 300 26 + }, 27 + "icon": { 28 + "type": "blob", 29 + "description": "Square image to identify the publication. Should be at least 256x256.", 30 + "accept": [ 31 + "image/*" 32 + ], 33 + "maxSize": 1000000 34 + }, 35 + "name": { 36 + "type": "string", 37 + "description": "Name of the publication.", 38 + "maxLength": 1280, 39 + "maxGraphemes": 128 40 + }, 41 + "preferences": { 42 + "type": "ref", 43 + "description": "Object containing platform specific preferences (with a few shared properties).", 44 + "ref": "#preferences" 45 + }, 46 + "url": { 47 + "type": "string", 48 + "description": "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path.", 49 + "format": "uri" 50 + } 40 51 } 41 52 } 42 53 }, 43 54 "preferences": { 44 55 "type": "object", 56 + "description": "Platform-specific preferences for the publication, including discovery and visibility settings.", 45 57 "properties": { 46 58 "showInDiscover": { 47 59 "type": "boolean", 60 + "description": "Boolean which decides whether the publication should appear in discovery feeds.", 48 61 "default": true 49 62 } 50 63 }
+5
crates/weaver-api/lexicons/site_standard_theme_basic.json
··· 4 4 "defs": { 5 5 "main": { 6 6 "type": "object", 7 + "description": "A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications.", 7 8 "required": [ 8 9 "background", 9 10 "foreground", ··· 13 14 "properties": { 14 15 "accent": { 15 16 "type": "union", 17 + "description": "Color used for links and button backgrounds.", 16 18 "refs": [ 17 19 "site.standard.theme.color#rgb" 18 20 ] 19 21 }, 20 22 "accentForeground": { 21 23 "type": "union", 24 + "description": "Color used for button text.", 22 25 "refs": [ 23 26 "site.standard.theme.color#rgb" 24 27 ] 25 28 }, 26 29 "background": { 27 30 "type": "union", 31 + "description": "Color used for content background.", 28 32 "refs": [ 29 33 "site.standard.theme.color#rgb" 30 34 ] 31 35 }, 32 36 "foreground": { 33 37 "type": "union", 38 + "description": "Color used for content text.", 34 39 "refs": [ 35 40 "site.standard.theme.color#rgb" 36 41 ]
+106 -106
crates/weaver-api/src/app_bsky/actor.rs
··· 3627 3627 } 3628 3628 /// State trait tracking which required fields have been set 3629 3629 pub trait State: sealed::Sealed { 3630 - type Targets; 3631 3630 type Value; 3631 + type Targets; 3632 3632 } 3633 3633 /// Empty state - all required fields are unset 3634 3634 pub struct Empty(()); 3635 3635 impl sealed::Sealed for Empty {} 3636 3636 impl State for Empty { 3637 - type Targets = Unset; 3638 3637 type Value = Unset; 3639 - } 3640 - ///State transition - sets the `targets` field to Set 3641 - pub struct SetTargets<S: State = Empty>(PhantomData<fn() -> S>); 3642 - impl<S: State> sealed::Sealed for SetTargets<S> {} 3643 - impl<S: State> State for SetTargets<S> { 3644 - type Targets = Set<members::targets>; 3645 - type Value = S::Value; 3638 + type Targets = Unset; 3646 3639 } 3647 3640 ///State transition - sets the `value` field to Set 3648 3641 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 3649 3642 impl<S: State> sealed::Sealed for SetValue<S> {} 3650 3643 impl<S: State> State for SetValue<S> { 3651 - type Targets = S::Targets; 3652 3644 type Value = Set<members::value>; 3645 + type Targets = S::Targets; 3646 + } 3647 + ///State transition - sets the `targets` field to Set 3648 + pub struct SetTargets<S: State = Empty>(PhantomData<fn() -> S>); 3649 + impl<S: State> sealed::Sealed for SetTargets<S> {} 3650 + impl<S: State> State for SetTargets<S> { 3651 + type Value = S::Value; 3652 + type Targets = Set<members::targets>; 3653 3653 } 3654 3654 /// Marker types for field names 3655 3655 #[allow(non_camel_case_types)] 3656 3656 pub mod members { 3657 - ///Marker type for the `targets` field 3658 - pub struct targets(()); 3659 3657 ///Marker type for the `value` field 3660 3658 pub struct value(()); 3659 + ///Marker type for the `targets` field 3660 + pub struct targets(()); 3661 3661 } 3662 3662 } 3663 3663 ··· 3784 3784 impl<'a, S> MutedWordBuilder<'a, S> 3785 3785 where 3786 3786 S: muted_word_state::State, 3787 - S::Targets: muted_word_state::IsSet, 3788 3787 S::Value: muted_word_state::IsSet, 3788 + S::Targets: muted_word_state::IsSet, 3789 3789 { 3790 3790 /// Build the final struct 3791 3791 pub fn build(self) -> MutedWord<'a> { ··· 5007 5007 } 5008 5008 /// State trait tracking which required fields have been set 5009 5009 pub trait State: sealed::Sealed { 5010 - type Handle; 5011 5010 type Did; 5011 + type Handle; 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 Handle = Unset; 5018 5017 type Did = Unset; 5019 - } 5020 - ///State transition - sets the `handle` field to Set 5021 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 5022 - impl<S: State> sealed::Sealed for SetHandle<S> {} 5023 - impl<S: State> State for SetHandle<S> { 5024 - type Handle = Set<members::handle>; 5025 - type Did = S::Did; 5018 + type Handle = Unset; 5026 5019 } 5027 5020 ///State transition - sets the `did` field to Set 5028 5021 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 5029 5022 impl<S: State> sealed::Sealed for SetDid<S> {} 5030 5023 impl<S: State> State for SetDid<S> { 5031 - type Handle = S::Handle; 5032 5024 type Did = Set<members::did>; 5025 + type Handle = S::Handle; 5026 + } 5027 + ///State transition - sets the `handle` field to Set 5028 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 5029 + impl<S: State> sealed::Sealed for SetHandle<S> {} 5030 + impl<S: State> State for SetHandle<S> { 5031 + type Did = S::Did; 5032 + type Handle = Set<members::handle>; 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(()); 5039 5037 ///Marker type for the `did` field 5040 5038 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::Handle: profile_view_state::IsSet, 5366 5365 S::Did: profile_view_state::IsSet, 5366 + S::Handle: profile_view_state::IsSet, 5367 5367 { 5368 5368 /// Build the final struct 5369 5369 pub fn build(self) -> ProfileView<'a> { ··· 6040 6040 } 6041 6041 /// State trait tracking which required fields have been set 6042 6042 pub trait State: sealed::Sealed { 6043 - type Did; 6044 6043 type Handle; 6044 + type Did; 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 Did = Unset; 6051 6050 type Handle = Unset; 6051 + 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; 6052 6059 } 6053 6060 ///State transition - sets the `did` field to Set 6054 6061 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 6055 6062 impl<S: State> sealed::Sealed for SetDid<S> {} 6056 6063 impl<S: State> State for SetDid<S> { 6057 - type Did = Set<members::did>; 6058 6064 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>; 6065 + type Did = Set<members::did>; 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(()); 6070 6072 ///Marker type for the `did` field 6071 6073 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::Did: profile_view_detailed_state::IsSet, 6528 6527 S::Handle: profile_view_detailed_state::IsSet, 6528 + S::Did: 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 Type; 6701 - type Pinned; 6702 - type Id; 6703 6700 type Value; 6701 + type Id; 6702 + type Pinned; 6703 + type Type; 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 Type = Unset; 6710 - type Pinned = Unset; 6709 + type Value = Unset; 6711 6710 type Id = Unset; 6712 - type Value = Unset; 6711 + type Pinned = Unset; 6712 + type Type = Unset; 6713 6713 } 6714 - ///State transition - sets the `type` field to Set 6715 - pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 6716 - impl<S: State> sealed::Sealed for SetType<S> {} 6717 - impl<S: State> State for SetType<S> { 6718 - type Type = Set<members::r#type>; 6719 - type Pinned = S::Pinned; 6714 + ///State transition - sets the `value` field to Set 6715 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 6716 + impl<S: State> sealed::Sealed for SetValue<S> {} 6717 + impl<S: State> State for SetValue<S> { 6718 + type Value = Set<members::value>; 6720 6719 type Id = S::Id; 6721 - type Value = S::Value; 6722 - } 6723 - ///State transition - sets the `pinned` field to Set 6724 - pub struct SetPinned<S: State = Empty>(PhantomData<fn() -> S>); 6725 - impl<S: State> sealed::Sealed for SetPinned<S> {} 6726 - impl<S: State> State for SetPinned<S> { 6720 + type Pinned = S::Pinned; 6727 6721 type Type = S::Type; 6728 - type Pinned = Set<members::pinned>; 6729 - type Id = S::Id; 6730 - type Value = S::Value; 6731 6722 } 6732 6723 ///State transition - sets the `id` field to Set 6733 6724 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 6734 6725 impl<S: State> sealed::Sealed for SetId<S> {} 6735 6726 impl<S: State> State for SetId<S> { 6727 + type Value = S::Value; 6728 + type Id = Set<members::id>; 6729 + type Pinned = S::Pinned; 6736 6730 type Type = S::Type; 6737 - type Pinned = S::Pinned; 6738 - type Id = Set<members::id>; 6739 - type Value = S::Value; 6740 6731 } 6741 - ///State transition - sets the `value` field to Set 6742 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 6743 - impl<S: State> sealed::Sealed for SetValue<S> {} 6744 - impl<S: State> State for SetValue<S> { 6732 + ///State transition - sets the `pinned` field to Set 6733 + pub struct SetPinned<S: State = Empty>(PhantomData<fn() -> S>); 6734 + impl<S: State> sealed::Sealed for SetPinned<S> {} 6735 + impl<S: State> State for SetPinned<S> { 6736 + type Value = S::Value; 6737 + type Id = S::Id; 6738 + type Pinned = Set<members::pinned>; 6745 6739 type Type = S::Type; 6746 - type Pinned = S::Pinned; 6740 + } 6741 + ///State transition - sets the `type` field to Set 6742 + pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 6743 + impl<S: State> sealed::Sealed for SetType<S> {} 6744 + impl<S: State> State for SetType<S> { 6745 + type Value = S::Value; 6747 6746 type Id = S::Id; 6748 - type Value = Set<members::value>; 6747 + type Pinned = S::Pinned; 6748 + type Type = Set<members::r#type>; 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 `type` field 6754 - pub struct r#type(()); 6753 + ///Marker type for the `value` field 6754 + pub struct value(()); 6755 + ///Marker type for the `id` field 6756 + pub struct id(()); 6755 6757 ///Marker type for the `pinned` field 6756 6758 pub struct pinned(()); 6757 - ///Marker type for the `id` field 6758 - pub struct id(()); 6759 - ///Marker type for the `value` field 6760 - pub struct value(()); 6759 + ///Marker type for the `type` field 6760 + pub struct r#type(()); 6761 6761 } 6762 6762 } 6763 6763 ··· 6870 6870 impl<'a, S> SavedFeedBuilder<'a, S> 6871 6871 where 6872 6872 S: saved_feed_state::State, 6873 - S::Type: saved_feed_state::IsSet, 6874 - S::Pinned: saved_feed_state::IsSet, 6875 - S::Id: saved_feed_state::IsSet, 6876 6873 S::Value: saved_feed_state::IsSet, 6874 + S::Id: saved_feed_state::IsSet, 6875 + S::Pinned: saved_feed_state::IsSet, 6876 + S::Type: saved_feed_state::IsSet, 6877 6877 { 6878 6878 /// Build the final struct 6879 6879 pub fn build(self) -> SavedFeed<'a> { ··· 7383 7383 } 7384 7384 /// State trait tracking which required fields have been set 7385 7385 pub trait State: sealed::Sealed { 7386 - type Record; 7387 7386 type Status; 7387 + type Record; 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 Record = Unset; 7394 7393 type Status = Unset; 7394 + 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; 7395 7402 } 7396 7403 ///State transition - sets the `record` field to Set 7397 7404 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 7398 7405 impl<S: State> sealed::Sealed for SetRecord<S> {} 7399 7406 impl<S: State> State for SetRecord<S> { 7407 + type Status = S::Status; 7400 7408 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 `status` field 7414 + pub struct status(()); 7413 7415 ///Marker type for the `record` field 7414 7416 pub struct record(()); 7415 - ///Marker type for the `status` field 7416 - pub struct status(()); 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::Record: status_view_state::IsSet, 7544 7543 S::Status: status_view_state::IsSet, 7544 + S::Record: status_view_state::IsSet, 7545 7545 { 7546 7546 /// Build the final struct 7547 7547 pub fn build(self) -> StatusView<'a> { ··· 7884 7884 } 7885 7885 /// State trait tracking which required fields have been set 7886 7886 pub trait State: sealed::Sealed { 7887 + type VerifiedStatus; 7887 7888 type Verifications; 7888 7889 type TrustedVerifierStatus; 7889 - type VerifiedStatus; 7890 7890 } 7891 7891 /// Empty state - all required fields are unset 7892 7892 pub struct Empty(()); 7893 7893 impl sealed::Sealed for Empty {} 7894 7894 impl State for Empty { 7895 + type VerifiedStatus = Unset; 7895 7896 type Verifications = Unset; 7896 7897 type TrustedVerifierStatus = Unset; 7897 - type VerifiedStatus = Unset; 7898 + } 7899 + ///State transition - sets the `verified_status` field to Set 7900 + pub struct SetVerifiedStatus<S: State = Empty>(PhantomData<fn() -> S>); 7901 + impl<S: State> sealed::Sealed for SetVerifiedStatus<S> {} 7902 + impl<S: State> State for SetVerifiedStatus<S> { 7903 + type VerifiedStatus = Set<members::verified_status>; 7904 + type Verifications = S::Verifications; 7905 + type TrustedVerifierStatus = S::TrustedVerifierStatus; 7898 7906 } 7899 7907 ///State transition - sets the `verifications` field to Set 7900 7908 pub struct SetVerifications<S: State = Empty>(PhantomData<fn() -> S>); 7901 7909 impl<S: State> sealed::Sealed for SetVerifications<S> {} 7902 7910 impl<S: State> State for SetVerifications<S> { 7911 + type VerifiedStatus = S::VerifiedStatus; 7903 7912 type Verifications = Set<members::verifications>; 7904 7913 type TrustedVerifierStatus = S::TrustedVerifierStatus; 7905 - type VerifiedStatus = S::VerifiedStatus; 7906 7914 } 7907 7915 ///State transition - sets the `trusted_verifier_status` field to Set 7908 7916 pub struct SetTrustedVerifierStatus<S: State = Empty>(PhantomData<fn() -> S>); 7909 7917 impl<S: State> sealed::Sealed for SetTrustedVerifierStatus<S> {} 7910 7918 impl<S: State> State for SetTrustedVerifierStatus<S> { 7911 - type Verifications = S::Verifications; 7912 - type TrustedVerifierStatus = Set<members::trusted_verifier_status>; 7913 7919 type VerifiedStatus = S::VerifiedStatus; 7914 - } 7915 - ///State transition - sets the `verified_status` field to Set 7916 - pub struct SetVerifiedStatus<S: State = Empty>(PhantomData<fn() -> S>); 7917 - impl<S: State> sealed::Sealed for SetVerifiedStatus<S> {} 7918 - impl<S: State> State for SetVerifiedStatus<S> { 7919 7920 type Verifications = S::Verifications; 7920 - type TrustedVerifierStatus = S::TrustedVerifierStatus; 7921 - type VerifiedStatus = Set<members::verified_status>; 7921 + type TrustedVerifierStatus = Set<members::trusted_verifier_status>; 7922 7922 } 7923 7923 /// Marker types for field names 7924 7924 #[allow(non_camel_case_types)] 7925 7925 pub mod members { 7926 + ///Marker type for the `verified_status` field 7927 + pub struct verified_status(()); 7926 7928 ///Marker type for the `verifications` field 7927 7929 pub struct verifications(()); 7928 7930 ///Marker type for the `trusted_verifier_status` field 7929 7931 pub struct trusted_verifier_status(()); 7930 - ///Marker type for the `verified_status` field 7931 - pub struct verified_status(()); 7932 7932 } 7933 7933 } 7934 7934 ··· 8024 8024 impl<'a, S> VerificationStateBuilder<'a, S> 8025 8025 where 8026 8026 S: verification_state_state::State, 8027 + S::VerifiedStatus: verification_state_state::IsSet, 8027 8028 S::Verifications: verification_state_state::IsSet, 8028 8029 S::TrustedVerifierStatus: verification_state_state::IsSet, 8029 - S::VerifiedStatus: verification_state_state::IsSet, 8030 8030 { 8031 8031 /// Build the final struct 8032 8032 pub fn build(self) -> VerificationState<'a> {
+84 -84
crates/weaver-api/src/app_bsky/ageassurance.rs
··· 2088 2088 } 2089 2089 /// State trait tracking which required fields have been set 2090 2090 pub trait State: sealed::Sealed { 2091 - type Age; 2092 2091 type Access; 2092 + type Age; 2093 2093 } 2094 2094 /// Empty state - all required fields are unset 2095 2095 pub struct Empty(()); 2096 2096 impl sealed::Sealed for Empty {} 2097 2097 impl State for Empty { 2098 - type Age = Unset; 2099 2098 type Access = Unset; 2100 - } 2101 - ///State transition - sets the `age` field to Set 2102 - pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2103 - impl<S: State> sealed::Sealed for SetAge<S> {} 2104 - impl<S: State> State for SetAge<S> { 2105 - type Age = Set<members::age>; 2106 - type Access = S::Access; 2099 + type Age = Unset; 2107 2100 } 2108 2101 ///State transition - sets the `access` field to Set 2109 2102 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2110 2103 impl<S: State> sealed::Sealed for SetAccess<S> {} 2111 2104 impl<S: State> State for SetAccess<S> { 2112 - type Age = S::Age; 2113 2105 type Access = Set<members::access>; 2106 + type Age = S::Age; 2107 + } 2108 + ///State transition - sets the `age` field to Set 2109 + pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2110 + impl<S: State> sealed::Sealed for SetAge<S> {} 2111 + impl<S: State> State for SetAge<S> { 2112 + type Access = S::Access; 2113 + type Age = Set<members::age>; 2114 2114 } 2115 2115 /// Marker types for field names 2116 2116 #[allow(non_camel_case_types)] 2117 2117 pub mod members { 2118 - ///Marker type for the `age` field 2119 - pub struct age(()); 2120 2118 ///Marker type for the `access` field 2121 2119 pub struct access(()); 2120 + ///Marker type for the `age` field 2121 + pub struct age(()); 2122 2122 } 2123 2123 } 2124 2124 ··· 2208 2208 impl<'a, S> ConfigRegionRuleIfAssuredUnderAgeBuilder<'a, S> 2209 2209 where 2210 2210 S: config_region_rule_if_assured_under_age_state::State, 2211 - S::Age: config_region_rule_if_assured_under_age_state::IsSet, 2212 2211 S::Access: config_region_rule_if_assured_under_age_state::IsSet, 2212 + S::Age: config_region_rule_if_assured_under_age_state::IsSet, 2213 2213 { 2214 2214 /// Build the final struct 2215 2215 pub fn build(self) -> ConfigRegionRuleIfAssuredUnderAge<'a> { ··· 2476 2476 } 2477 2477 /// State trait tracking which required fields have been set 2478 2478 pub trait State: sealed::Sealed { 2479 - type Age; 2480 2479 type Access; 2480 + type Age; 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 Age = Unset; 2487 2486 type Access = Unset; 2488 - } 2489 - ///State transition - sets the `age` field to Set 2490 - pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2491 - impl<S: State> sealed::Sealed for SetAge<S> {} 2492 - impl<S: State> State for SetAge<S> { 2493 - type Age = Set<members::age>; 2494 - type Access = S::Access; 2487 + type Age = Unset; 2495 2488 } 2496 2489 ///State transition - sets the `access` field to Set 2497 2490 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2498 2491 impl<S: State> sealed::Sealed for SetAccess<S> {} 2499 2492 impl<S: State> State for SetAccess<S> { 2500 - type Age = S::Age; 2501 2493 type Access = Set<members::access>; 2494 + type Age = S::Age; 2495 + } 2496 + ///State transition - sets the `age` field to Set 2497 + pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2498 + impl<S: State> sealed::Sealed for SetAge<S> {} 2499 + impl<S: State> State for SetAge<S> { 2500 + type Access = S::Access; 2501 + type Age = Set<members::age>; 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 `access` field 2507 + pub struct access(()); 2506 2508 ///Marker type for the `age` field 2507 2509 pub struct age(()); 2508 - ///Marker type for the `access` field 2509 - pub struct access(()); 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::Age: config_region_rule_if_declared_under_age_state::IsSet, 2600 2599 S::Access: config_region_rule_if_declared_under_age_state::IsSet, 2600 + S::Age: 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 CountryCode; 2708 + type AttemptId; 2709 + type Access; 2707 2710 type CreatedAt; 2708 - type Access; 2709 2711 type Status; 2710 - type AttemptId; 2711 - type CountryCode; 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 CountryCode = Unset; 2718 + type AttemptId = Unset; 2719 + type Access = Unset; 2717 2720 type CreatedAt = Unset; 2718 - type Access = Unset; 2719 2721 type Status = Unset; 2720 - type AttemptId = Unset; 2721 - type CountryCode = Unset; 2722 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>; 2723 + ///State transition - sets the `country_code` field to Set 2724 + pub struct SetCountryCode<S: State = Empty>(PhantomData<fn() -> S>); 2725 + impl<S: State> sealed::Sealed for SetCountryCode<S> {} 2726 + impl<S: State> State for SetCountryCode<S> { 2727 + type CountryCode = Set<members::country_code>; 2728 + type AttemptId = S::AttemptId; 2728 2729 type Access = S::Access; 2730 + type CreatedAt = S::CreatedAt; 2729 2731 type Status = S::Status; 2730 - type AttemptId = S::AttemptId; 2732 + } 2733 + ///State transition - sets the `attempt_id` field to Set 2734 + pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 2735 + impl<S: State> sealed::Sealed for SetAttemptId<S> {} 2736 + impl<S: State> State for SetAttemptId<S> { 2731 2737 type CountryCode = S::CountryCode; 2738 + type AttemptId = Set<members::attempt_id>; 2739 + type Access = S::Access; 2740 + type CreatedAt = S::CreatedAt; 2741 + type Status = S::Status; 2732 2742 } 2733 2743 ///State transition - sets the `access` field to Set 2734 2744 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2735 2745 impl<S: State> sealed::Sealed for SetAccess<S> {} 2736 2746 impl<S: State> State for SetAccess<S> { 2737 - type CreatedAt = S::CreatedAt; 2747 + type CountryCode = S::CountryCode; 2748 + type AttemptId = S::AttemptId; 2738 2749 type Access = Set<members::access>; 2750 + type CreatedAt = S::CreatedAt; 2739 2751 type Status = S::Status; 2752 + } 2753 + ///State transition - sets the `created_at` field to Set 2754 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 2755 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 2756 + impl<S: State> State for SetCreatedAt<S> { 2757 + type CountryCode = S::CountryCode; 2740 2758 type AttemptId = S::AttemptId; 2741 - type CountryCode = S::CountryCode; 2759 + type Access = S::Access; 2760 + type CreatedAt = Set<members::created_at>; 2761 + type Status = S::Status; 2742 2762 } 2743 2763 ///State transition - sets the `status` field to Set 2744 2764 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 2745 2765 impl<S: State> sealed::Sealed for SetStatus<S> {} 2746 2766 impl<S: State> State for SetStatus<S> { 2747 - type CreatedAt = S::CreatedAt; 2748 - type Access = S::Access; 2749 - type Status = Set<members::status>; 2750 - type AttemptId = S::AttemptId; 2751 2767 type CountryCode = S::CountryCode; 2752 - } 2753 - ///State transition - sets the `attempt_id` field to Set 2754 - pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 2755 - impl<S: State> sealed::Sealed for SetAttemptId<S> {} 2756 - impl<S: State> State for SetAttemptId<S> { 2757 - type CreatedAt = S::CreatedAt; 2768 + type AttemptId = S::AttemptId; 2758 2769 type Access = S::Access; 2759 - type Status = S::Status; 2760 - type AttemptId = Set<members::attempt_id>; 2761 - type CountryCode = S::CountryCode; 2762 - } 2763 - ///State transition - sets the `country_code` field to Set 2764 - pub struct SetCountryCode<S: State = Empty>(PhantomData<fn() -> S>); 2765 - impl<S: State> sealed::Sealed for SetCountryCode<S> {} 2766 - impl<S: State> State for SetCountryCode<S> { 2767 2770 type CreatedAt = S::CreatedAt; 2768 - type Access = S::Access; 2769 - type Status = S::Status; 2770 - type AttemptId = S::AttemptId; 2771 - type CountryCode = Set<members::country_code>; 2771 + type Status = Set<members::status>; 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 + ///Marker type for the `country_code` field 2777 + pub struct country_code(()); 2778 + ///Marker type for the `attempt_id` field 2779 + pub struct attempt_id(()); 2778 2780 ///Marker type for the `access` field 2779 2781 pub struct access(()); 2782 + ///Marker type for the `created_at` field 2783 + pub struct created_at(()); 2780 2784 ///Marker type for the `status` field 2781 2785 pub struct status(()); 2782 - ///Marker type for the `attempt_id` field 2783 - pub struct attempt_id(()); 2784 - ///Marker type for the `country_code` field 2785 - pub struct country_code(()); 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 + S::CountryCode: event_state::IsSet, 3042 + S::AttemptId: event_state::IsSet, 3042 3043 S::Access: event_state::IsSet, 3044 + S::CreatedAt: event_state::IsSet, 3043 3045 S::Status: event_state::IsSet, 3044 - S::AttemptId: event_state::IsSet, 3045 - S::CountryCode: 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 Status; 3337 3336 type Access; 3337 + type Status; 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 Status = Unset; 3344 3343 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; 3344 + type Status = Unset; 3352 3345 } 3353 3346 ///State transition - sets the `access` field to Set 3354 3347 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 3355 3348 impl<S: State> sealed::Sealed for SetAccess<S> {} 3356 3349 impl<S: State> State for SetAccess<S> { 3350 + type Access = Set<members::access>; 3357 3351 type Status = S::Status; 3358 - type Access = Set<members::access>; 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(()); 3363 3365 ///Marker type for the `status` field 3364 3366 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::Status: state_state::IsSet, 3460 3459 S::Access: state_state::IsSet, 3460 + S::Status: 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 Item; 285 284 type Subject; 285 + type Item; 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 Item = Unset; 292 291 type Subject = Unset; 293 - } 294 - ///State transition - sets the `item` field to Set 295 - pub struct SetItem<S: State = Empty>(PhantomData<fn() -> S>); 296 - impl<S: State> sealed::Sealed for SetItem<S> {} 297 - impl<S: State> State for SetItem<S> { 298 - type Item = Set<members::item>; 299 - type Subject = S::Subject; 292 + type Item = Unset; 300 293 } 301 294 ///State transition - sets the `subject` field to Set 302 295 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 303 296 impl<S: State> sealed::Sealed for SetSubject<S> {} 304 297 impl<S: State> State for SetSubject<S> { 305 - type Item = S::Item; 306 298 type Subject = Set<members::subject>; 299 + type Item = S::Item; 300 + } 301 + ///State transition - sets the `item` field to Set 302 + pub struct SetItem<S: State = Empty>(PhantomData<fn() -> S>); 303 + impl<S: State> sealed::Sealed for SetItem<S> {} 304 + impl<S: State> State for SetItem<S> { 305 + type Subject = S::Subject; 306 + type Item = Set<members::item>; 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 `item` field 312 - pub struct item(()); 313 311 ///Marker type for the `subject` field 314 312 pub struct subject(()); 313 + ///Marker type for the `item` field 314 + pub struct item(()); 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::Item: bookmark_view_state::IsSet, 408 407 S::Subject: bookmark_view_state::IsSet, 408 + S::Item: 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 Uri; 37 36 type Cid; 37 + type Uri; 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 Uri = Unset; 44 43 type Cid = Unset; 45 - } 46 - ///State transition - sets the `uri` field to Set 47 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetUri<S> {} 49 - impl<S: State> State for SetUri<S> { 50 - type Uri = Set<members::uri>; 51 - type Cid = S::Cid; 44 + type Uri = Unset; 52 45 } 53 46 ///State transition - sets the `cid` field to Set 54 47 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetCid<S> {} 56 49 impl<S: State> State for SetCid<S> { 57 - type Uri = S::Uri; 58 50 type Cid = Set<members::cid>; 51 + type Uri = S::Uri; 52 + } 53 + ///State transition - sets the `uri` field to Set 54 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetUri<S> {} 56 + impl<S: State> State for SetUri<S> { 57 + type Cid = S::Cid; 58 + type Uri = Set<members::uri>; 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 `uri` field 64 - pub struct uri(()); 65 63 ///Marker type for the `cid` field 66 64 pub struct cid(()); 65 + ///Marker type for the `uri` field 66 + pub struct uri(()); 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::Uri: create_bookmark_state::IsSet, 140 139 S::Cid: create_bookmark_state::IsSet, 140 + S::Uri: create_bookmark_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> CreateBookmark<'a> {
+30 -30
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 Description; 43 42 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 49 type Title = Unset; 50 - type Description = Unset; 51 50 type Uri = Unset; 51 + type Description = 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 Description = S::Description; 59 58 type Uri = S::Uri; 60 - } 61 - ///State transition - sets the `description` field to Set 62 - pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 63 - impl<S: State> sealed::Sealed for SetDescription<S> {} 64 - impl<S: State> State for SetDescription<S> { 65 - type Title = S::Title; 66 - type Description = Set<members::description>; 67 - type Uri = S::Uri; 59 + type Description = S::Description; 68 60 } 69 61 ///State transition - sets the `uri` field to Set 70 62 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 71 63 impl<S: State> sealed::Sealed for SetUri<S> {} 72 64 impl<S: State> State for SetUri<S> { 73 65 type Title = S::Title; 74 - type Description = S::Description; 75 66 type Uri = Set<members::uri>; 67 + 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 + type Title = S::Title; 74 + type Uri = S::Uri; 75 + type Description = Set<members::description>; 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 `uri` field 83 + pub struct uri(()); 82 84 ///Marker type for the `description` field 83 85 pub struct description(()); 84 - ///Marker type for the `uri` field 85 - pub struct uri(()); 86 86 } 87 87 } 88 88 ··· 196 196 where 197 197 S: external_state::State, 198 198 S::Title: external_state::IsSet, 199 - S::Description: external_state::IsSet, 200 199 S::Uri: external_state::IsSet, 200 + S::Description: 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 Title; 788 787 type Uri; 788 + type Title; 789 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 795 type Uri = Unset; 796 + type Title = Unset; 797 797 type Description = Unset; 798 798 } 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 - type Uri = S::Uri; 805 - type Description = S::Description; 806 - } 807 799 ///State transition - sets the `uri` field to Set 808 800 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 809 801 impl<S: State> sealed::Sealed for SetUri<S> {} 810 802 impl<S: State> State for SetUri<S> { 811 - type Title = S::Title; 812 803 type Uri = Set<members::uri>; 804 + type Title = S::Title; 805 + type Description = S::Description; 806 + } 807 + ///State transition - sets the `title` field to Set 808 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 809 + impl<S: State> sealed::Sealed for SetTitle<S> {} 810 + impl<S: State> State for SetTitle<S> { 811 + type Uri = S::Uri; 812 + type Title = Set<members::title>; 813 813 type Description = S::Description; 814 814 } 815 815 ///State transition - sets the `description` field to Set 816 816 pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 817 817 impl<S: State> sealed::Sealed for SetDescription<S> {} 818 818 impl<S: State> State for SetDescription<S> { 819 - type Title = S::Title; 820 819 type Uri = S::Uri; 820 + type Title = S::Title; 821 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 `uri` field 827 + pub struct uri(()); 826 828 ///Marker type for the `title` field 827 829 pub struct title(()); 828 - ///Marker type for the `uri` field 829 - pub struct uri(()); 830 830 ///Marker type for the `description` field 831 831 pub struct description(()); 832 832 } ··· 941 941 impl<'a, S> ViewExternalBuilder<'a, S> 942 942 where 943 943 S: view_external_state::State, 944 - S::Title: view_external_state::IsSet, 945 944 S::Uri: view_external_state::IsSet, 945 + S::Title: view_external_state::IsSet, 946 946 S::Description: view_external_state::IsSet, 947 947 { 948 948 /// Build the final struct
+28 -28
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 Image; 41 40 type Alt; 41 + type Image; 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 Image = Unset; 48 47 type Alt = Unset; 49 - } 50 - ///State transition - sets the `image` field to Set 51 - pub struct SetImage<S: State = Empty>(PhantomData<fn() -> S>); 52 - impl<S: State> sealed::Sealed for SetImage<S> {} 53 - impl<S: State> State for SetImage<S> { 54 - type Image = Set<members::image>; 55 - type Alt = S::Alt; 48 + type Image = Unset; 56 49 } 57 50 ///State transition - sets the `alt` field to Set 58 51 pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 59 52 impl<S: State> sealed::Sealed for SetAlt<S> {} 60 53 impl<S: State> State for SetAlt<S> { 61 - type Image = S::Image; 62 54 type Alt = Set<members::alt>; 55 + type Image = S::Image; 56 + } 57 + ///State transition - sets the `image` field to Set 58 + pub struct SetImage<S: State = Empty>(PhantomData<fn() -> S>); 59 + impl<S: State> sealed::Sealed for SetImage<S> {} 60 + impl<S: State> State for SetImage<S> { 61 + type Alt = S::Alt; 62 + type Image = Set<members::image>; 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 `image` field 68 - pub struct image(()); 69 67 ///Marker type for the `alt` field 70 68 pub struct alt(()); 69 + ///Marker type for the `image` field 70 + pub struct image(()); 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::Image: image_state::IsSet, 164 163 S::Alt: image_state::IsSet, 164 + S::Image: image_state::IsSet, 165 165 { 166 166 /// Build the final struct 167 167 pub fn build(self) -> Image<'a> { ··· 760 760 } 761 761 /// State trait tracking which required fields have been set 762 762 pub trait State: sealed::Sealed { 763 + type Thumb; 763 764 type Fullsize; 764 765 type Alt; 765 - type Thumb; 766 766 } 767 767 /// Empty state - all required fields are unset 768 768 pub struct Empty(()); 769 769 impl sealed::Sealed for Empty {} 770 770 impl State for Empty { 771 + type Thumb = Unset; 771 772 type Fullsize = Unset; 772 773 type Alt = Unset; 773 - type Thumb = Unset; 774 + } 775 + ///State transition - sets the `thumb` field to Set 776 + pub struct SetThumb<S: State = Empty>(PhantomData<fn() -> S>); 777 + impl<S: State> sealed::Sealed for SetThumb<S> {} 778 + impl<S: State> State for SetThumb<S> { 779 + type Thumb = Set<members::thumb>; 780 + type Fullsize = S::Fullsize; 781 + type Alt = S::Alt; 774 782 } 775 783 ///State transition - sets the `fullsize` field to Set 776 784 pub struct SetFullsize<S: State = Empty>(PhantomData<fn() -> S>); 777 785 impl<S: State> sealed::Sealed for SetFullsize<S> {} 778 786 impl<S: State> State for SetFullsize<S> { 787 + type Thumb = S::Thumb; 779 788 type Fullsize = Set<members::fullsize>; 780 789 type Alt = S::Alt; 781 - type Thumb = S::Thumb; 782 790 } 783 791 ///State transition - sets the `alt` field to Set 784 792 pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 785 793 impl<S: State> sealed::Sealed for SetAlt<S> {} 786 794 impl<S: State> State for SetAlt<S> { 787 - type Fullsize = S::Fullsize; 788 - type Alt = Set<members::alt>; 789 795 type Thumb = S::Thumb; 790 - } 791 - ///State transition - sets the `thumb` field to Set 792 - pub struct SetThumb<S: State = Empty>(PhantomData<fn() -> S>); 793 - impl<S: State> sealed::Sealed for SetThumb<S> {} 794 - impl<S: State> State for SetThumb<S> { 795 796 type Fullsize = S::Fullsize; 796 - type Alt = S::Alt; 797 - type Thumb = Set<members::thumb>; 797 + type Alt = Set<members::alt>; 798 798 } 799 799 /// Marker types for field names 800 800 #[allow(non_camel_case_types)] 801 801 pub mod members { 802 + ///Marker type for the `thumb` field 803 + pub struct thumb(()); 802 804 ///Marker type for the `fullsize` field 803 805 pub struct fullsize(()); 804 806 ///Marker type for the `alt` field 805 807 pub struct alt(()); 806 - ///Marker type for the `thumb` field 807 - pub struct thumb(()); 808 808 } 809 809 } 810 810 ··· 917 917 impl<'a, S> ViewImageBuilder<'a, S> 918 918 where 919 919 S: view_image_state::State, 920 + S::Thumb: view_image_state::IsSet, 920 921 S::Fullsize: view_image_state::IsSet, 921 922 S::Alt: view_image_state::IsSet, 922 - S::Thumb: view_image_state::IsSet, 923 923 { 924 924 /// Build the final struct 925 925 pub fn build(self) -> ViewImage<'a> {
+84 -84
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; 726 727 type Uri; 727 728 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; 734 735 type Uri = Unset; 735 736 type Blocked = Unset; 736 - type Author = 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; 737 745 } 738 746 ///State transition - sets the `uri` field to Set 739 747 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 740 748 impl<S: State> sealed::Sealed for SetUri<S> {} 741 749 impl<S: State> State for SetUri<S> { 750 + type Author = S::Author; 742 751 type Uri = Set<members::uri>; 743 752 type Blocked = S::Blocked; 744 - type Author = S::Author; 745 753 } 746 754 ///State transition - sets the `blocked` field to Set 747 755 pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 748 756 impl<S: State> sealed::Sealed for SetBlocked<S> {} 749 757 impl<S: State> State for SetBlocked<S> { 750 - type Uri = S::Uri; 751 - type Blocked = Set<members::blocked>; 752 758 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> { 758 759 type Uri = S::Uri; 759 - type Blocked = S::Blocked; 760 - type Author = Set<members::author>; 760 + type Blocked = Set<members::blocked>; 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(()); 765 767 ///Marker type for the `uri` field 766 768 pub struct uri(()); 767 769 ///Marker type for the `blocked` field 768 770 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, 863 864 S::Uri: view_blocked_state::IsSet, 864 865 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 Detached; 938 937 type Uri; 938 + type Detached; 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; 945 944 type Uri = 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; 945 + type Detached = Unset; 953 946 } 954 947 ///State transition - sets the `uri` field to Set 955 948 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 956 949 impl<S: State> sealed::Sealed for SetUri<S> {} 957 950 impl<S: State> State for SetUri<S> { 958 - type Detached = S::Detached; 959 951 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 `uri` field 965 + pub struct uri(()); 964 966 ///Marker type for the `detached` field 965 967 pub struct detached(()); 966 - ///Marker type for the `uri` field 967 - pub struct uri(()); 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::Detached: view_detached_state::IsSet, 1041 1040 S::Uri: view_detached_state::IsSet, 1041 + S::Detached: 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 NotFound; 1112 1111 type Uri; 1112 + type NotFound; 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; 1119 1118 type Uri = Unset; 1120 - } 1121 - ///State transition - sets the `not_found` field to Set 1122 - pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>); 1123 - impl<S: State> sealed::Sealed for SetNotFound<S> {} 1124 - impl<S: State> State for SetNotFound<S> { 1125 - type NotFound = Set<members::not_found>; 1126 - type Uri = S::Uri; 1119 + type NotFound = Unset; 1127 1120 } 1128 1121 ///State transition - sets the `uri` field to Set 1129 1122 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1130 1123 impl<S: State> sealed::Sealed for SetUri<S> {} 1131 1124 impl<S: State> State for SetUri<S> { 1125 + type Uri = Set<members::uri>; 1132 1126 type NotFound = S::NotFound; 1133 - type Uri = Set<members::uri>; 1127 + } 1128 + ///State transition - sets the `not_found` field to Set 1129 + pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>); 1130 + impl<S: State> sealed::Sealed for SetNotFound<S> {} 1131 + impl<S: State> State for SetNotFound<S> { 1132 + type Uri = S::Uri; 1133 + type NotFound = Set<members::not_found>; 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(()); 1140 1138 ///Marker type for the `uri` field 1141 1139 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::NotFound: view_not_found_state::IsSet, 1215 1214 S::Uri: view_not_found_state::IsSet, 1215 + S::NotFound: 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 Cid; 1306 + type Uri; 1307 1307 type Author; 1308 - type Value; 1309 1308 type IndexedAt; 1310 - type Uri; 1309 + type Cid; 1310 + type Value; 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 Cid = Unset; 1316 + type Uri = Unset; 1317 1317 type Author = Unset; 1318 + type IndexedAt = Unset; 1319 + type Cid = Unset; 1318 1320 type Value = Unset; 1319 - type IndexedAt = Unset; 1320 - type Uri = Unset; 1321 1321 } 1322 - ///State transition - sets the `cid` field to Set 1323 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1324 - impl<S: State> sealed::Sealed for SetCid<S> {} 1325 - impl<S: State> State for SetCid<S> { 1326 - type Cid = Set<members::cid>; 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 1327 type Author = S::Author; 1328 - type Value = S::Value; 1329 1328 type IndexedAt = S::IndexedAt; 1330 - type Uri = S::Uri; 1329 + type Cid = S::Cid; 1330 + type Value = S::Value; 1331 1331 } 1332 1332 ///State transition - sets the `author` field to Set 1333 1333 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1334 1334 impl<S: State> sealed::Sealed for SetAuthor<S> {} 1335 1335 impl<S: State> State for SetAuthor<S> { 1336 - type Cid = S::Cid; 1336 + type Uri = S::Uri; 1337 1337 type Author = Set<members::author>; 1338 - type Value = S::Value; 1339 1338 type IndexedAt = S::IndexedAt; 1340 - type Uri = S::Uri; 1341 - } 1342 - ///State transition - sets the `value` field to Set 1343 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1344 - impl<S: State> sealed::Sealed for SetValue<S> {} 1345 - impl<S: State> State for SetValue<S> { 1346 1339 type Cid = S::Cid; 1347 - type Author = S::Author; 1348 - type Value = Set<members::value>; 1349 - type IndexedAt = S::IndexedAt; 1350 - type Uri = S::Uri; 1340 + type Value = S::Value; 1351 1341 } 1352 1342 ///State transition - sets the `indexed_at` field to Set 1353 1343 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1354 1344 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1355 1345 impl<S: State> State for SetIndexedAt<S> { 1356 - type Cid = S::Cid; 1346 + type Uri = S::Uri; 1357 1347 type Author = S::Author; 1348 + type IndexedAt = Set<members::indexed_at>; 1349 + type Cid = S::Cid; 1358 1350 type Value = S::Value; 1359 - type IndexedAt = Set<members::indexed_at>; 1351 + } 1352 + ///State transition - sets the `cid` field to Set 1353 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1354 + impl<S: State> sealed::Sealed for SetCid<S> {} 1355 + impl<S: State> State for SetCid<S> { 1360 1356 type Uri = S::Uri; 1357 + type Author = S::Author; 1358 + type IndexedAt = S::IndexedAt; 1359 + type Cid = Set<members::cid>; 1360 + type Value = S::Value; 1361 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> { 1366 - type Cid = S::Cid; 1362 + ///State transition - sets the `value` field to Set 1363 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1364 + impl<S: State> sealed::Sealed for SetValue<S> {} 1365 + impl<S: State> State for SetValue<S> { 1366 + type Uri = S::Uri; 1367 1367 type Author = S::Author; 1368 - type Value = S::Value; 1369 1368 type IndexedAt = S::IndexedAt; 1370 - type Uri = Set<members::uri>; 1369 + type Cid = S::Cid; 1370 + type Value = Set<members::value>; 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 + ///Marker type for the `author` field 1378 + pub struct author(()); 1379 + ///Marker type for the `indexed_at` field 1380 + pub struct indexed_at(()); 1375 1381 ///Marker type for the `cid` field 1376 1382 pub struct cid(()); 1377 - ///Marker type for the `author` field 1378 - pub struct author(()); 1379 1383 ///Marker type for the `value` field 1380 1384 pub struct value(()); 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 ··· 1619 1619 impl<'a, S> ViewRecordBuilder<'a, S> 1620 1620 where 1621 1621 S: view_record_state::State, 1622 - S::Cid: view_record_state::IsSet, 1622 + S::Uri: view_record_state::IsSet, 1623 1623 S::Author: view_record_state::IsSet, 1624 - S::Value: view_record_state::IsSet, 1625 1624 S::IndexedAt: view_record_state::IsSet, 1626 - S::Uri: view_record_state::IsSet, 1625 + S::Cid: view_record_state::IsSet, 1626 + S::Value: 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
··· 322 322 } 323 323 /// State trait tracking which required fields have been set 324 324 pub trait State: sealed::Sealed { 325 - type Record; 326 325 type Media; 326 + type Record; 327 327 } 328 328 /// Empty state - all required fields are unset 329 329 pub struct Empty(()); 330 330 impl sealed::Sealed for Empty {} 331 331 impl State for Empty { 332 - type Record = Unset; 333 332 type Media = Unset; 334 - } 335 - ///State transition - sets the `record` field to Set 336 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 337 - impl<S: State> sealed::Sealed for SetRecord<S> {} 338 - impl<S: State> State for SetRecord<S> { 339 - type Record = Set<members::record>; 340 - type Media = S::Media; 333 + type Record = Unset; 341 334 } 342 335 ///State transition - sets the `media` field to Set 343 336 pub struct SetMedia<S: State = Empty>(PhantomData<fn() -> S>); 344 337 impl<S: State> sealed::Sealed for SetMedia<S> {} 345 338 impl<S: State> State for SetMedia<S> { 346 - type Record = S::Record; 347 339 type Media = Set<members::media>; 340 + type Record = S::Record; 341 + } 342 + ///State transition - sets the `record` field to Set 343 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 344 + impl<S: State> sealed::Sealed for SetRecord<S> {} 345 + impl<S: State> State for SetRecord<S> { 346 + type Media = S::Media; 347 + type Record = Set<members::record>; 348 348 } 349 349 /// Marker types for field names 350 350 #[allow(non_camel_case_types)] 351 351 pub mod members { 352 - ///Marker type for the `record` field 353 - pub struct record(()); 354 352 ///Marker type for the `media` field 355 353 pub struct media(()); 354 + ///Marker type for the `record` field 355 + pub struct record(()); 356 356 } 357 357 } 358 358 ··· 425 425 impl<'a, S> ViewBuilder<'a, S> 426 426 where 427 427 S: view_state::State, 428 - S::Record: view_state::IsSet, 429 428 S::Media: view_state::IsSet, 429 + S::Record: view_state::IsSet, 430 430 { 431 431 /// Build the final struct 432 432 pub fn build(self) -> View<'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 Playlist; 691 690 type Cid; 691 + type Playlist; 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 Playlist = Unset; 698 697 type Cid = Unset; 699 - } 700 - ///State transition - sets the `playlist` field to Set 701 - pub struct SetPlaylist<S: State = Empty>(PhantomData<fn() -> S>); 702 - impl<S: State> sealed::Sealed for SetPlaylist<S> {} 703 - impl<S: State> State for SetPlaylist<S> { 704 - type Playlist = Set<members::playlist>; 705 - type Cid = S::Cid; 698 + type Playlist = Unset; 706 699 } 707 700 ///State transition - sets the `cid` field to Set 708 701 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 709 702 impl<S: State> sealed::Sealed for SetCid<S> {} 710 703 impl<S: State> State for SetCid<S> { 711 - type Playlist = S::Playlist; 712 704 type Cid = Set<members::cid>; 705 + type Playlist = S::Playlist; 706 + } 707 + ///State transition - sets the `playlist` field to Set 708 + pub struct SetPlaylist<S: State = Empty>(PhantomData<fn() -> S>); 709 + impl<S: State> sealed::Sealed for SetPlaylist<S> {} 710 + impl<S: State> State for SetPlaylist<S> { 711 + type Cid = S::Cid; 712 + type Playlist = Set<members::playlist>; 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 `playlist` field 718 - pub struct playlist(()); 719 717 ///Marker type for the `cid` field 720 718 pub struct cid(()); 719 + ///Marker type for the `playlist` field 720 + pub struct playlist(()); 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::Playlist: view_state::IsSet, 848 847 S::Cid: view_state::IsSet, 848 + S::Playlist: view_state::IsSet, 849 849 { 850 850 /// Build the final struct 851 851 pub fn build(self) -> View<'a> {
+109 -109
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 Author; 1613 1612 type Blocked; 1614 1613 type Uri; 1614 + type Author; 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 Author = Unset; 1621 1620 type Blocked = Unset; 1622 1621 type Uri = Unset; 1623 - } 1624 - ///State transition - sets the `author` field to Set 1625 - pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1626 - impl<S: State> sealed::Sealed for SetAuthor<S> {} 1627 - impl<S: State> State for SetAuthor<S> { 1628 - type Author = Set<members::author>; 1629 - type Blocked = S::Blocked; 1630 - type Uri = S::Uri; 1622 + type Author = Unset; 1631 1623 } 1632 1624 ///State transition - sets the `blocked` field to Set 1633 1625 pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 1634 1626 impl<S: State> sealed::Sealed for SetBlocked<S> {} 1635 1627 impl<S: State> State for SetBlocked<S> { 1636 - type Author = S::Author; 1637 1628 type Blocked = Set<members::blocked>; 1638 1629 type Uri = S::Uri; 1630 + type Author = S::Author; 1639 1631 } 1640 1632 ///State transition - sets the `uri` field to Set 1641 1633 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1642 1634 impl<S: State> sealed::Sealed for SetUri<S> {} 1643 1635 impl<S: State> State for SetUri<S> { 1644 - type Author = S::Author; 1645 1636 type Blocked = S::Blocked; 1646 1637 type Uri = Set<members::uri>; 1638 + type Author = S::Author; 1639 + } 1640 + ///State transition - sets the `author` field to Set 1641 + pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1642 + impl<S: State> sealed::Sealed for SetAuthor<S> {} 1643 + impl<S: State> State for SetAuthor<S> { 1644 + type Blocked = S::Blocked; 1645 + type Uri = S::Uri; 1646 + type Author = Set<members::author>; 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(()); 1653 1651 ///Marker type for the `blocked` field 1654 1652 pub struct blocked(()); 1655 1653 ///Marker type for the `uri` field 1656 1654 pub struct uri(()); 1655 + ///Marker type for the `author` field 1656 + pub struct author(()); 1657 1657 } 1658 1658 } 1659 1659 ··· 1746 1746 impl<'a, S> BlockedPostBuilder<'a, S> 1747 1747 where 1748 1748 S: blocked_post_state::State, 1749 - S::Author: blocked_post_state::IsSet, 1750 1749 S::Blocked: blocked_post_state::IsSet, 1751 1750 S::Uri: blocked_post_state::IsSet, 1751 + S::Author: blocked_post_state::IsSet, 1752 1752 { 1753 1753 /// Build the final struct 1754 1754 pub fn build(self) -> BlockedPost<'a> { ··· 2234 2234 } 2235 2235 /// State trait tracking which required fields have been set 2236 2236 pub trait State: sealed::Sealed { 2237 - type Uri; 2237 + type Creator; 2238 + type DisplayName; 2238 2239 type Cid; 2239 2240 type Did; 2240 2241 type IndexedAt; 2241 - type Creator; 2242 - type DisplayName; 2242 + type Uri; 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 Uri = Unset; 2248 + type Creator = Unset; 2249 + type DisplayName = Unset; 2249 2250 type Cid = Unset; 2250 2251 type Did = Unset; 2251 2252 type IndexedAt = Unset; 2252 - type Creator = Unset; 2253 - type DisplayName = Unset; 2253 + type Uri = Unset; 2254 2254 } 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>; 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>; 2260 + type DisplayName = S::DisplayName; 2260 2261 type Cid = S::Cid; 2261 2262 type Did = S::Did; 2262 2263 type IndexedAt = S::IndexedAt; 2264 + type Uri = S::Uri; 2265 + } 2266 + ///State transition - sets the `display_name` field to Set 2267 + pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 2268 + impl<S: State> sealed::Sealed for SetDisplayName<S> {} 2269 + impl<S: State> State for SetDisplayName<S> { 2263 2270 type Creator = S::Creator; 2264 - type DisplayName = S::DisplayName; 2271 + type DisplayName = Set<members::display_name>; 2272 + type Cid = S::Cid; 2273 + type Did = S::Did; 2274 + type IndexedAt = S::IndexedAt; 2275 + type Uri = S::Uri; 2265 2276 } 2266 2277 ///State transition - sets the `cid` field to Set 2267 2278 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2268 2279 impl<S: State> sealed::Sealed for SetCid<S> {} 2269 2280 impl<S: State> State for SetCid<S> { 2270 - type Uri = S::Uri; 2281 + type Creator = S::Creator; 2282 + type DisplayName = S::DisplayName; 2271 2283 type Cid = Set<members::cid>; 2272 2284 type Did = S::Did; 2273 2285 type IndexedAt = S::IndexedAt; 2274 - type Creator = S::Creator; 2275 - type DisplayName = S::DisplayName; 2286 + type Uri = S::Uri; 2276 2287 } 2277 2288 ///State transition - sets the `did` field to Set 2278 2289 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2279 2290 impl<S: State> sealed::Sealed for SetDid<S> {} 2280 2291 impl<S: State> State for SetDid<S> { 2281 - type Uri = S::Uri; 2292 + type Creator = S::Creator; 2293 + type DisplayName = S::DisplayName; 2282 2294 type Cid = S::Cid; 2283 2295 type Did = Set<members::did>; 2284 2296 type IndexedAt = S::IndexedAt; 2285 - type Creator = S::Creator; 2286 - type DisplayName = S::DisplayName; 2297 + type Uri = S::Uri; 2287 2298 } 2288 2299 ///State transition - sets the `indexed_at` field to Set 2289 2300 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2290 2301 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2291 2302 impl<S: State> State for SetIndexedAt<S> { 2292 - type Uri = S::Uri; 2303 + type Creator = S::Creator; 2304 + type DisplayName = S::DisplayName; 2293 2305 type Cid = S::Cid; 2294 2306 type Did = S::Did; 2295 2307 type IndexedAt = Set<members::indexed_at>; 2308 + type Uri = S::Uri; 2309 + } 2310 + ///State transition - sets the `uri` field to Set 2311 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2312 + impl<S: State> sealed::Sealed for SetUri<S> {} 2313 + impl<S: State> State for SetUri<S> { 2296 2314 type Creator = S::Creator; 2297 2315 type DisplayName = S::DisplayName; 2298 - } 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 2316 type Cid = S::Cid; 2305 2317 type Did = S::Did; 2306 2318 type IndexedAt = S::IndexedAt; 2307 - type Creator = Set<members::creator>; 2308 - type DisplayName = S::DisplayName; 2309 - } 2310 - ///State transition - sets the `display_name` field to Set 2311 - pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 2312 - impl<S: State> sealed::Sealed for SetDisplayName<S> {} 2313 - impl<S: State> State for SetDisplayName<S> { 2314 - type Uri = S::Uri; 2315 - type Cid = S::Cid; 2316 - type Did = S::Did; 2317 - type IndexedAt = S::IndexedAt; 2318 - type Creator = S::Creator; 2319 - type DisplayName = Set<members::display_name>; 2319 + type Uri = Set<members::uri>; 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 `uri` field 2325 - pub struct uri(()); 2324 + ///Marker type for the `creator` field 2325 + pub struct creator(()); 2326 + ///Marker type for the `display_name` field 2327 + pub struct display_name(()); 2326 2328 ///Marker type for the `cid` field 2327 2329 pub struct cid(()); 2328 2330 ///Marker type for the `did` field 2329 2331 pub struct did(()); 2330 2332 ///Marker type for the `indexed_at` field 2331 2333 pub struct indexed_at(()); 2332 - ///Marker type for the `creator` field 2333 - pub struct creator(()); 2334 - ///Marker type for the `display_name` field 2335 - pub struct display_name(()); 2334 + ///Marker type for the `uri` field 2335 + pub struct uri(()); 2336 2336 } 2337 2337 } 2338 2338 ··· 2648 2648 impl<'a, S> GeneratorViewBuilder<'a, S> 2649 2649 where 2650 2650 S: generator_view_state::State, 2651 - S::Uri: generator_view_state::IsSet, 2651 + S::Creator: generator_view_state::IsSet, 2652 + S::DisplayName: generator_view_state::IsSet, 2652 2653 S::Cid: generator_view_state::IsSet, 2653 2654 S::Did: generator_view_state::IsSet, 2654 2655 S::IndexedAt: generator_view_state::IsSet, 2655 - S::Creator: generator_view_state::IsSet, 2656 - S::DisplayName: generator_view_state::IsSet, 2656 + S::Uri: generator_view_state::IsSet, 2657 2657 { 2658 2658 /// Build the final struct 2659 2659 pub fn build(self) -> GeneratorView<'a> { ··· 3235 3235 } 3236 3236 /// State trait tracking which required fields have been set 3237 3237 pub trait State: sealed::Sealed { 3238 - type NotFound; 3239 3238 type Uri; 3239 + type NotFound; 3240 3240 } 3241 3241 /// Empty state - all required fields are unset 3242 3242 pub struct Empty(()); 3243 3243 impl sealed::Sealed for Empty {} 3244 3244 impl State for Empty { 3245 - type NotFound = Unset; 3246 3245 type Uri = Unset; 3247 - } 3248 - ///State transition - sets the `not_found` field to Set 3249 - pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>); 3250 - impl<S: State> sealed::Sealed for SetNotFound<S> {} 3251 - impl<S: State> State for SetNotFound<S> { 3252 - type NotFound = Set<members::not_found>; 3253 - type Uri = S::Uri; 3246 + type NotFound = Unset; 3254 3247 } 3255 3248 ///State transition - sets the `uri` field to Set 3256 3249 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3257 3250 impl<S: State> sealed::Sealed for SetUri<S> {} 3258 3251 impl<S: State> State for SetUri<S> { 3259 - type NotFound = S::NotFound; 3260 3252 type Uri = Set<members::uri>; 3253 + type NotFound = S::NotFound; 3254 + } 3255 + ///State transition - sets the `not_found` field to Set 3256 + pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>); 3257 + impl<S: State> sealed::Sealed for SetNotFound<S> {} 3258 + impl<S: State> State for SetNotFound<S> { 3259 + type Uri = S::Uri; 3260 + type NotFound = Set<members::not_found>; 3261 3261 } 3262 3262 /// Marker types for field names 3263 3263 #[allow(non_camel_case_types)] 3264 3264 pub mod members { 3265 + ///Marker type for the `uri` field 3266 + pub struct uri(()); 3265 3267 ///Marker type for the `not_found` field 3266 3268 pub struct not_found(()); 3267 - ///Marker type for the `uri` field 3268 - pub struct uri(()); 3269 3269 } 3270 3270 } 3271 3271 ··· 3338 3338 impl<'a, S> NotFoundPostBuilder<'a, S> 3339 3339 where 3340 3340 S: not_found_post_state::State, 3341 - S::NotFound: not_found_post_state::IsSet, 3342 3341 S::Uri: not_found_post_state::IsSet, 3342 + S::NotFound: not_found_post_state::IsSet, 3343 3343 { 3344 3344 /// Build the final struct 3345 3345 pub fn build(self) -> NotFoundPost<'a> { ··· 3442 3442 /// State trait tracking which required fields have been set 3443 3443 pub trait State: sealed::Sealed { 3444 3444 type Record; 3445 + type Cid; 3446 + type Uri; 3445 3447 type Author; 3446 3448 type IndexedAt; 3447 - type Cid; 3448 - type Uri; 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 3454 type Record = Unset; 3455 + type Cid = Unset; 3456 + type Uri = Unset; 3455 3457 type Author = Unset; 3456 3458 type IndexedAt = Unset; 3457 - type Cid = Unset; 3458 - type Uri = Unset; 3459 3459 } 3460 3460 ///State transition - sets the `record` field to Set 3461 3461 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3462 3462 impl<S: State> sealed::Sealed for SetRecord<S> {} 3463 3463 impl<S: State> State for SetRecord<S> { 3464 3464 type Record = Set<members::record>; 3465 + type Cid = S::Cid; 3466 + type Uri = S::Uri; 3465 3467 type Author = S::Author; 3466 3468 type IndexedAt = S::IndexedAt; 3469 + } 3470 + ///State transition - sets the `cid` field to Set 3471 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3472 + impl<S: State> sealed::Sealed for SetCid<S> {} 3473 + impl<S: State> State for SetCid<S> { 3474 + type Record = S::Record; 3475 + type Cid = Set<members::cid>; 3476 + type Uri = S::Uri; 3477 + type Author = S::Author; 3478 + type IndexedAt = S::IndexedAt; 3479 + } 3480 + ///State transition - sets the `uri` field to Set 3481 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3482 + impl<S: State> sealed::Sealed for SetUri<S> {} 3483 + impl<S: State> State for SetUri<S> { 3484 + type Record = S::Record; 3467 3485 type Cid = S::Cid; 3468 - type Uri = S::Uri; 3486 + type Uri = Set<members::uri>; 3487 + type Author = S::Author; 3488 + type IndexedAt = S::IndexedAt; 3469 3489 } 3470 3490 ///State transition - sets the `author` field to Set 3471 3491 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 3472 3492 impl<S: State> sealed::Sealed for SetAuthor<S> {} 3473 3493 impl<S: State> State for SetAuthor<S> { 3474 3494 type Record = S::Record; 3475 - type Author = Set<members::author>; 3476 - type IndexedAt = S::IndexedAt; 3477 3495 type Cid = S::Cid; 3478 3496 type Uri = S::Uri; 3497 + type Author = Set<members::author>; 3498 + type IndexedAt = S::IndexedAt; 3479 3499 } 3480 3500 ///State transition - sets the `indexed_at` field to Set 3481 3501 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3482 3502 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3483 3503 impl<S: State> State for SetIndexedAt<S> { 3484 3504 type Record = S::Record; 3485 - type Author = S::Author; 3486 - type IndexedAt = Set<members::indexed_at>; 3487 3505 type Cid = S::Cid; 3488 3506 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> { 3494 - type Record = S::Record; 3495 3507 type Author = S::Author; 3496 - type IndexedAt = S::IndexedAt; 3497 - type Cid = Set<members::cid>; 3498 - type Uri = S::Uri; 3499 - } 3500 - ///State transition - sets the `uri` field to Set 3501 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3502 - impl<S: State> sealed::Sealed for SetUri<S> {} 3503 - impl<S: State> State for SetUri<S> { 3504 - type Record = S::Record; 3505 - type Author = S::Author; 3506 - type IndexedAt = S::IndexedAt; 3507 - type Cid = S::Cid; 3508 - type Uri = Set<members::uri>; 3508 + type IndexedAt = Set<members::indexed_at>; 3509 3509 } 3510 3510 /// Marker types for field names 3511 3511 #[allow(non_camel_case_types)] 3512 3512 pub mod members { 3513 3513 ///Marker type for the `record` field 3514 3514 pub struct record(()); 3515 - ///Marker type for the `author` field 3516 - pub struct author(()); 3517 - ///Marker type for the `indexed_at` field 3518 - pub struct indexed_at(()); 3519 3515 ///Marker type for the `cid` field 3520 3516 pub struct cid(()); 3521 3517 ///Marker type for the `uri` field 3522 3518 pub struct uri(()); 3519 + ///Marker type for the `author` field 3520 + pub struct author(()); 3521 + ///Marker type for the `indexed_at` field 3522 + pub struct indexed_at(()); 3523 3523 } 3524 3524 } 3525 3525 ··· 3833 3833 where 3834 3834 S: post_view_state::State, 3835 3835 S::Record: post_view_state::IsSet, 3836 + S::Cid: post_view_state::IsSet, 3837 + S::Uri: post_view_state::IsSet, 3836 3838 S::Author: post_view_state::IsSet, 3837 3839 S::IndexedAt: post_view_state::IsSet, 3838 - S::Cid: post_view_state::IsSet, 3839 - S::Uri: post_view_state::IsSet, 3840 3840 { 3841 3841 /// Build the final struct 3842 3842 pub fn build(self) -> PostView<'a> {
+15 -15
crates/weaver-api/src/app_bsky/feed/generator.rs
··· 57 57 /// State trait tracking which required fields have been set 58 58 pub trait State: sealed::Sealed { 59 59 type Did; 60 - type CreatedAt; 61 60 type DisplayName; 61 + type CreatedAt; 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 67 type Did = Unset; 68 - type CreatedAt = Unset; 69 68 type DisplayName = Unset; 69 + type CreatedAt = Unset; 70 70 } 71 71 ///State transition - sets the `did` field to Set 72 72 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 73 73 impl<S: State> sealed::Sealed for SetDid<S> {} 74 74 impl<S: State> State for SetDid<S> { 75 75 type Did = Set<members::did>; 76 - type CreatedAt = S::CreatedAt; 77 76 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 - type DisplayName = S::DisplayName; 77 + type CreatedAt = S::CreatedAt; 86 78 } 87 79 ///State transition - sets the `display_name` field to Set 88 80 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 89 81 impl<S: State> sealed::Sealed for SetDisplayName<S> {} 90 82 impl<S: State> State for SetDisplayName<S> { 91 83 type Did = S::Did; 92 - type CreatedAt = S::CreatedAt; 93 84 type DisplayName = Set<members::display_name>; 85 + type CreatedAt = S::CreatedAt; 86 + } 87 + ///State transition - sets the `created_at` field to Set 88 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 89 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 90 + impl<S: State> State for SetCreatedAt<S> { 91 + type Did = S::Did; 92 + type DisplayName = S::DisplayName; 93 + type CreatedAt = Set<members::created_at>; 94 94 } 95 95 /// Marker types for field names 96 96 #[allow(non_camel_case_types)] 97 97 pub mod members { 98 98 ///Marker type for the `did` field 99 99 pub struct did(()); 100 + ///Marker type for the `display_name` field 101 + pub struct display_name(()); 100 102 ///Marker type for the `created_at` field 101 103 pub struct created_at(()); 102 - ///Marker type for the `display_name` field 103 - pub struct display_name(()); 104 104 } 105 105 } 106 106 ··· 318 318 where 319 319 S: generator_state::State, 320 320 S::Did: generator_state::IsSet, 321 - S::CreatedAt: generator_state::IsSet, 322 321 S::DisplayName: generator_state::IsSet, 322 + S::CreatedAt: generator_state::IsSet, 323 323 { 324 324 /// Build the final struct 325 325 pub fn build(self) -> Generator<'a> {
+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 IndexedAt; 37 36 type Actor; 37 + type IndexedAt; 38 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 IndexedAt = Unset; 45 44 type Actor = Unset; 45 + type IndexedAt = Unset; 46 46 type CreatedAt = Unset; 47 47 } 48 - ///State transition - sets the `indexed_at` field to Set 49 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 51 - impl<S: State> State for SetIndexedAt<S> { 52 - type IndexedAt = Set<members::indexed_at>; 53 - type Actor = S::Actor; 54 - type CreatedAt = S::CreatedAt; 55 - } 56 48 ///State transition - sets the `actor` field to Set 57 49 pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 58 50 impl<S: State> sealed::Sealed for SetActor<S> {} 59 51 impl<S: State> State for SetActor<S> { 60 - type IndexedAt = S::IndexedAt; 61 52 type Actor = Set<members::actor>; 53 + type IndexedAt = S::IndexedAt; 54 + type CreatedAt = S::CreatedAt; 55 + } 56 + ///State transition - sets the `indexed_at` field to Set 57 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 59 + impl<S: State> State for SetIndexedAt<S> { 60 + type Actor = S::Actor; 61 + type IndexedAt = Set<members::indexed_at>; 62 62 type CreatedAt = S::CreatedAt; 63 63 } 64 64 ///State transition - sets the `created_at` field to Set 65 65 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 66 66 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 67 67 impl<S: State> State for SetCreatedAt<S> { 68 - type IndexedAt = S::IndexedAt; 69 68 type Actor = S::Actor; 69 + type IndexedAt = S::IndexedAt; 70 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 `actor` field 76 + pub struct actor(()); 75 77 ///Marker type for the `indexed_at` field 76 78 pub struct indexed_at(()); 77 - ///Marker type for the `actor` field 78 - pub struct actor(()); 79 79 ///Marker type for the `created_at` field 80 80 pub struct created_at(()); 81 81 } ··· 170 170 impl<'a, S> LikeBuilder<'a, S> 171 171 where 172 172 S: like_state::State, 173 - S::IndexedAt: like_state::IsSet, 174 173 S::Actor: like_state::IsSet, 174 + S::IndexedAt: like_state::IsSet, 175 175 S::CreatedAt: like_state::IsSet, 176 176 { 177 177 /// Build the final struct
+13 -13
crates/weaver-api/src/app_bsky/feed/like.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Subject; 40 39 type CreatedAt; 40 + type Subject; 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 Subject = Unset; 47 46 type CreatedAt = Unset; 48 - } 49 - ///State transition - sets the `subject` field to Set 50 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 51 - impl<S: State> sealed::Sealed for SetSubject<S> {} 52 - impl<S: State> State for SetSubject<S> { 53 - type Subject = Set<members::subject>; 54 - type CreatedAt = S::CreatedAt; 47 + type Subject = Unset; 55 48 } 56 49 ///State transition - sets the `created_at` field to Set 57 50 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 58 51 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 59 52 impl<S: State> State for SetCreatedAt<S> { 60 - type Subject = S::Subject; 61 53 type CreatedAt = Set<members::created_at>; 54 + type Subject = S::Subject; 55 + } 56 + ///State transition - sets the `subject` field to Set 57 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetSubject<S> {} 59 + impl<S: State> State for SetSubject<S> { 60 + type CreatedAt = S::CreatedAt; 61 + type Subject = Set<members::subject>; 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 `subject` field 67 - pub struct subject(()); 68 66 ///Marker type for the `created_at` field 69 67 pub struct created_at(()); 68 + ///Marker type for the `subject` field 69 + pub struct subject(()); 70 70 } 71 71 } 72 72 ··· 159 159 impl<'a, S> LikeBuilder<'a, S> 160 160 where 161 161 S: like_state::State, 162 - S::Subject: like_state::IsSet, 163 162 S::CreatedAt: like_state::IsSet, 163 + S::Subject: like_state::IsSet, 164 164 { 165 165 /// Build the final struct 166 166 pub fn build(self) -> Like<'a> {
+13 -13
crates/weaver-api/src/app_bsky/feed/post.rs
··· 1271 1271 } 1272 1272 /// State trait tracking which required fields have been set 1273 1273 pub trait State: sealed::Sealed { 1274 - type End; 1275 1274 type Start; 1275 + type End; 1276 1276 } 1277 1277 /// Empty state - all required fields are unset 1278 1278 pub struct Empty(()); 1279 1279 impl sealed::Sealed for Empty {} 1280 1280 impl State for Empty { 1281 - type End = Unset; 1282 1281 type Start = Unset; 1283 - } 1284 - ///State transition - sets the `end` field to Set 1285 - pub struct SetEnd<S: State = Empty>(PhantomData<fn() -> S>); 1286 - impl<S: State> sealed::Sealed for SetEnd<S> {} 1287 - impl<S: State> State for SetEnd<S> { 1288 - type End = Set<members::end>; 1289 - type Start = S::Start; 1282 + type End = Unset; 1290 1283 } 1291 1284 ///State transition - sets the `start` field to Set 1292 1285 pub struct SetStart<S: State = Empty>(PhantomData<fn() -> S>); 1293 1286 impl<S: State> sealed::Sealed for SetStart<S> {} 1294 1287 impl<S: State> State for SetStart<S> { 1295 - type End = S::End; 1296 1288 type Start = Set<members::start>; 1289 + type End = S::End; 1290 + } 1291 + ///State transition - sets the `end` field to Set 1292 + pub struct SetEnd<S: State = Empty>(PhantomData<fn() -> S>); 1293 + impl<S: State> sealed::Sealed for SetEnd<S> {} 1294 + impl<S: State> State for SetEnd<S> { 1295 + type Start = S::Start; 1296 + type End = Set<members::end>; 1297 1297 } 1298 1298 /// Marker types for field names 1299 1299 #[allow(non_camel_case_types)] 1300 1300 pub mod members { 1301 - ///Marker type for the `end` field 1302 - pub struct end(()); 1303 1301 ///Marker type for the `start` field 1304 1302 pub struct start(()); 1303 + ///Marker type for the `end` field 1304 + pub struct end(()); 1305 1305 } 1306 1306 } 1307 1307 ··· 1371 1371 impl<'a, S> TextSliceBuilder<'a, S> 1372 1372 where 1373 1373 S: text_slice_state::State, 1374 - S::End: text_slice_state::IsSet, 1375 1374 S::Start: text_slice_state::IsSet, 1375 + S::End: text_slice_state::IsSet, 1376 1376 { 1377 1377 /// Build the final struct 1378 1378 pub fn build(self) -> TextSlice<'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 Post; 228 227 type CreatedAt; 228 + type Post; 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 Post = Unset; 235 234 type CreatedAt = Unset; 236 - } 237 - ///State transition - sets the `post` field to Set 238 - pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 239 - impl<S: State> sealed::Sealed for SetPost<S> {} 240 - impl<S: State> State for SetPost<S> { 241 - type Post = Set<members::post>; 242 - type CreatedAt = S::CreatedAt; 235 + type Post = Unset; 243 236 } 244 237 ///State transition - sets the `created_at` field to Set 245 238 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 246 239 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 247 240 impl<S: State> State for SetCreatedAt<S> { 248 - type Post = S::Post; 249 241 type CreatedAt = Set<members::created_at>; 242 + type Post = S::Post; 243 + } 244 + ///State transition - sets the `post` field to Set 245 + pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 246 + impl<S: State> sealed::Sealed for SetPost<S> {} 247 + impl<S: State> State for SetPost<S> { 248 + type CreatedAt = S::CreatedAt; 249 + type Post = Set<members::post>; 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 `post` field 255 - pub struct post(()); 256 254 ///Marker type for the `created_at` field 257 255 pub struct created_at(()); 256 + ///Marker type for the `post` field 257 + pub struct post(()); 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::Post: postgate_state::IsSet, 371 370 S::CreatedAt: postgate_state::IsSet, 371 + S::Post: 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/threadgate.rs
··· 463 463 } 464 464 /// State trait tracking which required fields have been set 465 465 pub trait State: sealed::Sealed { 466 - type CreatedAt; 467 466 type Post; 467 + type CreatedAt; 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 CreatedAt = Unset; 474 473 type Post = Unset; 475 - } 476 - ///State transition - sets the `created_at` field to Set 477 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 478 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 479 - impl<S: State> State for SetCreatedAt<S> { 480 - type CreatedAt = Set<members::created_at>; 481 - type Post = S::Post; 474 + type CreatedAt = Unset; 482 475 } 483 476 ///State transition - sets the `post` field to Set 484 477 pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 485 478 impl<S: State> sealed::Sealed for SetPost<S> {} 486 479 impl<S: State> State for SetPost<S> { 487 - type CreatedAt = S::CreatedAt; 488 480 type Post = Set<members::post>; 481 + type CreatedAt = S::CreatedAt; 482 + } 483 + ///State transition - sets the `created_at` field to Set 484 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 485 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 486 + impl<S: State> State for SetCreatedAt<S> { 487 + type Post = S::Post; 488 + type CreatedAt = Set<members::created_at>; 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 `created_at` field 494 - pub struct created_at(()); 495 493 ///Marker type for the `post` field 496 494 pub struct post(()); 495 + ///Marker type for the `created_at` field 496 + pub struct created_at(()); 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::CreatedAt: threadgate_state::IsSet, 607 606 S::Post: threadgate_state::IsSet, 607 + S::CreatedAt: threadgate_state::IsSet, 608 608 { 609 609 /// Build the final struct 610 610 pub fn build(self) -> Threadgate<'a> {
+187 -187
crates/weaver-api/src/app_bsky/graph.rs
··· 82 82 } 83 83 /// State trait tracking which required fields have been set 84 84 pub trait State: sealed::Sealed { 85 - type Uri; 86 85 type Subject; 86 + type Uri; 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 Uri = Unset; 93 92 type Subject = Unset; 94 - } 95 - ///State transition - sets the `uri` field to Set 96 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 97 - impl<S: State> sealed::Sealed for SetUri<S> {} 98 - impl<S: State> State for SetUri<S> { 99 - type Uri = Set<members::uri>; 100 - type Subject = S::Subject; 93 + type Uri = Unset; 101 94 } 102 95 ///State transition - sets the `subject` field to Set 103 96 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 104 97 impl<S: State> sealed::Sealed for SetSubject<S> {} 105 98 impl<S: State> State for SetSubject<S> { 106 - type Uri = S::Uri; 107 99 type Subject = Set<members::subject>; 100 + type Uri = S::Uri; 101 + } 102 + ///State transition - sets the `uri` field to Set 103 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 104 + impl<S: State> sealed::Sealed for SetUri<S> {} 105 + impl<S: State> State for SetUri<S> { 106 + type Subject = S::Subject; 107 + type Uri = Set<members::uri>; 108 108 } 109 109 /// Marker types for field names 110 110 #[allow(non_camel_case_types)] 111 111 pub mod members { 112 - ///Marker type for the `uri` field 113 - pub struct uri(()); 114 112 ///Marker type for the `subject` field 115 113 pub struct subject(()); 114 + ///Marker type for the `uri` field 115 + pub struct uri(()); 116 116 } 117 117 } 118 118 ··· 185 185 impl<'a, S> ListItemViewBuilder<'a, S> 186 186 where 187 187 S: list_item_view_state::State, 188 - S::Uri: list_item_view_state::IsSet, 189 188 S::Subject: list_item_view_state::IsSet, 189 + S::Uri: list_item_view_state::IsSet, 190 190 { 191 191 /// Build the final struct 192 192 pub fn build(self) -> ListItemView<'a> { ··· 1283 1283 } 1284 1284 /// State trait tracking which required fields have been set 1285 1285 pub trait State: sealed::Sealed { 1286 + type Uri; 1287 + type IndexedAt; 1288 + type Creator; 1289 + type Cid; 1286 1290 type Purpose; 1287 1291 type Name; 1288 - type Cid; 1289 - type Creator; 1290 - type IndexedAt; 1291 - type Uri; 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 + type Uri = Unset; 1298 + type IndexedAt = Unset; 1299 + type Creator = Unset; 1300 + type Cid = Unset; 1297 1301 type Purpose = Unset; 1298 1302 type Name = Unset; 1299 - type Cid = Unset; 1300 - type Creator = Unset; 1301 - type IndexedAt = Unset; 1302 - type Uri = Unset; 1303 1303 } 1304 - ///State transition - sets the `purpose` field to Set 1305 - pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1306 - impl<S: State> sealed::Sealed for SetPurpose<S> {} 1307 - impl<S: State> State for SetPurpose<S> { 1308 - type Purpose = Set<members::purpose>; 1309 - type Name = S::Name; 1310 - type Cid = S::Cid; 1304 + ///State transition - sets the `uri` field to Set 1305 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1306 + impl<S: State> sealed::Sealed for SetUri<S> {} 1307 + impl<S: State> State for SetUri<S> { 1308 + type Uri = Set<members::uri>; 1309 + type IndexedAt = S::IndexedAt; 1311 1310 type Creator = S::Creator; 1312 - type IndexedAt = S::IndexedAt; 1313 - type Uri = S::Uri; 1311 + type Cid = S::Cid; 1312 + type Purpose = S::Purpose; 1313 + type Name = S::Name; 1314 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>; 1315 + ///State transition - sets the `indexed_at` field to Set 1316 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1317 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1318 + impl<S: State> State for SetIndexedAt<S> { 1319 + type Uri = S::Uri; 1320 + type IndexedAt = Set<members::indexed_at>; 1321 + type Creator = S::Creator; 1321 1322 type Cid = S::Cid; 1322 - type Creator = S::Creator; 1323 - type IndexedAt = S::IndexedAt; 1324 - type Uri = S::Uri; 1325 - } 1326 - ///State transition - sets the `cid` field to Set 1327 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1328 - impl<S: State> sealed::Sealed for SetCid<S> {} 1329 - impl<S: State> State for SetCid<S> { 1330 1323 type Purpose = S::Purpose; 1331 1324 type Name = S::Name; 1332 - type Cid = Set<members::cid>; 1333 - type Creator = S::Creator; 1334 - type IndexedAt = S::IndexedAt; 1335 - type Uri = S::Uri; 1336 1325 } 1337 1326 ///State transition - sets the `creator` field to Set 1338 1327 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1339 1328 impl<S: State> sealed::Sealed for SetCreator<S> {} 1340 1329 impl<S: State> State for SetCreator<S> { 1330 + type Uri = S::Uri; 1331 + type IndexedAt = S::IndexedAt; 1332 + type Creator = Set<members::creator>; 1333 + type Cid = S::Cid; 1341 1334 type Purpose = S::Purpose; 1342 1335 type Name = S::Name; 1343 - type Cid = S::Cid; 1344 - type Creator = Set<members::creator>; 1345 - type IndexedAt = S::IndexedAt; 1346 - type Uri = S::Uri; 1347 1336 } 1348 - ///State transition - sets the `indexed_at` field to Set 1349 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1350 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1351 - impl<S: State> State for SetIndexedAt<S> { 1337 + ///State transition - sets the `cid` field to Set 1338 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1339 + impl<S: State> sealed::Sealed for SetCid<S> {} 1340 + impl<S: State> State for SetCid<S> { 1341 + type Uri = S::Uri; 1342 + type IndexedAt = S::IndexedAt; 1343 + type Creator = S::Creator; 1344 + type Cid = Set<members::cid>; 1352 1345 type Purpose = S::Purpose; 1353 1346 type Name = S::Name; 1347 + } 1348 + ///State transition - sets the `purpose` field to Set 1349 + pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1350 + impl<S: State> sealed::Sealed for SetPurpose<S> {} 1351 + impl<S: State> State for SetPurpose<S> { 1352 + type Uri = S::Uri; 1353 + type IndexedAt = S::IndexedAt; 1354 + type Creator = S::Creator; 1354 1355 type Cid = S::Cid; 1355 - type Creator = S::Creator; 1356 - type IndexedAt = Set<members::indexed_at>; 1356 + type Purpose = Set<members::purpose>; 1357 + type Name = S::Name; 1358 + } 1359 + ///State transition - sets the `name` field to Set 1360 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1361 + impl<S: State> sealed::Sealed for SetName<S> {} 1362 + impl<S: State> State for SetName<S> { 1357 1363 type Uri = S::Uri; 1358 - } 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> { 1364 + type IndexedAt = S::IndexedAt; 1365 + type Creator = S::Creator; 1366 + type Cid = S::Cid; 1363 1367 type Purpose = S::Purpose; 1364 - type Name = S::Name; 1365 - type Cid = S::Cid; 1366 - type Creator = S::Creator; 1367 - type IndexedAt = S::IndexedAt; 1368 - type Uri = Set<members::uri>; 1368 + type Name = Set<members::name>; 1369 1369 } 1370 1370 /// Marker types for field names 1371 1371 #[allow(non_camel_case_types)] 1372 1372 pub mod members { 1373 + ///Marker type for the `uri` field 1374 + pub struct uri(()); 1375 + ///Marker type for the `indexed_at` field 1376 + pub struct indexed_at(()); 1377 + ///Marker type for the `creator` field 1378 + pub struct creator(()); 1379 + ///Marker type for the `cid` field 1380 + pub struct cid(()); 1373 1381 ///Marker type for the `purpose` field 1374 1382 pub struct purpose(()); 1375 1383 ///Marker type for the `name` field 1376 1384 pub struct name(()); 1377 - ///Marker type for the `cid` field 1378 - pub struct cid(()); 1379 - ///Marker type for the `creator` field 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 ··· 1661 1661 impl<'a, S> ListViewBuilder<'a, S> 1662 1662 where 1663 1663 S: list_view_state::State, 1664 + S::Uri: list_view_state::IsSet, 1665 + S::IndexedAt: list_view_state::IsSet, 1666 + S::Creator: list_view_state::IsSet, 1667 + S::Cid: list_view_state::IsSet, 1664 1668 S::Purpose: list_view_state::IsSet, 1665 1669 S::Name: list_view_state::IsSet, 1666 - S::Cid: list_view_state::IsSet, 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 1845 type Name; 1845 - type Purpose; 1846 1846 type Uri; 1847 - type Cid; 1847 + type Purpose; 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 1854 type Name = Unset; 1855 + type Uri = Unset; 1854 1856 type Purpose = Unset; 1855 - type Uri = Unset; 1856 - type Cid = Unset; 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>; 1863 + type Name = S::Name; 1864 + type Uri = S::Uri; 1865 + type Purpose = S::Purpose; 1857 1866 } 1858 1867 ///State transition - sets the `name` field to Set 1859 1868 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1860 1869 impl<S: State> sealed::Sealed for SetName<S> {} 1861 1870 impl<S: State> State for SetName<S> { 1862 - type Name = Set<members::name>; 1863 - type Purpose = S::Purpose; 1864 - type Uri = S::Uri; 1865 1871 type Cid = S::Cid; 1866 - } 1867 - ///State transition - sets the `purpose` field to Set 1868 - pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1869 - impl<S: State> sealed::Sealed for SetPurpose<S> {} 1870 - impl<S: State> State for SetPurpose<S> { 1871 - type Name = S::Name; 1872 - type Purpose = Set<members::purpose>; 1872 + type Name = Set<members::name>; 1873 1873 type Uri = S::Uri; 1874 - type Cid = S::Cid; 1874 + type Purpose = S::Purpose; 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 1881 type Name = S::Name; 1881 - type Purpose = S::Purpose; 1882 1882 type Uri = Set<members::uri>; 1883 - type Cid = S::Cid; 1883 + type Purpose = S::Purpose; 1884 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> { 1885 + ///State transition - sets the `purpose` field to Set 1886 + pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1887 + impl<S: State> sealed::Sealed for SetPurpose<S> {} 1888 + impl<S: State> State for SetPurpose<S> { 1889 + type Cid = S::Cid; 1889 1890 type Name = S::Name; 1890 - type Purpose = S::Purpose; 1891 1891 type Uri = S::Uri; 1892 - type Cid = Set<members::cid>; 1892 + type Purpose = Set<members::purpose>; 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 1899 ///Marker type for the `name` field 1898 1900 pub struct name(()); 1901 + ///Marker type for the `uri` field 1902 + pub struct uri(()); 1899 1903 ///Marker type for the `purpose` field 1900 1904 pub struct purpose(()); 1901 - ///Marker type for the `uri` field 1902 - pub struct uri(()); 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 2122 S::Name: list_view_basic_state::IsSet, 2122 - S::Purpose: list_view_basic_state::IsSet, 2123 2123 S::Uri: list_view_basic_state::IsSet, 2124 - S::Cid: list_view_basic_state::IsSet, 2124 + S::Purpose: list_view_basic_state::IsSet, 2125 2125 { 2126 2126 /// Build the final struct 2127 2127 pub fn build(self) -> ListViewBasic<'a> { ··· 2298 2298 } 2299 2299 /// State trait tracking which required fields have been set 2300 2300 pub trait State: sealed::Sealed { 2301 - type Actor; 2302 2301 type NotFound; 2302 + type Actor; 2303 2303 } 2304 2304 /// Empty state - all required fields are unset 2305 2305 pub struct Empty(()); 2306 2306 impl sealed::Sealed for Empty {} 2307 2307 impl State for Empty { 2308 - type Actor = Unset; 2309 2308 type NotFound = Unset; 2310 - } 2311 - ///State transition - sets the `actor` field to Set 2312 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 2313 - impl<S: State> sealed::Sealed for SetActor<S> {} 2314 - impl<S: State> State for SetActor<S> { 2315 - type Actor = Set<members::actor>; 2316 - type NotFound = S::NotFound; 2309 + type Actor = Unset; 2317 2310 } 2318 2311 ///State transition - sets the `not_found` field to Set 2319 2312 pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>); 2320 2313 impl<S: State> sealed::Sealed for SetNotFound<S> {} 2321 2314 impl<S: State> State for SetNotFound<S> { 2322 - type Actor = S::Actor; 2323 2315 type NotFound = Set<members::not_found>; 2316 + type Actor = S::Actor; 2317 + } 2318 + ///State transition - sets the `actor` field to Set 2319 + pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 2320 + impl<S: State> sealed::Sealed for SetActor<S> {} 2321 + impl<S: State> State for SetActor<S> { 2322 + type NotFound = S::NotFound; 2323 + type Actor = Set<members::actor>; 2324 2324 } 2325 2325 /// Marker types for field names 2326 2326 #[allow(non_camel_case_types)] 2327 2327 pub mod members { 2328 + ///Marker type for the `not_found` field 2329 + pub struct not_found(()); 2328 2330 ///Marker type for the `actor` field 2329 2331 pub struct actor(()); 2330 - ///Marker type for the `not_found` field 2331 - pub struct not_found(()); 2332 2332 } 2333 2333 } 2334 2334 ··· 2401 2401 impl<'a, S> NotFoundActorBuilder<'a, S> 2402 2402 where 2403 2403 S: not_found_actor_state::State, 2404 - S::Actor: not_found_actor_state::IsSet, 2405 2404 S::NotFound: not_found_actor_state::IsSet, 2405 + S::Actor: not_found_actor_state::IsSet, 2406 2406 { 2407 2407 /// Build the final struct 2408 2408 pub fn build(self) -> NotFoundActor<'a> { ··· 2706 2706 /// State trait tracking which required fields have been set 2707 2707 pub trait State: sealed::Sealed { 2708 2708 type Creator; 2709 - type Uri; 2710 - type Record; 2711 2709 type IndexedAt; 2710 + type Uri; 2712 2711 type Cid; 2712 + type Record; 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 2718 type Creator = Unset; 2719 - type Uri = Unset; 2720 - type Record = Unset; 2721 2719 type IndexedAt = Unset; 2720 + type Uri = Unset; 2722 2721 type Cid = Unset; 2722 + type Record = Unset; 2723 2723 } 2724 2724 ///State transition - sets the `creator` field to Set 2725 2725 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 2726 2726 impl<S: State> sealed::Sealed for SetCreator<S> {} 2727 2727 impl<S: State> State for SetCreator<S> { 2728 2728 type Creator = Set<members::creator>; 2729 + type IndexedAt = S::IndexedAt; 2729 2730 type Uri = S::Uri; 2731 + type Cid = S::Cid; 2730 2732 type Record = S::Record; 2731 - type IndexedAt = S::IndexedAt; 2733 + } 2734 + ///State transition - sets the `indexed_at` field to Set 2735 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2736 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2737 + impl<S: State> State for SetIndexedAt<S> { 2738 + type Creator = S::Creator; 2739 + type IndexedAt = Set<members::indexed_at>; 2740 + type Uri = S::Uri; 2732 2741 type Cid = S::Cid; 2742 + type Record = S::Record; 2733 2743 } 2734 2744 ///State transition - sets the `uri` field to Set 2735 2745 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2736 2746 impl<S: State> sealed::Sealed for SetUri<S> {} 2737 2747 impl<S: State> State for SetUri<S> { 2738 2748 type Creator = S::Creator; 2749 + type IndexedAt = S::IndexedAt; 2739 2750 type Uri = Set<members::uri>; 2751 + type Cid = S::Cid; 2740 2752 type Record = S::Record; 2753 + } 2754 + ///State transition - sets the `cid` field to Set 2755 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2756 + impl<S: State> sealed::Sealed for SetCid<S> {} 2757 + impl<S: State> State for SetCid<S> { 2758 + type Creator = S::Creator; 2741 2759 type IndexedAt = S::IndexedAt; 2742 - type Cid = S::Cid; 2760 + type Uri = S::Uri; 2761 + type Cid = Set<members::cid>; 2762 + type Record = S::Record; 2743 2763 } 2744 2764 ///State transition - sets the `record` field to Set 2745 2765 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 2746 2766 impl<S: State> sealed::Sealed for SetRecord<S> {} 2747 2767 impl<S: State> State for SetRecord<S> { 2748 2768 type Creator = S::Creator; 2749 - type Uri = S::Uri; 2750 - type Record = Set<members::record>; 2751 2769 type IndexedAt = S::IndexedAt; 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> { 2758 - type Creator = S::Creator; 2759 2770 type Uri = S::Uri; 2760 - type Record = S::Record; 2761 - type IndexedAt = Set<members::indexed_at>; 2762 2771 type Cid = S::Cid; 2763 - } 2764 - ///State transition - sets the `cid` field to Set 2765 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2766 - impl<S: State> sealed::Sealed for SetCid<S> {} 2767 - impl<S: State> State for SetCid<S> { 2768 - type Creator = S::Creator; 2769 - type Uri = S::Uri; 2770 - type Record = S::Record; 2771 - type IndexedAt = S::IndexedAt; 2772 - type Cid = Set<members::cid>; 2772 + type Record = Set<members::record>; 2773 2773 } 2774 2774 /// Marker types for field names 2775 2775 #[allow(non_camel_case_types)] 2776 2776 pub mod members { 2777 2777 ///Marker type for the `creator` field 2778 2778 pub struct creator(()); 2779 - ///Marker type for the `uri` field 2780 - pub struct uri(()); 2781 - ///Marker type for the `record` field 2782 - pub struct record(()); 2783 2779 ///Marker type for the `indexed_at` field 2784 2780 pub struct indexed_at(()); 2781 + ///Marker type for the `uri` field 2782 + pub struct uri(()); 2785 2783 ///Marker type for the `cid` field 2786 2784 pub struct cid(()); 2785 + ///Marker type for the `record` field 2786 + pub struct record(()); 2787 2787 } 2788 2788 } 2789 2789 ··· 3037 3037 where 3038 3038 S: starter_pack_view_state::State, 3039 3039 S::Creator: starter_pack_view_state::IsSet, 3040 - S::Uri: starter_pack_view_state::IsSet, 3041 - S::Record: starter_pack_view_state::IsSet, 3042 3040 S::IndexedAt: starter_pack_view_state::IsSet, 3041 + S::Uri: starter_pack_view_state::IsSet, 3043 3042 S::Cid: starter_pack_view_state::IsSet, 3043 + S::Record: 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 Cid; 3193 3192 type Creator; 3194 3193 type IndexedAt; 3194 + type Record; 3195 3195 type Uri; 3196 - type Record; 3196 + type Cid; 3197 3197 } 3198 3198 /// Empty state - all required fields are unset 3199 3199 pub struct Empty(()); 3200 3200 impl sealed::Sealed for Empty {} 3201 3201 impl State for Empty { 3202 - type Cid = Unset; 3203 3202 type Creator = Unset; 3204 3203 type IndexedAt = Unset; 3205 - type Uri = Unset; 3206 3204 type Record = Unset; 3207 - } 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 - type Creator = S::Creator; 3214 - type IndexedAt = S::IndexedAt; 3215 - type Uri = S::Uri; 3216 - type Record = S::Record; 3205 + type Uri = Unset; 3206 + type Cid = Unset; 3217 3207 } 3218 3208 ///State transition - sets the `creator` field to Set 3219 3209 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 3220 3210 impl<S: State> sealed::Sealed for SetCreator<S> {} 3221 3211 impl<S: State> State for SetCreator<S> { 3222 - type Cid = S::Cid; 3223 3212 type Creator = Set<members::creator>; 3224 3213 type IndexedAt = S::IndexedAt; 3214 + type Record = S::Record; 3225 3215 type Uri = S::Uri; 3226 - type Record = S::Record; 3216 + type Cid = S::Cid; 3227 3217 } 3228 3218 ///State transition - sets the `indexed_at` field to Set 3229 3219 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3230 3220 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3231 3221 impl<S: State> State for SetIndexedAt<S> { 3222 + type Creator = S::Creator; 3223 + type IndexedAt = Set<members::indexed_at>; 3224 + type Record = S::Record; 3225 + type Uri = S::Uri; 3232 3226 type Cid = S::Cid; 3227 + } 3228 + ///State transition - sets the `record` field to Set 3229 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3230 + impl<S: State> sealed::Sealed for SetRecord<S> {} 3231 + impl<S: State> State for SetRecord<S> { 3233 3232 type Creator = S::Creator; 3234 - type IndexedAt = Set<members::indexed_at>; 3233 + type IndexedAt = S::IndexedAt; 3234 + type Record = Set<members::record>; 3235 3235 type Uri = S::Uri; 3236 - type Record = S::Record; 3236 + type Cid = S::Cid; 3237 3237 } 3238 3238 ///State transition - sets the `uri` field to Set 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 Cid = S::Cid; 3243 3242 type Creator = S::Creator; 3244 3243 type IndexedAt = S::IndexedAt; 3245 - type Uri = Set<members::uri>; 3246 3244 type Record = S::Record; 3247 - } 3248 - ///State transition - sets the `record` field to Set 3249 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3250 - impl<S: State> sealed::Sealed for SetRecord<S> {} 3251 - impl<S: State> State for SetRecord<S> { 3245 + type Uri = Set<members::uri>; 3252 3246 type Cid = S::Cid; 3247 + } 3248 + ///State transition - sets the `cid` field to Set 3249 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3250 + impl<S: State> sealed::Sealed for SetCid<S> {} 3251 + impl<S: State> State for SetCid<S> { 3253 3252 type Creator = S::Creator; 3254 3253 type IndexedAt = S::IndexedAt; 3254 + type Record = S::Record; 3255 3255 type Uri = S::Uri; 3256 - type Record = Set<members::record>; 3256 + type Cid = Set<members::cid>; 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 `cid` field 3262 - pub struct cid(()); 3263 3261 ///Marker type for the `creator` field 3264 3262 pub struct creator(()); 3265 3263 ///Marker type for the `indexed_at` field 3266 3264 pub struct indexed_at(()); 3267 - ///Marker type for the `uri` field 3268 - pub struct uri(()); 3269 3265 ///Marker type for the `record` field 3270 3266 pub struct record(()); 3267 + ///Marker type for the `uri` field 3268 + pub struct uri(()); 3269 + ///Marker type for the `cid` field 3270 + pub struct cid(()); 3271 3271 } 3272 3272 } 3273 3273 ··· 3478 3478 impl<'a, S> StarterPackViewBasicBuilder<'a, S> 3479 3479 where 3480 3480 S: starter_pack_view_basic_state::State, 3481 - S::Cid: starter_pack_view_basic_state::IsSet, 3482 3481 S::Creator: starter_pack_view_basic_state::IsSet, 3483 3482 S::IndexedAt: starter_pack_view_basic_state::IsSet, 3484 - S::Uri: starter_pack_view_basic_state::IsSet, 3485 3483 S::Record: starter_pack_view_basic_state::IsSet, 3484 + S::Uri: starter_pack_view_basic_state::IsSet, 3485 + S::Cid: starter_pack_view_basic_state::IsSet, 3486 3486 { 3487 3487 /// Build the final struct 3488 3488 pub fn build(self) -> StarterPackViewBasic<'a> {
+13 -13
crates/weaver-api/src/app_bsky/graph/follow.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Subject; 40 39 type CreatedAt; 40 + type Subject; 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 Subject = Unset; 47 46 type CreatedAt = Unset; 48 - } 49 - ///State transition - sets the `subject` field to Set 50 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 51 - impl<S: State> sealed::Sealed for SetSubject<S> {} 52 - impl<S: State> State for SetSubject<S> { 53 - type Subject = Set<members::subject>; 54 - type CreatedAt = S::CreatedAt; 47 + type Subject = Unset; 55 48 } 56 49 ///State transition - sets the `created_at` field to Set 57 50 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 58 51 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 59 52 impl<S: State> State for SetCreatedAt<S> { 60 - type Subject = S::Subject; 61 53 type CreatedAt = Set<members::created_at>; 54 + type Subject = S::Subject; 55 + } 56 + ///State transition - sets the `subject` field to Set 57 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetSubject<S> {} 59 + impl<S: State> State for SetSubject<S> { 60 + type CreatedAt = S::CreatedAt; 61 + type Subject = Set<members::subject>; 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 `subject` field 67 - pub struct subject(()); 68 66 ///Marker type for the `created_at` field 69 67 pub struct created_at(()); 68 + ///Marker type for the `subject` field 69 + pub struct subject(()); 70 70 } 71 71 } 72 72 ··· 159 159 impl<'a, S> FollowBuilder<'a, S> 160 160 where 161 161 S: follow_state::State, 162 - S::Subject: follow_state::IsSet, 163 162 S::CreatedAt: follow_state::IsSet, 163 + S::Subject: follow_state::IsSet, 164 164 { 165 165 /// Build the final struct 166 166 pub fn build(self) -> Follow<'a> {
+24 -24
crates/weaver-api/src/app_bsky/graph/list.rs
··· 51 51 } 52 52 /// State trait tracking which required fields have been set 53 53 pub trait State: sealed::Sealed { 54 - type Name; 55 - type CreatedAt; 56 54 type Purpose; 55 + type CreatedAt; 56 + type Name; 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 + type Purpose = Unset; 63 + type CreatedAt = Unset; 62 64 type Name = Unset; 63 - type CreatedAt = Unset; 64 - type Purpose = Unset; 65 65 } 66 - ///State transition - sets the `name` field to Set 67 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 68 - impl<S: State> sealed::Sealed for SetName<S> {} 69 - impl<S: State> State for SetName<S> { 70 - type Name = Set<members::name>; 66 + ///State transition - sets the `purpose` field to Set 67 + pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 68 + impl<S: State> sealed::Sealed for SetPurpose<S> {} 69 + impl<S: State> State for SetPurpose<S> { 70 + type Purpose = Set<members::purpose>; 71 71 type CreatedAt = S::CreatedAt; 72 - type Purpose = S::Purpose; 72 + type Name = S::Name; 73 73 } 74 74 ///State transition - sets the `created_at` field to Set 75 75 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 76 76 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 77 77 impl<S: State> State for SetCreatedAt<S> { 78 - type Name = S::Name; 79 - type CreatedAt = Set<members::created_at>; 80 78 type Purpose = S::Purpose; 79 + type CreatedAt = Set<members::created_at>; 80 + type Name = S::Name; 81 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; 82 + ///State transition - sets the `name` field to Set 83 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 84 + impl<S: State> sealed::Sealed for SetName<S> {} 85 + impl<S: State> State for SetName<S> { 86 + type Purpose = S::Purpose; 87 87 type CreatedAt = S::CreatedAt; 88 - type Purpose = Set<members::purpose>; 88 + type Name = Set<members::name>; 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 `purpose` field 94 + pub struct purpose(()); 95 + ///Marker type for the `created_at` field 96 + pub struct created_at(()); 93 97 ///Marker type for the `name` field 94 98 pub struct name(()); 95 - ///Marker type for the `created_at` field 96 - pub struct created_at(()); 97 - ///Marker type for the `purpose` field 98 - pub struct purpose(()); 99 99 } 100 100 } 101 101 ··· 268 268 impl<'a, S> ListBuilder<'a, S> 269 269 where 270 270 S: list_state::State, 271 - S::Name: list_state::IsSet, 272 - S::CreatedAt: list_state::IsSet, 273 271 S::Purpose: list_state::IsSet, 272 + S::CreatedAt: list_state::IsSet, 273 + S::Name: list_state::IsSet, 274 274 { 275 275 /// Build the final struct 276 276 pub fn build(self) -> List<'a> {
+24 -24
crates/weaver-api/src/app_bsky/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/app_bsky/graph/starterpack.rs
··· 367 367 /// State trait tracking which required fields have been set 368 368 pub trait State: sealed::Sealed { 369 369 type Name; 370 - type List; 371 370 type CreatedAt; 371 + type List; 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 377 type Name = Unset; 378 - type List = Unset; 379 378 type CreatedAt = Unset; 379 + type List = Unset; 380 380 } 381 381 ///State transition - sets the `name` field to Set 382 382 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 383 383 impl<S: State> sealed::Sealed for SetName<S> {} 384 384 impl<S: State> State for SetName<S> { 385 385 type Name = Set<members::name>; 386 - type List = S::List; 387 386 type CreatedAt = S::CreatedAt; 388 - } 389 - ///State transition - sets the `list` field to Set 390 - pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 391 - impl<S: State> sealed::Sealed for SetList<S> {} 392 - impl<S: State> State for SetList<S> { 393 - type Name = S::Name; 394 - type List = Set<members::list>; 395 - type CreatedAt = S::CreatedAt; 387 + type List = S::List; 396 388 } 397 389 ///State transition - sets the `created_at` field to Set 398 390 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 399 391 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 400 392 impl<S: State> State for SetCreatedAt<S> { 401 393 type Name = S::Name; 402 - type List = S::List; 403 394 type CreatedAt = Set<members::created_at>; 395 + type List = S::List; 396 + } 397 + ///State transition - sets the `list` field to Set 398 + pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 399 + impl<S: State> sealed::Sealed for SetList<S> {} 400 + impl<S: State> State for SetList<S> { 401 + type Name = S::Name; 402 + type CreatedAt = S::CreatedAt; 403 + type List = Set<members::list>; 404 404 } 405 405 /// Marker types for field names 406 406 #[allow(non_camel_case_types)] 407 407 pub mod members { 408 408 ///Marker type for the `name` field 409 409 pub struct name(()); 410 + ///Marker type for the `created_at` field 411 + pub struct created_at(()); 410 412 ///Marker type for the `list` field 411 413 pub struct list(()); 412 - ///Marker type for the `created_at` field 413 - pub struct created_at(()); 414 414 } 415 415 } 416 416 ··· 564 564 where 565 565 S: starterpack_state::State, 566 566 S::Name: starterpack_state::IsSet, 567 - S::List: starterpack_state::IsSet, 568 567 S::CreatedAt: starterpack_state::IsSet, 568 + S::List: starterpack_state::IsSet, 569 569 { 570 570 /// Build the final struct 571 571 pub fn build(self) -> Starterpack<'a> {
+17 -17
crates/weaver-api/src/app_bsky/graph/verification.rs
··· 43 43 pub trait State: sealed::Sealed { 44 44 type Handle; 45 45 type DisplayName; 46 - type Subject; 47 46 type CreatedAt; 47 + type Subject; 48 48 } 49 49 /// Empty state - all required fields are unset 50 50 pub struct Empty(()); ··· 52 52 impl State for Empty { 53 53 type Handle = Unset; 54 54 type DisplayName = Unset; 55 - type Subject = Unset; 56 55 type CreatedAt = Unset; 56 + type Subject = Unset; 57 57 } 58 58 ///State transition - sets the `handle` field to Set 59 59 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); ··· 61 61 impl<S: State> State for SetHandle<S> { 62 62 type Handle = Set<members::handle>; 63 63 type DisplayName = S::DisplayName; 64 - type Subject = S::Subject; 65 64 type CreatedAt = S::CreatedAt; 65 + type Subject = S::Subject; 66 66 } 67 67 ///State transition - sets the `display_name` field to Set 68 68 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); ··· 70 70 impl<S: State> State for SetDisplayName<S> { 71 71 type Handle = S::Handle; 72 72 type DisplayName = Set<members::display_name>; 73 - type Subject = S::Subject; 74 - type CreatedAt = S::CreatedAt; 75 - } 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 - type DisplayName = S::DisplayName; 82 - type Subject = Set<members::subject>; 83 73 type CreatedAt = S::CreatedAt; 74 + type Subject = S::Subject; 84 75 } 85 76 ///State transition - sets the `created_at` field to Set 86 77 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); ··· 88 79 impl<S: State> State for SetCreatedAt<S> { 89 80 type Handle = S::Handle; 90 81 type DisplayName = S::DisplayName; 91 - type Subject = S::Subject; 92 82 type CreatedAt = Set<members::created_at>; 83 + type Subject = S::Subject; 84 + } 85 + ///State transition - sets the `subject` field to Set 86 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 87 + impl<S: State> sealed::Sealed for SetSubject<S> {} 88 + impl<S: State> State for SetSubject<S> { 89 + type Handle = S::Handle; 90 + type DisplayName = S::DisplayName; 91 + type CreatedAt = S::CreatedAt; 92 + type Subject = Set<members::subject>; 93 93 } 94 94 /// Marker types for field names 95 95 #[allow(non_camel_case_types)] ··· 98 98 pub struct handle(()); 99 99 ///Marker type for the `display_name` field 100 100 pub struct display_name(()); 101 + ///Marker type for the `created_at` field 102 + pub struct created_at(()); 101 103 ///Marker type for the `subject` field 102 104 pub struct subject(()); 103 - ///Marker type for the `created_at` field 104 - pub struct created_at(()); 105 105 } 106 106 } 107 107 ··· 216 216 S: verification_state::State, 217 217 S::Handle: verification_state::IsSet, 218 218 S::DisplayName: verification_state::IsSet, 219 - S::Subject: verification_state::IsSet, 220 219 S::CreatedAt: verification_state::IsSet, 220 + S::Subject: verification_state::IsSet, 221 221 { 222 222 /// Build the final struct 223 223 pub fn build(self) -> Verification<'a> {
+36 -36
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 IndexedAt; 635 636 type Creator; 636 637 type Uri; 637 638 type Cid; 638 - type IndexedAt; 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; 644 645 type Creator = Unset; 645 646 type Uri = Unset; 646 647 type Cid = Unset; 647 - type IndexedAt = Unset; 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 Creator = S::Creator; 655 + type Uri = S::Uri; 656 + type Cid = S::Cid; 648 657 } 649 658 ///State transition - sets the `creator` field to Set 650 659 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 651 660 impl<S: State> sealed::Sealed for SetCreator<S> {} 652 661 impl<S: State> State for SetCreator<S> { 662 + type IndexedAt = S::IndexedAt; 653 663 type Creator = Set<members::creator>; 654 664 type Uri = S::Uri; 655 665 type Cid = S::Cid; 656 - type IndexedAt = S::IndexedAt; 657 666 } 658 667 ///State transition - sets the `uri` field to Set 659 668 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 660 669 impl<S: State> sealed::Sealed for SetUri<S> {} 661 670 impl<S: State> State for SetUri<S> { 671 + type IndexedAt = S::IndexedAt; 662 672 type Creator = S::Creator; 663 673 type Uri = Set<members::uri>; 664 674 type Cid = S::Cid; 665 - type IndexedAt = S::IndexedAt; 666 675 } 667 676 ///State transition - sets the `cid` field to Set 668 677 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 669 678 impl<S: State> sealed::Sealed for SetCid<S> {} 670 679 impl<S: State> State for SetCid<S> { 671 - type Creator = S::Creator; 672 - type Uri = S::Uri; 673 - type Cid = Set<members::cid>; 674 680 type IndexedAt = S::IndexedAt; 675 - } 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> { 680 681 type Creator = S::Creator; 681 682 type Uri = S::Uri; 682 - type Cid = S::Cid; 683 - type IndexedAt = Set<members::indexed_at>; 683 + type Cid = Set<members::cid>; 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 690 ///Marker type for the `creator` field 689 691 pub struct creator(()); 690 692 ///Marker type for the `uri` field 691 693 pub struct uri(()); 692 694 ///Marker type for the `cid` field 693 695 pub struct cid(()); 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, 862 863 S::Creator: labeler_view_state::IsSet, 863 864 S::Uri: labeler_view_state::IsSet, 864 865 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> { ··· 988 988 type Uri; 989 989 type Policies; 990 990 type IndexedAt; 991 - type Creator; 992 991 type Cid; 992 + type Creator; 993 993 } 994 994 /// Empty state - all required fields are unset 995 995 pub struct Empty(()); ··· 998 998 type Uri = Unset; 999 999 type Policies = Unset; 1000 1000 type IndexedAt = Unset; 1001 - type Creator = Unset; 1002 1001 type Cid = Unset; 1002 + type Creator = Unset; 1003 1003 } 1004 1004 ///State transition - sets the `uri` field to Set 1005 1005 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); ··· 1008 1008 type Uri = Set<members::uri>; 1009 1009 type Policies = S::Policies; 1010 1010 type IndexedAt = S::IndexedAt; 1011 + type Cid = S::Cid; 1011 1012 type Creator = S::Creator; 1012 - type Cid = S::Cid; 1013 1013 } 1014 1014 ///State transition - sets the `policies` field to Set 1015 1015 pub struct SetPolicies<S: State = Empty>(PhantomData<fn() -> S>); ··· 1018 1018 type Uri = S::Uri; 1019 1019 type Policies = Set<members::policies>; 1020 1020 type IndexedAt = S::IndexedAt; 1021 + type Cid = S::Cid; 1021 1022 type Creator = S::Creator; 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>); ··· 1028 1028 type Uri = S::Uri; 1029 1029 type Policies = S::Policies; 1030 1030 type IndexedAt = Set<members::indexed_at>; 1031 - type Creator = S::Creator; 1032 - type Cid = S::Cid; 1033 - } 1034 - ///State transition - sets the `creator` field to Set 1035 - pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1036 - impl<S: State> sealed::Sealed for SetCreator<S> {} 1037 - impl<S: State> State for SetCreator<S> { 1038 - type Uri = S::Uri; 1039 - type Policies = S::Policies; 1040 - type IndexedAt = S::IndexedAt; 1041 - type Creator = Set<members::creator>; 1042 1031 type Cid = S::Cid; 1032 + type Creator = S::Creator; 1043 1033 } 1044 1034 ///State transition - sets the `cid` field to Set 1045 1035 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); ··· 1048 1038 type Uri = S::Uri; 1049 1039 type Policies = S::Policies; 1050 1040 type IndexedAt = S::IndexedAt; 1041 + type Cid = Set<members::cid>; 1051 1042 type Creator = S::Creator; 1052 - type Cid = Set<members::cid>; 1043 + } 1044 + ///State transition - sets the `creator` field to Set 1045 + pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1046 + impl<S: State> sealed::Sealed for SetCreator<S> {} 1047 + impl<S: State> State for SetCreator<S> { 1048 + type Uri = S::Uri; 1049 + type Policies = S::Policies; 1050 + type IndexedAt = S::IndexedAt; 1051 + type Cid = S::Cid; 1052 + type Creator = Set<members::creator>; 1053 1053 } 1054 1054 /// Marker types for field names 1055 1055 #[allow(non_camel_case_types)] ··· 1060 1060 pub struct policies(()); 1061 1061 ///Marker type for the `indexed_at` field 1062 1062 pub struct indexed_at(()); 1063 + ///Marker type for the `cid` field 1064 + pub struct cid(()); 1063 1065 ///Marker type for the `creator` field 1064 1066 pub struct creator(()); 1065 - ///Marker type for the `cid` field 1066 - pub struct cid(()); 1067 1067 } 1068 1068 } 1069 1069 ··· 1325 1325 S::Uri: labeler_view_detailed_state::IsSet, 1326 1326 S::Policies: labeler_view_detailed_state::IsSet, 1327 1327 S::IndexedAt: labeler_view_detailed_state::IsSet, 1328 - S::Creator: labeler_view_detailed_state::IsSet, 1329 1328 S::Cid: labeler_view_detailed_state::IsSet, 1329 + S::Creator: labeler_view_detailed_state::IsSet, 1330 1330 { 1331 1331 /// Build the final struct 1332 1332 pub fn build(self) -> LabelerViewDetailed<'a> {
+193 -193
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 Reply; 47 46 type Post; 47 + type Reply; 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 Reply = Unset; 54 53 type Post = Unset; 55 - } 56 - ///State transition - sets the `reply` field to Set 57 - pub struct SetReply<S: State = Empty>(PhantomData<fn() -> S>); 58 - impl<S: State> sealed::Sealed for SetReply<S> {} 59 - impl<S: State> State for SetReply<S> { 60 - type Reply = Set<members::reply>; 61 - type Post = S::Post; 54 + type Reply = Unset; 62 55 } 63 56 ///State transition - sets the `post` field to Set 64 57 pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 65 58 impl<S: State> sealed::Sealed for SetPost<S> {} 66 59 impl<S: State> State for SetPost<S> { 67 - type Reply = S::Reply; 68 60 type Post = Set<members::post>; 61 + type Reply = S::Reply; 62 + } 63 + ///State transition - sets the `reply` field to Set 64 + pub struct SetReply<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetReply<S> {} 66 + impl<S: State> State for SetReply<S> { 67 + type Post = S::Post; 68 + type Reply = Set<members::reply>; 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 `reply` field 74 - pub struct reply(()); 75 73 ///Marker type for the `post` field 76 74 pub struct post(()); 75 + ///Marker type for the `reply` field 76 + pub struct reply(()); 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::Reply: activity_subscription_state::IsSet, 147 146 S::Post: activity_subscription_state::IsSet, 147 + S::Reply: 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 Push; 605 604 type Include; 605 + type Push; 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 Push = Unset; 612 611 type Include = Unset; 612 + 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; 613 620 } 614 621 ///State transition - sets the `push` field to Set 615 622 pub struct SetPush<S: State = Empty>(PhantomData<fn() -> S>); 616 623 impl<S: State> sealed::Sealed for SetPush<S> {} 617 624 impl<S: State> State for SetPush<S> { 625 + type Include = S::Include; 618 626 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(()); 631 633 ///Marker type for the `push` field 632 634 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::Push: chat_preference_state::IsSet, 708 707 S::Include: chat_preference_state::IsSet, 708 + S::Push: chat_preference_state::IsSet, 709 709 { 710 710 /// Build the final struct 711 711 pub fn build(self) -> ChatPreference<'a> { ··· 1360 1360 } 1361 1361 /// State trait tracking which required fields have been set 1362 1362 pub trait State: sealed::Sealed { 1363 + type StarterpackJoined; 1364 + type RepostViaRepost; 1363 1365 type SubscribedPost; 1364 - type RepostViaRepost; 1365 1366 type Unverified; 1367 + type Follow; 1366 1368 type Verified; 1367 - type Like; 1368 - type Repost; 1369 1369 type Quote; 1370 + type Like; 1371 + type LikeViaRepost; 1372 + type Chat; 1370 1373 type Mention; 1371 - type StarterpackJoined; 1372 - type Follow; 1373 1374 type Reply; 1374 - type Chat; 1375 - type LikeViaRepost; 1375 + type Repost; 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 SubscribedPost = Unset; 1381 + type StarterpackJoined = Unset; 1382 1382 type RepostViaRepost = Unset; 1383 + type SubscribedPost = Unset; 1383 1384 type Unverified = Unset; 1385 + type Follow = Unset; 1384 1386 type Verified = Unset; 1387 + type Quote = Unset; 1385 1388 type Like = Unset; 1386 - type Repost = Unset; 1387 - type Quote = Unset; 1389 + type LikeViaRepost = Unset; 1390 + type Chat = Unset; 1388 1391 type Mention = Unset; 1389 - type StarterpackJoined = Unset; 1390 - type Follow = Unset; 1391 1392 type Reply = Unset; 1392 - type Chat = Unset; 1393 - type LikeViaRepost = Unset; 1393 + type Repost = Unset; 1394 1394 } 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>; 1395 + ///State transition - sets the `starterpack_joined` field to Set 1396 + pub struct SetStarterpackJoined<S: State = Empty>(PhantomData<fn() -> S>); 1397 + impl<S: State> sealed::Sealed for SetStarterpackJoined<S> {} 1398 + impl<S: State> State for SetStarterpackJoined<S> { 1399 + type StarterpackJoined = Set<members::starterpack_joined>; 1400 1400 type RepostViaRepost = S::RepostViaRepost; 1401 + type SubscribedPost = S::SubscribedPost; 1401 1402 type Unverified = S::Unverified; 1403 + type Follow = S::Follow; 1402 1404 type Verified = S::Verified; 1405 + type Quote = S::Quote; 1403 1406 type Like = S::Like; 1404 - type Repost = S::Repost; 1405 - type Quote = S::Quote; 1407 + type LikeViaRepost = S::LikeViaRepost; 1408 + type Chat = S::Chat; 1406 1409 type Mention = S::Mention; 1407 - type StarterpackJoined = S::StarterpackJoined; 1408 - type Follow = S::Follow; 1409 1410 type Reply = S::Reply; 1410 - type Chat = S::Chat; 1411 - type LikeViaRepost = S::LikeViaRepost; 1411 + type Repost = S::Repost; 1412 1412 } 1413 1413 ///State transition - sets the `repost_via_repost` field to Set 1414 1414 pub struct SetRepostViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1415 1415 impl<S: State> sealed::Sealed for SetRepostViaRepost<S> {} 1416 1416 impl<S: State> State for SetRepostViaRepost<S> { 1417 - type SubscribedPost = S::SubscribedPost; 1417 + type StarterpackJoined = S::StarterpackJoined; 1418 1418 type RepostViaRepost = Set<members::repost_via_repost>; 1419 + type SubscribedPost = S::SubscribedPost; 1419 1420 type Unverified = S::Unverified; 1421 + type Follow = S::Follow; 1420 1422 type Verified = S::Verified; 1423 + type Quote = S::Quote; 1421 1424 type Like = S::Like; 1422 - type Repost = S::Repost; 1423 - type Quote = S::Quote; 1425 + type LikeViaRepost = S::LikeViaRepost; 1426 + type Chat = S::Chat; 1424 1427 type Mention = S::Mention; 1428 + type Reply = S::Reply; 1429 + type Repost = S::Repost; 1430 + } 1431 + ///State transition - sets the `subscribed_post` field to Set 1432 + pub struct SetSubscribedPost<S: State = Empty>(PhantomData<fn() -> S>); 1433 + impl<S: State> sealed::Sealed for SetSubscribedPost<S> {} 1434 + impl<S: State> State for SetSubscribedPost<S> { 1425 1435 type StarterpackJoined = S::StarterpackJoined; 1436 + type RepostViaRepost = S::RepostViaRepost; 1437 + type SubscribedPost = Set<members::subscribed_post>; 1438 + type Unverified = S::Unverified; 1426 1439 type Follow = S::Follow; 1427 - type Reply = S::Reply; 1428 - type Chat = S::Chat; 1440 + type Verified = S::Verified; 1441 + type Quote = S::Quote; 1442 + type Like = S::Like; 1429 1443 type LikeViaRepost = S::LikeViaRepost; 1444 + type Chat = S::Chat; 1445 + type Mention = S::Mention; 1446 + type Reply = S::Reply; 1447 + type Repost = S::Repost; 1430 1448 } 1431 1449 ///State transition - sets the `unverified` field to Set 1432 1450 pub struct SetUnverified<S: State = Empty>(PhantomData<fn() -> S>); 1433 1451 impl<S: State> sealed::Sealed for SetUnverified<S> {} 1434 1452 impl<S: State> State for SetUnverified<S> { 1453 + type StarterpackJoined = S::StarterpackJoined; 1454 + type RepostViaRepost = S::RepostViaRepost; 1435 1455 type SubscribedPost = S::SubscribedPost; 1436 - type RepostViaRepost = S::RepostViaRepost; 1437 1456 type Unverified = Set<members::unverified>; 1457 + type Follow = S::Follow; 1438 1458 type Verified = S::Verified; 1459 + type Quote = S::Quote; 1439 1460 type Like = S::Like; 1461 + type LikeViaRepost = S::LikeViaRepost; 1462 + type Chat = S::Chat; 1463 + type Mention = S::Mention; 1464 + type Reply = S::Reply; 1440 1465 type Repost = S::Repost; 1466 + } 1467 + ///State transition - sets the `follow` field to Set 1468 + pub struct SetFollow<S: State = Empty>(PhantomData<fn() -> S>); 1469 + impl<S: State> sealed::Sealed for SetFollow<S> {} 1470 + impl<S: State> State for SetFollow<S> { 1471 + type StarterpackJoined = S::StarterpackJoined; 1472 + type RepostViaRepost = S::RepostViaRepost; 1473 + type SubscribedPost = S::SubscribedPost; 1474 + type Unverified = S::Unverified; 1475 + type Follow = Set<members::follow>; 1476 + type Verified = S::Verified; 1441 1477 type Quote = S::Quote; 1478 + type Like = S::Like; 1479 + type LikeViaRepost = S::LikeViaRepost; 1480 + type Chat = S::Chat; 1442 1481 type Mention = S::Mention; 1443 - type StarterpackJoined = S::StarterpackJoined; 1444 - type Follow = S::Follow; 1445 1482 type Reply = S::Reply; 1446 - type Chat = S::Chat; 1447 - type LikeViaRepost = S::LikeViaRepost; 1483 + type Repost = S::Repost; 1448 1484 } 1449 1485 ///State transition - sets the `verified` field to Set 1450 1486 pub struct SetVerified<S: State = Empty>(PhantomData<fn() -> S>); 1451 1487 impl<S: State> sealed::Sealed for SetVerified<S> {} 1452 1488 impl<S: State> State for SetVerified<S> { 1453 - type SubscribedPost = S::SubscribedPost; 1489 + type StarterpackJoined = S::StarterpackJoined; 1454 1490 type RepostViaRepost = S::RepostViaRepost; 1491 + type SubscribedPost = S::SubscribedPost; 1455 1492 type Unverified = S::Unverified; 1493 + type Follow = S::Follow; 1456 1494 type Verified = Set<members::verified>; 1457 - type Like = S::Like; 1458 - type Repost = S::Repost; 1459 1495 type Quote = S::Quote; 1496 + type Like = S::Like; 1497 + type LikeViaRepost = S::LikeViaRepost; 1498 + type Chat = S::Chat; 1460 1499 type Mention = S::Mention; 1500 + type Reply = S::Reply; 1501 + type Repost = S::Repost; 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> { 1461 1507 type StarterpackJoined = S::StarterpackJoined; 1508 + type RepostViaRepost = S::RepostViaRepost; 1509 + type SubscribedPost = S::SubscribedPost; 1510 + type Unverified = S::Unverified; 1462 1511 type Follow = S::Follow; 1463 - type Reply = S::Reply; 1464 - type Chat = S::Chat; 1512 + type Verified = S::Verified; 1513 + type Quote = Set<members::quote>; 1514 + type Like = S::Like; 1465 1515 type LikeViaRepost = S::LikeViaRepost; 1516 + type Chat = S::Chat; 1517 + type Mention = S::Mention; 1518 + type Reply = S::Reply; 1519 + type Repost = S::Repost; 1466 1520 } 1467 1521 ///State transition - sets the `like` field to Set 1468 1522 pub struct SetLike<S: State = Empty>(PhantomData<fn() -> S>); 1469 1523 impl<S: State> sealed::Sealed for SetLike<S> {} 1470 1524 impl<S: State> State for SetLike<S> { 1471 - type SubscribedPost = S::SubscribedPost; 1525 + type StarterpackJoined = S::StarterpackJoined; 1472 1526 type RepostViaRepost = S::RepostViaRepost; 1527 + type SubscribedPost = S::SubscribedPost; 1473 1528 type Unverified = S::Unverified; 1529 + type Follow = S::Follow; 1474 1530 type Verified = S::Verified; 1531 + type Quote = S::Quote; 1475 1532 type Like = Set<members::like>; 1476 - type Repost = S::Repost; 1477 - type Quote = S::Quote; 1533 + type LikeViaRepost = S::LikeViaRepost; 1534 + type Chat = S::Chat; 1478 1535 type Mention = S::Mention; 1479 - type StarterpackJoined = S::StarterpackJoined; 1480 - type Follow = S::Follow; 1481 1536 type Reply = S::Reply; 1482 - type Chat = S::Chat; 1483 - type LikeViaRepost = S::LikeViaRepost; 1537 + type Repost = S::Repost; 1484 1538 } 1485 - ///State transition - sets the `repost` field to Set 1486 - pub struct SetRepost<S: State = Empty>(PhantomData<fn() -> S>); 1487 - impl<S: State> sealed::Sealed for SetRepost<S> {} 1488 - impl<S: State> State for SetRepost<S> { 1539 + ///State transition - sets the `like_via_repost` field to Set 1540 + pub struct SetLikeViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1541 + impl<S: State> sealed::Sealed for SetLikeViaRepost<S> {} 1542 + impl<S: State> State for SetLikeViaRepost<S> { 1543 + type StarterpackJoined = S::StarterpackJoined; 1544 + type RepostViaRepost = S::RepostViaRepost; 1489 1545 type SubscribedPost = S::SubscribedPost; 1490 - type RepostViaRepost = S::RepostViaRepost; 1491 1546 type Unverified = S::Unverified; 1547 + type Follow = S::Follow; 1492 1548 type Verified = S::Verified; 1549 + type Quote = S::Quote; 1493 1550 type Like = S::Like; 1494 - type Repost = Set<members::repost>; 1495 - type Quote = S::Quote; 1551 + type LikeViaRepost = Set<members::like_via_repost>; 1552 + type Chat = S::Chat; 1496 1553 type Mention = S::Mention; 1497 - type StarterpackJoined = S::StarterpackJoined; 1498 - type Follow = S::Follow; 1499 1554 type Reply = S::Reply; 1500 - type Chat = S::Chat; 1501 - type LikeViaRepost = S::LikeViaRepost; 1555 + type Repost = S::Repost; 1502 1556 } 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> { 1507 - type SubscribedPost = S::SubscribedPost; 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 StarterpackJoined = S::StarterpackJoined; 1508 1562 type RepostViaRepost = S::RepostViaRepost; 1563 + type SubscribedPost = S::SubscribedPost; 1509 1564 type Unverified = S::Unverified; 1565 + type Follow = S::Follow; 1510 1566 type Verified = S::Verified; 1567 + type Quote = S::Quote; 1511 1568 type Like = S::Like; 1512 - type Repost = S::Repost; 1513 - type Quote = Set<members::quote>; 1569 + type LikeViaRepost = S::LikeViaRepost; 1570 + type Chat = Set<members::chat>; 1514 1571 type Mention = S::Mention; 1515 - type StarterpackJoined = S::StarterpackJoined; 1516 - type Follow = S::Follow; 1517 1572 type Reply = S::Reply; 1518 - type Chat = S::Chat; 1519 - type LikeViaRepost = S::LikeViaRepost; 1573 + type Repost = S::Repost; 1520 1574 } 1521 1575 ///State transition - sets the `mention` field to Set 1522 1576 pub struct SetMention<S: State = Empty>(PhantomData<fn() -> S>); 1523 1577 impl<S: State> sealed::Sealed for SetMention<S> {} 1524 1578 impl<S: State> State for SetMention<S> { 1579 + type StarterpackJoined = S::StarterpackJoined; 1580 + type RepostViaRepost = S::RepostViaRepost; 1525 1581 type SubscribedPost = S::SubscribedPost; 1526 - type RepostViaRepost = S::RepostViaRepost; 1527 1582 type Unverified = S::Unverified; 1583 + type Follow = S::Follow; 1528 1584 type Verified = S::Verified; 1585 + type Quote = S::Quote; 1529 1586 type Like = S::Like; 1530 - type Repost = S::Repost; 1531 - type Quote = S::Quote; 1587 + type LikeViaRepost = S::LikeViaRepost; 1588 + type Chat = S::Chat; 1532 1589 type Mention = Set<members::mention>; 1533 - type StarterpackJoined = S::StarterpackJoined; 1534 - type Follow = S::Follow; 1535 1590 type Reply = S::Reply; 1536 - type Chat = S::Chat; 1537 - type LikeViaRepost = S::LikeViaRepost; 1538 - } 1539 - ///State transition - sets the `starterpack_joined` field to Set 1540 - pub struct SetStarterpackJoined<S: State = Empty>(PhantomData<fn() -> S>); 1541 - impl<S: State> sealed::Sealed for SetStarterpackJoined<S> {} 1542 - impl<S: State> State for SetStarterpackJoined<S> { 1543 - type SubscribedPost = S::SubscribedPost; 1544 - type RepostViaRepost = S::RepostViaRepost; 1545 - type Unverified = S::Unverified; 1546 - type Verified = S::Verified; 1547 - type Like = S::Like; 1548 1591 type Repost = S::Repost; 1549 - type Quote = S::Quote; 1550 - type Mention = S::Mention; 1551 - type StarterpackJoined = Set<members::starterpack_joined>; 1552 - type Follow = S::Follow; 1553 - type Reply = S::Reply; 1554 - type Chat = S::Chat; 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> { 1561 - type SubscribedPost = S::SubscribedPost; 1562 - type RepostViaRepost = S::RepostViaRepost; 1563 - type Unverified = S::Unverified; 1564 - type Verified = S::Verified; 1565 - type Like = S::Like; 1566 - type Repost = S::Repost; 1567 - type Quote = S::Quote; 1568 - type Mention = S::Mention; 1569 - type StarterpackJoined = S::StarterpackJoined; 1570 - type Follow = Set<members::follow>; 1571 - type Reply = S::Reply; 1572 - type Chat = S::Chat; 1573 - type LikeViaRepost = S::LikeViaRepost; 1574 1592 } 1575 1593 ///State transition - sets the `reply` field to Set 1576 1594 pub struct SetReply<S: State = Empty>(PhantomData<fn() -> S>); 1577 1595 impl<S: State> sealed::Sealed for SetReply<S> {} 1578 1596 impl<S: State> State for SetReply<S> { 1597 + type StarterpackJoined = S::StarterpackJoined; 1598 + type RepostViaRepost = S::RepostViaRepost; 1579 1599 type SubscribedPost = S::SubscribedPost; 1580 - type RepostViaRepost = S::RepostViaRepost; 1581 1600 type Unverified = S::Unverified; 1601 + type Follow = S::Follow; 1582 1602 type Verified = S::Verified; 1583 - type Like = S::Like; 1584 - type Repost = S::Repost; 1585 1603 type Quote = S::Quote; 1604 + type Like = S::Like; 1605 + type LikeViaRepost = S::LikeViaRepost; 1606 + type Chat = S::Chat; 1586 1607 type Mention = S::Mention; 1587 - type StarterpackJoined = S::StarterpackJoined; 1588 - type Follow = S::Follow; 1589 1608 type Reply = Set<members::reply>; 1590 - type Chat = S::Chat; 1591 - type LikeViaRepost = S::LikeViaRepost; 1609 + type Repost = S::Repost; 1592 1610 } 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> { 1611 + ///State transition - sets the `repost` field to Set 1612 + pub struct SetRepost<S: State = Empty>(PhantomData<fn() -> S>); 1613 + impl<S: State> sealed::Sealed for SetRepost<S> {} 1614 + impl<S: State> State for SetRepost<S> { 1615 + type StarterpackJoined = S::StarterpackJoined; 1616 + type RepostViaRepost = S::RepostViaRepost; 1597 1617 type SubscribedPost = S::SubscribedPost; 1598 - type RepostViaRepost = S::RepostViaRepost; 1599 1618 type Unverified = S::Unverified; 1619 + type Follow = S::Follow; 1600 1620 type Verified = S::Verified; 1601 - type Like = S::Like; 1602 - type Repost = S::Repost; 1603 1621 type Quote = S::Quote; 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>; 1622 + type Like = S::Like; 1609 1623 type LikeViaRepost = S::LikeViaRepost; 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; 1616 - type RepostViaRepost = S::RepostViaRepost; 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; 1624 + type Chat = S::Chat; 1622 1625 type Mention = S::Mention; 1623 - type StarterpackJoined = S::StarterpackJoined; 1624 - type Follow = S::Follow; 1625 1626 type Reply = S::Reply; 1626 - type Chat = S::Chat; 1627 - type LikeViaRepost = Set<members::like_via_repost>; 1627 + type Repost = Set<members::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 `starterpack_joined` field 1633 + pub struct starterpack_joined(()); 1634 + ///Marker type for the `repost_via_repost` field 1635 + pub struct repost_via_repost(()); 1632 1636 ///Marker type for the `subscribed_post` field 1633 1637 pub struct subscribed_post(()); 1634 - ///Marker type for the `repost_via_repost` field 1635 - pub struct repost_via_repost(()); 1636 1638 ///Marker type for the `unverified` field 1637 1639 pub struct unverified(()); 1640 + ///Marker type for the `follow` field 1641 + pub struct follow(()); 1638 1642 ///Marker type for the `verified` field 1639 1643 pub struct verified(()); 1644 + ///Marker type for the `quote` field 1645 + pub struct quote(()); 1640 1646 ///Marker type for the `like` field 1641 1647 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(()); 1648 + ///Marker type for the `like_via_repost` field 1649 + pub struct like_via_repost(()); 1650 + ///Marker type for the `chat` field 1651 + pub struct chat(()); 1646 1652 ///Marker type for the `mention` field 1647 1653 pub struct mention(()); 1648 - ///Marker type for the `starterpack_joined` field 1649 - pub struct starterpack_joined(()); 1650 - ///Marker type for the `follow` field 1651 - pub struct follow(()); 1652 1654 ///Marker type for the `reply` field 1653 1655 pub struct reply(()); 1654 - ///Marker type for the `chat` field 1655 - pub struct chat(()); 1656 - ///Marker type for the `like_via_repost` field 1657 - pub struct like_via_repost(()); 1656 + ///Marker type for the `repost` field 1657 + pub struct 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::SubscribedPost: preferences_state::IsSet, 1964 + S::StarterpackJoined: preferences_state::IsSet, 1965 1965 S::RepostViaRepost: preferences_state::IsSet, 1966 + S::SubscribedPost: preferences_state::IsSet, 1966 1967 S::Unverified: preferences_state::IsSet, 1968 + S::Follow: preferences_state::IsSet, 1967 1969 S::Verified: preferences_state::IsSet, 1970 + S::Quote: preferences_state::IsSet, 1968 1971 S::Like: preferences_state::IsSet, 1969 - S::Repost: preferences_state::IsSet, 1970 - S::Quote: preferences_state::IsSet, 1972 + S::LikeViaRepost: preferences_state::IsSet, 1973 + S::Chat: preferences_state::IsSet, 1971 1974 S::Mention: preferences_state::IsSet, 1972 - S::StarterpackJoined: preferences_state::IsSet, 1973 - S::Follow: preferences_state::IsSet, 1974 1975 S::Reply: preferences_state::IsSet, 1975 - S::Chat: preferences_state::IsSet, 1976 - S::LikeViaRepost: preferences_state::IsSet, 1976 + S::Repost: preferences_state::IsSet, 1977 1977 { 1978 1978 /// Build the final struct 1979 1979 pub fn build(self) -> Preferences<'a> {
+78 -78
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 Cid; 275 - type Author; 276 - type Record; 277 - type IsRead; 278 274 type Reason; 279 - type Uri; 275 + type IsRead; 276 + type Author; 280 277 type IndexedAt; 278 + type Uri; 279 + type Cid; 280 + type Record; 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 Reason = Unset; 287 + type IsRead = Unset; 288 + type Author = Unset; 289 + type IndexedAt = Unset; 290 + type Uri = Unset; 286 291 type Cid = Unset; 287 - type Author = Unset; 288 292 type Record = Unset; 289 - type IsRead = Unset; 290 - type Reason = Unset; 291 - type Uri = Unset; 292 - type IndexedAt = Unset; 293 293 } 294 - ///State transition - sets the `cid` field to Set 295 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 296 - impl<S: State> sealed::Sealed for SetCid<S> {} 297 - impl<S: State> State for SetCid<S> { 298 - type Cid = Set<members::cid>; 294 + ///State transition - sets the `reason` field to Set 295 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 296 + impl<S: State> sealed::Sealed for SetReason<S> {} 297 + impl<S: State> State for SetReason<S> { 298 + type Reason = Set<members::reason>; 299 + type IsRead = S::IsRead; 299 300 type Author = S::Author; 301 + type IndexedAt = S::IndexedAt; 302 + type Uri = S::Uri; 303 + type Cid = S::Cid; 300 304 type Record = S::Record; 301 - type IsRead = S::IsRead; 305 + } 306 + ///State transition - sets the `is_read` field to Set 307 + pub struct SetIsRead<S: State = Empty>(PhantomData<fn() -> S>); 308 + impl<S: State> sealed::Sealed for SetIsRead<S> {} 309 + impl<S: State> State for SetIsRead<S> { 302 310 type Reason = S::Reason; 303 - type Uri = S::Uri; 311 + type IsRead = Set<members::is_read>; 312 + type Author = S::Author; 304 313 type IndexedAt = S::IndexedAt; 314 + type Uri = S::Uri; 315 + type Cid = S::Cid; 316 + type Record = S::Record; 305 317 } 306 318 ///State transition - sets the `author` field to Set 307 319 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 308 320 impl<S: State> sealed::Sealed for SetAuthor<S> {} 309 321 impl<S: State> State for SetAuthor<S> { 310 - type Cid = S::Cid; 311 - type Author = Set<members::author>; 312 - type Record = S::Record; 313 - type IsRead = S::IsRead; 314 322 type Reason = S::Reason; 315 - type Uri = S::Uri; 316 - type IndexedAt = S::IndexedAt; 317 - } 318 - ///State transition - sets the `record` field to Set 319 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 320 - impl<S: State> sealed::Sealed for SetRecord<S> {} 321 - impl<S: State> State for SetRecord<S> { 322 - type Cid = S::Cid; 323 - type Author = S::Author; 324 - type Record = Set<members::record>; 325 323 type IsRead = S::IsRead; 326 - type Reason = S::Reason; 327 - type Uri = S::Uri; 324 + type Author = Set<members::author>; 328 325 type IndexedAt = S::IndexedAt; 329 - } 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> { 326 + type Uri = S::Uri; 334 327 type Cid = S::Cid; 335 - type Author = S::Author; 336 328 type Record = S::Record; 337 - type IsRead = Set<members::is_read>; 329 + } 330 + ///State transition - sets the `indexed_at` field to Set 331 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 332 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 333 + impl<S: State> State for SetIndexedAt<S> { 338 334 type Reason = S::Reason; 335 + type IsRead = S::IsRead; 336 + type Author = S::Author; 337 + type IndexedAt = Set<members::indexed_at>; 339 338 type Uri = S::Uri; 340 - type IndexedAt = S::IndexedAt; 341 - } 342 - ///State transition - sets the `reason` field to Set 343 - pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 344 - impl<S: State> sealed::Sealed for SetReason<S> {} 345 - impl<S: State> State for SetReason<S> { 346 339 type Cid = S::Cid; 347 - type Author = S::Author; 348 340 type Record = S::Record; 349 - type IsRead = S::IsRead; 350 - type Reason = Set<members::reason>; 351 - type Uri = S::Uri; 352 - type IndexedAt = S::IndexedAt; 353 341 } 354 342 ///State transition - sets the `uri` field to Set 355 343 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 356 344 impl<S: State> sealed::Sealed for SetUri<S> {} 357 345 impl<S: State> State for SetUri<S> { 346 + type Reason = S::Reason; 347 + type IsRead = S::IsRead; 348 + type Author = S::Author; 349 + type IndexedAt = S::IndexedAt; 350 + type Uri = Set<members::uri>; 358 351 type Cid = S::Cid; 359 - type Author = S::Author; 360 352 type Record = S::Record; 361 - type IsRead = S::IsRead; 353 + } 354 + ///State transition - sets the `cid` field to Set 355 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 356 + impl<S: State> sealed::Sealed for SetCid<S> {} 357 + impl<S: State> State for SetCid<S> { 362 358 type Reason = S::Reason; 363 - type Uri = Set<members::uri>; 359 + type IsRead = S::IsRead; 360 + type Author = S::Author; 364 361 type IndexedAt = S::IndexedAt; 362 + type Uri = S::Uri; 363 + type Cid = Set<members::cid>; 364 + type Record = S::Record; 365 365 } 366 - ///State transition - sets the `indexed_at` field to Set 367 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 368 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 369 - impl<S: State> State for SetIndexedAt<S> { 370 - type Cid = S::Cid; 371 - type Author = S::Author; 372 - type Record = S::Record; 373 - type IsRead = S::IsRead; 366 + ///State transition - sets the `record` field to Set 367 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 368 + impl<S: State> sealed::Sealed for SetRecord<S> {} 369 + impl<S: State> State for SetRecord<S> { 374 370 type Reason = S::Reason; 371 + type IsRead = S::IsRead; 372 + type Author = S::Author; 373 + type IndexedAt = S::IndexedAt; 375 374 type Uri = S::Uri; 376 - type IndexedAt = Set<members::indexed_at>; 375 + type Cid = S::Cid; 376 + type Record = Set<members::record>; 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 `cid` field 382 - pub struct cid(()); 383 - ///Marker type for the `author` field 384 - pub struct author(()); 385 - ///Marker type for the `record` field 386 - pub struct record(()); 387 - ///Marker type for the `is_read` field 388 - pub struct is_read(()); 389 381 ///Marker type for the `reason` field 390 382 pub struct reason(()); 391 - ///Marker type for the `uri` field 392 - pub struct uri(()); 383 + ///Marker type for the `is_read` field 384 + pub struct is_read(()); 385 + ///Marker type for the `author` field 386 + pub struct author(()); 393 387 ///Marker type for the `indexed_at` field 394 388 pub struct indexed_at(()); 389 + ///Marker type for the `uri` field 390 + pub struct uri(()); 391 + ///Marker type for the `cid` field 392 + pub struct cid(()); 393 + ///Marker type for the `record` field 394 + pub struct record(()); 395 395 } 396 396 } 397 397 ··· 614 614 impl<'a, S> NotificationBuilder<'a, S> 615 615 where 616 616 S: notification_state::State, 617 - S::Cid: notification_state::IsSet, 618 - S::Author: notification_state::IsSet, 619 - S::Record: notification_state::IsSet, 620 - S::IsRead: notification_state::IsSet, 621 617 S::Reason: notification_state::IsSet, 622 - S::Uri: notification_state::IsSet, 618 + S::IsRead: notification_state::IsSet, 619 + S::Author: notification_state::IsSet, 623 620 S::IndexedAt: notification_state::IsSet, 621 + S::Uri: notification_state::IsSet, 622 + S::Cid: notification_state::IsSet, 623 + S::Record: notification_state::IsSet, 624 624 { 625 625 /// Build the final struct 626 626 pub fn build(self) -> Notification<'a> {
+31 -31
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 ServiceDid; 44 + type Token; 43 45 type Platform; 44 46 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 ServiceDid = Unset; 53 + type Token = Unset; 52 54 type Platform = Unset; 53 55 type AppId = Unset; 54 - type ServiceDid = Unset; 55 - type Token = Unset; 56 - } 57 - ///State transition - sets the `platform` field to Set 58 - pub struct SetPlatform<S: State = Empty>(PhantomData<fn() -> S>); 59 - impl<S: State> sealed::Sealed for SetPlatform<S> {} 60 - impl<S: State> State for SetPlatform<S> { 61 - type Platform = Set<members::platform>; 62 - type AppId = S::AppId; 63 - type ServiceDid = S::ServiceDid; 64 - type Token = S::Token; 65 - } 66 - ///State transition - sets the `app_id` field to Set 67 - pub struct SetAppId<S: State = Empty>(PhantomData<fn() -> S>); 68 - impl<S: State> sealed::Sealed for SetAppId<S> {} 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; 73 - type Token = S::Token; 74 56 } 75 57 ///State transition - sets the `service_did` field to Set 76 58 pub struct SetServiceDid<S: State = Empty>(PhantomData<fn() -> S>); 77 59 impl<S: State> sealed::Sealed for SetServiceDid<S> {} 78 60 impl<S: State> State for SetServiceDid<S> { 79 - type Platform = S::Platform; 80 - type AppId = S::AppId; 81 61 type ServiceDid = Set<members::service_did>; 82 62 type Token = S::Token; 63 + type Platform = S::Platform; 64 + type AppId = S::AppId; 83 65 } 84 66 ///State transition - sets the `token` field to Set 85 67 pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 86 68 impl<S: State> sealed::Sealed for SetToken<S> {} 87 69 impl<S: State> State for SetToken<S> { 70 + type ServiceDid = S::ServiceDid; 71 + type Token = Set<members::token>; 88 72 type Platform = S::Platform; 89 73 type AppId = S::AppId; 74 + } 75 + ///State transition - sets the `platform` field to Set 76 + pub struct SetPlatform<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetPlatform<S> {} 78 + impl<S: State> State for SetPlatform<S> { 90 79 type ServiceDid = S::ServiceDid; 91 - type Token = Set<members::token>; 80 + type Token = S::Token; 81 + type Platform = Set<members::platform>; 82 + type AppId = S::AppId; 83 + } 84 + ///State transition - sets the `app_id` field to Set 85 + pub struct SetAppId<S: State = Empty>(PhantomData<fn() -> S>); 86 + impl<S: State> sealed::Sealed for SetAppId<S> {} 87 + impl<S: State> State for SetAppId<S> { 88 + type ServiceDid = S::ServiceDid; 89 + type Token = S::Token; 90 + type Platform = S::Platform; 91 + type AppId = Set<members::app_id>; 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 `platform` field 97 - pub struct platform(()); 98 - ///Marker type for the `app_id` field 99 - pub struct app_id(()); 100 96 ///Marker type for the `service_did` field 101 97 pub struct service_did(()); 102 98 ///Marker type for the `token` field 103 99 pub struct token(()); 100 + ///Marker type for the `platform` field 101 + pub struct platform(()); 102 + ///Marker type for the `app_id` field 103 + pub struct app_id(()); 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::ServiceDid: register_push_state::IsSet, 231 + S::Token: register_push_state::IsSet, 230 232 S::Platform: register_push_state::IsSet, 231 233 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> {
+26 -26
crates/weaver-api/src/app_bsky/notification/unregister_push.rs
··· 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 40 type AppId; 41 - type ServiceDid; 42 - type Token; 43 41 type Platform; 42 + type Token; 43 + type ServiceDid; 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 AppId = Unset; 50 - type ServiceDid = Unset; 51 - type Token = Unset; 52 50 type Platform = Unset; 51 + type Token = Unset; 52 + type ServiceDid = Unset; 53 53 } 54 54 ///State transition - sets the `app_id` field to Set 55 55 pub struct SetAppId<S: State = Empty>(PhantomData<fn() -> S>); 56 56 impl<S: State> sealed::Sealed for SetAppId<S> {} 57 57 impl<S: State> State for SetAppId<S> { 58 58 type AppId = Set<members::app_id>; 59 - type ServiceDid = S::ServiceDid; 60 - type Token = S::Token; 61 59 type Platform = S::Platform; 60 + type Token = S::Token; 61 + type ServiceDid = S::ServiceDid; 62 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> { 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 67 type AppId = S::AppId; 68 - type ServiceDid = Set<members::service_did>; 68 + type Platform = Set<members::platform>; 69 69 type Token = S::Token; 70 - type Platform = S::Platform; 70 + type ServiceDid = S::ServiceDid; 71 71 } 72 72 ///State transition - sets the `token` field to Set 73 73 pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 74 74 impl<S: State> sealed::Sealed for SetToken<S> {} 75 75 impl<S: State> State for SetToken<S> { 76 76 type AppId = S::AppId; 77 - type ServiceDid = S::ServiceDid; 77 + type Platform = S::Platform; 78 78 type Token = Set<members::token>; 79 - type Platform = S::Platform; 79 + type ServiceDid = S::ServiceDid; 80 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> { 81 + ///State transition - sets the `service_did` field to Set 82 + pub struct SetServiceDid<S: State = Empty>(PhantomData<fn() -> S>); 83 + impl<S: State> sealed::Sealed for SetServiceDid<S> {} 84 + impl<S: State> State for SetServiceDid<S> { 85 85 type AppId = S::AppId; 86 - type ServiceDid = S::ServiceDid; 86 + type Platform = S::Platform; 87 87 type Token = S::Token; 88 - type Platform = Set<members::platform>; 88 + type ServiceDid = Set<members::service_did>; 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 `app_id` field 94 94 pub struct app_id(()); 95 - ///Marker type for the `service_did` field 96 - pub struct service_did(()); 97 - ///Marker type for the `token` field 98 - pub struct token(()); 99 95 ///Marker type for the `platform` field 100 96 pub struct platform(()); 97 + ///Marker type for the `token` field 98 + pub struct token(()); 99 + ///Marker type for the `service_did` field 100 + pub struct service_did(()); 101 101 } 102 102 } 103 103 ··· 211 211 where 212 212 S: unregister_push_state::State, 213 213 S::AppId: unregister_push_state::IsSet, 214 - S::ServiceDid: unregister_push_state::IsSet, 215 - S::Token: unregister_push_state::IsSet, 216 214 S::Platform: unregister_push_state::IsSet, 215 + S::Token: unregister_push_state::IsSet, 216 + S::ServiceDid: unregister_push_state::IsSet, 217 217 { 218 218 /// Build the final struct 219 219 pub fn build(self) -> UnregisterPush<'a> {
+171 -171
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 Status; 85 84 type CreatedAt; 86 85 type AttemptId; 86 + type Status; 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 Status = Unset; 93 92 type CreatedAt = Unset; 94 93 type AttemptId = Unset; 95 - } 96 - ///State transition - sets the `status` field to Set 97 - pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 98 - impl<S: State> sealed::Sealed for SetStatus<S> {} 99 - impl<S: State> State for SetStatus<S> { 100 - type Status = Set<members::status>; 101 - type CreatedAt = S::CreatedAt; 102 - type AttemptId = S::AttemptId; 94 + type Status = Unset; 103 95 } 104 96 ///State transition - sets the `created_at` field to Set 105 97 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 106 98 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 107 99 impl<S: State> State for SetCreatedAt<S> { 108 - type Status = S::Status; 109 100 type CreatedAt = Set<members::created_at>; 110 101 type AttemptId = S::AttemptId; 102 + type Status = S::Status; 111 103 } 112 104 ///State transition - sets the `attempt_id` field to Set 113 105 pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 114 106 impl<S: State> sealed::Sealed for SetAttemptId<S> {} 115 107 impl<S: State> State for SetAttemptId<S> { 116 - type Status = S::Status; 117 108 type CreatedAt = S::CreatedAt; 118 109 type AttemptId = Set<members::attempt_id>; 110 + type Status = S::Status; 111 + } 112 + ///State transition - sets the `status` field to Set 113 + pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 114 + impl<S: State> sealed::Sealed for SetStatus<S> {} 115 + impl<S: State> State for SetStatus<S> { 116 + type CreatedAt = S::CreatedAt; 117 + type AttemptId = S::AttemptId; 118 + type Status = Set<members::status>; 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 `status` field 124 - pub struct status(()); 125 123 ///Marker type for the `created_at` field 126 124 pub struct created_at(()); 127 125 ///Marker type for the `attempt_id` field 128 126 pub struct attempt_id(()); 127 + ///Marker type for the `status` field 128 + pub struct status(()); 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::Status: age_assurance_event_state::IsSet, 313 312 S::CreatedAt: age_assurance_event_state::IsSet, 314 313 S::AttemptId: age_assurance_event_state::IsSet, 314 + S::Status: 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 Dids; 1944 - type Link; 1945 1943 type Topic; 1946 1944 type StartedAt; 1947 1945 type PostCount; 1946 + type Dids; 1948 1947 type DisplayName; 1948 + type Link; 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 Dids = Unset; 1955 - type Link = Unset; 1956 1954 type Topic = Unset; 1957 1955 type StartedAt = Unset; 1958 1956 type PostCount = Unset; 1957 + type Dids = Unset; 1959 1958 type DisplayName = Unset; 1960 - } 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 - type Link = S::Link; 1967 - type Topic = S::Topic; 1968 - type StartedAt = S::StartedAt; 1969 - type PostCount = S::PostCount; 1970 - type DisplayName = S::DisplayName; 1971 - } 1972 - ///State transition - sets the `link` field to Set 1973 - pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 1974 - impl<S: State> sealed::Sealed for SetLink<S> {} 1975 - impl<S: State> State for SetLink<S> { 1976 - type Dids = S::Dids; 1977 - type Link = Set<members::link>; 1978 - type Topic = S::Topic; 1979 - type StartedAt = S::StartedAt; 1980 - type PostCount = S::PostCount; 1981 - type DisplayName = S::DisplayName; 1959 + type Link = Unset; 1982 1960 } 1983 1961 ///State transition - sets the `topic` field to Set 1984 1962 pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>); 1985 1963 impl<S: State> sealed::Sealed for SetTopic<S> {} 1986 1964 impl<S: State> State for SetTopic<S> { 1987 - type Dids = S::Dids; 1988 - type Link = S::Link; 1989 1965 type Topic = Set<members::topic>; 1990 1966 type StartedAt = S::StartedAt; 1991 1967 type PostCount = S::PostCount; 1968 + type Dids = S::Dids; 1992 1969 type DisplayName = S::DisplayName; 1970 + type Link = S::Link; 1993 1971 } 1994 1972 ///State transition - sets the `started_at` field to Set 1995 1973 pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>); 1996 1974 impl<S: State> sealed::Sealed for SetStartedAt<S> {} 1997 1975 impl<S: State> State for SetStartedAt<S> { 1998 - type Dids = S::Dids; 1999 - type Link = S::Link; 2000 1976 type Topic = S::Topic; 2001 1977 type StartedAt = Set<members::started_at>; 2002 1978 type PostCount = S::PostCount; 1979 + type Dids = S::Dids; 2003 1980 type DisplayName = S::DisplayName; 1981 + type Link = S::Link; 2004 1982 } 2005 1983 ///State transition - sets the `post_count` field to Set 2006 1984 pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>); 2007 1985 impl<S: State> sealed::Sealed for SetPostCount<S> {} 2008 1986 impl<S: State> State for SetPostCount<S> { 1987 + type Topic = S::Topic; 1988 + type StartedAt = S::StartedAt; 1989 + type PostCount = Set<members::post_count>; 2009 1990 type Dids = S::Dids; 1991 + type DisplayName = S::DisplayName; 2010 1992 type Link = S::Link; 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> { 2011 1998 type Topic = S::Topic; 2012 1999 type StartedAt = S::StartedAt; 2013 - type PostCount = Set<members::post_count>; 2000 + type PostCount = S::PostCount; 2001 + type Dids = Set<members::dids>; 2014 2002 type DisplayName = S::DisplayName; 2003 + type Link = S::Link; 2015 2004 } 2016 2005 ///State transition - sets the `display_name` field to Set 2017 2006 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 2018 2007 impl<S: State> sealed::Sealed for SetDisplayName<S> {} 2019 2008 impl<S: State> State for SetDisplayName<S> { 2009 + type Topic = S::Topic; 2010 + type StartedAt = S::StartedAt; 2011 + type PostCount = S::PostCount; 2020 2012 type Dids = S::Dids; 2013 + type DisplayName = Set<members::display_name>; 2021 2014 type Link = S::Link; 2015 + } 2016 + ///State transition - sets the `link` field to Set 2017 + pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 2018 + impl<S: State> sealed::Sealed for SetLink<S> {} 2019 + impl<S: State> State for SetLink<S> { 2022 2020 type Topic = S::Topic; 2023 2021 type StartedAt = S::StartedAt; 2024 2022 type PostCount = S::PostCount; 2025 - type DisplayName = Set<members::display_name>; 2023 + type Dids = S::Dids; 2024 + type DisplayName = S::DisplayName; 2025 + type Link = Set<members::link>; 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 `dids` field 2031 - pub struct dids(()); 2032 - ///Marker type for the `link` field 2033 - pub struct link(()); 2034 2030 ///Marker type for the `topic` field 2035 2031 pub struct topic(()); 2036 2032 ///Marker type for the `started_at` field 2037 2033 pub struct started_at(()); 2038 2034 ///Marker type for the `post_count` field 2039 2035 pub struct post_count(()); 2036 + ///Marker type for the `dids` field 2037 + pub struct dids(()); 2040 2038 ///Marker type for the `display_name` field 2041 2039 pub struct display_name(()); 2040 + ///Marker type for the `link` field 2041 + pub struct link(()); 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::Dids: skeleton_trend_state::IsSet, 2226 - S::Link: skeleton_trend_state::IsSet, 2227 2225 S::Topic: skeleton_trend_state::IsSet, 2228 2226 S::StartedAt: skeleton_trend_state::IsSet, 2229 2227 S::PostCount: skeleton_trend_state::IsSet, 2228 + S::Dids: skeleton_trend_state::IsSet, 2230 2229 S::DisplayName: skeleton_trend_state::IsSet, 2230 + S::Link: 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 MutedByViewer; 2603 - type MoreParents; 2602 + type Post; 2604 2603 type MoreReplies; 2605 - type OpThread; 2606 - type Post; 2607 2604 type HiddenByThreadgate; 2605 + type OpThread; 2606 + type MutedByViewer; 2607 + type MoreParents; 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 MutedByViewer = Unset; 2614 - type MoreParents = Unset; 2613 + type Post = Unset; 2615 2614 type MoreReplies = Unset; 2615 + type HiddenByThreadgate = Unset; 2616 2616 type OpThread = Unset; 2617 - type Post = Unset; 2618 - type HiddenByThreadgate = Unset; 2617 + type MutedByViewer = Unset; 2618 + type MoreParents = Unset; 2619 2619 } 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 - type MoreParents = S::MoreParents; 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>; 2626 2625 type MoreReplies = S::MoreReplies; 2627 - type OpThread = S::OpThread; 2628 - type Post = S::Post; 2629 2626 type HiddenByThreadgate = S::HiddenByThreadgate; 2630 - } 2631 - ///State transition - sets the `more_parents` field to Set 2632 - pub struct SetMoreParents<S: State = Empty>(PhantomData<fn() -> S>); 2633 - impl<S: State> sealed::Sealed for SetMoreParents<S> {} 2634 - impl<S: State> State for SetMoreParents<S> { 2635 - type MutedByViewer = S::MutedByViewer; 2636 - type MoreParents = Set<members::more_parents>; 2637 - type MoreReplies = S::MoreReplies; 2638 2627 type OpThread = S::OpThread; 2639 - type Post = S::Post; 2640 - type HiddenByThreadgate = S::HiddenByThreadgate; 2628 + type MutedByViewer = S::MutedByViewer; 2629 + type MoreParents = S::MoreParents; 2641 2630 } 2642 2631 ///State transition - sets the `more_replies` field to Set 2643 2632 pub struct SetMoreReplies<S: State = Empty>(PhantomData<fn() -> S>); 2644 2633 impl<S: State> sealed::Sealed for SetMoreReplies<S> {} 2645 2634 impl<S: State> State for SetMoreReplies<S> { 2646 - type MutedByViewer = S::MutedByViewer; 2647 - type MoreParents = S::MoreParents; 2635 + type Post = S::Post; 2648 2636 type MoreReplies = Set<members::more_replies>; 2637 + type HiddenByThreadgate = S::HiddenByThreadgate; 2649 2638 type OpThread = S::OpThread; 2639 + type MutedByViewer = S::MutedByViewer; 2640 + type MoreParents = S::MoreParents; 2641 + } 2642 + ///State transition - sets the `hidden_by_threadgate` field to Set 2643 + pub struct SetHiddenByThreadgate<S: State = Empty>(PhantomData<fn() -> S>); 2644 + impl<S: State> sealed::Sealed for SetHiddenByThreadgate<S> {} 2645 + impl<S: State> State for SetHiddenByThreadgate<S> { 2650 2646 type Post = S::Post; 2651 - type HiddenByThreadgate = S::HiddenByThreadgate; 2647 + type MoreReplies = S::MoreReplies; 2648 + type HiddenByThreadgate = Set<members::hidden_by_threadgate>; 2649 + type OpThread = S::OpThread; 2650 + type MutedByViewer = S::MutedByViewer; 2651 + type MoreParents = S::MoreParents; 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 MutedByViewer = S::MutedByViewer; 2658 - type MoreParents = S::MoreParents; 2657 + type Post = S::Post; 2659 2658 type MoreReplies = S::MoreReplies; 2660 - type OpThread = Set<members::op_thread>; 2661 - type Post = S::Post; 2662 2659 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> { 2660 + type OpThread = Set<members::op_thread>; 2668 2661 type MutedByViewer = S::MutedByViewer; 2669 2662 type MoreParents = S::MoreParents; 2663 + } 2664 + ///State transition - sets the `muted_by_viewer` field to Set 2665 + pub struct SetMutedByViewer<S: State = Empty>(PhantomData<fn() -> S>); 2666 + impl<S: State> sealed::Sealed for SetMutedByViewer<S> {} 2667 + impl<S: State> State for SetMutedByViewer<S> { 2668 + type Post = S::Post; 2670 2669 type MoreReplies = S::MoreReplies; 2671 - type OpThread = S::OpThread; 2672 - type Post = Set<members::post>; 2673 2670 type HiddenByThreadgate = S::HiddenByThreadgate; 2674 - } 2675 - ///State transition - sets the `hidden_by_threadgate` field to Set 2676 - pub struct SetHiddenByThreadgate<S: State = Empty>(PhantomData<fn() -> S>); 2677 - impl<S: State> sealed::Sealed for SetHiddenByThreadgate<S> {} 2678 - impl<S: State> State for SetHiddenByThreadgate<S> { 2679 - type MutedByViewer = S::MutedByViewer; 2671 + type OpThread = S::OpThread; 2672 + type MutedByViewer = Set<members::muted_by_viewer>; 2680 2673 type MoreParents = S::MoreParents; 2674 + } 2675 + ///State transition - sets the `more_parents` field to Set 2676 + pub struct SetMoreParents<S: State = Empty>(PhantomData<fn() -> S>); 2677 + impl<S: State> sealed::Sealed for SetMoreParents<S> {} 2678 + impl<S: State> State for SetMoreParents<S> { 2679 + type Post = S::Post; 2681 2680 type MoreReplies = S::MoreReplies; 2681 + type HiddenByThreadgate = S::HiddenByThreadgate; 2682 2682 type OpThread = S::OpThread; 2683 - type Post = S::Post; 2684 - type HiddenByThreadgate = Set<members::hidden_by_threadgate>; 2683 + type MutedByViewer = S::MutedByViewer; 2684 + type MoreParents = Set<members::more_parents>; 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 `muted_by_viewer` field 2690 - pub struct muted_by_viewer(()); 2691 - ///Marker type for the `more_parents` field 2692 - pub struct more_parents(()); 2693 - ///Marker type for the `more_replies` field 2694 - pub struct more_replies(()); 2695 - ///Marker type for the `op_thread` field 2696 - pub struct op_thread(()); 2697 2689 ///Marker type for the `post` field 2698 2690 pub struct post(()); 2691 + ///Marker type for the `more_replies` field 2692 + pub struct more_replies(()); 2699 2693 ///Marker type for the `hidden_by_threadgate` field 2700 2694 pub struct hidden_by_threadgate(()); 2695 + ///Marker type for the `op_thread` field 2696 + pub struct op_thread(()); 2697 + ///Marker type for the `muted_by_viewer` field 2698 + pub struct muted_by_viewer(()); 2699 + ///Marker type for the `more_parents` field 2700 + pub struct more_parents(()); 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::MutedByViewer: thread_item_post_state::IsSet, 2854 - S::MoreParents: thread_item_post_state::IsSet, 2853 + S::Post: thread_item_post_state::IsSet, 2855 2854 S::MoreReplies: thread_item_post_state::IsSet, 2855 + S::HiddenByThreadgate: thread_item_post_state::IsSet, 2856 2856 S::OpThread: thread_item_post_state::IsSet, 2857 - S::Post: thread_item_post_state::IsSet, 2858 - S::HiddenByThreadgate: thread_item_post_state::IsSet, 2857 + S::MutedByViewer: thread_item_post_state::IsSet, 2858 + S::MoreParents: thread_item_post_state::IsSet, 2859 2859 { 2860 2860 /// Build the final struct 2861 2861 pub fn build(self) -> ThreadItemPost<'a> { ··· 2946 2946 } 2947 2947 /// State trait tracking which required fields have been set 2948 2948 pub trait State: sealed::Sealed { 2949 - type Topic; 2950 - type Actors; 2951 - type StartedAt; 2952 2949 type PostCount; 2953 - type Link; 2954 2950 type DisplayName; 2951 + type StartedAt; 2952 + type Topic; 2953 + type Link; 2954 + type Actors; 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 + type PostCount = Unset; 2961 + type DisplayName = Unset; 2962 + type StartedAt = Unset; 2960 2963 type Topic = Unset; 2964 + type Link = Unset; 2961 2965 type Actors = Unset; 2962 - type StartedAt = Unset; 2963 - type PostCount = Unset; 2964 - type Link = Unset; 2965 - type DisplayName = Unset; 2966 2966 } 2967 - ///State transition - sets the `topic` field to Set 2968 - pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>); 2969 - impl<S: State> sealed::Sealed for SetTopic<S> {} 2970 - impl<S: State> State for SetTopic<S> { 2971 - type Topic = Set<members::topic>; 2972 - type Actors = S::Actors; 2967 + ///State transition - sets the `post_count` field to Set 2968 + pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>); 2969 + impl<S: State> sealed::Sealed for SetPostCount<S> {} 2970 + impl<S: State> State for SetPostCount<S> { 2971 + type PostCount = Set<members::post_count>; 2972 + type DisplayName = S::DisplayName; 2973 2973 type StartedAt = S::StartedAt; 2974 - type PostCount = S::PostCount; 2974 + type Topic = S::Topic; 2975 2975 type Link = S::Link; 2976 - type DisplayName = S::DisplayName; 2976 + type Actors = S::Actors; 2977 2977 } 2978 - ///State transition - sets the `actors` field to Set 2979 - pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>); 2980 - impl<S: State> sealed::Sealed for SetActors<S> {} 2981 - impl<S: State> State for SetActors<S> { 2982 - type Topic = S::Topic; 2983 - type Actors = Set<members::actors>; 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 PostCount = S::PostCount; 2983 + type DisplayName = Set<members::display_name>; 2984 2984 type StartedAt = S::StartedAt; 2985 - type PostCount = S::PostCount; 2985 + type Topic = S::Topic; 2986 2986 type Link = S::Link; 2987 - type DisplayName = S::DisplayName; 2987 + type Actors = S::Actors; 2988 2988 } 2989 2989 ///State transition - sets the `started_at` field to Set 2990 2990 pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>); 2991 2991 impl<S: State> sealed::Sealed for SetStartedAt<S> {} 2992 2992 impl<S: State> State for SetStartedAt<S> { 2993 + type PostCount = S::PostCount; 2994 + type DisplayName = S::DisplayName; 2995 + type StartedAt = Set<members::started_at>; 2993 2996 type Topic = S::Topic; 2997 + type Link = S::Link; 2994 2998 type Actors = S::Actors; 2995 - type StartedAt = Set<members::started_at>; 2999 + } 3000 + ///State transition - sets the `topic` field to Set 3001 + pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>); 3002 + impl<S: State> sealed::Sealed for SetTopic<S> {} 3003 + impl<S: State> State for SetTopic<S> { 2996 3004 type PostCount = S::PostCount; 2997 - type Link = S::Link; 2998 3005 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 3006 type StartedAt = S::StartedAt; 3007 - type PostCount = Set<members::post_count>; 3007 + type Topic = Set<members::topic>; 3008 3008 type Link = S::Link; 3009 - type DisplayName = S::DisplayName; 3009 + type Actors = S::Actors; 3010 3010 } 3011 3011 ///State transition - sets the `link` field to Set 3012 3012 pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 3013 3013 impl<S: State> sealed::Sealed for SetLink<S> {} 3014 3014 impl<S: State> State for SetLink<S> { 3015 - type Topic = S::Topic; 3016 - type Actors = S::Actors; 3017 - type StartedAt = S::StartedAt; 3018 3015 type PostCount = S::PostCount; 3019 - type Link = Set<members::link>; 3020 3016 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> { 3017 + type StartedAt = S::StartedAt; 3026 3018 type Topic = S::Topic; 3019 + type Link = Set<members::link>; 3027 3020 type Actors = S::Actors; 3028 - type StartedAt = S::StartedAt; 3021 + } 3022 + ///State transition - sets the `actors` field to Set 3023 + pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>); 3024 + impl<S: State> sealed::Sealed for SetActors<S> {} 3025 + impl<S: State> State for SetActors<S> { 3029 3026 type PostCount = S::PostCount; 3027 + type DisplayName = S::DisplayName; 3028 + type StartedAt = S::StartedAt; 3029 + type Topic = S::Topic; 3030 3030 type Link = S::Link; 3031 - type DisplayName = Set<members::display_name>; 3031 + type Actors = Set<members::actors>; 3032 3032 } 3033 3033 /// Marker types for field names 3034 3034 #[allow(non_camel_case_types)] 3035 3035 pub mod members { 3036 + ///Marker type for the `post_count` field 3037 + pub struct post_count(()); 3038 + ///Marker type for the `display_name` field 3039 + pub struct display_name(()); 3040 + ///Marker type for the `started_at` field 3041 + pub struct started_at(()); 3036 3042 ///Marker type for the `topic` field 3037 3043 pub struct topic(()); 3044 + ///Marker type for the `link` field 3045 + pub struct link(()); 3038 3046 ///Marker type for the `actors` field 3039 3047 pub struct actors(()); 3040 - ///Marker type for the `started_at` field 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 ··· 3228 3228 impl<'a, S> TrendViewBuilder<'a, S> 3229 3229 where 3230 3230 S: trend_view_state::State, 3231 - S::Topic: trend_view_state::IsSet, 3232 - S::Actors: trend_view_state::IsSet, 3233 - S::StartedAt: trend_view_state::IsSet, 3234 3231 S::PostCount: trend_view_state::IsSet, 3235 - S::Link: trend_view_state::IsSet, 3236 3232 S::DisplayName: trend_view_state::IsSet, 3233 + S::StartedAt: trend_view_state::IsSet, 3234 + S::Topic: trend_view_state::IsSet, 3235 + S::Link: trend_view_state::IsSet, 3236 + S::Actors: trend_view_state::IsSet, 3237 3237 { 3238 3238 /// Build the final struct 3239 3239 pub fn build(self) -> TrendView<'a> {
+13 -13
crates/weaver-api/src/app_bsky/unspecced/get_config.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 Domains; 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 Domains = 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 Domains = S::Domains; 44 + type Did = Unset; 52 45 } 53 46 ///State transition - sets the `domains` field to Set 54 47 pub struct SetDomains<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetDomains<S> {} 56 49 impl<S: State> State for SetDomains<S> { 57 - type Did = S::Did; 58 50 type Domains = Set<members::domains>; 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 Domains = S::Domains; 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 `domains` field 66 64 pub struct domains(()); 65 + ///Marker type for the `did` field 66 + pub struct did(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> LiveNowConfigBuilder<'a, S> 137 137 where 138 138 S: live_now_config_state::State, 139 - S::Did: live_now_config_state::IsSet, 140 139 S::Domains: live_now_config_state::IsSet, 140 + S::Did: live_now_config_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> LiveNowConfig<'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 Depth; 193 - type Value; 194 192 type Uri; 193 + type Value; 194 + type Depth; 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 Uri = Unset; 201 + type Value = Unset; 200 202 type Depth = Unset; 201 - type Value = Unset; 202 - type Uri = Unset; 203 203 } 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>; 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>; 209 209 type Value = S::Value; 210 - type Uri = S::Uri; 210 + type Depth = S::Depth; 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 Depth = S::Depth; 217 - type Value = Set<members::value>; 218 216 type Uri = S::Uri; 217 + type Value = Set<members::value>; 218 + type Depth = S::Depth; 219 219 } 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; 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; 225 225 type Value = S::Value; 226 - type Uri = Set<members::uri>; 226 + type Depth = Set<members::depth>; 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 `uri` field 232 + pub struct uri(()); 233 + ///Marker type for the `value` field 234 + pub struct value(()); 231 235 ///Marker type for the `depth` field 232 236 pub struct depth(()); 233 - ///Marker type for the `value` field 234 - pub struct value(()); 235 - ///Marker type for the `uri` field 236 - pub struct uri(()); 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::Depth: thread_item_state::IsSet, 330 - S::Value: thread_item_state::IsSet, 331 329 S::Uri: thread_item_state::IsSet, 330 + S::Value: thread_item_state::IsSet, 331 + S::Depth: thread_item_state::IsSet, 332 332 { 333 333 /// Build the final struct 334 334 pub fn build(self) -> ThreadItem<'a> {
+24 -24
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 Depth; 269 - type Uri; 270 268 type Value; 269 + type Uri; 270 + type Depth; 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 Value = Unset; 277 + type Uri = Unset; 276 278 type Depth = Unset; 277 - type Uri = Unset; 278 - type Value = Unset; 279 279 } 280 - ///State transition - sets the `depth` field to Set 281 - pub struct SetDepth<S: State = Empty>(PhantomData<fn() -> S>); 282 - impl<S: State> sealed::Sealed for SetDepth<S> {} 283 - impl<S: State> State for SetDepth<S> { 284 - type Depth = Set<members::depth>; 280 + ///State transition - sets the `value` field to Set 281 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 282 + impl<S: State> sealed::Sealed for SetValue<S> {} 283 + impl<S: State> State for SetValue<S> { 284 + type Value = Set<members::value>; 285 285 type Uri = S::Uri; 286 - type Value = S::Value; 286 + type Depth = S::Depth; 287 287 } 288 288 ///State transition - sets the `uri` field to Set 289 289 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 290 290 impl<S: State> sealed::Sealed for SetUri<S> {} 291 291 impl<S: State> State for SetUri<S> { 292 - type Depth = S::Depth; 293 - type Uri = Set<members::uri>; 294 292 type Value = S::Value; 293 + type Uri = Set<members::uri>; 294 + type Depth = S::Depth; 295 295 } 296 - ///State transition - sets the `value` field to Set 297 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 298 - impl<S: State> sealed::Sealed for SetValue<S> {} 299 - impl<S: State> State for SetValue<S> { 300 - type Depth = S::Depth; 296 + ///State transition - sets the `depth` field to Set 297 + pub struct SetDepth<S: State = Empty>(PhantomData<fn() -> S>); 298 + impl<S: State> sealed::Sealed for SetDepth<S> {} 299 + impl<S: State> State for SetDepth<S> { 300 + type Value = S::Value; 301 301 type Uri = S::Uri; 302 - type Value = Set<members::value>; 302 + type Depth = Set<members::depth>; 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 `value` field 308 + pub struct value(()); 309 + ///Marker type for the `uri` field 310 + pub struct uri(()); 307 311 ///Marker type for the `depth` field 308 312 pub struct depth(()); 309 - ///Marker type for the `uri` field 310 - pub struct uri(()); 311 - ///Marker type for the `value` field 312 - pub struct value(()); 313 313 } 314 314 } 315 315 ··· 402 402 impl<'a, S> ThreadItemBuilder<'a, S> 403 403 where 404 404 S: thread_item_state::State, 405 - S::Depth: thread_item_state::IsSet, 406 - S::Uri: thread_item_state::IsSet, 407 405 S::Value: thread_item_state::IsSet, 406 + S::Uri: thread_item_state::IsSet, 407 + S::Depth: thread_item_state::IsSet, 408 408 { 409 409 /// Build the final struct 410 410 pub fn build(self) -> ThreadItem<'a> {
+15 -15
crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs
··· 91 91 /// State trait tracking which required fields have been set 92 92 pub trait State: sealed::Sealed { 93 93 type SubjectType; 94 - type Tag; 95 94 type Subject; 95 + type Tag; 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 101 type SubjectType = Unset; 102 - type Tag = Unset; 103 102 type Subject = Unset; 103 + type Tag = Unset; 104 104 } 105 105 ///State transition - sets the `subject_type` field to Set 106 106 pub struct SetSubjectType<S: State = Empty>(PhantomData<fn() -> S>); 107 107 impl<S: State> sealed::Sealed for SetSubjectType<S> {} 108 108 impl<S: State> State for SetSubjectType<S> { 109 109 type SubjectType = Set<members::subject_type>; 110 - type Tag = S::Tag; 111 110 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 - type Subject = S::Subject; 111 + type Tag = S::Tag; 120 112 } 121 113 ///State transition - sets the `subject` field to Set 122 114 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 123 115 impl<S: State> sealed::Sealed for SetSubject<S> {} 124 116 impl<S: State> State for SetSubject<S> { 125 117 type SubjectType = S::SubjectType; 126 - type Tag = S::Tag; 127 118 type Subject = Set<members::subject>; 119 + type Tag = S::Tag; 120 + } 121 + ///State transition - sets the `tag` field to Set 122 + pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 123 + impl<S: State> sealed::Sealed for SetTag<S> {} 124 + impl<S: State> State for SetTag<S> { 125 + type SubjectType = S::SubjectType; 126 + type Subject = S::Subject; 127 + type Tag = Set<members::tag>; 128 128 } 129 129 /// Marker types for field names 130 130 #[allow(non_camel_case_types)] 131 131 pub mod members { 132 132 ///Marker type for the `subject_type` field 133 133 pub struct subject_type(()); 134 + ///Marker type for the `subject` field 135 + pub struct subject(()); 134 136 ///Marker type for the `tag` field 135 137 pub struct tag(()); 136 - ///Marker type for the `subject` field 137 - pub struct subject(()); 138 138 } 139 139 } 140 140 ··· 228 228 where 229 229 S: suggestion_state::State, 230 230 S::SubjectType: suggestion_state::IsSet, 231 - S::Tag: suggestion_state::IsSet, 232 231 S::Subject: suggestion_state::IsSet, 232 + S::Tag: suggestion_state::IsSet, 233 233 { 234 234 /// Build the final struct 235 235 pub fn build(self) -> Suggestion<'a> {
+1
crates/weaver-api/src/blog_pckt.rs
··· 5 5 6 6 pub mod block; 7 7 pub mod blog; 8 + pub mod content; 8 9 pub mod document; 9 10 pub mod mark; 10 11 pub mod post;
+13 -13
crates/weaver-api/src/blog_pckt/block/image.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Width; 38 37 type Height; 38 + type Width; 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 Width = Unset; 45 44 type Height = Unset; 46 - } 47 - ///State transition - sets the `width` field to Set 48 - pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetWidth<S> {} 50 - impl<S: State> State for SetWidth<S> { 51 - type Width = Set<members::width>; 52 - type Height = S::Height; 45 + type Width = Unset; 53 46 } 54 47 ///State transition - sets the `height` field to Set 55 48 pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetHeight<S> {} 57 50 impl<S: State> State for SetHeight<S> { 58 - type Width = S::Width; 59 51 type Height = Set<members::height>; 52 + type Width = S::Width; 53 + } 54 + ///State transition - sets the `width` field to Set 55 + pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetWidth<S> {} 57 + impl<S: State> State for SetWidth<S> { 58 + type Height = S::Height; 59 + type Width = Set<members::width>; 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 `width` field 65 - pub struct width(()); 66 64 ///Marker type for the `height` field 67 65 pub struct height(()); 66 + ///Marker type for the `width` field 67 + pub struct width(()); 68 68 } 69 69 } 70 70 ··· 134 134 impl<'a, S> AspectRatioBuilder<'a, S> 135 135 where 136 136 S: aspect_ratio_state::State, 137 - S::Width: aspect_ratio_state::IsSet, 138 137 S::Height: aspect_ratio_state::IsSet, 138 + S::Width: aspect_ratio_state::IsSet, 139 139 { 140 140 /// Build the final struct 141 141 pub fn build(self) -> AspectRatio<'a> {
+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 Did; 39 38 type Handle; 39 + type Did; 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 Did = Unset; 46 45 type Handle = Unset; 47 - } 48 - ///State transition - sets the `did` field to Set 49 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetDid<S> {} 51 - impl<S: State> State for SetDid<S> { 52 - type Did = Set<members::did>; 53 - type Handle = S::Handle; 46 + type Did = Unset; 54 47 } 55 48 ///State transition - sets the `handle` field to Set 56 49 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 57 50 impl<S: State> sealed::Sealed for SetHandle<S> {} 58 51 impl<S: State> State for SetHandle<S> { 59 - type Did = S::Did; 60 52 type Handle = Set<members::handle>; 53 + type Did = S::Did; 54 + } 55 + ///State transition - sets the `did` field to Set 56 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetDid<S> {} 58 + impl<S: State> State for SetDid<S> { 59 + type Handle = S::Handle; 60 + type Did = Set<members::did>; 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 `did` field 66 - pub struct did(()); 67 65 ///Marker type for the `handle` field 68 66 pub struct handle(()); 67 + ///Marker type for the `did` field 68 + pub struct did(()); 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::Did: mention_state::IsSet, 142 141 S::Handle: mention_state::IsSet, 142 + S::Did: 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 Content; 38 37 type Checked; 38 + type Content; 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 Content = Unset; 45 44 type Checked = Unset; 46 - } 47 - ///State transition - sets the `content` field to Set 48 - pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetContent<S> {} 50 - impl<S: State> State for SetContent<S> { 51 - type Content = Set<members::content>; 52 - type Checked = S::Checked; 45 + type Content = Unset; 53 46 } 54 47 ///State transition - sets the `checked` field to Set 55 48 pub struct SetChecked<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetChecked<S> {} 57 50 impl<S: State> State for SetChecked<S> { 58 - type Content = S::Content; 59 51 type Checked = Set<members::checked>; 52 + type Content = S::Content; 53 + } 54 + ///State transition - sets the `content` field to Set 55 + pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetContent<S> {} 57 + impl<S: State> State for SetContent<S> { 58 + type Checked = S::Checked; 59 + type Content = Set<members::content>; 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 `content` field 65 - pub struct content(()); 66 64 ///Marker type for the `checked` field 67 65 pub struct checked(()); 66 + ///Marker type for the `content` field 67 + pub struct content(()); 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::Content: task_item_state::IsSet, 141 140 S::Checked: task_item_state::IsSet, 141 + S::Content: task_item_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> TaskItem<'a> {
+190
crates/weaver-api/src/blog_pckt/content.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: blog.pckt.content 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + #[jacquard_derive::lexicon] 9 + #[derive( 10 + serde::Serialize, 11 + serde::Deserialize, 12 + Debug, 13 + Clone, 14 + PartialEq, 15 + Eq, 16 + jacquard_derive::IntoStatic 17 + )] 18 + #[serde(rename_all = "camelCase")] 19 + pub struct Content<'a> { 20 + /// Array of content blocks 21 + #[serde(borrow)] 22 + pub items: Vec<jacquard_common::types::value::Data<'a>>, 23 + } 24 + 25 + pub mod content_state { 26 + 27 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 28 + #[allow(unused)] 29 + use ::core::marker::PhantomData; 30 + mod sealed { 31 + pub trait Sealed {} 32 + } 33 + /// State trait tracking which required fields have been set 34 + pub trait State: sealed::Sealed { 35 + type Items; 36 + } 37 + /// Empty state - all required fields are unset 38 + pub struct Empty(()); 39 + impl sealed::Sealed for Empty {} 40 + impl State for Empty { 41 + type Items = Unset; 42 + } 43 + ///State transition - sets the `items` field to Set 44 + pub struct SetItems<S: State = Empty>(PhantomData<fn() -> S>); 45 + impl<S: State> sealed::Sealed for SetItems<S> {} 46 + impl<S: State> State for SetItems<S> { 47 + type Items = Set<members::items>; 48 + } 49 + /// Marker types for field names 50 + #[allow(non_camel_case_types)] 51 + pub mod members { 52 + ///Marker type for the `items` field 53 + pub struct items(()); 54 + } 55 + } 56 + 57 + /// Builder for constructing an instance of this type 58 + pub struct ContentBuilder<'a, S: content_state::State> { 59 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 60 + __unsafe_private_named: ( 61 + ::core::option::Option<Vec<jacquard_common::types::value::Data<'a>>>, 62 + ), 63 + _phantom: ::core::marker::PhantomData<&'a ()>, 64 + } 65 + 66 + impl<'a> Content<'a> { 67 + /// Create a new builder for this type 68 + pub fn new() -> ContentBuilder<'a, content_state::Empty> { 69 + ContentBuilder::new() 70 + } 71 + } 72 + 73 + impl<'a> ContentBuilder<'a, content_state::Empty> { 74 + /// Create a new builder with all fields unset 75 + pub fn new() -> Self { 76 + ContentBuilder { 77 + _phantom_state: ::core::marker::PhantomData, 78 + __unsafe_private_named: (None,), 79 + _phantom: ::core::marker::PhantomData, 80 + } 81 + } 82 + } 83 + 84 + impl<'a, S> ContentBuilder<'a, S> 85 + where 86 + S: content_state::State, 87 + S::Items: content_state::IsUnset, 88 + { 89 + /// Set the `items` field (required) 90 + pub fn items( 91 + mut self, 92 + value: impl Into<Vec<jacquard_common::types::value::Data<'a>>>, 93 + ) -> ContentBuilder<'a, content_state::SetItems<S>> { 94 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 95 + ContentBuilder { 96 + _phantom_state: ::core::marker::PhantomData, 97 + __unsafe_private_named: self.__unsafe_private_named, 98 + _phantom: ::core::marker::PhantomData, 99 + } 100 + } 101 + } 102 + 103 + impl<'a, S> ContentBuilder<'a, S> 104 + where 105 + S: content_state::State, 106 + S::Items: content_state::IsSet, 107 + { 108 + /// Build the final struct 109 + pub fn build(self) -> Content<'a> { 110 + Content { 111 + items: self.__unsafe_private_named.0.unwrap(), 112 + extra_data: Default::default(), 113 + } 114 + } 115 + /// Build the final struct with custom extra_data 116 + pub fn build_with_data( 117 + self, 118 + extra_data: std::collections::BTreeMap< 119 + jacquard_common::smol_str::SmolStr, 120 + jacquard_common::types::value::Data<'a>, 121 + >, 122 + ) -> Content<'a> { 123 + Content { 124 + items: self.__unsafe_private_named.0.unwrap(), 125 + extra_data: Some(extra_data), 126 + } 127 + } 128 + } 129 + 130 + fn lexicon_doc_blog_pckt_content() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 131 + ::jacquard_lexicon::lexicon::LexiconDoc { 132 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 133 + id: ::jacquard_common::CowStr::new_static("blog.pckt.content"), 134 + revision: None, 135 + description: None, 136 + defs: { 137 + let mut map = ::alloc::collections::BTreeMap::new(); 138 + map.insert( 139 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 140 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 141 + description: None, 142 + required: Some( 143 + vec![::jacquard_common::smol_str::SmolStr::new_static("items")], 144 + ), 145 + nullable: None, 146 + properties: { 147 + #[allow(unused_mut)] 148 + let mut map = ::alloc::collections::BTreeMap::new(); 149 + map.insert( 150 + ::jacquard_common::smol_str::SmolStr::new_static("items"), 151 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 152 + description: Some( 153 + ::jacquard_common::CowStr::new_static( 154 + "Array of content blocks", 155 + ), 156 + ), 157 + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { 158 + description: None, 159 + refs: vec![], 160 + closed: Some(false), 161 + }), 162 + min_length: None, 163 + max_length: None, 164 + }), 165 + ); 166 + map 167 + }, 168 + }), 169 + ); 170 + map 171 + }, 172 + } 173 + } 174 + 175 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Content<'a> { 176 + fn nsid() -> &'static str { 177 + "blog.pckt.content" 178 + } 179 + fn def_name() -> &'static str { 180 + "main" 181 + } 182 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 183 + lexicon_doc_blog_pckt_content() 184 + } 185 + fn validate( 186 + &self, 187 + ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 188 + Ok(()) 189 + } 190 + }
+28 -28
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 Blog; 56 + type Title; 57 57 type Blocks; 58 + type Blog; 58 59 type Url; 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; 66 + type Blocks = Unset; 65 67 type Blog = Unset; 66 - type Blocks = Unset; 67 68 type Url = Unset; 68 - type Title = Unset; 69 69 } 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>; 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 75 type Blocks = S::Blocks; 76 + type Blog = S::Blog; 76 77 type Url = S::Url; 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; 84 + type Blocks = Set<members::blocks>; 83 85 type Blog = S::Blog; 84 - type Blocks = Set<members::blocks>; 85 86 type Url = S::Url; 87 + } 88 + ///State transition - sets the `blog` field to Set 89 + pub struct SetBlog<S: State = Empty>(PhantomData<fn() -> S>); 90 + impl<S: State> sealed::Sealed for SetBlog<S> {} 91 + impl<S: State> State for SetBlog<S> { 86 92 type Title = S::Title; 93 + type Blocks = S::Blocks; 94 + type Blog = Set<members::blog>; 95 + type Url = S::Url; 87 96 } 88 97 ///State transition - sets the `url` field to Set 89 98 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 90 99 impl<S: State> sealed::Sealed for SetUrl<S> {} 91 100 impl<S: State> State for SetUrl<S> { 92 - type Blog = S::Blog; 93 - type Blocks = S::Blocks; 94 - type Url = Set<members::url>; 95 101 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 - type Url = S::Url; 104 - type Title = Set<members::title>; 103 + type Blog = S::Blog; 104 + type Url = Set<members::url>; 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 `blog` field 110 - pub struct blog(()); 109 + ///Marker type for the `title` field 110 + pub struct title(()); 111 111 ///Marker type for the `blocks` field 112 112 pub struct blocks(()); 113 + ///Marker type for the `blog` field 114 + pub struct blog(()); 113 115 ///Marker type for the `url` field 114 116 pub struct url(()); 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::Blog: post_state::IsSet, 360 + S::Title: post_state::IsSet, 361 361 S::Blocks: post_state::IsSet, 362 + S::Blog: post_state::IsSet, 362 363 S::Url: 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> {
+13 -13
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 ByteEnd; 556 555 type ByteStart; 556 + type ByteEnd; 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 ByteEnd = Unset; 563 562 type ByteStart = Unset; 564 - } 565 - ///State transition - sets the `byte_end` field to Set 566 - pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>); 567 - impl<S: State> sealed::Sealed for SetByteEnd<S> {} 568 - impl<S: State> State for SetByteEnd<S> { 569 - type ByteEnd = Set<members::byte_end>; 570 - type ByteStart = S::ByteStart; 563 + type ByteEnd = Unset; 571 564 } 572 565 ///State transition - sets the `byte_start` field to Set 573 566 pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 574 567 impl<S: State> sealed::Sealed for SetByteStart<S> {} 575 568 impl<S: State> State for SetByteStart<S> { 576 - type ByteEnd = S::ByteEnd; 577 569 type ByteStart = Set<members::byte_start>; 570 + type ByteEnd = S::ByteEnd; 571 + } 572 + ///State transition - sets the `byte_end` field to Set 573 + pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>); 574 + impl<S: State> sealed::Sealed for SetByteEnd<S> {} 575 + impl<S: State> State for SetByteEnd<S> { 576 + type ByteStart = S::ByteStart; 577 + type ByteEnd = Set<members::byte_end>; 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_end` field 583 - pub struct byte_end(()); 584 582 ///Marker type for the `byte_start` field 585 583 pub struct byte_start(()); 584 + ///Marker type for the `byte_end` field 585 + pub struct byte_end(()); 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::ByteEnd: byte_slice_state::IsSet, 656 655 S::ByteStart: byte_slice_state::IsSet, 656 + S::ByteEnd: byte_slice_state::IsSet, 657 657 { 658 658 /// Build the final struct 659 659 pub fn build(self) -> ByteSlice<'a> {
+165 -165
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; 70 69 type Muted; 71 70 type UnreadCount; 72 - type Rev; 71 + type Id; 73 72 type Members; 73 + type Rev; 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; 80 79 type Muted = Unset; 81 80 type UnreadCount = Unset; 82 - type Rev = Unset; 81 + type Id = Unset; 83 82 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; 83 + type Rev = Unset; 94 84 } 95 85 ///State transition - sets the `muted` field to Set 96 86 pub struct SetMuted<S: State = Empty>(PhantomData<fn() -> S>); 97 87 impl<S: State> sealed::Sealed for SetMuted<S> {} 98 88 impl<S: State> State for SetMuted<S> { 99 - type Id = S::Id; 100 89 type Muted = Set<members::muted>; 101 90 type UnreadCount = S::UnreadCount; 91 + type Id = S::Id; 92 + type Members = S::Members; 102 93 type Rev = S::Rev; 103 - type Members = S::Members; 104 94 } 105 95 ///State transition - sets the `unread_count` field to Set 106 96 pub struct SetUnreadCount<S: State = Empty>(PhantomData<fn() -> S>); 107 97 impl<S: State> sealed::Sealed for SetUnreadCount<S> {} 108 98 impl<S: State> State for SetUnreadCount<S> { 109 - type Id = S::Id; 110 99 type Muted = S::Muted; 111 100 type UnreadCount = Set<members::unread_count>; 112 - type Rev = S::Rev; 101 + type Id = S::Id; 113 102 type Members = S::Members; 103 + type Rev = S::Rev; 114 104 } 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; 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> { 120 109 type Muted = S::Muted; 121 110 type UnreadCount = S::UnreadCount; 122 - type Rev = Set<members::rev>; 111 + type Id = Set<members::id>; 123 112 type Members = S::Members; 113 + type Rev = S::Rev; 124 114 } 125 115 ///State transition - sets the `members` field to Set 126 116 pub struct SetMembers<S: State = Empty>(PhantomData<fn() -> S>); 127 117 impl<S: State> sealed::Sealed for SetMembers<S> {} 128 118 impl<S: State> State for SetMembers<S> { 129 - type Id = S::Id; 130 119 type Muted = S::Muted; 131 120 type UnreadCount = S::UnreadCount; 132 - type Rev = S::Rev; 121 + type Id = S::Id; 133 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 + type Muted = S::Muted; 130 + type UnreadCount = S::UnreadCount; 131 + type Id = S::Id; 132 + type Members = S::Members; 133 + type Rev = Set<members::rev>; 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(()); 140 138 ///Marker type for the `muted` field 141 139 pub struct muted(()); 142 140 ///Marker type for the `unread_count` field 143 141 pub struct unread_count(()); 142 + ///Marker type for the `id` field 143 + pub struct id(()); 144 + ///Marker type for the `members` field 145 + pub struct members(()); 144 146 ///Marker type for the `rev` field 145 147 pub struct rev(()); 146 - ///Marker type for the `members` field 147 - pub struct members(()); 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, 335 334 S::Muted: convo_view_state::IsSet, 336 335 S::UnreadCount: convo_view_state::IsSet, 337 - S::Rev: convo_view_state::IsSet, 336 + S::Id: convo_view_state::IsSet, 338 337 S::Members: convo_view_state::IsSet, 338 + S::Rev: 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; 1737 - type Sender; 1738 1736 type Id; 1737 + type Rev; 1739 1738 type SentAt; 1739 + type Sender; 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 Id = Unset; 1745 1746 type Rev = Unset; 1747 + type SentAt = Unset; 1746 1748 type Sender = Unset; 1747 - type Id = Unset; 1748 - type SentAt = Unset; 1749 + } 1750 + ///State transition - sets the `id` field to Set 1751 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 1752 + impl<S: State> sealed::Sealed for SetId<S> {} 1753 + impl<S: State> State for SetId<S> { 1754 + type Id = Set<members::id>; 1755 + type Rev = S::Rev; 1756 + type SentAt = S::SentAt; 1757 + type Sender = S::Sender; 1749 1758 } 1750 1759 ///State transition - sets the `rev` field to Set 1751 1760 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1752 1761 impl<S: State> sealed::Sealed for SetRev<S> {} 1753 1762 impl<S: State> State for SetRev<S> { 1763 + type Id = S::Id; 1754 1764 type Rev = Set<members::rev>; 1765 + type SentAt = S::SentAt; 1755 1766 type Sender = S::Sender; 1767 + } 1768 + ///State transition - sets the `sent_at` field to Set 1769 + pub struct SetSentAt<S: State = Empty>(PhantomData<fn() -> S>); 1770 + impl<S: State> sealed::Sealed for SetSentAt<S> {} 1771 + impl<S: State> State for SetSentAt<S> { 1756 1772 type Id = S::Id; 1757 - type SentAt = S::SentAt; 1773 + type Rev = S::Rev; 1774 + type SentAt = Set<members::sent_at>; 1775 + type Sender = S::Sender; 1758 1776 } 1759 1777 ///State transition - sets the `sender` field to Set 1760 1778 pub struct SetSender<S: State = Empty>(PhantomData<fn() -> S>); 1761 1779 impl<S: State> sealed::Sealed for SetSender<S> {} 1762 1780 impl<S: State> State for SetSender<S> { 1763 - type Rev = S::Rev; 1764 - type Sender = Set<members::sender>; 1765 1781 type Id = S::Id; 1766 - type SentAt = S::SentAt; 1767 - } 1768 - ///State transition - sets the `id` field to Set 1769 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 1770 - impl<S: State> sealed::Sealed for SetId<S> {} 1771 - impl<S: State> State for SetId<S> { 1772 1782 type Rev = S::Rev; 1773 - type Sender = S::Sender; 1774 - type Id = Set<members::id>; 1775 1783 type SentAt = S::SentAt; 1776 - } 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; 1782 - type Sender = S::Sender; 1783 - type Id = S::Id; 1784 - type SentAt = Set<members::sent_at>; 1784 + type Sender = Set<members::sender>; 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 `id` field 1790 + pub struct id(()); 1789 1791 ///Marker type for the `rev` field 1790 1792 pub struct rev(()); 1793 + ///Marker type for the `sent_at` field 1794 + pub struct sent_at(()); 1791 1795 ///Marker type for the `sender` field 1792 1796 pub struct sender(()); 1793 - ///Marker type for the `id` field 1794 - pub struct id(()); 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::Id: deleted_message_view_state::IsSet, 1909 1910 S::Rev: deleted_message_view_state::IsSet, 1911 + S::SentAt: deleted_message_view_state::IsSet, 1910 1912 S::Sender: deleted_message_view_state::IsSet, 1911 - S::Id: 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> { ··· 2024 2024 } 2025 2025 /// State trait tracking which required fields have been set 2026 2026 pub trait State: sealed::Sealed { 2027 - type Rev; 2028 2027 type ConvoId; 2029 - type Reaction; 2028 + type Rev; 2030 2029 type Message; 2030 + type Reaction; 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 - type Rev = Unset; 2037 2036 type ConvoId = Unset; 2038 - type Reaction = Unset; 2037 + type Rev = Unset; 2039 2038 type Message = Unset; 2040 - } 2041 - ///State transition - sets the `rev` field to Set 2042 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2043 - impl<S: State> sealed::Sealed for SetRev<S> {} 2044 - impl<S: State> State for SetRev<S> { 2045 - type Rev = Set<members::rev>; 2046 - type ConvoId = S::ConvoId; 2047 - type Reaction = S::Reaction; 2048 - type Message = S::Message; 2039 + type Reaction = Unset; 2049 2040 } 2050 2041 ///State transition - sets the `convo_id` field to Set 2051 2042 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2052 2043 impl<S: State> sealed::Sealed for SetConvoId<S> {} 2053 2044 impl<S: State> State for SetConvoId<S> { 2045 + type ConvoId = Set<members::convo_id>; 2054 2046 type Rev = S::Rev; 2055 - type ConvoId = Set<members::convo_id>; 2047 + type Message = S::Message; 2056 2048 type Reaction = S::Reaction; 2057 - type Message = S::Message; 2058 2049 } 2059 - ///State transition - sets the `reaction` field to Set 2060 - pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 2061 - impl<S: State> sealed::Sealed for SetReaction<S> {} 2062 - impl<S: State> State for SetReaction<S> { 2063 - type Rev = S::Rev; 2050 + ///State transition - sets the `rev` field to Set 2051 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2052 + impl<S: State> sealed::Sealed for SetRev<S> {} 2053 + impl<S: State> State for SetRev<S> { 2064 2054 type ConvoId = S::ConvoId; 2065 - type Reaction = Set<members::reaction>; 2055 + type Rev = Set<members::rev>; 2066 2056 type Message = S::Message; 2057 + type Reaction = S::Reaction; 2067 2058 } 2068 2059 ///State transition - sets the `message` field to Set 2069 2060 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2070 2061 impl<S: State> sealed::Sealed for SetMessage<S> {} 2071 2062 impl<S: State> State for SetMessage<S> { 2072 - type Rev = S::Rev; 2073 2063 type ConvoId = S::ConvoId; 2074 - type Reaction = S::Reaction; 2064 + type Rev = S::Rev; 2075 2065 type Message = Set<members::message>; 2066 + type Reaction = S::Reaction; 2067 + } 2068 + ///State transition - sets the `reaction` field to Set 2069 + pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 2070 + impl<S: State> sealed::Sealed for SetReaction<S> {} 2071 + impl<S: State> State for SetReaction<S> { 2072 + type ConvoId = S::ConvoId; 2073 + type Rev = S::Rev; 2074 + type Message = S::Message; 2075 + type Reaction = Set<members::reaction>; 2076 2076 } 2077 2077 /// Marker types for field names 2078 2078 #[allow(non_camel_case_types)] 2079 2079 pub mod members { 2080 + ///Marker type for the `convo_id` field 2081 + pub struct convo_id(()); 2080 2082 ///Marker type for the `rev` field 2081 2083 pub struct rev(()); 2082 - ///Marker type for the `convo_id` field 2083 - pub struct convo_id(()); 2084 + ///Marker type for the `message` field 2085 + pub struct message(()); 2084 2086 ///Marker type for the `reaction` field 2085 2087 pub struct reaction(()); 2086 - ///Marker type for the `message` field 2087 - pub struct message(()); 2088 2088 } 2089 2089 } 2090 2090 ··· 2197 2197 impl<'a, S> LogAddReactionBuilder<'a, S> 2198 2198 where 2199 2199 S: log_add_reaction_state::State, 2200 - S::Rev: log_add_reaction_state::IsSet, 2201 2200 S::ConvoId: log_add_reaction_state::IsSet, 2202 - S::Reaction: log_add_reaction_state::IsSet, 2201 + S::Rev: log_add_reaction_state::IsSet, 2203 2202 S::Message: log_add_reaction_state::IsSet, 2203 + S::Reaction: 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 Message; 2335 2336 type Rev; 2336 2337 type ConvoId; 2337 - type Message; 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 Message = Unset; 2343 2344 type Rev = Unset; 2344 2345 type ConvoId = Unset; 2345 - type Message = Unset; 2346 + } 2347 + ///State transition - sets the `message` field to Set 2348 + pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2349 + impl<S: State> sealed::Sealed for SetMessage<S> {} 2350 + impl<S: State> State for SetMessage<S> { 2351 + type Message = Set<members::message>; 2352 + type Rev = S::Rev; 2353 + type ConvoId = S::ConvoId; 2346 2354 } 2347 2355 ///State transition - sets the `rev` field to Set 2348 2356 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2349 2357 impl<S: State> sealed::Sealed for SetRev<S> {} 2350 2358 impl<S: State> State for SetRev<S> { 2359 + type Message = S::Message; 2351 2360 type Rev = Set<members::rev>; 2352 2361 type ConvoId = S::ConvoId; 2353 - type Message = S::Message; 2354 2362 } 2355 2363 ///State transition - sets the `convo_id` field to Set 2356 2364 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2357 2365 impl<S: State> sealed::Sealed for SetConvoId<S> {} 2358 2366 impl<S: State> State for SetConvoId<S> { 2367 + type Message = S::Message; 2359 2368 type Rev = S::Rev; 2360 2369 type ConvoId = Set<members::convo_id>; 2361 - type Message = S::Message; 2362 - } 2363 - ///State transition - sets the `message` field to Set 2364 - pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2365 - impl<S: State> sealed::Sealed for SetMessage<S> {} 2366 - impl<S: State> State for SetMessage<S> { 2367 - type Rev = S::Rev; 2368 - type ConvoId = S::ConvoId; 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 `message` field 2375 + pub struct message(()); 2374 2376 ///Marker type for the `rev` field 2375 2377 pub struct rev(()); 2376 2378 ///Marker type for the `convo_id` field 2377 2379 pub struct convo_id(()); 2378 - ///Marker type for the `message` field 2379 - pub struct message(()); 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::Message: log_create_message_state::IsSet, 2472 2473 S::Rev: log_create_message_state::IsSet, 2473 2474 S::ConvoId: log_create_message_state::IsSet, 2474 - S::Message: 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 Rev; 2569 2568 type ConvoId; 2569 + type Rev; 2570 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 Rev = Unset; 2577 2576 type ConvoId = Unset; 2577 + type Rev = Unset; 2578 2578 type Message = Unset; 2579 2579 } 2580 + ///State transition - sets the `convo_id` field to Set 2581 + pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2582 + impl<S: State> sealed::Sealed for SetConvoId<S> {} 2583 + impl<S: State> State for SetConvoId<S> { 2584 + type ConvoId = Set<members::convo_id>; 2585 + type Rev = S::Rev; 2586 + type Message = S::Message; 2587 + } 2580 2588 ///State transition - sets the `rev` field to Set 2581 2589 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2582 2590 impl<S: State> sealed::Sealed for SetRev<S> {} 2583 2591 impl<S: State> State for SetRev<S> { 2592 + type ConvoId = S::ConvoId; 2584 2593 type Rev = Set<members::rev>; 2585 - type ConvoId = S::ConvoId; 2586 - type Message = S::Message; 2587 - } 2588 - ///State transition - sets the `convo_id` field to Set 2589 - pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2590 - impl<S: State> sealed::Sealed for SetConvoId<S> {} 2591 - impl<S: State> State for SetConvoId<S> { 2592 - type Rev = S::Rev; 2593 - type ConvoId = Set<members::convo_id>; 2594 2594 type Message = S::Message; 2595 2595 } 2596 2596 ///State transition - sets the `message` field to Set 2597 2597 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2598 2598 impl<S: State> sealed::Sealed for SetMessage<S> {} 2599 2599 impl<S: State> State for SetMessage<S> { 2600 - type Rev = S::Rev; 2601 2600 type ConvoId = S::ConvoId; 2601 + type Rev = S::Rev; 2602 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 `convo_id` field 2608 + pub struct convo_id(()); 2607 2609 ///Marker type for the `rev` field 2608 2610 pub struct rev(()); 2609 - ///Marker type for the `convo_id` field 2610 - pub struct convo_id(()); 2611 2611 ///Marker type for the `message` field 2612 2612 pub struct message(()); 2613 2613 } ··· 2702 2702 impl<'a, S> LogDeleteMessageBuilder<'a, S> 2703 2703 where 2704 2704 S: log_delete_message_state::State, 2705 - S::Rev: log_delete_message_state::IsSet, 2706 2705 S::ConvoId: log_delete_message_state::IsSet, 2706 + S::Rev: log_delete_message_state::IsSet, 2707 2707 S::Message: log_delete_message_state::IsSet, 2708 2708 { 2709 2709 /// Build the final struct ··· 3105 3105 } 3106 3106 /// State trait tracking which required fields have been set 3107 3107 pub trait State: sealed::Sealed { 3108 - type Reaction; 3109 - type ConvoId; 3110 3108 type Rev; 3111 3109 type Message; 3110 + type Reaction; 3111 + type ConvoId; 3112 3112 } 3113 3113 /// Empty state - all required fields are unset 3114 3114 pub struct Empty(()); 3115 3115 impl sealed::Sealed for Empty {} 3116 3116 impl State for Empty { 3117 + type Rev = Unset; 3118 + type Message = Unset; 3117 3119 type Reaction = Unset; 3118 3120 type ConvoId = Unset; 3119 - type Rev = Unset; 3120 - type Message = Unset; 3121 - } 3122 - ///State transition - sets the `reaction` field to Set 3123 - pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 3124 - impl<S: State> sealed::Sealed for SetReaction<S> {} 3125 - impl<S: State> State for SetReaction<S> { 3126 - type Reaction = Set<members::reaction>; 3127 - type ConvoId = S::ConvoId; 3128 - type Rev = S::Rev; 3129 - type Message = S::Message; 3130 - } 3131 - ///State transition - sets the `convo_id` field to Set 3132 - pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 3133 - impl<S: State> sealed::Sealed for SetConvoId<S> {} 3134 - impl<S: State> State for SetConvoId<S> { 3135 - type Reaction = S::Reaction; 3136 - type ConvoId = Set<members::convo_id>; 3137 - type Rev = S::Rev; 3138 - type Message = S::Message; 3139 3121 } 3140 3122 ///State transition - sets the `rev` field to Set 3141 3123 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 3142 3124 impl<S: State> sealed::Sealed for SetRev<S> {} 3143 3125 impl<S: State> State for SetRev<S> { 3126 + type Rev = Set<members::rev>; 3127 + type Message = S::Message; 3144 3128 type Reaction = S::Reaction; 3145 3129 type ConvoId = S::ConvoId; 3146 - type Rev = Set<members::rev>; 3147 - type Message = S::Message; 3148 3130 } 3149 3131 ///State transition - sets the `message` field to Set 3150 3132 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 3151 3133 impl<S: State> sealed::Sealed for SetMessage<S> {} 3152 3134 impl<S: State> State for SetMessage<S> { 3135 + type Rev = S::Rev; 3136 + type Message = Set<members::message>; 3153 3137 type Reaction = S::Reaction; 3154 3138 type ConvoId = S::ConvoId; 3139 + } 3140 + ///State transition - sets the `reaction` field to Set 3141 + pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 3142 + impl<S: State> sealed::Sealed for SetReaction<S> {} 3143 + impl<S: State> State for SetReaction<S> { 3155 3144 type Rev = S::Rev; 3156 - type Message = Set<members::message>; 3145 + type Message = S::Message; 3146 + type Reaction = Set<members::reaction>; 3147 + type ConvoId = S::ConvoId; 3148 + } 3149 + ///State transition - sets the `convo_id` field to Set 3150 + pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 3151 + impl<S: State> sealed::Sealed for SetConvoId<S> {} 3152 + impl<S: State> State for SetConvoId<S> { 3153 + type Rev = S::Rev; 3154 + type Message = S::Message; 3155 + type Reaction = S::Reaction; 3156 + type ConvoId = Set<members::convo_id>; 3157 3157 } 3158 3158 /// Marker types for field names 3159 3159 #[allow(non_camel_case_types)] 3160 3160 pub mod members { 3161 + ///Marker type for the `rev` field 3162 + pub struct rev(()); 3163 + ///Marker type for the `message` field 3164 + pub struct message(()); 3161 3165 ///Marker type for the `reaction` field 3162 3166 pub struct reaction(()); 3163 3167 ///Marker type for the `convo_id` field 3164 3168 pub struct convo_id(()); 3165 - ///Marker type for the `rev` field 3166 - pub struct rev(()); 3167 - ///Marker type for the `message` field 3168 - pub struct message(()); 3169 3169 } 3170 3170 } 3171 3171 ··· 3278 3278 impl<'a, S> LogRemoveReactionBuilder<'a, S> 3279 3279 where 3280 3280 S: log_remove_reaction_state::State, 3281 + S::Rev: log_remove_reaction_state::IsSet, 3282 + S::Message: log_remove_reaction_state::IsSet, 3281 3283 S::Reaction: log_remove_reaction_state::IsSet, 3282 3284 S::ConvoId: log_remove_reaction_state::IsSet, 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 Message; 3415 3414 type Reaction; 3415 + type Message; 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; 3421 3422 type Message = Unset; 3422 - type Reaction = 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; 3423 3430 } 3424 3431 ///State transition - sets the `message` field to Set 3425 3432 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 3426 3433 impl<S: State> sealed::Sealed for SetMessage<S> {} 3427 3434 impl<S: State> State for SetMessage<S> { 3428 - type Message = Set<members::message>; 3429 3435 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>; 3436 + type Message = Set<members::message>; 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 `reaction` field 3442 + pub struct reaction(()); 3441 3443 ///Marker type for the `message` field 3442 3444 pub struct message(()); 3443 - ///Marker type for the `reaction` field 3444 - pub struct reaction(()); 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::Message: message_and_reaction_view_state::IsSet, 3527 3526 S::Reaction: message_and_reaction_view_state::IsSet, 3527 + S::Message: message_and_reaction_view_state::IsSet, 3528 3528 { 3529 3529 /// Build the final struct 3530 3530 pub fn build(self) -> MessageAndReactionView<'a> {
+17 -17
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 MessagesReceived; 189 188 type ConvosStarted; 190 189 type Convos; 191 190 type MessagesSent; 191 + type MessagesReceived; 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; 198 197 type ConvosStarted = Unset; 199 198 type Convos = Unset; 200 199 type MessagesSent = Unset; 201 - } 202 - ///State transition - sets the `messages_received` field to Set 203 - pub struct SetMessagesReceived<S: State = Empty>(PhantomData<fn() -> S>); 204 - impl<S: State> sealed::Sealed for SetMessagesReceived<S> {} 205 - impl<S: State> State for SetMessagesReceived<S> { 206 - type MessagesReceived = Set<members::messages_received>; 207 - type ConvosStarted = S::ConvosStarted; 208 - type Convos = S::Convos; 209 - type MessagesSent = S::MessagesSent; 200 + type MessagesReceived = Unset; 210 201 } 211 202 ///State transition - sets the `convos_started` field to Set 212 203 pub struct SetConvosStarted<S: State = Empty>(PhantomData<fn() -> S>); 213 204 impl<S: State> sealed::Sealed for SetConvosStarted<S> {} 214 205 impl<S: State> State for SetConvosStarted<S> { 215 - type MessagesReceived = S::MessagesReceived; 216 206 type ConvosStarted = Set<members::convos_started>; 217 207 type Convos = S::Convos; 218 208 type MessagesSent = S::MessagesSent; 209 + type MessagesReceived = S::MessagesReceived; 219 210 } 220 211 ///State transition - sets the `convos` field to Set 221 212 pub struct SetConvos<S: State = Empty>(PhantomData<fn() -> S>); 222 213 impl<S: State> sealed::Sealed for SetConvos<S> {} 223 214 impl<S: State> State for SetConvos<S> { 224 - type MessagesReceived = S::MessagesReceived; 225 215 type ConvosStarted = S::ConvosStarted; 226 216 type Convos = Set<members::convos>; 227 217 type MessagesSent = S::MessagesSent; 218 + type MessagesReceived = S::MessagesReceived; 228 219 } 229 220 ///State transition - sets the `messages_sent` field to Set 230 221 pub struct SetMessagesSent<S: State = Empty>(PhantomData<fn() -> S>); 231 222 impl<S: State> sealed::Sealed for SetMessagesSent<S> {} 232 223 impl<S: State> State for SetMessagesSent<S> { 233 - type MessagesReceived = S::MessagesReceived; 234 224 type ConvosStarted = S::ConvosStarted; 235 225 type Convos = S::Convos; 236 226 type MessagesSent = Set<members::messages_sent>; 227 + type MessagesReceived = S::MessagesReceived; 228 + } 229 + ///State transition - sets the `messages_received` field to Set 230 + pub struct SetMessagesReceived<S: State = Empty>(PhantomData<fn() -> S>); 231 + impl<S: State> sealed::Sealed for SetMessagesReceived<S> {} 232 + impl<S: State> State for SetMessagesReceived<S> { 233 + type ConvosStarted = S::ConvosStarted; 234 + type Convos = S::Convos; 235 + type MessagesSent = S::MessagesSent; 236 + type MessagesReceived = Set<members::messages_received>; 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 `messages_received` field 242 - pub struct messages_received(()); 243 241 ///Marker type for the `convos_started` field 244 242 pub struct convos_started(()); 245 243 ///Marker type for the `convos` field 246 244 pub struct convos(()); 247 245 ///Marker type for the `messages_sent` field 248 246 pub struct messages_sent(()); 247 + ///Marker type for the `messages_received` field 248 + pub struct messages_received(()); 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::MessagesReceived: metadata_state::IsSet, 362 361 S::ConvosStarted: metadata_state::IsSet, 363 362 S::Convos: metadata_state::IsSet, 364 363 S::MessagesSent: metadata_state::IsSet, 364 + S::MessagesReceived: 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/com_atproto/admin.rs
··· 907 907 } 908 908 /// State trait tracking which required fields have been set 909 909 pub trait State: sealed::Sealed { 910 - type Cid; 911 910 type Did; 911 + type Cid; 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 Cid = Unset; 918 917 type Did = Unset; 919 - } 920 - ///State transition - sets the `cid` field to Set 921 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 922 - impl<S: State> sealed::Sealed for SetCid<S> {} 923 - impl<S: State> State for SetCid<S> { 924 - type Cid = Set<members::cid>; 925 - type Did = S::Did; 918 + type Cid = Unset; 926 919 } 927 920 ///State transition - sets the `did` field to Set 928 921 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 929 922 impl<S: State> sealed::Sealed for SetDid<S> {} 930 923 impl<S: State> State for SetDid<S> { 931 - type Cid = S::Cid; 932 924 type Did = Set<members::did>; 925 + type Cid = S::Cid; 926 + } 927 + ///State transition - sets the `cid` field to Set 928 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 929 + impl<S: State> sealed::Sealed for SetCid<S> {} 930 + impl<S: State> State for SetCid<S> { 931 + type Did = S::Did; 932 + type Cid = Set<members::cid>; 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 `cid` field 938 - pub struct cid(()); 939 937 ///Marker type for the `did` field 940 938 pub struct did(()); 939 + ///Marker type for the `cid` field 940 + pub struct cid(()); 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::Cid: repo_blob_ref_state::IsSet, 1034 1033 S::Did: repo_blob_ref_state::IsSet, 1034 + S::Cid: repo_blob_ref_state::IsSet, 1035 1035 { 1036 1036 /// Build the final struct 1037 1037 pub fn build(self) -> RepoBlobRef<'a> {
+15 -15
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 RecipientDid; 46 45 type SenderDid; 46 + type RecipientDid; 47 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 53 type SenderDid = Unset; 54 + type RecipientDid = Unset; 55 55 type Content = Unset; 56 56 } 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 - type SenderDid = S::SenderDid; 63 - type Content = S::Content; 64 - } 65 57 ///State transition - sets the `sender_did` field to Set 66 58 pub struct SetSenderDid<S: State = Empty>(PhantomData<fn() -> S>); 67 59 impl<S: State> sealed::Sealed for SetSenderDid<S> {} 68 60 impl<S: State> State for SetSenderDid<S> { 69 - type RecipientDid = S::RecipientDid; 70 61 type SenderDid = Set<members::sender_did>; 62 + type RecipientDid = S::RecipientDid; 63 + type Content = S::Content; 64 + } 65 + ///State transition - sets the `recipient_did` field to Set 66 + pub struct SetRecipientDid<S: State = Empty>(PhantomData<fn() -> S>); 67 + impl<S: State> sealed::Sealed for SetRecipientDid<S> {} 68 + impl<S: State> State for SetRecipientDid<S> { 69 + type SenderDid = S::SenderDid; 70 + type RecipientDid = Set<members::recipient_did>; 71 71 type Content = S::Content; 72 72 } 73 73 ///State transition - sets the `content` field to Set 74 74 pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 75 75 impl<S: State> sealed::Sealed for SetContent<S> {} 76 76 impl<S: State> State for SetContent<S> { 77 - type RecipientDid = S::RecipientDid; 78 77 type SenderDid = S::SenderDid; 78 + type RecipientDid = S::RecipientDid; 79 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 `sender_did` field 85 + pub struct sender_did(()); 84 86 ///Marker type for the `recipient_did` field 85 87 pub struct recipient_did(()); 86 - ///Marker type for the `sender_did` field 87 - pub struct sender_did(()); 88 88 ///Marker type for the `content` field 89 89 pub struct content(()); 90 90 } ··· 213 213 impl<'a, S> SendEmailBuilder<'a, S> 214 214 where 215 215 S: send_email_state::State, 216 - S::RecipientDid: send_email_state::IsSet, 217 216 S::SenderDid: send_email_state::IsSet, 217 + S::RecipientDid: send_email_state::IsSet, 218 218 S::Content: send_email_state::IsSet, 219 219 { 220 220 /// Build the final struct
+13 -13
crates/weaver-api/src/com_atproto/admin/update_account_password.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Password; 37 36 type Did; 37 + type Password; 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 Password = Unset; 44 43 type Did = Unset; 45 - } 46 - ///State transition - sets the `password` field to Set 47 - pub struct SetPassword<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetPassword<S> {} 49 - impl<S: State> State for SetPassword<S> { 50 - type Password = Set<members::password>; 51 - type Did = S::Did; 44 + type Password = Unset; 52 45 } 53 46 ///State transition - sets the `did` field to Set 54 47 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetDid<S> {} 56 49 impl<S: State> State for SetDid<S> { 57 - type Password = S::Password; 58 50 type Did = Set<members::did>; 51 + type Password = S::Password; 52 + } 53 + ///State transition - sets the `password` field to Set 54 + pub struct SetPassword<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetPassword<S> {} 56 + impl<S: State> State for SetPassword<S> { 57 + type Did = S::Did; 58 + type Password = Set<members::password>; 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 `password` field 64 - pub struct password(()); 65 63 ///Marker type for the `did` field 66 64 pub struct did(()); 65 + ///Marker type for the `password` field 66 + pub struct password(()); 67 67 } 68 68 } 69 69 ··· 142 142 impl<'a, S> UpdateAccountPasswordBuilder<'a, S> 143 143 where 144 144 S: update_account_password_state::State, 145 - S::Password: update_account_password_state::IsSet, 146 145 S::Did: update_account_password_state::IsSet, 146 + S::Password: update_account_password_state::IsSet, 147 147 { 148 148 /// Build the final struct 149 149 pub fn build(self) -> UpdateAccountPassword<'a> {
+15 -15
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 DidDoc; 51 50 type Handle; 51 + type DidDoc; 52 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 58 type Handle = Unset; 59 + type DidDoc = Unset; 60 60 type Did = Unset; 61 61 } 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 - type Handle = S::Handle; 68 - type Did = S::Did; 69 - } 70 62 ///State transition - sets the `handle` field to Set 71 63 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 72 64 impl<S: State> sealed::Sealed for SetHandle<S> {} 73 65 impl<S: State> State for SetHandle<S> { 74 - type DidDoc = S::DidDoc; 75 66 type Handle = Set<members::handle>; 67 + type DidDoc = S::DidDoc; 68 + type Did = S::Did; 69 + } 70 + ///State transition - sets the `did_doc` field to Set 71 + pub struct SetDidDoc<S: State = Empty>(PhantomData<fn() -> S>); 72 + impl<S: State> sealed::Sealed for SetDidDoc<S> {} 73 + impl<S: State> State for SetDidDoc<S> { 74 + type Handle = S::Handle; 75 + type DidDoc = Set<members::did_doc>; 76 76 type Did = S::Did; 77 77 } 78 78 ///State transition - sets the `did` field to Set 79 79 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 80 80 impl<S: State> sealed::Sealed for SetDid<S> {} 81 81 impl<S: State> State for SetDid<S> { 82 - type DidDoc = S::DidDoc; 83 82 type Handle = S::Handle; 83 + type DidDoc = S::DidDoc; 84 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 `handle` field 90 + pub struct handle(()); 89 91 ///Marker type for the `did_doc` field 90 92 pub struct did_doc(()); 91 - ///Marker type for the `handle` field 92 - pub struct handle(()); 93 93 ///Marker type for the `did` field 94 94 pub struct did(()); 95 95 } ··· 184 184 impl<'a, S> IdentityInfoBuilder<'a, S> 185 185 where 186 186 S: identity_info_state::State, 187 - S::DidDoc: identity_info_state::IsSet, 188 187 S::Handle: identity_info_state::IsSet, 188 + S::DidDoc: identity_info_state::IsSet, 189 189 S::Did: identity_info_state::IsSet, 190 190 { 191 191 /// Build the final struct
+80 -80
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 Val; 67 + type Src; 68 + type Cts; 66 69 type Uri; 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 Uri = Unset; 76 - type Cts = Unset; 77 - type Src = Unset; 78 75 type Val = Unset; 76 + type Src = Unset; 77 + type Cts = Unset; 78 + type Uri = Unset; 79 79 } 80 - ///State transition - sets the `uri` field to Set 81 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 82 - impl<S: State> sealed::Sealed for SetUri<S> {} 83 - impl<S: State> State for SetUri<S> { 84 - type Uri = Set<members::uri>; 85 - type Cts = S::Cts; 80 + ///State transition - sets the `val` field to Set 81 + pub struct SetVal<S: State = Empty>(PhantomData<fn() -> S>); 82 + impl<S: State> sealed::Sealed for SetVal<S> {} 83 + impl<S: State> State for SetVal<S> { 84 + type Val = Set<members::val>; 86 85 type Src = S::Src; 87 - type Val = S::Val; 88 - } 89 - ///State transition - sets the `cts` field to Set 90 - pub struct SetCts<S: State = Empty>(PhantomData<fn() -> S>); 91 - impl<S: State> sealed::Sealed for SetCts<S> {} 92 - impl<S: State> State for SetCts<S> { 86 + type Cts = S::Cts; 93 87 type Uri = S::Uri; 94 - type Cts = Set<members::cts>; 95 - type Src = S::Src; 96 - type Val = S::Val; 97 88 } 98 89 ///State transition - sets the `src` field to Set 99 90 pub struct SetSrc<S: State = Empty>(PhantomData<fn() -> S>); 100 91 impl<S: State> sealed::Sealed for SetSrc<S> {} 101 92 impl<S: State> State for SetSrc<S> { 102 - type Uri = S::Uri; 103 - type Cts = S::Cts; 104 - type Src = Set<members::src>; 105 93 type Val = S::Val; 94 + type Src = Set<members::src>; 95 + type Cts = S::Cts; 96 + type Uri = S::Uri; 106 97 } 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> { 98 + ///State transition - sets the `cts` field to Set 99 + pub struct SetCts<S: State = Empty>(PhantomData<fn() -> S>); 100 + impl<S: State> sealed::Sealed for SetCts<S> {} 101 + impl<S: State> State for SetCts<S> { 102 + type Val = S::Val; 103 + type Src = S::Src; 104 + type Cts = Set<members::cts>; 111 105 type Uri = S::Uri; 112 - type Cts = S::Cts; 106 + } 107 + ///State transition - sets the `uri` field to Set 108 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 109 + impl<S: State> sealed::Sealed for SetUri<S> {} 110 + impl<S: State> State for SetUri<S> { 111 + type Val = S::Val; 113 112 type Src = S::Src; 114 - type Val = Set<members::val>; 113 + type Cts = S::Cts; 114 + type Uri = Set<members::uri>; 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 `uri` field 120 - pub struct uri(()); 121 - ///Marker type for the `cts` field 122 - pub struct cts(()); 119 + ///Marker type for the `val` field 120 + pub struct val(()); 123 121 ///Marker type for the `src` field 124 122 pub struct src(()); 125 - ///Marker type for the `val` field 126 - pub struct val(()); 123 + ///Marker type for the `cts` field 124 + pub struct cts(()); 125 + ///Marker type for the `uri` field 126 + pub struct uri(()); 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::Uri: label_state::IsSet, 332 - S::Cts: label_state::IsSet, 333 - S::Src: label_state::IsSet, 334 331 S::Val: label_state::IsSet, 332 + S::Src: label_state::IsSet, 333 + S::Cts: label_state::IsSet, 334 + S::Uri: label_state::IsSet, 335 335 { 336 336 /// Build the final struct 337 337 pub fn build(self) -> Label<'a> { ··· 1059 1059 } 1060 1060 /// State trait tracking which required fields have been set 1061 1061 pub trait State: sealed::Sealed { 1062 - type Severity; 1063 - type Identifier; 1064 1062 type Blurs; 1063 + type Identifier; 1064 + type Severity; 1065 1065 type Locales; 1066 1066 } 1067 1067 /// Empty state - all required fields are unset 1068 1068 pub struct Empty(()); 1069 1069 impl sealed::Sealed for Empty {} 1070 1070 impl State for Empty { 1071 - type Severity = Unset; 1072 - type Identifier = Unset; 1073 1071 type Blurs = Unset; 1072 + type Identifier = Unset; 1073 + type Severity = Unset; 1074 1074 type Locales = Unset; 1075 1075 } 1076 - ///State transition - sets the `severity` field to Set 1077 - pub struct SetSeverity<S: State = Empty>(PhantomData<fn() -> S>); 1078 - impl<S: State> sealed::Sealed for SetSeverity<S> {} 1079 - impl<S: State> State for SetSeverity<S> { 1080 - type Severity = Set<members::severity>; 1076 + ///State transition - sets the `blurs` field to Set 1077 + pub struct SetBlurs<S: State = Empty>(PhantomData<fn() -> S>); 1078 + impl<S: State> sealed::Sealed for SetBlurs<S> {} 1079 + impl<S: State> State for SetBlurs<S> { 1080 + type Blurs = Set<members::blurs>; 1081 1081 type Identifier = S::Identifier; 1082 - type Blurs = S::Blurs; 1082 + type Severity = S::Severity; 1083 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>); 1087 1087 impl<S: State> sealed::Sealed for SetIdentifier<S> {} 1088 1088 impl<S: State> State for SetIdentifier<S> { 1089 + type Blurs = S::Blurs; 1090 + type Identifier = Set<members::identifier>; 1089 1091 type Severity = S::Severity; 1090 - type Identifier = Set<members::identifier>; 1091 - type Blurs = S::Blurs; 1092 1092 type Locales = S::Locales; 1093 1093 } 1094 - ///State transition - sets the `blurs` field to Set 1095 - pub struct SetBlurs<S: State = Empty>(PhantomData<fn() -> S>); 1096 - impl<S: State> sealed::Sealed for SetBlurs<S> {} 1097 - impl<S: State> State for SetBlurs<S> { 1098 - type Severity = S::Severity; 1094 + ///State transition - sets the `severity` field to Set 1095 + pub struct SetSeverity<S: State = Empty>(PhantomData<fn() -> S>); 1096 + impl<S: State> sealed::Sealed for SetSeverity<S> {} 1097 + impl<S: State> State for SetSeverity<S> { 1098 + type Blurs = S::Blurs; 1099 1099 type Identifier = S::Identifier; 1100 - type Blurs = Set<members::blurs>; 1100 + type Severity = Set<members::severity>; 1101 1101 type Locales = S::Locales; 1102 1102 } 1103 1103 ///State transition - sets the `locales` field to Set 1104 1104 pub struct SetLocales<S: State = Empty>(PhantomData<fn() -> S>); 1105 1105 impl<S: State> sealed::Sealed for SetLocales<S> {} 1106 1106 impl<S: State> State for SetLocales<S> { 1107 - type Severity = S::Severity; 1107 + type Blurs = S::Blurs; 1108 1108 type Identifier = S::Identifier; 1109 - type Blurs = S::Blurs; 1109 + type Severity = S::Severity; 1110 1110 type Locales = Set<members::locales>; 1111 1111 } 1112 1112 /// Marker types for field names 1113 1113 #[allow(non_camel_case_types)] 1114 1114 pub mod members { 1115 + ///Marker type for the `blurs` field 1116 + pub struct blurs(()); 1117 + ///Marker type for the `identifier` field 1118 + pub struct identifier(()); 1115 1119 ///Marker type for the `severity` field 1116 1120 pub struct severity(()); 1117 - ///Marker type for the `identifier` field 1118 - pub struct identifier(()); 1119 - ///Marker type for the `blurs` field 1120 - pub struct blurs(()); 1121 1121 ///Marker type for the `locales` field 1122 1122 pub struct locales(()); 1123 1123 } ··· 1274 1274 impl<'a, S> LabelValueDefinitionBuilder<'a, S> 1275 1275 where 1276 1276 S: label_value_definition_state::State, 1277 - S::Severity: label_value_definition_state::IsSet, 1278 - S::Identifier: label_value_definition_state::IsSet, 1279 1277 S::Blurs: label_value_definition_state::IsSet, 1278 + S::Identifier: label_value_definition_state::IsSet, 1279 + S::Severity: label_value_definition_state::IsSet, 1280 1280 S::Locales: label_value_definition_state::IsSet, 1281 1281 { 1282 1282 /// Build the final struct ··· 1687 1687 } 1688 1688 /// State trait tracking which required fields have been set 1689 1689 pub trait State: sealed::Sealed { 1690 - type Name; 1691 1690 type Lang; 1692 1691 type Description; 1692 + type Name; 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 - type Name = Unset; 1699 1698 type Lang = Unset; 1700 1699 type Description = Unset; 1701 - } 1702 - ///State transition - sets the `name` field to Set 1703 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1704 - impl<S: State> sealed::Sealed for SetName<S> {} 1705 - impl<S: State> State for SetName<S> { 1706 - type Name = Set<members::name>; 1707 - type Lang = S::Lang; 1708 - type Description = S::Description; 1700 + type Name = Unset; 1709 1701 } 1710 1702 ///State transition - sets the `lang` field to Set 1711 1703 pub struct SetLang<S: State = Empty>(PhantomData<fn() -> S>); 1712 1704 impl<S: State> sealed::Sealed for SetLang<S> {} 1713 1705 impl<S: State> State for SetLang<S> { 1714 - type Name = S::Name; 1715 1706 type Lang = Set<members::lang>; 1716 1707 type Description = S::Description; 1708 + type Name = S::Name; 1717 1709 } 1718 1710 ///State transition - sets the `description` field to Set 1719 1711 pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 1720 1712 impl<S: State> sealed::Sealed for SetDescription<S> {} 1721 1713 impl<S: State> State for SetDescription<S> { 1722 - type Name = S::Name; 1723 1714 type Lang = S::Lang; 1724 1715 type Description = Set<members::description>; 1716 + type Name = S::Name; 1717 + } 1718 + ///State transition - sets the `name` field to Set 1719 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1720 + impl<S: State> sealed::Sealed for SetName<S> {} 1721 + impl<S: State> State for SetName<S> { 1722 + type Lang = S::Lang; 1723 + type Description = S::Description; 1724 + type Name = Set<members::name>; 1725 1725 } 1726 1726 /// Marker types for field names 1727 1727 #[allow(non_camel_case_types)] 1728 1728 pub mod members { 1729 - ///Marker type for the `name` field 1730 - pub struct name(()); 1731 1729 ///Marker type for the `lang` field 1732 1730 pub struct lang(()); 1733 1731 ///Marker type for the `description` field 1734 1732 pub struct description(()); 1733 + ///Marker type for the `name` field 1734 + pub struct name(()); 1735 1735 } 1736 1736 } 1737 1737 ··· 1841 1841 impl<'a, S> LabelValueDefinitionStringsBuilder<'a, S> 1842 1842 where 1843 1843 S: label_value_definition_strings_state::State, 1844 - S::Name: label_value_definition_strings_state::IsSet, 1845 1844 S::Lang: label_value_definition_strings_state::IsSet, 1846 1845 S::Description: label_value_definition_strings_state::IsSet, 1846 + S::Name: 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/moderation/create_report.rs
··· 43 43 } 44 44 /// State trait tracking which required fields have been set 45 45 pub trait State: sealed::Sealed { 46 - type ReasonType; 47 46 type Subject; 47 + type ReasonType; 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 ReasonType = Unset; 54 53 type Subject = Unset; 55 - } 56 - ///State transition - sets the `reason_type` field to Set 57 - pub struct SetReasonType<S: State = Empty>(PhantomData<fn() -> S>); 58 - impl<S: State> sealed::Sealed for SetReasonType<S> {} 59 - impl<S: State> State for SetReasonType<S> { 60 - type ReasonType = Set<members::reason_type>; 61 - type Subject = S::Subject; 54 + type ReasonType = Unset; 62 55 } 63 56 ///State transition - sets the `subject` field to Set 64 57 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 65 58 impl<S: State> sealed::Sealed for SetSubject<S> {} 66 59 impl<S: State> State for SetSubject<S> { 67 - type ReasonType = S::ReasonType; 68 60 type Subject = Set<members::subject>; 61 + type ReasonType = S::ReasonType; 62 + } 63 + ///State transition - sets the `reason_type` field to Set 64 + pub struct SetReasonType<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetReasonType<S> {} 66 + impl<S: State> State for SetReasonType<S> { 67 + type Subject = S::Subject; 68 + type ReasonType = Set<members::reason_type>; 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 `reason_type` field 74 - pub struct reason_type(()); 75 73 ///Marker type for the `subject` field 76 74 pub struct subject(()); 75 + ///Marker type for the `reason_type` field 76 + pub struct reason_type(()); 77 77 } 78 78 } 79 79 ··· 187 187 impl<'a, S> CreateReportBuilder<'a, S> 188 188 where 189 189 S: create_report_state::State, 190 - S::ReasonType: create_report_state::IsSet, 191 190 S::Subject: create_report_state::IsSet, 191 + S::ReasonType: create_report_state::IsSet, 192 192 { 193 193 /// Build the final struct 194 194 pub fn build(self) -> CreateReport<'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 Cid; 48 47 type Rev; 48 + type Cid; 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 Cid = Unset; 55 54 type Rev = Unset; 56 - } 57 - ///State transition - sets the `cid` field to Set 58 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 59 - impl<S: State> sealed::Sealed for SetCid<S> {} 60 - impl<S: State> State for SetCid<S> { 61 - type Cid = Set<members::cid>; 62 - type Rev = S::Rev; 55 + type Cid = Unset; 63 56 } 64 57 ///State transition - sets the `rev` field to Set 65 58 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 66 59 impl<S: State> sealed::Sealed for SetRev<S> {} 67 60 impl<S: State> State for SetRev<S> { 68 - type Cid = S::Cid; 69 61 type Rev = Set<members::rev>; 62 + type Cid = S::Cid; 63 + } 64 + ///State transition - sets the `cid` field to Set 65 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 66 + impl<S: State> sealed::Sealed for SetCid<S> {} 67 + impl<S: State> State for SetCid<S> { 68 + type Rev = S::Rev; 69 + type Cid = Set<members::cid>; 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 `cid` field 75 - pub struct cid(()); 76 74 ///Marker type for the `rev` field 77 75 pub struct rev(()); 76 + ///Marker type for the `cid` field 77 + pub struct cid(()); 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::Cid: commit_meta_state::IsSet, 151 150 S::Rev: commit_meta_state::IsSet, 151 + S::Cid: commit_meta_state::IsSet, 152 152 { 153 153 /// Build the final struct 154 154 pub fn build(self) -> CommitMeta<'a> {
+28 -28
crates/weaver-api/src/com_atproto/repo/apply_writes.rs
··· 1241 1241 } 1242 1242 /// State trait tracking which required fields have been set 1243 1243 pub trait State: sealed::Sealed { 1244 - type Writes; 1245 1244 type Repo; 1245 + type Writes; 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 Writes = Unset; 1252 1251 type Repo = Unset; 1253 - } 1254 - ///State transition - sets the `writes` field to Set 1255 - pub struct SetWrites<S: State = Empty>(PhantomData<fn() -> S>); 1256 - impl<S: State> sealed::Sealed for SetWrites<S> {} 1257 - impl<S: State> State for SetWrites<S> { 1258 - type Writes = Set<members::writes>; 1259 - type Repo = S::Repo; 1252 + type Writes = Unset; 1260 1253 } 1261 1254 ///State transition - sets the `repo` field to Set 1262 1255 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1263 1256 impl<S: State> sealed::Sealed for SetRepo<S> {} 1264 1257 impl<S: State> State for SetRepo<S> { 1265 - type Writes = S::Writes; 1266 1258 type Repo = Set<members::repo>; 1259 + type Writes = S::Writes; 1260 + } 1261 + ///State transition - sets the `writes` field to Set 1262 + pub struct SetWrites<S: State = Empty>(PhantomData<fn() -> S>); 1263 + impl<S: State> sealed::Sealed for SetWrites<S> {} 1264 + impl<S: State> State for SetWrites<S> { 1265 + type Repo = S::Repo; 1266 + type Writes = Set<members::writes>; 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 `writes` field 1272 - pub struct writes(()); 1273 1271 ///Marker type for the `repo` field 1274 1272 pub struct repo(()); 1273 + ///Marker type for the `writes` field 1274 + pub struct writes(()); 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::Writes: apply_writes_state::IsSet, 1382 1381 S::Repo: apply_writes_state::IsSet, 1382 + S::Writes: apply_writes_state::IsSet, 1383 1383 { 1384 1384 /// Build the final struct 1385 1385 pub fn build(self) -> ApplyWrites<'a> { ··· 1569 1569 /// State trait tracking which required fields have been set 1570 1570 pub trait State: sealed::Sealed { 1571 1571 type Collection; 1572 - type Rkey; 1573 1572 type Value; 1573 + type Rkey; 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 1579 type Collection = Unset; 1580 - type Rkey = Unset; 1581 1580 type Value = Unset; 1581 + type Rkey = Unset; 1582 1582 } 1583 1583 ///State transition - sets the `collection` field to Set 1584 1584 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 1585 1585 impl<S: State> sealed::Sealed for SetCollection<S> {} 1586 1586 impl<S: State> State for SetCollection<S> { 1587 1587 type Collection = Set<members::collection>; 1588 - type Rkey = S::Rkey; 1589 1588 type Value = S::Value; 1590 - } 1591 - ///State transition - sets the `rkey` field to Set 1592 - pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 1593 - impl<S: State> sealed::Sealed for SetRkey<S> {} 1594 - impl<S: State> State for SetRkey<S> { 1595 - type Collection = S::Collection; 1596 - type Rkey = Set<members::rkey>; 1597 - type Value = S::Value; 1589 + type Rkey = S::Rkey; 1598 1590 } 1599 1591 ///State transition - sets the `value` field to Set 1600 1592 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1601 1593 impl<S: State> sealed::Sealed for SetValue<S> {} 1602 1594 impl<S: State> State for SetValue<S> { 1603 1595 type Collection = S::Collection; 1604 - type Rkey = S::Rkey; 1605 1596 type Value = Set<members::value>; 1597 + type Rkey = S::Rkey; 1598 + } 1599 + ///State transition - sets the `rkey` field to Set 1600 + pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 1601 + impl<S: State> sealed::Sealed for SetRkey<S> {} 1602 + impl<S: State> State for SetRkey<S> { 1603 + type Collection = S::Collection; 1604 + type Value = S::Value; 1605 + type Rkey = Set<members::rkey>; 1606 1606 } 1607 1607 /// Marker types for field names 1608 1608 #[allow(non_camel_case_types)] 1609 1609 pub mod members { 1610 1610 ///Marker type for the `collection` field 1611 1611 pub struct collection(()); 1612 - ///Marker type for the `rkey` field 1613 - pub struct rkey(()); 1614 1612 ///Marker type for the `value` field 1615 1613 pub struct value(()); 1614 + ///Marker type for the `rkey` field 1615 + pub struct rkey(()); 1616 1616 } 1617 1617 } 1618 1618 ··· 1714 1714 where 1715 1715 S: update_state::State, 1716 1716 S::Collection: update_state::IsSet, 1717 - S::Rkey: update_state::IsSet, 1718 1717 S::Value: update_state::IsSet, 1718 + S::Rkey: 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
··· 53 53 } 54 54 /// State trait tracking which required fields have been set 55 55 pub trait State: sealed::Sealed { 56 + type Collection; 56 57 type Record; 57 58 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 + type Collection = Unset; 64 65 type Record = Unset; 65 66 type Repo = Unset; 66 - type Collection = Unset; 67 + } 68 + ///State transition - sets the `collection` field to Set 69 + pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 70 + impl<S: State> sealed::Sealed for SetCollection<S> {} 71 + impl<S: State> State for SetCollection<S> { 72 + type Collection = Set<members::collection>; 73 + type Record = S::Record; 74 + type Repo = S::Repo; 67 75 } 68 76 ///State transition - sets the `record` field to Set 69 77 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 70 78 impl<S: State> sealed::Sealed for SetRecord<S> {} 71 79 impl<S: State> State for SetRecord<S> { 80 + type Collection = S::Collection; 72 81 type Record = Set<members::record>; 73 82 type Repo = S::Repo; 74 - type Collection = S::Collection; 75 83 } 76 84 ///State transition - sets the `repo` field to Set 77 85 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 78 86 impl<S: State> sealed::Sealed for SetRepo<S> {} 79 87 impl<S: State> State for SetRepo<S> { 80 - type Record = S::Record; 81 - type Repo = Set<members::repo>; 82 88 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 89 type Record = S::Record; 89 - type Repo = S::Repo; 90 - type Collection = Set<members::collection>; 90 + type Repo = Set<members::repo>; 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 `collection` field 96 + pub struct collection(()); 95 97 ///Marker type for the `record` field 96 98 pub struct record(()); 97 99 ///Marker type for the `repo` field 98 100 pub struct repo(()); 99 - ///Marker type for the `collection` field 100 - pub struct collection(()); 101 101 } 102 102 } 103 103 ··· 258 258 impl<'a, S> CreateRecordBuilder<'a, S> 259 259 where 260 260 S: create_record_state::State, 261 + S::Collection: create_record_state::IsSet, 261 262 S::Record: create_record_state::IsSet, 262 263 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 Repo; 52 51 type Collection; 53 52 type Rkey; 53 + type Repo; 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 Repo = Unset; 60 59 type Collection = Unset; 61 60 type Rkey = Unset; 62 - } 63 - ///State transition - sets the `repo` field to Set 64 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 65 - impl<S: State> sealed::Sealed for SetRepo<S> {} 66 - impl<S: State> State for SetRepo<S> { 67 - type Repo = Set<members::repo>; 68 - type Collection = S::Collection; 69 - type Rkey = S::Rkey; 61 + type Repo = Unset; 70 62 } 71 63 ///State transition - sets the `collection` field to Set 72 64 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 73 65 impl<S: State> sealed::Sealed for SetCollection<S> {} 74 66 impl<S: State> State for SetCollection<S> { 75 - type Repo = S::Repo; 76 67 type Collection = Set<members::collection>; 77 68 type Rkey = S::Rkey; 69 + type Repo = S::Repo; 78 70 } 79 71 ///State transition - sets the `rkey` field to Set 80 72 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 81 73 impl<S: State> sealed::Sealed for SetRkey<S> {} 82 74 impl<S: State> State for SetRkey<S> { 83 - type Repo = S::Repo; 84 75 type Collection = S::Collection; 85 76 type Rkey = Set<members::rkey>; 77 + type Repo = S::Repo; 78 + } 79 + ///State transition - sets the `repo` field to Set 80 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 81 + impl<S: State> sealed::Sealed for SetRepo<S> {} 82 + impl<S: State> State for SetRepo<S> { 83 + type Collection = S::Collection; 84 + type Rkey = S::Rkey; 85 + type Repo = Set<members::repo>; 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(()); 92 90 ///Marker type for the `collection` field 93 91 pub struct collection(()); 94 92 ///Marker type for the `rkey` field 95 93 pub struct rkey(()); 94 + ///Marker type for the `repo` field 95 + pub struct repo(()); 96 96 } 97 97 } 98 98 ··· 233 233 impl<'a, S> DeleteRecordBuilder<'a, S> 234 234 where 235 235 S: delete_record_state::State, 236 - S::Repo: delete_record_state::IsSet, 237 236 S::Collection: delete_record_state::IsSet, 238 237 S::Rkey: delete_record_state::IsSet, 238 + S::Repo: delete_record_state::IsSet, 239 239 { 240 240 /// Build the final struct 241 241 pub fn build(self) -> DeleteRecord<'a> {
+15 -15
crates/weaver-api/src/com_atproto/repo/get_record.rs
··· 39 39 } 40 40 /// State trait tracking which required fields have been set 41 41 pub trait State: sealed::Sealed { 42 - type Rkey; 43 42 type Collection; 44 43 type Repo; 44 + type Rkey; 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 Rkey = Unset; 51 50 type Collection = Unset; 52 51 type Repo = Unset; 53 - } 54 - ///State transition - sets the `rkey` field to Set 55 - pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 56 - impl<S: State> sealed::Sealed for SetRkey<S> {} 57 - impl<S: State> State for SetRkey<S> { 58 - type Rkey = Set<members::rkey>; 59 - type Collection = S::Collection; 60 - type Repo = S::Repo; 52 + type Rkey = Unset; 61 53 } 62 54 ///State transition - sets the `collection` field to Set 63 55 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 64 56 impl<S: State> sealed::Sealed for SetCollection<S> {} 65 57 impl<S: State> State for SetCollection<S> { 66 - type Rkey = S::Rkey; 67 58 type Collection = Set<members::collection>; 68 59 type Repo = S::Repo; 60 + type Rkey = S::Rkey; 69 61 } 70 62 ///State transition - sets the `repo` field to Set 71 63 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 72 64 impl<S: State> sealed::Sealed for SetRepo<S> {} 73 65 impl<S: State> State for SetRepo<S> { 74 - type Rkey = S::Rkey; 75 66 type Collection = S::Collection; 76 67 type Repo = Set<members::repo>; 68 + type Rkey = S::Rkey; 69 + } 70 + ///State transition - sets the `rkey` field to Set 71 + pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 72 + impl<S: State> sealed::Sealed for SetRkey<S> {} 73 + impl<S: State> State for SetRkey<S> { 74 + type Collection = S::Collection; 75 + type Repo = S::Repo; 76 + type Rkey = Set<members::rkey>; 77 77 } 78 78 /// Marker types for field names 79 79 #[allow(non_camel_case_types)] 80 80 pub mod members { 81 - ///Marker type for the `rkey` field 82 - pub struct rkey(()); 83 81 ///Marker type for the `collection` field 84 82 pub struct collection(()); 85 83 ///Marker type for the `repo` field 86 84 pub struct repo(()); 85 + ///Marker type for the `rkey` field 86 + pub struct rkey(()); 87 87 } 88 88 } 89 89 ··· 204 204 impl<'a, S> GetRecordBuilder<'a, S> 205 205 where 206 206 S: get_record_state::State, 207 - S::Rkey: get_record_state::IsSet, 208 207 S::Collection: get_record_state::IsSet, 209 208 S::Repo: get_record_state::IsSet, 209 + S::Rkey: get_record_state::IsSet, 210 210 { 211 211 /// Build the final struct 212 212 pub fn build(self) -> GetRecord<'a> {
+15 -15
crates/weaver-api/src/com_atproto/repo/list_records.rs
··· 279 279 /// State trait tracking which required fields have been set 280 280 pub trait State: sealed::Sealed { 281 281 type Uri; 282 - type Cid; 283 282 type Value; 283 + type Cid; 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 289 type Uri = Unset; 290 - type Cid = Unset; 291 290 type Value = Unset; 291 + type Cid = Unset; 292 292 } 293 293 ///State transition - sets the `uri` field to Set 294 294 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 295 295 impl<S: State> sealed::Sealed for SetUri<S> {} 296 296 impl<S: State> State for SetUri<S> { 297 297 type Uri = Set<members::uri>; 298 - type Cid = S::Cid; 299 298 type Value = S::Value; 300 - } 301 - ///State transition - sets the `cid` field to Set 302 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 303 - impl<S: State> sealed::Sealed for SetCid<S> {} 304 - impl<S: State> State for SetCid<S> { 305 - type Uri = S::Uri; 306 - type Cid = Set<members::cid>; 307 - type Value = S::Value; 299 + type Cid = S::Cid; 308 300 } 309 301 ///State transition - sets the `value` field to Set 310 302 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 311 303 impl<S: State> sealed::Sealed for SetValue<S> {} 312 304 impl<S: State> State for SetValue<S> { 313 305 type Uri = S::Uri; 314 - type Cid = S::Cid; 315 306 type Value = Set<members::value>; 307 + type Cid = S::Cid; 308 + } 309 + ///State transition - sets the `cid` field to Set 310 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 311 + impl<S: State> sealed::Sealed for SetCid<S> {} 312 + impl<S: State> State for SetCid<S> { 313 + type Uri = S::Uri; 314 + type Value = S::Value; 315 + type Cid = Set<members::cid>; 316 316 } 317 317 /// Marker types for field names 318 318 #[allow(non_camel_case_types)] 319 319 pub mod members { 320 320 ///Marker type for the `uri` field 321 321 pub struct uri(()); 322 + ///Marker type for the `value` field 323 + pub struct value(()); 322 324 ///Marker type for the `cid` field 323 325 pub struct cid(()); 324 - ///Marker type for the `value` field 325 - pub struct value(()); 326 326 } 327 327 } 328 328 ··· 416 416 where 417 417 S: record_state::State, 418 418 S::Uri: record_state::IsSet, 419 - S::Cid: record_state::IsSet, 420 419 S::Value: record_state::IsSet, 420 + S::Cid: 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
··· 56 56 pub trait State: sealed::Sealed { 57 57 type Record; 58 58 type Repo; 59 - type Collection; 60 59 type Rkey; 60 + type Collection; 61 61 } 62 62 /// Empty state - all required fields are unset 63 63 pub struct Empty(()); ··· 65 65 impl State for Empty { 66 66 type Record = Unset; 67 67 type Repo = Unset; 68 - type Collection = Unset; 69 68 type Rkey = Unset; 69 + type Collection = Unset; 70 70 } 71 71 ///State transition - sets the `record` field to Set 72 72 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); ··· 74 74 impl<S: State> State for SetRecord<S> { 75 75 type Record = Set<members::record>; 76 76 type Repo = S::Repo; 77 - type Collection = S::Collection; 78 77 type Rkey = S::Rkey; 78 + type Collection = S::Collection; 79 79 } 80 80 ///State transition - sets the `repo` field to Set 81 81 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); ··· 83 83 impl<S: State> State for SetRepo<S> { 84 84 type Record = S::Record; 85 85 type Repo = Set<members::repo>; 86 - type Collection = S::Collection; 87 - type Rkey = S::Rkey; 88 - } 89 - ///State transition - sets the `collection` field to Set 90 - pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 91 - impl<S: State> sealed::Sealed for SetCollection<S> {} 92 - impl<S: State> State for SetCollection<S> { 93 - type Record = S::Record; 94 - type Repo = S::Repo; 95 - type Collection = Set<members::collection>; 96 86 type Rkey = S::Rkey; 87 + type Collection = S::Collection; 97 88 } 98 89 ///State transition - sets the `rkey` field to Set 99 90 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); ··· 101 92 impl<S: State> State for SetRkey<S> { 102 93 type Record = S::Record; 103 94 type Repo = S::Repo; 104 - type Collection = S::Collection; 105 95 type Rkey = Set<members::rkey>; 96 + type Collection = S::Collection; 97 + } 98 + ///State transition - sets the `collection` field to Set 99 + pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 100 + impl<S: State> sealed::Sealed for SetCollection<S> {} 101 + impl<S: State> State for SetCollection<S> { 102 + type Record = S::Record; 103 + type Repo = S::Repo; 104 + type Rkey = S::Rkey; 105 + type Collection = Set<members::collection>; 106 106 } 107 107 /// Marker types for field names 108 108 #[allow(non_camel_case_types)] ··· 111 111 pub struct record(()); 112 112 ///Marker type for the `repo` field 113 113 pub struct repo(()); 114 + ///Marker type for the `rkey` field 115 + pub struct rkey(()); 114 116 ///Marker type for the `collection` field 115 117 pub struct collection(()); 116 - ///Marker type for the `rkey` field 117 - pub struct rkey(()); 118 118 } 119 119 } 120 120 ··· 291 291 S: put_record_state::State, 292 292 S::Record: put_record_state::IsSet, 293 293 S::Repo: put_record_state::IsSet, 294 - S::Collection: put_record_state::IsSet, 295 294 S::Rkey: put_record_state::IsSet, 295 + S::Collection: put_record_state::IsSet, 296 296 { 297 297 /// Build the final struct 298 298 pub fn build(self) -> PutRecord<'a> {
+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 Uri; 37 36 type Cid; 37 + type Uri; 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 Uri = Unset; 44 43 type Cid = Unset; 45 - } 46 - ///State transition - sets the `uri` field to Set 47 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetUri<S> {} 49 - impl<S: State> State for SetUri<S> { 50 - type Uri = Set<members::uri>; 51 - type Cid = S::Cid; 44 + type Uri = Unset; 52 45 } 53 46 ///State transition - sets the `cid` field to Set 54 47 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetCid<S> {} 56 49 impl<S: State> State for SetCid<S> { 57 - type Uri = S::Uri; 58 50 type Cid = Set<members::cid>; 51 + type Uri = S::Uri; 52 + } 53 + ///State transition - sets the `uri` field to Set 54 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetUri<S> {} 56 + impl<S: State> State for SetUri<S> { 57 + type Cid = S::Cid; 58 + type Uri = Set<members::uri>; 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 `uri` field 64 - pub struct uri(()); 65 63 ///Marker type for the `cid` field 66 64 pub struct cid(()); 65 + ///Marker type for the `uri` field 66 + pub struct uri(()); 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::Uri: strong_ref_state::IsSet, 140 139 S::Cid: strong_ref_state::IsSet, 140 + S::Uri: strong_ref_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> StrongRef<'a> {
+74 -74
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 ForAccount; 70 + type CreatedBy; 71 + type Uses; 69 72 type Available; 73 + type Disabled; 70 74 type CreatedAt; 71 75 type Code; 72 - type Uses; 73 - type Disabled; 74 - type CreatedBy; 75 - type ForAccount; 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 ForAccount = Unset; 82 + type CreatedBy = Unset; 83 + type Uses = Unset; 81 84 type Available = Unset; 85 + type Disabled = Unset; 82 86 type CreatedAt = Unset; 83 87 type Code = Unset; 84 - type Uses = Unset; 85 - type Disabled = Unset; 86 - type CreatedBy = Unset; 87 - type ForAccount = Unset; 88 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; 89 + ///State transition - sets the `for_account` field to Set 90 + pub struct SetForAccount<S: State = Empty>(PhantomData<fn() -> S>); 91 + impl<S: State> sealed::Sealed for SetForAccount<S> {} 92 + impl<S: State> State for SetForAccount<S> { 93 + type ForAccount = Set<members::for_account>; 98 94 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> { 95 + type Uses = S::Uses; 105 96 type Available = S::Available; 106 - type CreatedAt = Set<members::created_at>; 97 + type Disabled = S::Disabled; 98 + type CreatedAt = S::CreatedAt; 107 99 type Code = S::Code; 100 + } 101 + ///State transition - sets the `created_by` field to Set 102 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 103 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 104 + impl<S: State> State for SetCreatedBy<S> { 105 + type ForAccount = S::ForAccount; 106 + type CreatedBy = Set<members::created_by>; 108 107 type Uses = S::Uses; 108 + type Available = S::Available; 109 109 type Disabled = S::Disabled; 110 - type CreatedBy = S::CreatedBy; 111 - type ForAccount = S::ForAccount; 112 - } 113 - ///State transition - sets the `code` field to Set 114 - pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 115 - impl<S: State> sealed::Sealed for SetCode<S> {} 116 - impl<S: State> State for SetCode<S> { 117 - type Available = S::Available; 118 110 type CreatedAt = S::CreatedAt; 119 - type Code = Set<members::code>; 120 - type Uses = S::Uses; 121 - type Disabled = S::Disabled; 122 - type CreatedBy = S::CreatedBy; 123 - type ForAccount = S::ForAccount; 111 + type Code = S::Code; 124 112 } 125 113 ///State transition - sets the `uses` field to Set 126 114 pub struct SetUses<S: State = Empty>(PhantomData<fn() -> S>); 127 115 impl<S: State> sealed::Sealed for SetUses<S> {} 128 116 impl<S: State> State for SetUses<S> { 117 + type ForAccount = S::ForAccount; 118 + type CreatedBy = S::CreatedBy; 119 + type Uses = Set<members::uses>; 129 120 type Available = S::Available; 121 + type Disabled = S::Disabled; 130 122 type CreatedAt = S::CreatedAt; 131 123 type Code = S::Code; 132 - type Uses = Set<members::uses>; 133 - type Disabled = S::Disabled; 134 - type CreatedBy = S::CreatedBy; 124 + } 125 + ///State transition - sets the `available` field to Set 126 + pub struct SetAvailable<S: State = Empty>(PhantomData<fn() -> S>); 127 + impl<S: State> sealed::Sealed for SetAvailable<S> {} 128 + impl<S: State> State for SetAvailable<S> { 135 129 type ForAccount = S::ForAccount; 130 + type CreatedBy = S::CreatedBy; 131 + type Uses = S::Uses; 132 + type Available = Set<members::available>; 133 + type Disabled = S::Disabled; 134 + type CreatedAt = S::CreatedAt; 135 + type Code = S::Code; 136 136 } 137 137 ///State transition - sets the `disabled` field to Set 138 138 pub struct SetDisabled<S: State = Empty>(PhantomData<fn() -> S>); 139 139 impl<S: State> sealed::Sealed for SetDisabled<S> {} 140 140 impl<S: State> State for SetDisabled<S> { 141 + type ForAccount = S::ForAccount; 142 + type CreatedBy = S::CreatedBy; 143 + type Uses = S::Uses; 141 144 type Available = S::Available; 142 - type CreatedAt = S::CreatedAt; 143 - type Code = S::Code; 144 - type Uses = S::Uses; 145 145 type Disabled = Set<members::disabled>; 146 - type CreatedBy = S::CreatedBy; 147 - type ForAccount = S::ForAccount; 148 - } 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 146 type CreatedAt = S::CreatedAt; 155 147 type Code = S::Code; 156 - type Uses = S::Uses; 157 - type Disabled = S::Disabled; 158 - type CreatedBy = Set<members::created_by>; 159 - type ForAccount = S::ForAccount; 160 148 } 161 - ///State transition - sets the `for_account` field to Set 162 - pub struct SetForAccount<S: State = Empty>(PhantomData<fn() -> S>); 163 - impl<S: State> sealed::Sealed for SetForAccount<S> {} 164 - impl<S: State> State for SetForAccount<S> { 149 + ///State transition - sets the `created_at` field to Set 150 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 151 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 152 + impl<S: State> State for SetCreatedAt<S> { 153 + type ForAccount = S::ForAccount; 154 + type CreatedBy = S::CreatedBy; 155 + type Uses = S::Uses; 165 156 type Available = S::Available; 166 - type CreatedAt = S::CreatedAt; 157 + type Disabled = S::Disabled; 158 + type CreatedAt = Set<members::created_at>; 167 159 type Code = S::Code; 160 + } 161 + ///State transition - sets the `code` field to Set 162 + pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 163 + impl<S: State> sealed::Sealed for SetCode<S> {} 164 + impl<S: State> State for SetCode<S> { 165 + type ForAccount = S::ForAccount; 166 + type CreatedBy = S::CreatedBy; 168 167 type Uses = S::Uses; 168 + type Available = S::Available; 169 169 type Disabled = S::Disabled; 170 - type CreatedBy = S::CreatedBy; 171 - type ForAccount = Set<members::for_account>; 170 + type CreatedAt = S::CreatedAt; 171 + type Code = Set<members::code>; 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 `for_account` field 177 + pub struct for_account(()); 178 + ///Marker type for the `created_by` field 179 + pub struct created_by(()); 180 + ///Marker type for the `uses` field 181 + pub struct uses(()); 176 182 ///Marker type for the `available` field 177 183 pub struct available(()); 184 + ///Marker type for the `disabled` field 185 + pub struct disabled(()); 178 186 ///Marker type for the `created_at` field 179 187 pub struct created_at(()); 180 188 ///Marker type for the `code` field 181 189 pub struct code(()); 182 - ///Marker type for the `uses` field 183 - pub struct uses(()); 184 - ///Marker type for the `disabled` field 185 - pub struct disabled(()); 186 - ///Marker type for the `created_by` field 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::ForAccount: invite_code_state::IsSet, 363 + S::CreatedBy: invite_code_state::IsSet, 364 + S::Uses: invite_code_state::IsSet, 362 365 S::Available: invite_code_state::IsSet, 366 + S::Disabled: invite_code_state::IsSet, 363 367 S::CreatedAt: invite_code_state::IsSet, 364 368 S::Code: invite_code_state::IsSet, 365 - S::Uses: invite_code_state::IsSet, 366 - S::Disabled: invite_code_state::IsSet, 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> {
+13 -13
crates/weaver-api/src/com_atproto/server/create_invite_codes.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Account; 37 36 type Codes; 37 + type Account; 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 Account = Unset; 44 43 type Codes = Unset; 45 - } 46 - ///State transition - sets the `account` field to Set 47 - pub struct SetAccount<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetAccount<S> {} 49 - impl<S: State> State for SetAccount<S> { 50 - type Account = Set<members::account>; 51 - type Codes = S::Codes; 44 + type Account = Unset; 52 45 } 53 46 ///State transition - sets the `codes` field to Set 54 47 pub struct SetCodes<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetCodes<S> {} 56 49 impl<S: State> State for SetCodes<S> { 57 - type Account = S::Account; 58 50 type Codes = Set<members::codes>; 51 + type Account = S::Account; 52 + } 53 + ///State transition - sets the `account` field to Set 54 + pub struct SetAccount<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetAccount<S> {} 56 + impl<S: State> State for SetAccount<S> { 57 + type Codes = S::Codes; 58 + type Account = Set<members::account>; 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 `account` field 64 - pub struct account(()); 65 63 ///Marker type for the `codes` field 66 64 pub struct codes(()); 65 + ///Marker type for the `account` field 66 + pub struct account(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> AccountCodesBuilder<'a, S> 137 137 where 138 138 S: account_codes_state::State, 139 - S::Account: account_codes_state::IsSet, 140 139 S::Codes: account_codes_state::IsSet, 140 + S::Account: account_codes_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> AccountCodes<'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; 39 38 type Password; 39 + type Did; 40 40 type Token; 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; 47 46 type Password = Unset; 47 + type Did = Unset; 48 48 type Token = Unset; 49 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; 57 - } 58 50 ///State transition - sets the `password` field to Set 59 51 pub struct SetPassword<S: State = Empty>(PhantomData<fn() -> S>); 60 52 impl<S: State> sealed::Sealed for SetPassword<S> {} 61 53 impl<S: State> State for SetPassword<S> { 62 - type Did = S::Did; 63 54 type Password = Set<members::password>; 55 + type Did = S::Did; 56 + type Token = S::Token; 57 + } 58 + ///State transition - sets the `did` field to Set 59 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 60 + impl<S: State> sealed::Sealed for SetDid<S> {} 61 + impl<S: State> State for SetDid<S> { 62 + type Password = S::Password; 63 + type Did = Set<members::did>; 64 64 type Token = S::Token; 65 65 } 66 66 ///State transition - sets the `token` field to Set 67 67 pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 68 68 impl<S: State> sealed::Sealed for SetToken<S> {} 69 69 impl<S: State> State for SetToken<S> { 70 - type Did = S::Did; 71 70 type Password = S::Password; 71 + type Did = S::Did; 72 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 `password` field 78 + pub struct password(()); 77 79 ///Marker type for the `did` field 78 80 pub struct did(()); 79 - ///Marker type for the `password` field 80 - pub struct password(()); 81 81 ///Marker type for the `token` field 82 82 pub struct token(()); 83 83 } ··· 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, 176 175 S::Password: delete_account_state::IsSet, 176 + S::Did: delete_account_state::IsSet, 177 177 S::Token: delete_account_state::IsSet, 178 178 { 179 179 /// Build the final struct
+13 -13
crates/weaver-api/src/com_atproto/server/list_app_passwords.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 Name; 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 Name = 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 Name = S::Name; 45 + type CreatedAt = Unset; 53 46 } 54 47 ///State transition - sets the `name` field to Set 55 48 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetName<S> {} 57 50 impl<S: State> State for SetName<S> { 58 - type CreatedAt = S::CreatedAt; 59 51 type Name = Set<members::name>; 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 Name = S::Name; 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 `name` field 67 65 pub struct name(()); 66 + ///Marker type for the `created_at` field 67 + pub struct created_at(()); 68 68 } 69 69 } 70 70 ··· 151 151 impl<'a, S> AppPasswordBuilder<'a, S> 152 152 where 153 153 S: app_password_state::State, 154 - S::CreatedAt: app_password_state::IsSet, 155 154 S::Name: app_password_state::IsSet, 155 + S::CreatedAt: app_password_state::IsSet, 156 156 { 157 157 /// Build the final struct 158 158 pub fn build(self) -> AppPassword<'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 Did; 36 35 type Cid; 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 Cid = 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 Cid = S::Cid; 43 + type Did = Unset; 51 44 } 52 45 ///State transition - sets the `cid` field to Set 53 46 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 54 47 impl<S: State> sealed::Sealed for SetCid<S> {} 55 48 impl<S: State> State for SetCid<S> { 56 - type Did = S::Did; 57 49 type Cid = Set<members::cid>; 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 Cid = S::Cid; 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 `cid` field 65 63 pub struct cid(()); 64 + ///Marker type for the `did` field 65 + pub struct did(()); 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::Did: get_blob_state::IsSet, 139 138 S::Cid: get_blob_state::IsSet, 139 + S::Did: get_blob_state::IsSet, 140 140 { 141 141 /// Build the final struct 142 142 pub fn build(self) -> GetBlob<'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 Collection; 40 39 type Did; 40 + type Collection; 41 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 Collection = Unset; 48 47 type Did = Unset; 48 + type Collection = Unset; 49 49 type Rkey = Unset; 50 50 } 51 - ///State transition - sets the `collection` field to Set 52 - pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetCollection<S> {} 54 - impl<S: State> State for SetCollection<S> { 55 - type Collection = Set<members::collection>; 56 - type Did = S::Did; 57 - type Rkey = S::Rkey; 58 - } 59 51 ///State transition - sets the `did` field to Set 60 52 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 61 53 impl<S: State> sealed::Sealed for SetDid<S> {} 62 54 impl<S: State> State for SetDid<S> { 63 - type Collection = S::Collection; 64 55 type Did = Set<members::did>; 56 + type Collection = S::Collection; 57 + type Rkey = S::Rkey; 58 + } 59 + ///State transition - sets the `collection` field to Set 60 + pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 61 + impl<S: State> sealed::Sealed for SetCollection<S> {} 62 + impl<S: State> State for SetCollection<S> { 63 + type Did = S::Did; 64 + type Collection = Set<members::collection>; 65 65 type Rkey = S::Rkey; 66 66 } 67 67 ///State transition - sets the `rkey` field to Set 68 68 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 69 69 impl<S: State> sealed::Sealed for SetRkey<S> {} 70 70 impl<S: State> State for SetRkey<S> { 71 - type Collection = S::Collection; 72 71 type Did = S::Did; 72 + type Collection = S::Collection; 73 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 `did` field 79 + pub struct did(()); 78 80 ///Marker type for the `collection` field 79 81 pub struct collection(()); 80 - ///Marker type for the `did` field 81 - pub struct did(()); 82 82 ///Marker type for the `rkey` field 83 83 pub struct rkey(()); 84 84 } ··· 181 181 impl<'a, S> GetRecordBuilder<'a, S> 182 182 where 183 183 S: get_record_state::State, 184 - S::Collection: get_record_state::IsSet, 185 184 S::Did: get_record_state::IsSet, 185 + S::Collection: get_record_state::IsSet, 186 186 S::Rkey: get_record_state::IsSet, 187 187 { 188 188 /// Build the final struct
+24 -24
crates/weaver-api/src/com_atproto/sync/list_repos.rs
··· 194 194 } 195 195 /// State trait tracking which required fields have been set 196 196 pub trait State: sealed::Sealed { 197 - type Did; 198 - type Rev; 199 197 type Head; 198 + type Rev; 199 + type Did; 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 + type Head = Unset; 206 + type Rev = Unset; 205 207 type Did = Unset; 206 - type Rev = Unset; 207 - type Head = Unset; 208 208 } 209 - ///State transition - sets the `did` field to Set 210 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 211 - impl<S: State> sealed::Sealed for SetDid<S> {} 212 - impl<S: State> State for SetDid<S> { 213 - type Did = Set<members::did>; 209 + ///State transition - sets the `head` field to Set 210 + pub struct SetHead<S: State = Empty>(PhantomData<fn() -> S>); 211 + impl<S: State> sealed::Sealed for SetHead<S> {} 212 + impl<S: State> State for SetHead<S> { 213 + type Head = Set<members::head>; 214 214 type Rev = S::Rev; 215 - type Head = S::Head; 215 + type Did = S::Did; 216 216 } 217 217 ///State transition - sets the `rev` field to Set 218 218 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 219 219 impl<S: State> sealed::Sealed for SetRev<S> {} 220 220 impl<S: State> State for SetRev<S> { 221 - type Did = S::Did; 222 - type Rev = Set<members::rev>; 223 221 type Head = S::Head; 222 + type Rev = Set<members::rev>; 223 + type Did = S::Did; 224 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; 225 + ///State transition - sets the `did` field to Set 226 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 227 + impl<S: State> sealed::Sealed for SetDid<S> {} 228 + impl<S: State> State for SetDid<S> { 229 + type Head = S::Head; 230 230 type Rev = S::Rev; 231 - type Head = Set<members::head>; 231 + type Did = Set<members::did>; 232 232 } 233 233 /// Marker types for field names 234 234 #[allow(non_camel_case_types)] 235 235 pub mod members { 236 + ///Marker type for the `head` field 237 + pub struct head(()); 238 + ///Marker type for the `rev` field 239 + pub struct rev(()); 236 240 ///Marker type for the `did` field 237 241 pub struct did(()); 238 - ///Marker type for the `rev` field 239 - pub struct rev(()); 240 - ///Marker type for the `head` field 241 - pub struct head(()); 242 242 } 243 243 } 244 244 ··· 359 359 impl<'a, S> RepoBuilder<'a, S> 360 360 where 361 361 S: repo_state::State, 362 - S::Did: repo_state::IsSet, 363 - S::Rev: repo_state::IsSet, 364 362 S::Head: repo_state::IsSet, 363 + S::Rev: repo_state::IsSet, 364 + S::Did: repo_state::IsSet, 365 365 { 366 366 /// Build the final struct 367 367 pub fn build(self) -> Repo<'a> {
+181 -181
crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs
··· 41 41 /// State trait tracking which required fields have been set 42 42 pub trait State: sealed::Sealed { 43 43 type Did; 44 - type Active; 45 44 type Time; 45 + type Active; 46 46 type Seq; 47 47 } 48 48 /// Empty state - all required fields are unset ··· 50 50 impl sealed::Sealed for Empty {} 51 51 impl State for Empty { 52 52 type Did = Unset; 53 - type Active = Unset; 54 53 type Time = Unset; 54 + type Active = Unset; 55 55 type Seq = Unset; 56 56 } 57 57 ///State transition - sets the `did` field to Set ··· 59 59 impl<S: State> sealed::Sealed for SetDid<S> {} 60 60 impl<S: State> State for SetDid<S> { 61 61 type Did = Set<members::did>; 62 - type Active = S::Active; 63 62 type Time = S::Time; 64 - type Seq = S::Seq; 65 - } 66 - ///State transition - sets the `active` field to Set 67 - pub struct SetActive<S: State = Empty>(PhantomData<fn() -> S>); 68 - impl<S: State> sealed::Sealed for SetActive<S> {} 69 - impl<S: State> State for SetActive<S> { 70 - type Did = S::Did; 71 - type Active = Set<members::active>; 72 - type Time = S::Time; 63 + type Active = S::Active; 73 64 type Seq = S::Seq; 74 65 } 75 66 ///State transition - sets the `time` field to Set ··· 77 68 impl<S: State> sealed::Sealed for SetTime<S> {} 78 69 impl<S: State> State for SetTime<S> { 79 70 type Did = S::Did; 80 - type Active = S::Active; 81 71 type Time = Set<members::time>; 72 + type Active = S::Active; 73 + type Seq = S::Seq; 74 + } 75 + ///State transition - sets the `active` field to Set 76 + pub struct SetActive<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetActive<S> {} 78 + impl<S: State> State for SetActive<S> { 79 + type Did = S::Did; 80 + type Time = S::Time; 81 + type Active = Set<members::active>; 82 82 type Seq = S::Seq; 83 83 } 84 84 ///State transition - sets the `seq` field to Set ··· 86 86 impl<S: State> sealed::Sealed for SetSeq<S> {} 87 87 impl<S: State> State for SetSeq<S> { 88 88 type Did = S::Did; 89 - type Active = S::Active; 90 89 type Time = S::Time; 90 + type Active = S::Active; 91 91 type Seq = Set<members::seq>; 92 92 } 93 93 /// Marker types for field names ··· 95 95 pub mod members { 96 96 ///Marker type for the `did` field 97 97 pub struct did(()); 98 + ///Marker type for the `time` field 99 + pub struct time(()); 98 100 ///Marker type for the `active` field 99 101 pub struct active(()); 100 - ///Marker type for the `time` field 101 - pub struct time(()); 102 102 ///Marker type for the `seq` field 103 103 pub struct seq(()); 104 104 } ··· 228 228 where 229 229 S: account_state::State, 230 230 S::Did: account_state::IsSet, 231 - S::Active: account_state::IsSet, 232 231 S::Time: account_state::IsSet, 232 + S::Active: account_state::IsSet, 233 233 S::Seq: account_state::IsSet, 234 234 { 235 235 /// Build the final struct ··· 1073 1073 } 1074 1074 /// State trait tracking which required fields have been set 1075 1075 pub trait State: sealed::Sealed { 1076 - type TooBig; 1077 - type Blobs; 1078 - type Repo; 1076 + type Seq; 1077 + type Blocks; 1079 1078 type Time; 1080 1079 type Rev; 1080 + type Blobs; 1081 + type Repo; 1082 + type Rebase; 1081 1083 type Commit; 1082 - type Blocks; 1083 1084 type Ops; 1084 - type Rebase; 1085 - type Seq; 1085 + type TooBig; 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 TooBig = Unset; 1091 + type Seq = Unset; 1092 + type Blocks = Unset; 1093 + type Time = Unset; 1094 + type Rev = Unset; 1092 1095 type Blobs = Unset; 1093 1096 type Repo = Unset; 1094 - type Time = Unset; 1095 - type Rev = Unset; 1097 + type Rebase = Unset; 1096 1098 type Commit = Unset; 1097 - type Blocks = Unset; 1098 1099 type Ops = Unset; 1099 - type Rebase = Unset; 1100 - type Seq = Unset; 1100 + type TooBig = Unset; 1101 1101 } 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>; 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>; 1107 + type Blocks = S::Blocks; 1108 + type Time = S::Time; 1109 + type Rev = S::Rev; 1107 1110 type Blobs = S::Blobs; 1108 1111 type Repo = S::Repo; 1112 + type Rebase = S::Rebase; 1113 + type Commit = S::Commit; 1114 + type Ops = S::Ops; 1115 + type TooBig = S::TooBig; 1116 + } 1117 + ///State transition - sets the `blocks` field to Set 1118 + pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>); 1119 + impl<S: State> sealed::Sealed for SetBlocks<S> {} 1120 + impl<S: State> State for SetBlocks<S> { 1121 + type Seq = S::Seq; 1122 + type Blocks = Set<members::blocks>; 1109 1123 type Time = S::Time; 1110 1124 type Rev = S::Rev; 1125 + type Blobs = S::Blobs; 1126 + type Repo = S::Repo; 1127 + type Rebase = S::Rebase; 1111 1128 type Commit = S::Commit; 1129 + type Ops = S::Ops; 1130 + type TooBig = S::TooBig; 1131 + } 1132 + ///State transition - sets the `time` field to Set 1133 + pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 1134 + impl<S: State> sealed::Sealed for SetTime<S> {} 1135 + impl<S: State> State for SetTime<S> { 1136 + type Seq = S::Seq; 1112 1137 type Blocks = S::Blocks; 1138 + type Time = Set<members::time>; 1139 + type Rev = S::Rev; 1140 + type Blobs = S::Blobs; 1141 + type Repo = S::Repo; 1142 + type Rebase = S::Rebase; 1143 + type Commit = S::Commit; 1113 1144 type Ops = S::Ops; 1145 + type TooBig = S::TooBig; 1146 + } 1147 + ///State transition - sets the `rev` field to Set 1148 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1149 + impl<S: State> sealed::Sealed for SetRev<S> {} 1150 + impl<S: State> State for SetRev<S> { 1151 + type Seq = S::Seq; 1152 + type Blocks = S::Blocks; 1153 + type Time = S::Time; 1154 + type Rev = Set<members::rev>; 1155 + type Blobs = S::Blobs; 1156 + type Repo = S::Repo; 1114 1157 type Rebase = S::Rebase; 1115 - type Seq = S::Seq; 1158 + type Commit = S::Commit; 1159 + type Ops = S::Ops; 1160 + type TooBig = S::TooBig; 1116 1161 } 1117 1162 ///State transition - sets the `blobs` field to Set 1118 1163 pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>); 1119 1164 impl<S: State> sealed::Sealed for SetBlobs<S> {} 1120 1165 impl<S: State> State for SetBlobs<S> { 1121 - type TooBig = S::TooBig; 1166 + type Seq = S::Seq; 1167 + type Blocks = S::Blocks; 1168 + type Time = S::Time; 1169 + type Rev = S::Rev; 1122 1170 type Blobs = Set<members::blobs>; 1123 1171 type Repo = S::Repo; 1124 - type Time = S::Time; 1125 - type Rev = S::Rev; 1172 + type Rebase = S::Rebase; 1126 1173 type Commit = S::Commit; 1127 - type Blocks = S::Blocks; 1128 1174 type Ops = S::Ops; 1129 - type Rebase = S::Rebase; 1130 - type Seq = S::Seq; 1175 + type TooBig = S::TooBig; 1131 1176 } 1132 1177 ///State transition - sets the `repo` field to Set 1133 1178 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1134 1179 impl<S: State> sealed::Sealed for SetRepo<S> {} 1135 1180 impl<S: State> State for SetRepo<S> { 1136 - type TooBig = S::TooBig; 1181 + type Seq = S::Seq; 1182 + type Blocks = S::Blocks; 1183 + type Time = S::Time; 1184 + type Rev = S::Rev; 1137 1185 type Blobs = S::Blobs; 1138 1186 type Repo = Set<members::repo>; 1139 - type Time = S::Time; 1140 - type Rev = S::Rev; 1187 + type Rebase = S::Rebase; 1141 1188 type Commit = S::Commit; 1142 - type Blocks = S::Blocks; 1143 1189 type Ops = S::Ops; 1144 - type Rebase = S::Rebase; 1190 + type TooBig = S::TooBig; 1191 + } 1192 + ///State transition - sets the `rebase` field to Set 1193 + pub struct SetRebase<S: State = Empty>(PhantomData<fn() -> S>); 1194 + impl<S: State> sealed::Sealed for SetRebase<S> {} 1195 + impl<S: State> State for SetRebase<S> { 1145 1196 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; 1152 - type Blobs = S::Blobs; 1153 - type Repo = S::Repo; 1154 - type Time = Set<members::time>; 1197 + type Blocks = S::Blocks; 1198 + type Time = S::Time; 1155 1199 type Rev = S::Rev; 1156 - type Commit = S::Commit; 1157 - type Blocks = S::Blocks; 1158 - type Ops = S::Ops; 1159 - type Rebase = S::Rebase; 1160 - type Seq = S::Seq; 1161 - } 1162 - ///State transition - sets the `rev` field to Set 1163 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1164 - impl<S: State> sealed::Sealed for SetRev<S> {} 1165 - impl<S: State> State for SetRev<S> { 1166 - type TooBig = S::TooBig; 1167 1200 type Blobs = S::Blobs; 1168 1201 type Repo = S::Repo; 1169 - type Time = S::Time; 1170 - type Rev = Set<members::rev>; 1202 + type Rebase = Set<members::rebase>; 1171 1203 type Commit = S::Commit; 1172 - type Blocks = S::Blocks; 1173 1204 type Ops = S::Ops; 1174 - type Rebase = S::Rebase; 1175 - type Seq = S::Seq; 1205 + type TooBig = S::TooBig; 1176 1206 } 1177 1207 ///State transition - sets the `commit` field to Set 1178 1208 pub struct SetCommit<S: State = Empty>(PhantomData<fn() -> S>); 1179 1209 impl<S: State> sealed::Sealed for SetCommit<S> {} 1180 1210 impl<S: State> State for SetCommit<S> { 1181 - type TooBig = S::TooBig; 1182 - type Blobs = S::Blobs; 1183 - type Repo = S::Repo; 1211 + type Seq = S::Seq; 1212 + type Blocks = S::Blocks; 1184 1213 type Time = S::Time; 1185 1214 type Rev = S::Rev; 1186 - type Commit = Set<members::commit>; 1187 - type Blocks = S::Blocks; 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 1215 type Blobs = S::Blobs; 1198 1216 type Repo = S::Repo; 1199 - type Time = S::Time; 1200 - type Rev = S::Rev; 1201 - type Commit = S::Commit; 1202 - type Blocks = Set<members::blocks>; 1217 + type Rebase = S::Rebase; 1218 + type Commit = Set<members::commit>; 1203 1219 type Ops = S::Ops; 1204 - type Rebase = S::Rebase; 1205 - type Seq = S::Seq; 1220 + type TooBig = S::TooBig; 1206 1221 } 1207 1222 ///State transition - sets the `ops` field to Set 1208 1223 pub struct SetOps<S: State = Empty>(PhantomData<fn() -> S>); 1209 1224 impl<S: State> sealed::Sealed for SetOps<S> {} 1210 1225 impl<S: State> State for SetOps<S> { 1211 - type TooBig = S::TooBig; 1212 - type Blobs = S::Blobs; 1213 - type Repo = S::Repo; 1226 + type Seq = S::Seq; 1227 + type Blocks = S::Blocks; 1214 1228 type Time = S::Time; 1215 1229 type Rev = S::Rev; 1230 + type Blobs = S::Blobs; 1231 + type Repo = S::Repo; 1232 + type Rebase = S::Rebase; 1216 1233 type Commit = S::Commit; 1217 - type Blocks = S::Blocks; 1218 1234 type Ops = Set<members::ops>; 1219 - type Rebase = S::Rebase; 1235 + 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> { 1220 1241 type Seq = S::Seq; 1221 - } 1222 - ///State transition - sets the `rebase` field to Set 1223 - pub struct SetRebase<S: State = Empty>(PhantomData<fn() -> S>); 1224 - impl<S: State> sealed::Sealed for SetRebase<S> {} 1225 - impl<S: State> State for SetRebase<S> { 1226 - type TooBig = S::TooBig; 1227 - type Blobs = S::Blobs; 1228 - type Repo = S::Repo; 1242 + type Blocks = S::Blocks; 1229 1243 type Time = S::Time; 1230 1244 type Rev = S::Rev; 1231 - type Commit = S::Commit; 1232 - type Blocks = S::Blocks; 1233 - type Ops = S::Ops; 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> { 1241 - type TooBig = S::TooBig; 1242 1245 type Blobs = S::Blobs; 1243 1246 type Repo = S::Repo; 1244 - type Time = S::Time; 1245 - type Rev = S::Rev; 1247 + type Rebase = S::Rebase; 1246 1248 type Commit = S::Commit; 1247 - type Blocks = S::Blocks; 1248 1249 type Ops = S::Ops; 1249 - type Rebase = S::Rebase; 1250 - type Seq = Set<members::seq>; 1250 + type TooBig = Set<members::too_big>; 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 `too_big` field 1256 - pub struct too_big(()); 1257 - ///Marker type for the `blobs` field 1258 - pub struct blobs(()); 1259 - ///Marker type for the `repo` field 1260 - pub struct repo(()); 1255 + ///Marker type for the `seq` field 1256 + pub struct seq(()); 1257 + ///Marker type for the `blocks` field 1258 + pub struct blocks(()); 1261 1259 ///Marker type for the `time` field 1262 1260 pub struct time(()); 1263 1261 ///Marker type for the `rev` field 1264 1262 pub struct rev(()); 1263 + ///Marker type for the `blobs` field 1264 + pub struct blobs(()); 1265 + ///Marker type for the `repo` field 1266 + pub struct repo(()); 1267 + ///Marker type for the `rebase` field 1268 + pub struct rebase(()); 1265 1269 ///Marker type for the `commit` field 1266 1270 pub struct commit(()); 1267 - ///Marker type for the `blocks` field 1268 - pub struct blocks(()); 1269 1271 ///Marker type for the `ops` field 1270 1272 pub struct ops(()); 1271 - ///Marker type for the `rebase` field 1272 - pub struct rebase(()); 1273 - ///Marker type for the `seq` field 1274 - pub struct seq(()); 1273 + ///Marker type for the `too_big` field 1274 + pub struct too_big(()); 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::TooBig: commit_state::IsSet, 1563 - S::Blobs: commit_state::IsSet, 1564 - S::Repo: commit_state::IsSet, 1562 + S::Seq: commit_state::IsSet, 1563 + S::Blocks: commit_state::IsSet, 1565 1564 S::Time: commit_state::IsSet, 1566 1565 S::Rev: commit_state::IsSet, 1566 + S::Blobs: commit_state::IsSet, 1567 + S::Repo: commit_state::IsSet, 1568 + S::Rebase: commit_state::IsSet, 1567 1569 S::Commit: commit_state::IsSet, 1568 - S::Blocks: commit_state::IsSet, 1569 1570 S::Ops: commit_state::IsSet, 1570 - S::Rebase: commit_state::IsSet, 1571 - S::Seq: commit_state::IsSet, 1571 + S::TooBig: 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 Seq; 1681 1680 type Did; 1682 1681 type Time; 1682 + type Seq; 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 Seq = Unset; 1689 1688 type Did = Unset; 1690 1689 type Time = Unset; 1691 - } 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 - type Did = S::Did; 1698 - type Time = S::Time; 1690 + type Seq = Unset; 1699 1691 } 1700 1692 ///State transition - sets the `did` field to Set 1701 1693 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 1702 1694 impl<S: State> sealed::Sealed for SetDid<S> {} 1703 1695 impl<S: State> State for SetDid<S> { 1704 - type Seq = S::Seq; 1705 1696 type Did = Set<members::did>; 1706 1697 type Time = S::Time; 1698 + type Seq = S::Seq; 1707 1699 } 1708 1700 ///State transition - sets the `time` field to Set 1709 1701 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 1710 1702 impl<S: State> sealed::Sealed for SetTime<S> {} 1711 1703 impl<S: State> State for SetTime<S> { 1704 + type Did = S::Did; 1705 + type Time = Set<members::time>; 1712 1706 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> { 1713 1712 type Did = S::Did; 1714 - type Time = Set<members::time>; 1713 + type Time = S::Time; 1714 + type Seq = Set<members::seq>; 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 `seq` field 1720 - pub struct seq(()); 1721 1719 ///Marker type for the `did` field 1722 1720 pub struct did(()); 1723 1721 ///Marker type for the `time` field 1724 1722 pub struct time(()); 1723 + ///Marker type for the `seq` field 1724 + pub struct seq(()); 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::Seq: identity_state::IsSet, 1838 1837 S::Did: identity_state::IsSet, 1839 1838 S::Time: identity_state::IsSet, 1839 + S::Seq: identity_state::IsSet, 1840 1840 { 1841 1841 /// Build the final struct 1842 1842 pub fn build(self) -> Identity<'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; 2584 2582 type Did; 2583 + type Blocks; 2584 + type Rev; 2585 2585 type Seq; 2586 2586 type Time; 2587 2587 } ··· 2589 2589 pub struct Empty(()); 2590 2590 impl sealed::Sealed for Empty {} 2591 2591 impl State for Empty { 2592 + type Did = Unset; 2593 + type Blocks = Unset; 2592 2594 type Rev = Unset; 2593 - type Blocks = Unset; 2594 - type Did = Unset; 2595 2595 type Seq = Unset; 2596 2596 type Time = Unset; 2597 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>; 2598 + ///State transition - sets the `did` field to Set 2599 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2600 + impl<S: State> sealed::Sealed for SetDid<S> {} 2601 + impl<S: State> State for SetDid<S> { 2602 + type Did = Set<members::did>; 2603 2603 type Blocks = S::Blocks; 2604 - type Did = S::Did; 2604 + type Rev = S::Rev; 2605 2605 type Seq = S::Seq; 2606 2606 type Time = S::Time; 2607 2607 } ··· 2609 2609 pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>); 2610 2610 impl<S: State> sealed::Sealed for SetBlocks<S> {} 2611 2611 impl<S: State> State for SetBlocks<S> { 2612 - type Rev = S::Rev; 2612 + type Did = S::Did; 2613 2613 type Blocks = Set<members::blocks>; 2614 - type Did = S::Did; 2614 + type Rev = S::Rev; 2615 2615 type Seq = S::Seq; 2616 2616 type Time = S::Time; 2617 2617 } 2618 - ///State transition - sets the `did` field to Set 2619 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2620 - impl<S: State> sealed::Sealed for SetDid<S> {} 2621 - impl<S: State> State for SetDid<S> { 2622 - type Rev = S::Rev; 2618 + ///State transition - sets the `rev` field to Set 2619 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2620 + impl<S: State> sealed::Sealed for SetRev<S> {} 2621 + impl<S: State> State for SetRev<S> { 2622 + type Did = S::Did; 2623 2623 type Blocks = S::Blocks; 2624 - type Did = Set<members::did>; 2624 + type Rev = Set<members::rev>; 2625 2625 type Seq = S::Seq; 2626 2626 type Time = S::Time; 2627 2627 } ··· 2629 2629 pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 2630 2630 impl<S: State> sealed::Sealed for SetSeq<S> {} 2631 2631 impl<S: State> State for SetSeq<S> { 2632 - type Rev = S::Rev; 2632 + type Did = S::Did; 2633 2633 type Blocks = S::Blocks; 2634 - type Did = S::Did; 2634 + type Rev = S::Rev; 2635 2635 type Seq = Set<members::seq>; 2636 2636 type Time = S::Time; 2637 2637 } ··· 2639 2639 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 2640 2640 impl<S: State> sealed::Sealed for SetTime<S> {} 2641 2641 impl<S: State> State for SetTime<S> { 2642 + type Did = S::Did; 2643 + type Blocks = S::Blocks; 2642 2644 type Rev = S::Rev; 2643 - type Blocks = S::Blocks; 2644 - type Did = S::Did; 2645 2645 type Seq = S::Seq; 2646 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(()); 2651 + ///Marker type for the `did` field 2652 + pub struct did(()); 2653 2653 ///Marker type for the `blocks` field 2654 2654 pub struct blocks(()); 2655 - ///Marker type for the `did` field 2656 - pub struct did(()); 2655 + ///Marker type for the `rev` field 2656 + pub struct rev(()); 2657 2657 ///Marker type for the `seq` field 2658 2658 pub struct seq(()); 2659 2659 ///Marker type for the `time` field ··· 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, 2795 2793 S::Did: sync_state::IsSet, 2794 + S::Blocks: sync_state::IsSet, 2795 + S::Rev: sync_state::IsSet, 2796 2796 S::Seq: sync_state::IsSet, 2797 2797 S::Time: sync_state::IsSet, 2798 2798 {
+30 -30
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; 45 46 type ScryfallId; 46 47 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; 53 54 type ScryfallId = Unset; 54 55 type Quantity = Unset; 55 - type Section = 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; 56 64 } 57 65 ///State transition - sets the `scryfall_id` field to Set 58 66 pub struct SetScryfallId<S: State = Empty>(PhantomData<fn() -> S>); 59 67 impl<S: State> sealed::Sealed for SetScryfallId<S> {} 60 68 impl<S: State> State for SetScryfallId<S> { 69 + type Section = S::Section; 61 70 type ScryfallId = Set<members::scryfall_id>; 62 71 type Quantity = S::Quantity; 63 - type Section = S::Section; 64 72 } 65 73 ///State transition - sets the `quantity` field to Set 66 74 pub struct SetQuantity<S: State = Empty>(PhantomData<fn() -> S>); 67 75 impl<S: State> sealed::Sealed for SetQuantity<S> {} 68 76 impl<S: State> State for SetQuantity<S> { 69 - type ScryfallId = S::ScryfallId; 70 - type Quantity = Set<members::quantity>; 71 77 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 78 type ScryfallId = S::ScryfallId; 78 - type Quantity = S::Quantity; 79 - type Section = Set<members::section>; 79 + type Quantity = Set<members::quantity>; 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(()); 84 86 ///Marker type for the `scryfall_id` field 85 87 pub struct scryfall_id(()); 86 88 ///Marker type for the `quantity` field 87 89 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, 202 203 S::ScryfallId: card_state::IsSet, 203 204 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 CreatedAt; 708 707 type Name; 709 708 type Cards; 709 + type CreatedAt; 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 715 type Name = Unset; 717 716 type Cards = Unset; 718 - } 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 - type Name = S::Name; 725 - type Cards = S::Cards; 717 + type CreatedAt = Unset; 726 718 } 727 719 ///State transition - sets the `name` field to Set 728 720 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 729 721 impl<S: State> sealed::Sealed for SetName<S> {} 730 722 impl<S: State> State for SetName<S> { 731 - type CreatedAt = S::CreatedAt; 732 723 type Name = Set<members::name>; 733 724 type Cards = S::Cards; 725 + type CreatedAt = S::CreatedAt; 734 726 } 735 727 ///State transition - sets the `cards` field to Set 736 728 pub struct SetCards<S: State = Empty>(PhantomData<fn() -> S>); 737 729 impl<S: State> sealed::Sealed for SetCards<S> {} 738 730 impl<S: State> State for SetCards<S> { 739 - type CreatedAt = S::CreatedAt; 740 731 type Name = S::Name; 741 732 type Cards = Set<members::cards>; 733 + type CreatedAt = S::CreatedAt; 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 Name = S::Name; 740 + type Cards = S::Cards; 741 + type CreatedAt = Set<members::created_at>; 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 746 ///Marker type for the `name` field 749 747 pub struct name(()); 750 748 ///Marker type for the `cards` field 751 749 pub struct cards(()); 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::CreatedAt: list_state::IsSet, 919 918 S::Name: list_state::IsSet, 920 919 S::Cards: list_state::IsSet, 920 + S::CreatedAt: 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
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type ByteStart; 38 37 type ByteEnd; 38 + type ByteStart; 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 ByteStart = Unset; 45 44 type ByteEnd = Unset; 46 - } 47 - ///State transition - sets the `byte_start` field to Set 48 - pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetByteStart<S> {} 50 - impl<S: State> State for SetByteStart<S> { 51 - type ByteStart = Set<members::byte_start>; 52 - type ByteEnd = S::ByteEnd; 45 + type ByteStart = Unset; 53 46 } 54 47 ///State transition - sets the `byte_end` field to Set 55 48 pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetByteEnd<S> {} 57 50 impl<S: State> State for SetByteEnd<S> { 58 - type ByteStart = S::ByteStart; 59 51 type ByteEnd = Set<members::byte_end>; 52 + type ByteStart = S::ByteStart; 53 + } 54 + ///State transition - sets the `byte_start` field to Set 55 + pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetByteStart<S> {} 57 + impl<S: State> State for SetByteStart<S> { 58 + type ByteEnd = S::ByteEnd; 59 + type ByteStart = Set<members::byte_start>; 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 `byte_start` field 65 - pub struct byte_start(()); 66 64 ///Marker type for the `byte_end` field 67 65 pub struct byte_end(()); 66 + ///Marker type for the `byte_start` field 67 + pub struct byte_start(()); 68 68 } 69 69 } 70 70 ··· 134 134 impl<'a, S> ByteSliceBuilder<'a, S> 135 135 where 136 136 S: byte_slice_state::State, 137 - S::ByteStart: byte_slice_state::IsSet, 138 137 S::ByteEnd: byte_slice_state::IsSet, 138 + S::ByteStart: byte_slice_state::IsSet, 139 139 { 140 140 /// Build the final struct 141 141 pub fn build(self) -> ByteSlice<'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 EntryUri; 458 457 type Content; 458 + type EntryUri; 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 EntryUri = Unset; 465 464 type Content = Unset; 466 - } 467 - ///State transition - sets the `entry_uri` field to Set 468 - pub struct SetEntryUri<S: State = Empty>(PhantomData<fn() -> S>); 469 - impl<S: State> sealed::Sealed for SetEntryUri<S> {} 470 - impl<S: State> State for SetEntryUri<S> { 471 - type EntryUri = Set<members::entry_uri>; 472 - type Content = S::Content; 465 + type EntryUri = Unset; 473 466 } 474 467 ///State transition - sets the `content` field to Set 475 468 pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 476 469 impl<S: State> sealed::Sealed for SetContent<S> {} 477 470 impl<S: State> State for SetContent<S> { 478 - type EntryUri = S::EntryUri; 479 471 type Content = Set<members::content>; 472 + type EntryUri = S::EntryUri; 473 + } 474 + ///State transition - sets the `entry_uri` field to Set 475 + pub struct SetEntryUri<S: State = Empty>(PhantomData<fn() -> S>); 476 + impl<S: State> sealed::Sealed for SetEntryUri<S> {} 477 + impl<S: State> State for SetEntryUri<S> { 478 + type Content = S::Content; 479 + type EntryUri = Set<members::entry_uri>; 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 `entry_uri` field 485 - pub struct entry_uri(()); 486 484 ///Marker type for the `content` field 487 485 pub struct content(()); 486 + ///Marker type for the `entry_uri` field 487 + pub struct entry_uri(()); 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::EntryUri: comment_state::IsSet, 561 560 S::Content: comment_state::IsSet, 561 + S::EntryUri: 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/pub_leaflet/blocks/image.rs
··· 31 31 } 32 32 /// State trait tracking which required fields have been set 33 33 pub trait State: sealed::Sealed { 34 - type Height; 35 34 type Width; 35 + type Height; 36 36 } 37 37 /// Empty state - all required fields are unset 38 38 pub struct Empty(()); 39 39 impl sealed::Sealed for Empty {} 40 40 impl State for Empty { 41 - type Height = Unset; 42 41 type Width = Unset; 43 - } 44 - ///State transition - sets the `height` field to Set 45 - pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 46 - impl<S: State> sealed::Sealed for SetHeight<S> {} 47 - impl<S: State> State for SetHeight<S> { 48 - type Height = Set<members::height>; 49 - type Width = S::Width; 42 + type Height = Unset; 50 43 } 51 44 ///State transition - sets the `width` field to Set 52 45 pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 53 46 impl<S: State> sealed::Sealed for SetWidth<S> {} 54 47 impl<S: State> State for SetWidth<S> { 55 - type Height = S::Height; 56 48 type Width = Set<members::width>; 49 + type Height = S::Height; 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 Width = S::Width; 56 + type Height = Set<members::height>; 57 57 } 58 58 /// Marker types for field names 59 59 #[allow(non_camel_case_types)] 60 60 pub mod members { 61 - ///Marker type for the `height` field 62 - pub struct height(()); 63 61 ///Marker type for the `width` field 64 62 pub struct width(()); 63 + ///Marker type for the `height` field 64 + pub struct height(()); 65 65 } 66 66 } 67 67 ··· 131 131 impl<'a, S> AspectRatioBuilder<'a, S> 132 132 where 133 133 S: aspect_ratio_state::State, 134 - S::Height: aspect_ratio_state::IsSet, 135 134 S::Width: aspect_ratio_state::IsSet, 135 + S::Height: aspect_ratio_state::IsSet, 136 136 { 137 137 /// Build the final struct 138 138 pub fn build(self) -> AspectRatio<'a> {
+37 -37
crates/weaver-api/src/pub_leaflet/comment.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Quote; 37 36 type Document; 37 + type Quote; 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 Quote = Unset; 44 43 type Document = Unset; 45 - } 46 - ///State transition - sets the `quote` field to Set 47 - pub struct SetQuote<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetQuote<S> {} 49 - impl<S: State> State for SetQuote<S> { 50 - type Quote = Set<members::quote>; 51 - type Document = S::Document; 44 + type Quote = Unset; 52 45 } 53 46 ///State transition - sets the `document` field to Set 54 47 pub struct SetDocument<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetDocument<S> {} 56 49 impl<S: State> State for SetDocument<S> { 57 - type Quote = S::Quote; 58 50 type Document = Set<members::document>; 51 + type Quote = S::Quote; 52 + } 53 + ///State transition - sets the `quote` field to Set 54 + pub struct SetQuote<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetQuote<S> {} 56 + impl<S: State> State for SetQuote<S> { 57 + type Document = S::Document; 58 + type Quote = Set<members::quote>; 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 `quote` field 64 - pub struct quote(()); 65 63 ///Marker type for the `document` field 66 64 pub struct document(()); 65 + ///Marker type for the `quote` field 66 + pub struct quote(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> LinearDocumentQuoteBuilder<'a, S> 137 137 where 138 138 S: linear_document_quote_state::State, 139 - S::Quote: linear_document_quote_state::IsSet, 140 139 S::Document: linear_document_quote_state::IsSet, 140 + S::Quote: linear_document_quote_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> LinearDocumentQuote<'a> { ··· 443 443 } 444 444 /// State trait tracking which required fields have been set 445 445 pub trait State: sealed::Sealed { 446 - type CreatedAt; 447 - type Plaintext; 448 446 type Subject; 447 + type Plaintext; 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 Subject = Unset; 455 + type Plaintext = Unset; 454 456 type CreatedAt = Unset; 455 - type Plaintext = Unset; 456 - type Subject = Unset; 457 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>; 458 + ///State transition - sets the `subject` field to Set 459 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 460 + impl<S: State> sealed::Sealed for SetSubject<S> {} 461 + impl<S: State> State for SetSubject<S> { 462 + type Subject = Set<members::subject>; 463 463 type Plaintext = S::Plaintext; 464 - type Subject = S::Subject; 464 + type CreatedAt = S::CreatedAt; 465 465 } 466 466 ///State transition - sets the `plaintext` field to Set 467 467 pub struct SetPlaintext<S: State = Empty>(PhantomData<fn() -> S>); 468 468 impl<S: State> sealed::Sealed for SetPlaintext<S> {} 469 469 impl<S: State> State for SetPlaintext<S> { 470 - type CreatedAt = S::CreatedAt; 470 + type Subject = S::Subject; 471 471 type Plaintext = Set<members::plaintext>; 472 + 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> { 472 478 type Subject = S::Subject; 473 - } 474 - ///State transition - sets the `subject` field to Set 475 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 476 - impl<S: State> sealed::Sealed for SetSubject<S> {} 477 - impl<S: State> State for SetSubject<S> { 478 - type CreatedAt = S::CreatedAt; 479 479 type Plaintext = S::Plaintext; 480 - type Subject = Set<members::subject>; 480 + type CreatedAt = Set<members::created_at>; 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(()); 487 - ///Marker type for the `plaintext` field 488 - pub struct plaintext(()); 489 485 ///Marker type for the `subject` field 490 486 pub struct subject(()); 487 + ///Marker type for the `plaintext` field 488 + pub struct plaintext(()); 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, 661 - S::Plaintext: comment_state::IsSet, 662 660 S::Subject: comment_state::IsSet, 661 + S::Plaintext: 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> {
+24 -24
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 Pages; 59 - type Author; 60 58 type Title; 59 + type Author; 60 + type Pages; 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 + type Author = Unset; 66 68 type Pages = Unset; 67 - type Author = Unset; 68 - type Title = Unset; 69 69 } 70 - ///State transition - sets the `pages` field to Set 71 - pub struct SetPages<S: State = Empty>(PhantomData<fn() -> S>); 72 - impl<S: State> sealed::Sealed for SetPages<S> {} 73 - impl<S: State> State for SetPages<S> { 74 - type Pages = Set<members::pages>; 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 75 type Author = S::Author; 76 - type Title = S::Title; 76 + type Pages = S::Pages; 77 77 } 78 78 ///State transition - sets the `author` field to Set 79 79 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 80 80 impl<S: State> sealed::Sealed for SetAuthor<S> {} 81 81 impl<S: State> State for SetAuthor<S> { 82 - type Pages = S::Pages; 83 - type Author = Set<members::author>; 84 82 type Title = S::Title; 83 + type Author = Set<members::author>; 84 + type Pages = S::Pages; 85 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; 86 + ///State transition - sets the `pages` field to Set 87 + pub struct SetPages<S: State = Empty>(PhantomData<fn() -> S>); 88 + impl<S: State> sealed::Sealed for SetPages<S> {} 89 + impl<S: State> State for SetPages<S> { 90 + type Title = S::Title; 91 91 type Author = S::Author; 92 - type Title = Set<members::title>; 92 + type Pages = Set<members::pages>; 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 + ///Marker type for the `author` field 100 + pub struct author(()); 97 101 ///Marker type for the `pages` field 98 102 pub struct pages(()); 99 - ///Marker type for the `author` field 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::Pages: document_state::IsSet, 326 - S::Author: document_state::IsSet, 327 325 S::Title: document_state::IsSet, 326 + S::Author: document_state::IsSet, 327 + S::Pages: document_state::IsSet, 328 328 { 329 329 /// Build the final struct 330 330 pub fn build(self) -> Document<'a> {
+30 -30
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 Y; 42 43 type X; 43 44 type Block; 44 45 type Width; 45 - type Y; 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 Y = Unset; 51 52 type X = Unset; 52 53 type Block = Unset; 53 54 type Width = Unset; 54 - type Y = Unset; 55 + } 56 + ///State transition - sets the `y` field to Set 57 + pub struct SetY<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetY<S> {} 59 + impl<S: State> State for SetY<S> { 60 + type Y = Set<members::y>; 61 + type X = S::X; 62 + type Block = S::Block; 63 + type Width = S::Width; 55 64 } 56 65 ///State transition - sets the `x` field to Set 57 66 pub struct SetX<S: State = Empty>(PhantomData<fn() -> S>); 58 67 impl<S: State> sealed::Sealed for SetX<S> {} 59 68 impl<S: State> State for SetX<S> { 69 + type Y = S::Y; 60 70 type X = Set<members::x>; 61 71 type Block = S::Block; 62 72 type Width = S::Width; 63 - type Y = S::Y; 64 73 } 65 74 ///State transition - sets the `block` field to Set 66 75 pub struct SetBlock<S: State = Empty>(PhantomData<fn() -> S>); 67 76 impl<S: State> sealed::Sealed for SetBlock<S> {} 68 77 impl<S: State> State for SetBlock<S> { 78 + type Y = S::Y; 69 79 type X = S::X; 70 80 type Block = Set<members::block>; 71 81 type Width = S::Width; 72 - type Y = S::Y; 73 82 } 74 83 ///State transition - sets the `width` field to Set 75 84 pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 76 85 impl<S: State> sealed::Sealed for SetWidth<S> {} 77 86 impl<S: State> State for SetWidth<S> { 78 - type X = S::X; 79 - type Block = S::Block; 80 - type Width = Set<members::width>; 81 87 type Y = S::Y; 82 - } 83 - ///State transition - sets the `y` field to Set 84 - pub struct SetY<S: State = Empty>(PhantomData<fn() -> S>); 85 - impl<S: State> sealed::Sealed for SetY<S> {} 86 - impl<S: State> State for SetY<S> { 87 88 type X = S::X; 88 89 type Block = S::Block; 89 - type Width = S::Width; 90 - type Y = Set<members::y>; 90 + type Width = Set<members::width>; 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 `y` field 96 + pub struct y(()); 95 97 ///Marker type for the `x` field 96 98 pub struct x(()); 97 99 ///Marker type for the `block` field 98 100 pub struct block(()); 99 101 ///Marker type for the `width` field 100 102 pub struct width(()); 101 - ///Marker type for the `y` field 102 - pub struct y(()); 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::Y: block_state::IsSet, 237 238 S::X: block_state::IsSet, 238 239 S::Block: block_state::IsSet, 239 240 S::Width: block_state::IsSet, 240 - S::Y: 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 Offset; 768 767 type Block; 768 + type Offset; 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 Offset = Unset; 775 774 type Block = Unset; 776 - } 777 - ///State transition - sets the `offset` field to Set 778 - pub struct SetOffset<S: State = Empty>(PhantomData<fn() -> S>); 779 - impl<S: State> sealed::Sealed for SetOffset<S> {} 780 - impl<S: State> State for SetOffset<S> { 781 - type Offset = Set<members::offset>; 782 - type Block = S::Block; 775 + type Offset = Unset; 783 776 } 784 777 ///State transition - sets the `block` field to Set 785 778 pub struct SetBlock<S: State = Empty>(PhantomData<fn() -> S>); 786 779 impl<S: State> sealed::Sealed for SetBlock<S> {} 787 780 impl<S: State> State for SetBlock<S> { 788 - type Offset = S::Offset; 789 781 type Block = Set<members::block>; 782 + type Offset = S::Offset; 783 + } 784 + ///State transition - sets the `offset` field to Set 785 + pub struct SetOffset<S: State = Empty>(PhantomData<fn() -> S>); 786 + impl<S: State> sealed::Sealed for SetOffset<S> {} 787 + impl<S: State> State for SetOffset<S> { 788 + type Block = S::Block; 789 + type Offset = Set<members::offset>; 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 `offset` field 795 - pub struct offset(()); 796 794 ///Marker type for the `block` field 797 795 pub struct block(()); 796 + ///Marker type for the `offset` field 797 + pub struct offset(()); 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::Offset: position_state::IsSet, 871 870 S::Block: position_state::IsSet, 871 + S::Offset: 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/pages/linear_document.rs
··· 876 876 } 877 877 /// State trait tracking which required fields have been set 878 878 pub trait State: sealed::Sealed { 879 - type Start; 880 879 type End; 880 + type Start; 881 881 } 882 882 /// Empty state - all required fields are unset 883 883 pub struct Empty(()); 884 884 impl sealed::Sealed for Empty {} 885 885 impl State for Empty { 886 - type Start = Unset; 887 886 type End = Unset; 888 - } 889 - ///State transition - sets the `start` field to Set 890 - pub struct SetStart<S: State = Empty>(PhantomData<fn() -> S>); 891 - impl<S: State> sealed::Sealed for SetStart<S> {} 892 - impl<S: State> State for SetStart<S> { 893 - type Start = Set<members::start>; 894 - type End = S::End; 887 + type Start = Unset; 895 888 } 896 889 ///State transition - sets the `end` field to Set 897 890 pub struct SetEnd<S: State = Empty>(PhantomData<fn() -> S>); 898 891 impl<S: State> sealed::Sealed for SetEnd<S> {} 899 892 impl<S: State> State for SetEnd<S> { 900 - type Start = S::Start; 901 893 type End = Set<members::end>; 894 + type Start = S::Start; 895 + } 896 + ///State transition - sets the `start` field to Set 897 + pub struct SetStart<S: State = Empty>(PhantomData<fn() -> S>); 898 + impl<S: State> sealed::Sealed for SetStart<S> {} 899 + impl<S: State> State for SetStart<S> { 900 + type End = S::End; 901 + type Start = Set<members::start>; 902 902 } 903 903 /// Marker types for field names 904 904 #[allow(non_camel_case_types)] 905 905 pub mod members { 906 - ///Marker type for the `start` field 907 - pub struct start(()); 908 906 ///Marker type for the `end` field 909 907 pub struct end(()); 908 + ///Marker type for the `start` field 909 + pub struct start(()); 910 910 } 911 911 } 912 912 ··· 979 979 impl<'a, S> QuoteBuilder<'a, S> 980 980 where 981 981 S: quote_state::State, 982 - S::Start: quote_state::IsSet, 983 982 S::End: quote_state::IsSet, 983 + S::Start: quote_state::IsSet, 984 984 { 985 985 /// Build the final struct 986 986 pub fn build(self) -> Quote<'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 Poll; 38 37 type Option; 38 + type Poll; 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 Poll = Unset; 45 44 type Option = Unset; 46 - } 47 - ///State transition - sets the `poll` field to Set 48 - pub struct SetPoll<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetPoll<S> {} 50 - impl<S: State> State for SetPoll<S> { 51 - type Poll = Set<members::poll>; 52 - type Option = S::Option; 45 + type Poll = Unset; 53 46 } 54 47 ///State transition - sets the `option` field to Set 55 48 pub struct SetOption<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetOption<S> {} 57 50 impl<S: State> State for SetOption<S> { 58 - type Poll = S::Poll; 59 51 type Option = Set<members::option>; 52 + type Poll = S::Poll; 53 + } 54 + ///State transition - sets the `poll` field to Set 55 + pub struct SetPoll<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetPoll<S> {} 57 + impl<S: State> State for SetPoll<S> { 58 + type Option = S::Option; 59 + type Poll = Set<members::poll>; 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 `poll` field 65 - pub struct poll(()); 66 64 ///Marker type for the `option` field 67 65 pub struct option(()); 66 + ///Marker type for the `poll` field 67 + pub struct poll(()); 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::Poll: vote_state::IsSet, 141 140 S::Option: vote_state::IsSet, 141 + S::Poll: vote_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> Vote<'a> {
+26 -26
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 ByteStart; 560 559 type ByteEnd; 560 + type ByteStart; 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 ByteStart = Unset; 567 566 type ByteEnd = Unset; 568 - } 569 - ///State transition - sets the `byte_start` field to Set 570 - pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 571 - impl<S: State> sealed::Sealed for SetByteStart<S> {} 572 - impl<S: State> State for SetByteStart<S> { 573 - type ByteStart = Set<members::byte_start>; 574 - type ByteEnd = S::ByteEnd; 567 + type ByteStart = Unset; 575 568 } 576 569 ///State transition - sets the `byte_end` field to Set 577 570 pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>); 578 571 impl<S: State> sealed::Sealed for SetByteEnd<S> {} 579 572 impl<S: State> State for SetByteEnd<S> { 580 - type ByteStart = S::ByteStart; 581 573 type ByteEnd = Set<members::byte_end>; 574 + type ByteStart = S::ByteStart; 575 + } 576 + ///State transition - sets the `byte_start` field to Set 577 + pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 578 + impl<S: State> sealed::Sealed for SetByteStart<S> {} 579 + impl<S: State> State for SetByteStart<S> { 580 + type ByteEnd = S::ByteEnd; 581 + type ByteStart = Set<members::byte_start>; 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_start` field 587 - pub struct byte_start(()); 588 586 ///Marker type for the `byte_end` field 589 587 pub struct byte_end(()); 588 + ///Marker type for the `byte_start` field 589 + pub struct byte_start(()); 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::ByteStart: byte_slice_state::IsSet, 660 659 S::ByteEnd: byte_slice_state::IsSet, 660 + S::ByteStart: byte_slice_state::IsSet, 661 661 { 662 662 /// Build the final struct 663 663 pub fn build(self) -> ByteSlice<'a> { ··· 1056 1056 } 1057 1057 /// State trait tracking which required fields have been set 1058 1058 pub trait State: sealed::Sealed { 1059 - type Index; 1060 1059 type Features; 1060 + type Index; 1061 1061 } 1062 1062 /// Empty state - all required fields are unset 1063 1063 pub struct Empty(()); 1064 1064 impl sealed::Sealed for Empty {} 1065 1065 impl State for Empty { 1066 - type Index = Unset; 1067 1066 type Features = Unset; 1068 - } 1069 - ///State transition - sets the `index` field to Set 1070 - pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 1071 - impl<S: State> sealed::Sealed for SetIndex<S> {} 1072 - impl<S: State> State for SetIndex<S> { 1073 - type Index = Set<members::index>; 1074 - type Features = S::Features; 1067 + type Index = Unset; 1075 1068 } 1076 1069 ///State transition - sets the `features` field to Set 1077 1070 pub struct SetFeatures<S: State = Empty>(PhantomData<fn() -> S>); 1078 1071 impl<S: State> sealed::Sealed for SetFeatures<S> {} 1079 1072 impl<S: State> State for SetFeatures<S> { 1080 - type Index = S::Index; 1081 1073 type Features = Set<members::features>; 1074 + type Index = S::Index; 1075 + } 1076 + ///State transition - sets the `index` field to Set 1077 + pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 1078 + impl<S: State> sealed::Sealed for SetIndex<S> {} 1079 + impl<S: State> State for SetIndex<S> { 1080 + type Features = S::Features; 1081 + type Index = Set<members::index>; 1082 1082 } 1083 1083 /// Marker types for field names 1084 1084 #[allow(non_camel_case_types)] 1085 1085 pub mod members { 1086 - ///Marker type for the `index` field 1087 - pub struct index(()); 1088 1086 ///Marker type for the `features` field 1089 1087 pub struct features(()); 1088 + ///Marker type for the `index` field 1089 + pub struct index(()); 1090 1090 } 1091 1091 } 1092 1092 ··· 1159 1159 impl<'a, S> FacetBuilder<'a, S> 1160 1160 where 1161 1161 S: facet_state::State, 1162 - S::Index: facet_state::IsSet, 1163 1162 S::Features: facet_state::IsSet, 1163 + S::Index: facet_state::IsSet, 1164 1164 { 1165 1165 /// Build the final struct 1166 1166 pub fn build(self) -> Facet<'a> {
+39 -39
crates/weaver-api/src/pub_leaflet/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 G; 442 + type B; 443 + type A; 441 444 type R; 442 - type A; 443 - 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 R = Unset; 451 - type A = Unset; 452 - type B = Unset; 453 450 type G = Unset; 451 + type B = Unset; 452 + type A = Unset; 453 + type R = Unset; 454 454 } 455 - ///State transition - sets the `r` field to Set 456 - pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>); 457 - impl<S: State> sealed::Sealed for SetR<S> {} 458 - impl<S: State> State for SetR<S> { 459 - type R = Set<members::r>; 460 - type A = S::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>; 461 460 type B = S::B; 462 - type G = S::G; 463 - } 464 - ///State transition - sets the `a` field to Set 465 - pub struct SetA<S: State = Empty>(PhantomData<fn() -> S>); 466 - impl<S: State> sealed::Sealed for SetA<S> {} 467 - impl<S: State> State for SetA<S> { 461 + type A = S::A; 468 462 type R = S::R; 469 - type A = Set<members::a>; 470 - type B = S::B; 471 - type G = S::G; 472 463 } 473 464 ///State transition - sets the `b` field to Set 474 465 pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>); 475 466 impl<S: State> sealed::Sealed for SetB<S> {} 476 467 impl<S: State> State for SetB<S> { 477 - type R = S::R; 478 - type A = S::A; 479 - type B = Set<members::b>; 480 468 type G = S::G; 469 + type B = Set<members::b>; 470 + type A = S::A; 471 + type R = S::R; 481 472 } 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> { 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> { 477 + type G = S::G; 478 + type B = S::B; 479 + type A = Set<members::a>; 486 480 type R = S::R; 487 - type A = S::A; 481 + } 482 + ///State transition - sets the `r` field to Set 483 + pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>); 484 + impl<S: State> sealed::Sealed for SetR<S> {} 485 + impl<S: State> State for SetR<S> { 486 + type G = S::G; 488 487 type B = S::B; 489 - type G = Set<members::g>; 488 + type A = S::A; 489 + type R = Set<members::r>; 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 `r` field 495 - pub struct r(()); 496 - ///Marker type for the `a` field 497 - pub struct a(()); 494 + ///Marker type for the `g` field 495 + pub struct g(()); 498 496 ///Marker type for the `b` field 499 497 pub struct b(()); 500 - ///Marker type for the `g` field 501 - pub struct g(()); 498 + ///Marker type for the `a` field 499 + pub struct a(()); 500 + ///Marker type for the `r` field 501 + pub struct r(()); 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::R: rgba_state::IsSet, 603 - S::A: rgba_state::IsSet, 604 - S::B: rgba_state::IsSet, 605 602 S::G: rgba_state::IsSet, 603 + S::B: rgba_state::IsSet, 604 + S::A: rgba_state::IsSet, 605 + S::R: rgba_state::IsSet, 606 606 { 607 607 /// Build the final struct 608 608 pub fn build(self) -> Rgba<'a> {
+1
crates/weaver-api/src/sh_weaver.rs
··· 5 5 6 6 pub mod actor; 7 7 pub mod collab; 8 + pub mod domain; 8 9 pub mod edit; 9 10 pub mod embed; 10 11 pub mod graph;
+28 -28
crates/weaver-api/src/sh_weaver/actor.rs
··· 2623 2623 } 2624 2624 /// State trait tracking which required fields have been set 2625 2625 pub trait State: sealed::Sealed { 2626 - type Did; 2627 2626 type Handle; 2627 + type Did; 2628 2628 } 2629 2629 /// Empty state - all required fields are unset 2630 2630 pub struct Empty(()); 2631 2631 impl sealed::Sealed for Empty {} 2632 2632 impl State for Empty { 2633 - type Did = Unset; 2634 2633 type Handle = Unset; 2635 - } 2636 - ///State transition - sets the `did` field to Set 2637 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2638 - impl<S: State> sealed::Sealed for SetDid<S> {} 2639 - impl<S: State> State for SetDid<S> { 2640 - type Did = Set<members::did>; 2641 - type Handle = S::Handle; 2634 + type Did = Unset; 2642 2635 } 2643 2636 ///State transition - sets the `handle` field to Set 2644 2637 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 2645 2638 impl<S: State> sealed::Sealed for SetHandle<S> {} 2646 2639 impl<S: State> State for SetHandle<S> { 2647 - type Did = S::Did; 2648 2640 type Handle = Set<members::handle>; 2641 + type Did = S::Did; 2642 + } 2643 + ///State transition - sets the `did` field to Set 2644 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2645 + impl<S: State> sealed::Sealed for SetDid<S> {} 2646 + impl<S: State> State for SetDid<S> { 2647 + type Handle = S::Handle; 2648 + type Did = Set<members::did>; 2649 2649 } 2650 2650 /// Marker types for field names 2651 2651 #[allow(non_camel_case_types)] 2652 2652 pub mod members { 2653 - ///Marker type for the `did` field 2654 - pub struct did(()); 2655 2653 ///Marker type for the `handle` field 2656 2654 pub struct handle(()); 2655 + ///Marker type for the `did` field 2656 + pub struct did(()); 2657 2657 } 2658 2658 } 2659 2659 ··· 2846 2846 impl<'a, S> ProfileViewBasicBuilder<'a, S> 2847 2847 where 2848 2848 S: profile_view_basic_state::State, 2849 - S::Did: profile_view_basic_state::IsSet, 2850 2849 S::Handle: profile_view_basic_state::IsSet, 2850 + S::Did: profile_view_basic_state::IsSet, 2851 2851 { 2852 2852 /// Build the final struct 2853 2853 pub fn build(self) -> ProfileViewBasic<'a> { ··· 3166 3166 } 3167 3167 /// State trait tracking which required fields have been set 3168 3168 pub trait State: sealed::Sealed { 3169 - type Did; 3170 3169 type Handle; 3170 + type Did; 3171 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 - type Did = Unset; 3178 3177 type Handle = Unset; 3178 + type Did = Unset; 3179 3179 type Bluesky = Unset; 3180 3180 } 3181 - ///State transition - sets the `did` field to Set 3182 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 3183 - impl<S: State> sealed::Sealed for SetDid<S> {} 3184 - impl<S: State> State for SetDid<S> { 3185 - type Did = Set<members::did>; 3186 - type Handle = S::Handle; 3187 - type Bluesky = S::Bluesky; 3188 - } 3189 3181 ///State transition - sets the `handle` field to Set 3190 3182 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 3191 3183 impl<S: State> sealed::Sealed for SetHandle<S> {} 3192 3184 impl<S: State> State for SetHandle<S> { 3193 - type Did = S::Did; 3194 3185 type Handle = Set<members::handle>; 3186 + type Did = S::Did; 3187 + type Bluesky = S::Bluesky; 3188 + } 3189 + ///State transition - sets the `did` field to Set 3190 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 3191 + impl<S: State> sealed::Sealed for SetDid<S> {} 3192 + impl<S: State> State for SetDid<S> { 3193 + type Handle = S::Handle; 3194 + type Did = Set<members::did>; 3195 3195 type Bluesky = S::Bluesky; 3196 3196 } 3197 3197 ///State transition - sets the `bluesky` field to Set 3198 3198 pub struct SetBluesky<S: State = Empty>(PhantomData<fn() -> S>); 3199 3199 impl<S: State> sealed::Sealed for SetBluesky<S> {} 3200 3200 impl<S: State> State for SetBluesky<S> { 3201 - type Did = S::Did; 3202 3201 type Handle = S::Handle; 3202 + type Did = S::Did; 3203 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 - ///Marker type for the `did` field 3209 - pub struct did(()); 3210 3208 ///Marker type for the `handle` field 3211 3209 pub struct handle(()); 3210 + ///Marker type for the `did` field 3211 + pub struct did(()); 3212 3212 ///Marker type for the `bluesky` field 3213 3213 pub struct bluesky(()); 3214 3214 } ··· 3400 3400 impl<'a, S> TangledProfileViewBuilder<'a, S> 3401 3401 where 3402 3402 S: tangled_profile_view_state::State, 3403 - S::Did: tangled_profile_view_state::IsSet, 3404 3403 S::Handle: tangled_profile_view_state::IsSet, 3404 + S::Did: tangled_profile_view_state::IsSet, 3405 3405 S::Bluesky: tangled_profile_view_state::IsSet, 3406 3406 { 3407 3407 /// Build the final struct
+143 -143
crates/weaver-api/src/sh_weaver/collab.rs
··· 94 94 } 95 95 /// State trait tracking which required fields have been set 96 96 pub trait State: sealed::Sealed { 97 - type Resource; 98 - type Status; 99 97 type Participants; 98 + type Status; 99 + type Resource; 100 100 } 101 101 /// Empty state - all required fields are unset 102 102 pub struct Empty(()); 103 103 impl sealed::Sealed for Empty {} 104 104 impl State for Empty { 105 + type Participants = Unset; 106 + type Status = Unset; 105 107 type Resource = Unset; 106 - type Status = Unset; 107 - type Participants = Unset; 108 108 } 109 - ///State transition - sets the `resource` field to Set 110 - pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 111 - impl<S: State> sealed::Sealed for SetResource<S> {} 112 - impl<S: State> State for SetResource<S> { 113 - type Resource = Set<members::resource>; 109 + ///State transition - sets the `participants` field to Set 110 + pub struct SetParticipants<S: State = Empty>(PhantomData<fn() -> S>); 111 + impl<S: State> sealed::Sealed for SetParticipants<S> {} 112 + impl<S: State> State for SetParticipants<S> { 113 + type Participants = Set<members::participants>; 114 114 type Status = S::Status; 115 - type Participants = S::Participants; 115 + type Resource = S::Resource; 116 116 } 117 117 ///State transition - sets the `status` field to Set 118 118 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 119 119 impl<S: State> sealed::Sealed for SetStatus<S> {} 120 120 impl<S: State> State for SetStatus<S> { 121 - type Resource = S::Resource; 122 - type Status = Set<members::status>; 123 121 type Participants = S::Participants; 122 + type Status = Set<members::status>; 123 + type Resource = S::Resource; 124 124 } 125 - ///State transition - sets the `participants` field to Set 126 - pub struct SetParticipants<S: State = Empty>(PhantomData<fn() -> S>); 127 - impl<S: State> sealed::Sealed for SetParticipants<S> {} 128 - impl<S: State> State for SetParticipants<S> { 129 - type Resource = S::Resource; 125 + ///State transition - sets the `resource` field to Set 126 + pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 127 + impl<S: State> sealed::Sealed for SetResource<S> {} 128 + impl<S: State> State for SetResource<S> { 129 + type Participants = S::Participants; 130 130 type Status = S::Status; 131 - type Participants = Set<members::participants>; 131 + type Resource = Set<members::resource>; 132 132 } 133 133 /// Marker types for field names 134 134 #[allow(non_camel_case_types)] 135 135 pub mod members { 136 + ///Marker type for the `participants` field 137 + pub struct participants(()); 138 + ///Marker type for the `status` field 139 + pub struct status(()); 136 140 ///Marker type for the `resource` field 137 141 pub struct resource(()); 138 - ///Marker type for the `status` field 139 - pub struct status(()); 140 - ///Marker type for the `participants` field 141 - pub struct participants(()); 142 142 } 143 143 } 144 144 ··· 426 426 impl<'a, S> CollaborationStateViewBuilder<'a, S> 427 427 where 428 428 S: collaboration_state_view_state::State, 429 - S::Resource: collaboration_state_view_state::IsSet, 430 - S::Status: collaboration_state_view_state::IsSet, 431 429 S::Participants: collaboration_state_view_state::IsSet, 430 + S::Status: collaboration_state_view_state::IsSet, 431 + S::Resource: collaboration_state_view_state::IsSet, 432 432 { 433 433 /// Build the final struct 434 434 pub fn build(self) -> CollaborationStateView<'a> { ··· 1612 1612 pub trait State: sealed::Sealed { 1613 1613 type EndReason; 1614 1614 type WasActiveFrom; 1615 - type WasActiveUntil; 1616 1615 type User; 1616 + type WasActiveUntil; 1617 1617 } 1618 1618 /// Empty state - all required fields are unset 1619 1619 pub struct Empty(()); ··· 1621 1621 impl State for Empty { 1622 1622 type EndReason = Unset; 1623 1623 type WasActiveFrom = Unset; 1624 - type WasActiveUntil = Unset; 1625 1624 type User = Unset; 1625 + type WasActiveUntil = Unset; 1626 1626 } 1627 1627 ///State transition - sets the `end_reason` field to Set 1628 1628 pub struct SetEndReason<S: State = Empty>(PhantomData<fn() -> S>); ··· 1630 1630 impl<S: State> State for SetEndReason<S> { 1631 1631 type EndReason = Set<members::end_reason>; 1632 1632 type WasActiveFrom = S::WasActiveFrom; 1633 - type WasActiveUntil = S::WasActiveUntil; 1634 1633 type User = S::User; 1634 + type WasActiveUntil = S::WasActiveUntil; 1635 1635 } 1636 1636 ///State transition - sets the `was_active_from` field to Set 1637 1637 pub struct SetWasActiveFrom<S: State = Empty>(PhantomData<fn() -> S>); ··· 1639 1639 impl<S: State> State for SetWasActiveFrom<S> { 1640 1640 type EndReason = S::EndReason; 1641 1641 type WasActiveFrom = Set<members::was_active_from>; 1642 - type WasActiveUntil = S::WasActiveUntil; 1643 1642 type User = S::User; 1644 - } 1645 - ///State transition - sets the `was_active_until` field to Set 1646 - pub struct SetWasActiveUntil<S: State = Empty>(PhantomData<fn() -> S>); 1647 - impl<S: State> sealed::Sealed for SetWasActiveUntil<S> {} 1648 - impl<S: State> State for SetWasActiveUntil<S> { 1649 - type EndReason = S::EndReason; 1650 - type WasActiveFrom = S::WasActiveFrom; 1651 - type WasActiveUntil = Set<members::was_active_until>; 1652 - type User = S::User; 1643 + type WasActiveUntil = S::WasActiveUntil; 1653 1644 } 1654 1645 ///State transition - sets the `user` field to Set 1655 1646 pub struct SetUser<S: State = Empty>(PhantomData<fn() -> S>); ··· 1657 1648 impl<S: State> State for SetUser<S> { 1658 1649 type EndReason = S::EndReason; 1659 1650 type WasActiveFrom = S::WasActiveFrom; 1660 - type WasActiveUntil = S::WasActiveUntil; 1661 1651 type User = Set<members::user>; 1652 + type WasActiveUntil = S::WasActiveUntil; 1653 + } 1654 + ///State transition - sets the `was_active_until` field to Set 1655 + pub struct SetWasActiveUntil<S: State = Empty>(PhantomData<fn() -> S>); 1656 + impl<S: State> sealed::Sealed for SetWasActiveUntil<S> {} 1657 + impl<S: State> State for SetWasActiveUntil<S> { 1658 + type EndReason = S::EndReason; 1659 + type WasActiveFrom = S::WasActiveFrom; 1660 + type User = S::User; 1661 + type WasActiveUntil = Set<members::was_active_until>; 1662 1662 } 1663 1663 /// Marker types for field names 1664 1664 #[allow(non_camel_case_types)] ··· 1667 1667 pub struct end_reason(()); 1668 1668 ///Marker type for the `was_active_from` field 1669 1669 pub struct was_active_from(()); 1670 + ///Marker type for the `user` field 1671 + pub struct user(()); 1670 1672 ///Marker type for the `was_active_until` field 1671 1673 pub struct was_active_until(()); 1672 - ///Marker type for the `user` field 1673 - pub struct user(()); 1674 1674 } 1675 1675 } 1676 1676 ··· 1845 1845 S: former_collaborator_view_state::State, 1846 1846 S::EndReason: former_collaborator_view_state::IsSet, 1847 1847 S::WasActiveFrom: former_collaborator_view_state::IsSet, 1848 - S::WasActiveUntil: former_collaborator_view_state::IsSet, 1849 1848 S::User: former_collaborator_view_state::IsSet, 1849 + S::WasActiveUntil: former_collaborator_view_state::IsSet, 1850 1850 { 1851 1851 /// Build the final struct 1852 1852 pub fn build(self) -> FormerCollaboratorView<'a> { ··· 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 2064 type Status; 2069 2065 type Uri; 2070 2066 type Inviter; 2067 + type Invitee; 2068 + type Cid; 2069 + type Resource; 2070 + type CreatedAt; 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; 2076 + type Status = Unset; 2077 + type Uri = Unset; 2078 + type Inviter = Unset; 2077 2079 type Invitee = Unset; 2078 2080 type Cid = Unset; 2081 + type Resource = Unset; 2079 2082 type CreatedAt = Unset; 2080 - type Status = Unset; 2081 - type Uri = Unset; 2082 - type Inviter = Unset; 2083 + } 2084 + ///State transition - sets the `status` field to Set 2085 + pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 2086 + impl<S: State> sealed::Sealed for SetStatus<S> {} 2087 + impl<S: State> State for SetStatus<S> { 2088 + type Status = Set<members::status>; 2089 + type Uri = S::Uri; 2090 + type Inviter = S::Inviter; 2091 + type Invitee = S::Invitee; 2092 + type Cid = S::Cid; 2093 + type Resource = S::Resource; 2094 + type CreatedAt = S::CreatedAt; 2083 2095 } 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>; 2096 + ///State transition - sets the `uri` field to Set 2097 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2098 + impl<S: State> sealed::Sealed for SetUri<S> {} 2099 + impl<S: State> State for SetUri<S> { 2100 + type Status = S::Status; 2101 + type Uri = Set<members::uri>; 2102 + type Inviter = S::Inviter; 2089 2103 type Invitee = S::Invitee; 2090 2104 type Cid = S::Cid; 2105 + type Resource = S::Resource; 2091 2106 type CreatedAt = S::CreatedAt; 2107 + } 2108 + ///State transition - sets the `inviter` field to Set 2109 + pub struct SetInviter<S: State = Empty>(PhantomData<fn() -> S>); 2110 + impl<S: State> sealed::Sealed for SetInviter<S> {} 2111 + impl<S: State> State for SetInviter<S> { 2092 2112 type Status = S::Status; 2093 2113 type Uri = S::Uri; 2094 - type Inviter = S::Inviter; 2114 + type Inviter = Set<members::inviter>; 2115 + type Invitee = S::Invitee; 2116 + type Cid = S::Cid; 2117 + type Resource = S::Resource; 2118 + type CreatedAt = S::CreatedAt; 2095 2119 } 2096 2120 ///State transition - sets the `invitee` field to Set 2097 2121 pub struct SetInvitee<S: State = Empty>(PhantomData<fn() -> S>); 2098 2122 impl<S: State> sealed::Sealed for SetInvitee<S> {} 2099 2123 impl<S: State> State for SetInvitee<S> { 2100 - type Resource = S::Resource; 2124 + type Status = S::Status; 2125 + type Uri = S::Uri; 2126 + type Inviter = S::Inviter; 2101 2127 type Invitee = Set<members::invitee>; 2102 2128 type Cid = S::Cid; 2129 + type Resource = S::Resource; 2103 2130 type CreatedAt = S::CreatedAt; 2104 - type Status = S::Status; 2105 - type Uri = S::Uri; 2106 - type Inviter = S::Inviter; 2107 2131 } 2108 2132 ///State transition - sets the `cid` field to Set 2109 2133 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2110 2134 impl<S: State> sealed::Sealed for SetCid<S> {} 2111 2135 impl<S: State> State for SetCid<S> { 2112 - type Resource = S::Resource; 2136 + type Status = S::Status; 2137 + type Uri = S::Uri; 2138 + type Inviter = S::Inviter; 2113 2139 type Invitee = S::Invitee; 2114 2140 type Cid = Set<members::cid>; 2141 + type Resource = S::Resource; 2115 2142 type CreatedAt = S::CreatedAt; 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> { 2116 2148 type Status = S::Status; 2117 2149 type Uri = S::Uri; 2118 2150 type Inviter = S::Inviter; 2151 + type Invitee = S::Invitee; 2152 + type Cid = S::Cid; 2153 + type Resource = Set<members::resource>; 2154 + type CreatedAt = S::CreatedAt; 2119 2155 } 2120 2156 ///State transition - sets the `created_at` field to Set 2121 2157 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 2122 2158 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 2123 2159 impl<S: State> State for SetCreatedAt<S> { 2124 - type Resource = S::Resource; 2125 - type Invitee = S::Invitee; 2126 - type Cid = S::Cid; 2127 - type CreatedAt = Set<members::created_at>; 2128 2160 type Status = S::Status; 2129 2161 type Uri = S::Uri; 2130 2162 type Inviter = S::Inviter; 2131 - } 2132 - ///State transition - sets the `status` field to Set 2133 - pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 2134 - impl<S: State> sealed::Sealed for SetStatus<S> {} 2135 - impl<S: State> State for SetStatus<S> { 2136 - type Resource = S::Resource; 2137 2163 type Invitee = S::Invitee; 2138 2164 type Cid = S::Cid; 2139 - type CreatedAt = S::CreatedAt; 2140 - type Status = Set<members::status>; 2141 - type Uri = S::Uri; 2142 - type Inviter = S::Inviter; 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> { 2148 2165 type Resource = S::Resource; 2149 - type Invitee = S::Invitee; 2150 - type Cid = S::Cid; 2151 - type CreatedAt = S::CreatedAt; 2152 - type Status = S::Status; 2153 - type Uri = Set<members::uri>; 2154 - type Inviter = S::Inviter; 2155 - } 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; 2163 - type CreatedAt = S::CreatedAt; 2164 - type Status = S::Status; 2165 - type Uri = S::Uri; 2166 - type Inviter = Set<members::inviter>; 2166 + type CreatedAt = Set<members::created_at>; 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 2171 ///Marker type for the `status` field 2180 2172 pub struct status(()); 2181 2173 ///Marker type for the `uri` field 2182 2174 pub struct uri(()); 2183 2175 ///Marker type for the `inviter` field 2184 2176 pub struct inviter(()); 2177 + ///Marker type for the `invitee` field 2178 + pub struct invitee(()); 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 `created_at` field 2184 + pub struct created_at(()); 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::Resource: invite_view_state::IsSet, 2482 + S::Status: invite_view_state::IsSet, 2483 + S::Uri: invite_view_state::IsSet, 2484 + S::Inviter: invite_view_state::IsSet, 2483 2485 S::Invitee: invite_view_state::IsSet, 2484 2486 S::Cid: invite_view_state::IsSet, 2487 + S::Resource: invite_view_state::IsSet, 2485 2488 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; 2824 2825 type Role; 2825 2826 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; 2832 2833 type Role = Unset; 2833 2834 type Status = Unset; 2834 - type User = 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; 2835 2843 } 2836 2844 ///State transition - sets the `role` field to Set 2837 2845 pub struct SetRole<S: State = Empty>(PhantomData<fn() -> S>); 2838 2846 impl<S: State> sealed::Sealed for SetRole<S> {} 2839 2847 impl<S: State> State for SetRole<S> { 2848 + type User = S::User; 2840 2849 type Role = Set<members::role>; 2841 2850 type Status = S::Status; 2842 - type User = S::User; 2843 2851 } 2844 2852 ///State transition - sets the `status` field to Set 2845 2853 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 2846 2854 impl<S: State> sealed::Sealed for SetStatus<S> {} 2847 2855 impl<S: State> State for SetStatus<S> { 2848 - type Role = S::Role; 2849 - type Status = Set<members::status>; 2850 2856 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 2857 type Role = S::Role; 2857 - type Status = S::Status; 2858 - type User = Set<members::user>; 2858 + type Status = Set<members::status>; 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(()); 2863 2865 ///Marker type for the `role` field 2864 2866 pub struct role(()); 2865 2867 ///Marker type for the `status` field 2866 2868 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, 3130 3131 S::Role: participant_state_view_state::IsSet, 3131 3132 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> { ··· 3544 3544 /// State trait tracking which required fields have been set 3545 3545 pub trait State: sealed::Sealed { 3546 3546 type Resource; 3547 - type Uri; 3548 3547 type CreatedAt; 3549 3548 type NodeId; 3549 + type Uri; 3550 3550 type User; 3551 3551 } 3552 3552 /// Empty state - all required fields are unset ··· 3554 3554 impl sealed::Sealed for Empty {} 3555 3555 impl State for Empty { 3556 3556 type Resource = Unset; 3557 - type Uri = Unset; 3558 3557 type CreatedAt = Unset; 3559 3558 type NodeId = Unset; 3559 + type Uri = Unset; 3560 3560 type User = Unset; 3561 3561 } 3562 3562 ///State transition - sets the `resource` field to Set ··· 3564 3564 impl<S: State> sealed::Sealed for SetResource<S> {} 3565 3565 impl<S: State> State for SetResource<S> { 3566 3566 type Resource = Set<members::resource>; 3567 - type Uri = S::Uri; 3568 3567 type CreatedAt = S::CreatedAt; 3569 3568 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> { 3576 - type Resource = S::Resource; 3577 - type Uri = Set<members::uri>; 3578 - type CreatedAt = S::CreatedAt; 3579 - type NodeId = S::NodeId; 3569 + type Uri = S::Uri; 3580 3570 type User = S::User; 3581 3571 } 3582 3572 ///State transition - sets the `created_at` field to Set ··· 3584 3574 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 3585 3575 impl<S: State> State for SetCreatedAt<S> { 3586 3576 type Resource = S::Resource; 3587 - type Uri = S::Uri; 3588 3577 type CreatedAt = Set<members::created_at>; 3589 3578 type NodeId = S::NodeId; 3579 + type Uri = S::Uri; 3590 3580 type User = S::User; 3591 3581 } 3592 3582 ///State transition - sets the `node_id` field to Set ··· 3594 3584 impl<S: State> sealed::Sealed for SetNodeId<S> {} 3595 3585 impl<S: State> State for SetNodeId<S> { 3596 3586 type Resource = S::Resource; 3587 + type CreatedAt = S::CreatedAt; 3588 + type NodeId = Set<members::node_id>; 3597 3589 type Uri = S::Uri; 3590 + type User = S::User; 3591 + } 3592 + ///State transition - sets the `uri` field to Set 3593 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3594 + impl<S: State> sealed::Sealed for SetUri<S> {} 3595 + impl<S: State> State for SetUri<S> { 3596 + type Resource = S::Resource; 3598 3597 type CreatedAt = S::CreatedAt; 3599 - type NodeId = Set<members::node_id>; 3598 + type NodeId = S::NodeId; 3599 + type Uri = Set<members::uri>; 3600 3600 type User = S::User; 3601 3601 } 3602 3602 ///State transition - sets the `user` field to Set ··· 3604 3604 impl<S: State> sealed::Sealed for SetUser<S> {} 3605 3605 impl<S: State> State for SetUser<S> { 3606 3606 type Resource = S::Resource; 3607 - type Uri = S::Uri; 3608 3607 type CreatedAt = S::CreatedAt; 3609 3608 type NodeId = S::NodeId; 3609 + type Uri = S::Uri; 3610 3610 type User = Set<members::user>; 3611 3611 } 3612 3612 /// Marker types for field names ··· 3614 3614 pub mod members { 3615 3615 ///Marker type for the `resource` field 3616 3616 pub struct resource(()); 3617 - ///Marker type for the `uri` field 3618 - pub struct uri(()); 3619 3617 ///Marker type for the `created_at` field 3620 3618 pub struct created_at(()); 3621 3619 ///Marker type for the `node_id` field 3622 3620 pub struct node_id(()); 3621 + ///Marker type for the `uri` field 3622 + pub struct uri(()); 3623 3623 ///Marker type for the `user` field 3624 3624 pub struct user(()); 3625 3625 } ··· 3795 3795 where 3796 3796 S: session_view_state::State, 3797 3797 S::Resource: session_view_state::IsSet, 3798 - S::Uri: session_view_state::IsSet, 3799 3798 S::CreatedAt: session_view_state::IsSet, 3800 3799 S::NodeId: session_view_state::IsSet, 3800 + S::Uri: session_view_state::IsSet, 3801 3801 S::User: session_view_state::IsSet, 3802 3802 { 3803 3803 /// Build the final struct
+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 Resource; 143 144 type Invitee; 144 145 type CreatedAt; 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 Resource = Unset; 151 152 type Invitee = Unset; 152 153 type CreatedAt = Unset; 153 - type Resource = Unset; 154 + } 155 + ///State transition - sets the `resource` field to Set 156 + pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 157 + impl<S: State> sealed::Sealed for SetResource<S> {} 158 + impl<S: State> State for SetResource<S> { 159 + type Resource = Set<members::resource>; 160 + type Invitee = S::Invitee; 161 + type CreatedAt = S::CreatedAt; 154 162 } 155 163 ///State transition - sets the `invitee` field to Set 156 164 pub struct SetInvitee<S: State = Empty>(PhantomData<fn() -> S>); 157 165 impl<S: State> sealed::Sealed for SetInvitee<S> {} 158 166 impl<S: State> State for SetInvitee<S> { 167 + type Resource = S::Resource; 159 168 type Invitee = Set<members::invitee>; 160 169 type CreatedAt = S::CreatedAt; 161 - type Resource = S::Resource; 162 170 } 163 171 ///State transition - sets the `created_at` field to Set 164 172 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 165 173 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 166 174 impl<S: State> State for SetCreatedAt<S> { 167 - type Invitee = S::Invitee; 168 - type CreatedAt = Set<members::created_at>; 169 175 type Resource = S::Resource; 170 - } 171 - ///State transition - sets the `resource` field to Set 172 - pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 173 - impl<S: State> sealed::Sealed for SetResource<S> {} 174 - impl<S: State> State for SetResource<S> { 175 176 type Invitee = S::Invitee; 176 - type CreatedAt = S::CreatedAt; 177 - type Resource = Set<members::resource>; 177 + type CreatedAt = Set<members::created_at>; 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 `resource` field 183 + pub struct resource(()); 182 184 ///Marker type for the `invitee` field 183 185 pub struct invitee(()); 184 186 ///Marker type for the `created_at` field 185 187 pub struct created_at(()); 186 - ///Marker type for the `resource` field 187 - pub struct resource(()); 188 188 } 189 189 } 190 190 ··· 334 334 impl<'a, S> InviteBuilder<'a, S> 335 335 where 336 336 S: invite_state::State, 337 + S::Resource: invite_state::IsSet, 337 338 S::Invitee: invite_state::IsSet, 338 339 S::CreatedAt: invite_state::IsSet, 339 - S::Resource: invite_state::IsSet, 340 340 { 341 341 /// Build the final struct 342 342 pub fn build(self) -> Invite<'a> {
+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 CreatedAt; 48 47 type NodeId; 48 + type CreatedAt; 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 CreatedAt = Unset; 56 55 type NodeId = Unset; 56 + type CreatedAt = Unset; 57 57 type Resource = Unset; 58 58 } 59 - ///State transition - sets the `created_at` field to Set 60 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 61 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 62 - impl<S: State> State for SetCreatedAt<S> { 63 - type CreatedAt = Set<members::created_at>; 64 - type NodeId = S::NodeId; 65 - type Resource = S::Resource; 66 - } 67 59 ///State transition - sets the `node_id` field to Set 68 60 pub struct SetNodeId<S: State = Empty>(PhantomData<fn() -> S>); 69 61 impl<S: State> sealed::Sealed for SetNodeId<S> {} 70 62 impl<S: State> State for SetNodeId<S> { 71 - type CreatedAt = S::CreatedAt; 72 63 type NodeId = Set<members::node_id>; 64 + type CreatedAt = S::CreatedAt; 65 + type Resource = S::Resource; 66 + } 67 + ///State transition - sets the `created_at` field to Set 68 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 69 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 70 + impl<S: State> State for SetCreatedAt<S> { 71 + type NodeId = S::NodeId; 72 + type CreatedAt = Set<members::created_at>; 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 CreatedAt = S::CreatedAt; 80 79 type NodeId = S::NodeId; 80 + type CreatedAt = S::CreatedAt; 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 `node_id` field 87 + pub struct node_id(()); 86 88 ///Marker type for the `created_at` field 87 89 pub struct created_at(()); 88 - ///Marker type for the `node_id` field 89 - pub struct node_id(()); 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::CreatedAt: session_state::IsSet, 225 224 S::NodeId: session_state::IsSet, 225 + S::CreatedAt: session_state::IsSet, 226 226 S::Resource: session_state::IsSet, 227 227 { 228 228 /// Build the final struct
+1339
crates/weaver-api/src/sh_weaver/domain.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: sh.weaver.domain.defs 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + pub mod generate_document; 9 + pub mod resolve_by_domain; 10 + pub mod resolve_document; 11 + 12 + /// Hydrated view of a document with re-hydrated content. 13 + #[jacquard_derive::lexicon] 14 + #[derive( 15 + serde::Serialize, 16 + serde::Deserialize, 17 + Debug, 18 + Clone, 19 + PartialEq, 20 + Eq, 21 + jacquard_derive::IntoStatic 22 + )] 23 + #[serde(rename_all = "camelCase")] 24 + pub struct DocumentView<'a> { 25 + #[serde(borrow)] 26 + pub cid: jacquard_common::types::string::Cid<'a>, 27 + #[serde(borrow)] 28 + pub did: jacquard_common::types::string::Did<'a>, 29 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 30 + pub entry_index: std::option::Option<i64>, 31 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 32 + #[serde(borrow)] 33 + pub entry_uri: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 34 + pub indexed_at: jacquard_common::types::string::Datetime, 35 + #[serde(borrow)] 36 + pub path: jacquard_common::CowStr<'a>, 37 + #[serde(borrow)] 38 + pub record: jacquard_common::types::value::Data<'a>, 39 + #[serde(borrow)] 40 + pub rkey: jacquard_common::CowStr<'a>, 41 + #[serde(borrow)] 42 + pub title: jacquard_common::CowStr<'a>, 43 + #[serde(borrow)] 44 + pub uri: jacquard_common::types::string::AtUri<'a>, 45 + } 46 + 47 + pub mod document_view_state { 48 + 49 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 50 + #[allow(unused)] 51 + use ::core::marker::PhantomData; 52 + mod sealed { 53 + pub trait Sealed {} 54 + } 55 + /// State trait tracking which required fields have been set 56 + pub trait State: sealed::Sealed { 57 + type Rkey; 58 + type IndexedAt; 59 + type Record; 60 + type Path; 61 + type Uri; 62 + type Cid; 63 + type Title; 64 + type Did; 65 + } 66 + /// Empty state - all required fields are unset 67 + pub struct Empty(()); 68 + impl sealed::Sealed for Empty {} 69 + impl State for Empty { 70 + type Rkey = Unset; 71 + type IndexedAt = Unset; 72 + type Record = Unset; 73 + type Path = Unset; 74 + type Uri = Unset; 75 + type Cid = Unset; 76 + type Title = Unset; 77 + type Did = Unset; 78 + } 79 + ///State transition - sets the `rkey` field to Set 80 + pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 81 + impl<S: State> sealed::Sealed for SetRkey<S> {} 82 + impl<S: State> State for SetRkey<S> { 83 + type Rkey = Set<members::rkey>; 84 + type IndexedAt = S::IndexedAt; 85 + type Record = S::Record; 86 + type Path = S::Path; 87 + type Uri = S::Uri; 88 + type Cid = S::Cid; 89 + type Title = S::Title; 90 + type Did = S::Did; 91 + } 92 + ///State transition - sets the `indexed_at` field to Set 93 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 94 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 95 + impl<S: State> State for SetIndexedAt<S> { 96 + type Rkey = S::Rkey; 97 + type IndexedAt = Set<members::indexed_at>; 98 + type Record = S::Record; 99 + type Path = S::Path; 100 + type Uri = S::Uri; 101 + type Cid = S::Cid; 102 + type Title = S::Title; 103 + type Did = S::Did; 104 + } 105 + ///State transition - sets the `record` field to Set 106 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 107 + impl<S: State> sealed::Sealed for SetRecord<S> {} 108 + impl<S: State> State for SetRecord<S> { 109 + type Rkey = S::Rkey; 110 + type IndexedAt = S::IndexedAt; 111 + type Record = Set<members::record>; 112 + type Path = S::Path; 113 + type Uri = S::Uri; 114 + type Cid = S::Cid; 115 + type Title = S::Title; 116 + type Did = S::Did; 117 + } 118 + ///State transition - sets the `path` field to Set 119 + pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 120 + impl<S: State> sealed::Sealed for SetPath<S> {} 121 + impl<S: State> State for SetPath<S> { 122 + type Rkey = S::Rkey; 123 + type IndexedAt = S::IndexedAt; 124 + type Record = S::Record; 125 + type Path = Set<members::path>; 126 + type Uri = S::Uri; 127 + type Cid = S::Cid; 128 + type Title = S::Title; 129 + type Did = S::Did; 130 + } 131 + ///State transition - sets the `uri` field to Set 132 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 133 + impl<S: State> sealed::Sealed for SetUri<S> {} 134 + impl<S: State> State for SetUri<S> { 135 + type Rkey = S::Rkey; 136 + type IndexedAt = S::IndexedAt; 137 + type Record = S::Record; 138 + type Path = S::Path; 139 + type Uri = Set<members::uri>; 140 + type Cid = S::Cid; 141 + type Title = S::Title; 142 + type Did = S::Did; 143 + } 144 + ///State transition - sets the `cid` field to Set 145 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 146 + impl<S: State> sealed::Sealed for SetCid<S> {} 147 + impl<S: State> State for SetCid<S> { 148 + type Rkey = S::Rkey; 149 + type IndexedAt = S::IndexedAt; 150 + type Record = S::Record; 151 + type Path = S::Path; 152 + type Uri = S::Uri; 153 + type Cid = Set<members::cid>; 154 + type Title = S::Title; 155 + type Did = S::Did; 156 + } 157 + ///State transition - sets the `title` field to Set 158 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 159 + impl<S: State> sealed::Sealed for SetTitle<S> {} 160 + impl<S: State> State for SetTitle<S> { 161 + type Rkey = S::Rkey; 162 + type IndexedAt = S::IndexedAt; 163 + type Record = S::Record; 164 + type Path = S::Path; 165 + type Uri = S::Uri; 166 + type Cid = S::Cid; 167 + type Title = Set<members::title>; 168 + type Did = S::Did; 169 + } 170 + ///State transition - sets the `did` field to Set 171 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 172 + impl<S: State> sealed::Sealed for SetDid<S> {} 173 + impl<S: State> State for SetDid<S> { 174 + type Rkey = S::Rkey; 175 + type IndexedAt = S::IndexedAt; 176 + type Record = S::Record; 177 + type Path = S::Path; 178 + type Uri = S::Uri; 179 + type Cid = S::Cid; 180 + type Title = S::Title; 181 + type Did = Set<members::did>; 182 + } 183 + /// Marker types for field names 184 + #[allow(non_camel_case_types)] 185 + pub mod members { 186 + ///Marker type for the `rkey` field 187 + pub struct rkey(()); 188 + ///Marker type for the `indexed_at` field 189 + pub struct indexed_at(()); 190 + ///Marker type for the `record` field 191 + pub struct record(()); 192 + ///Marker type for the `path` field 193 + pub struct path(()); 194 + ///Marker type for the `uri` field 195 + pub struct uri(()); 196 + ///Marker type for the `cid` field 197 + pub struct cid(()); 198 + ///Marker type for the `title` field 199 + pub struct title(()); 200 + ///Marker type for the `did` field 201 + pub struct did(()); 202 + } 203 + } 204 + 205 + /// Builder for constructing an instance of this type 206 + pub struct DocumentViewBuilder<'a, S: document_view_state::State> { 207 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 208 + __unsafe_private_named: ( 209 + ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 210 + ::core::option::Option<jacquard_common::types::string::Did<'a>>, 211 + ::core::option::Option<i64>, 212 + ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 213 + ::core::option::Option<jacquard_common::types::string::Datetime>, 214 + ::core::option::Option<jacquard_common::CowStr<'a>>, 215 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 216 + ::core::option::Option<jacquard_common::CowStr<'a>>, 217 + ::core::option::Option<jacquard_common::CowStr<'a>>, 218 + ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 219 + ), 220 + _phantom: ::core::marker::PhantomData<&'a ()>, 221 + } 222 + 223 + impl<'a> DocumentView<'a> { 224 + /// Create a new builder for this type 225 + pub fn new() -> DocumentViewBuilder<'a, document_view_state::Empty> { 226 + DocumentViewBuilder::new() 227 + } 228 + } 229 + 230 + impl<'a> DocumentViewBuilder<'a, document_view_state::Empty> { 231 + /// Create a new builder with all fields unset 232 + pub fn new() -> Self { 233 + DocumentViewBuilder { 234 + _phantom_state: ::core::marker::PhantomData, 235 + __unsafe_private_named: ( 236 + None, 237 + None, 238 + None, 239 + None, 240 + None, 241 + None, 242 + None, 243 + None, 244 + None, 245 + None, 246 + ), 247 + _phantom: ::core::marker::PhantomData, 248 + } 249 + } 250 + } 251 + 252 + impl<'a, S> DocumentViewBuilder<'a, S> 253 + where 254 + S: document_view_state::State, 255 + S::Cid: document_view_state::IsUnset, 256 + { 257 + /// Set the `cid` field (required) 258 + pub fn cid( 259 + mut self, 260 + value: impl Into<jacquard_common::types::string::Cid<'a>>, 261 + ) -> DocumentViewBuilder<'a, document_view_state::SetCid<S>> { 262 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 263 + DocumentViewBuilder { 264 + _phantom_state: ::core::marker::PhantomData, 265 + __unsafe_private_named: self.__unsafe_private_named, 266 + _phantom: ::core::marker::PhantomData, 267 + } 268 + } 269 + } 270 + 271 + impl<'a, S> DocumentViewBuilder<'a, S> 272 + where 273 + S: document_view_state::State, 274 + S::Did: document_view_state::IsUnset, 275 + { 276 + /// Set the `did` field (required) 277 + pub fn did( 278 + mut self, 279 + value: impl Into<jacquard_common::types::string::Did<'a>>, 280 + ) -> DocumentViewBuilder<'a, document_view_state::SetDid<S>> { 281 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 282 + DocumentViewBuilder { 283 + _phantom_state: ::core::marker::PhantomData, 284 + __unsafe_private_named: self.__unsafe_private_named, 285 + _phantom: ::core::marker::PhantomData, 286 + } 287 + } 288 + } 289 + 290 + impl<'a, S: document_view_state::State> DocumentViewBuilder<'a, S> { 291 + /// Set the `entryIndex` field (optional) 292 + pub fn entry_index(mut self, value: impl Into<Option<i64>>) -> Self { 293 + self.__unsafe_private_named.2 = value.into(); 294 + self 295 + } 296 + /// Set the `entryIndex` field to an Option value (optional) 297 + pub fn maybe_entry_index(mut self, value: Option<i64>) -> Self { 298 + self.__unsafe_private_named.2 = value; 299 + self 300 + } 301 + } 302 + 303 + impl<'a, S: document_view_state::State> DocumentViewBuilder<'a, S> { 304 + /// Set the `entryUri` field (optional) 305 + pub fn entry_uri( 306 + mut self, 307 + value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>, 308 + ) -> Self { 309 + self.__unsafe_private_named.3 = value.into(); 310 + self 311 + } 312 + /// Set the `entryUri` field to an Option value (optional) 313 + pub fn maybe_entry_uri( 314 + mut self, 315 + value: Option<jacquard_common::types::string::AtUri<'a>>, 316 + ) -> Self { 317 + self.__unsafe_private_named.3 = value; 318 + self 319 + } 320 + } 321 + 322 + impl<'a, S> DocumentViewBuilder<'a, S> 323 + where 324 + S: document_view_state::State, 325 + S::IndexedAt: document_view_state::IsUnset, 326 + { 327 + /// Set the `indexedAt` field (required) 328 + pub fn indexed_at( 329 + mut self, 330 + value: impl Into<jacquard_common::types::string::Datetime>, 331 + ) -> DocumentViewBuilder<'a, document_view_state::SetIndexedAt<S>> { 332 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 333 + DocumentViewBuilder { 334 + _phantom_state: ::core::marker::PhantomData, 335 + __unsafe_private_named: self.__unsafe_private_named, 336 + _phantom: ::core::marker::PhantomData, 337 + } 338 + } 339 + } 340 + 341 + impl<'a, S> DocumentViewBuilder<'a, S> 342 + where 343 + S: document_view_state::State, 344 + S::Path: document_view_state::IsUnset, 345 + { 346 + /// Set the `path` field (required) 347 + pub fn path( 348 + mut self, 349 + value: impl Into<jacquard_common::CowStr<'a>>, 350 + ) -> DocumentViewBuilder<'a, document_view_state::SetPath<S>> { 351 + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 352 + DocumentViewBuilder { 353 + _phantom_state: ::core::marker::PhantomData, 354 + __unsafe_private_named: self.__unsafe_private_named, 355 + _phantom: ::core::marker::PhantomData, 356 + } 357 + } 358 + } 359 + 360 + impl<'a, S> DocumentViewBuilder<'a, S> 361 + where 362 + S: document_view_state::State, 363 + S::Record: document_view_state::IsUnset, 364 + { 365 + /// Set the `record` field (required) 366 + pub fn record( 367 + mut self, 368 + value: impl Into<jacquard_common::types::value::Data<'a>>, 369 + ) -> DocumentViewBuilder<'a, document_view_state::SetRecord<S>> { 370 + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 371 + DocumentViewBuilder { 372 + _phantom_state: ::core::marker::PhantomData, 373 + __unsafe_private_named: self.__unsafe_private_named, 374 + _phantom: ::core::marker::PhantomData, 375 + } 376 + } 377 + } 378 + 379 + impl<'a, S> DocumentViewBuilder<'a, S> 380 + where 381 + S: document_view_state::State, 382 + S::Rkey: document_view_state::IsUnset, 383 + { 384 + /// Set the `rkey` field (required) 385 + pub fn rkey( 386 + mut self, 387 + value: impl Into<jacquard_common::CowStr<'a>>, 388 + ) -> DocumentViewBuilder<'a, document_view_state::SetRkey<S>> { 389 + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); 390 + DocumentViewBuilder { 391 + _phantom_state: ::core::marker::PhantomData, 392 + __unsafe_private_named: self.__unsafe_private_named, 393 + _phantom: ::core::marker::PhantomData, 394 + } 395 + } 396 + } 397 + 398 + impl<'a, S> DocumentViewBuilder<'a, S> 399 + where 400 + S: document_view_state::State, 401 + S::Title: document_view_state::IsUnset, 402 + { 403 + /// Set the `title` field (required) 404 + pub fn title( 405 + mut self, 406 + value: impl Into<jacquard_common::CowStr<'a>>, 407 + ) -> DocumentViewBuilder<'a, document_view_state::SetTitle<S>> { 408 + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); 409 + DocumentViewBuilder { 410 + _phantom_state: ::core::marker::PhantomData, 411 + __unsafe_private_named: self.__unsafe_private_named, 412 + _phantom: ::core::marker::PhantomData, 413 + } 414 + } 415 + } 416 + 417 + impl<'a, S> DocumentViewBuilder<'a, S> 418 + where 419 + S: document_view_state::State, 420 + S::Uri: document_view_state::IsUnset, 421 + { 422 + /// Set the `uri` field (required) 423 + pub fn uri( 424 + mut self, 425 + value: impl Into<jacquard_common::types::string::AtUri<'a>>, 426 + ) -> DocumentViewBuilder<'a, document_view_state::SetUri<S>> { 427 + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); 428 + DocumentViewBuilder { 429 + _phantom_state: ::core::marker::PhantomData, 430 + __unsafe_private_named: self.__unsafe_private_named, 431 + _phantom: ::core::marker::PhantomData, 432 + } 433 + } 434 + } 435 + 436 + impl<'a, S> DocumentViewBuilder<'a, S> 437 + where 438 + S: document_view_state::State, 439 + S::Rkey: document_view_state::IsSet, 440 + S::IndexedAt: document_view_state::IsSet, 441 + S::Record: document_view_state::IsSet, 442 + S::Path: document_view_state::IsSet, 443 + S::Uri: document_view_state::IsSet, 444 + S::Cid: document_view_state::IsSet, 445 + S::Title: document_view_state::IsSet, 446 + S::Did: document_view_state::IsSet, 447 + { 448 + /// Build the final struct 449 + pub fn build(self) -> DocumentView<'a> { 450 + DocumentView { 451 + cid: self.__unsafe_private_named.0.unwrap(), 452 + did: self.__unsafe_private_named.1.unwrap(), 453 + entry_index: self.__unsafe_private_named.2, 454 + entry_uri: self.__unsafe_private_named.3, 455 + indexed_at: self.__unsafe_private_named.4.unwrap(), 456 + path: self.__unsafe_private_named.5.unwrap(), 457 + record: self.__unsafe_private_named.6.unwrap(), 458 + rkey: self.__unsafe_private_named.7.unwrap(), 459 + title: self.__unsafe_private_named.8.unwrap(), 460 + uri: self.__unsafe_private_named.9.unwrap(), 461 + extra_data: Default::default(), 462 + } 463 + } 464 + /// Build the final struct with custom extra_data 465 + pub fn build_with_data( 466 + self, 467 + extra_data: std::collections::BTreeMap< 468 + jacquard_common::smol_str::SmolStr, 469 + jacquard_common::types::value::Data<'a>, 470 + >, 471 + ) -> DocumentView<'a> { 472 + DocumentView { 473 + cid: self.__unsafe_private_named.0.unwrap(), 474 + did: self.__unsafe_private_named.1.unwrap(), 475 + entry_index: self.__unsafe_private_named.2, 476 + entry_uri: self.__unsafe_private_named.3, 477 + indexed_at: self.__unsafe_private_named.4.unwrap(), 478 + path: self.__unsafe_private_named.5.unwrap(), 479 + record: self.__unsafe_private_named.6.unwrap(), 480 + rkey: self.__unsafe_private_named.7.unwrap(), 481 + title: self.__unsafe_private_named.8.unwrap(), 482 + uri: self.__unsafe_private_named.9.unwrap(), 483 + extra_data: Some(extra_data), 484 + } 485 + } 486 + } 487 + 488 + fn lexicon_doc_sh_weaver_domain_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 489 + 'static, 490 + > { 491 + ::jacquard_lexicon::lexicon::LexiconDoc { 492 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 493 + id: ::jacquard_common::CowStr::new_static("sh.weaver.domain.defs"), 494 + revision: None, 495 + description: None, 496 + defs: { 497 + let mut map = ::alloc::collections::BTreeMap::new(); 498 + map.insert( 499 + ::jacquard_common::smol_str::SmolStr::new_static("documentView"), 500 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 501 + description: Some( 502 + ::jacquard_common::CowStr::new_static( 503 + "Hydrated view of a document with re-hydrated content.", 504 + ), 505 + ), 506 + required: Some( 507 + vec![ 508 + ::jacquard_common::smol_str::SmolStr::new_static("uri"), 509 + ::jacquard_common::smol_str::SmolStr::new_static("cid"), 510 + ::jacquard_common::smol_str::SmolStr::new_static("did"), 511 + ::jacquard_common::smol_str::SmolStr::new_static("rkey"), 512 + ::jacquard_common::smol_str::SmolStr::new_static("title"), 513 + ::jacquard_common::smol_str::SmolStr::new_static("path"), 514 + ::jacquard_common::smol_str::SmolStr::new_static("record"), 515 + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") 516 + ], 517 + ), 518 + nullable: None, 519 + properties: { 520 + #[allow(unused_mut)] 521 + let mut map = ::alloc::collections::BTreeMap::new(); 522 + map.insert( 523 + ::jacquard_common::smol_str::SmolStr::new_static("cid"), 524 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 525 + description: None, 526 + format: Some( 527 + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, 528 + ), 529 + default: None, 530 + min_length: None, 531 + max_length: None, 532 + min_graphemes: None, 533 + max_graphemes: None, 534 + r#enum: None, 535 + r#const: None, 536 + known_values: None, 537 + }), 538 + ); 539 + map.insert( 540 + ::jacquard_common::smol_str::SmolStr::new_static("did"), 541 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 542 + description: None, 543 + format: Some( 544 + ::jacquard_lexicon::lexicon::LexStringFormat::Did, 545 + ), 546 + default: None, 547 + min_length: None, 548 + max_length: None, 549 + min_graphemes: None, 550 + max_graphemes: None, 551 + r#enum: None, 552 + r#const: None, 553 + known_values: None, 554 + }), 555 + ); 556 + map.insert( 557 + ::jacquard_common::smol_str::SmolStr::new_static( 558 + "entryIndex", 559 + ), 560 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 561 + description: None, 562 + default: None, 563 + minimum: None, 564 + maximum: None, 565 + r#enum: None, 566 + r#const: None, 567 + }), 568 + ); 569 + map.insert( 570 + ::jacquard_common::smol_str::SmolStr::new_static("entryUri"), 571 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 572 + description: None, 573 + format: Some( 574 + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 575 + ), 576 + default: None, 577 + min_length: None, 578 + max_length: None, 579 + min_graphemes: None, 580 + max_graphemes: None, 581 + r#enum: None, 582 + r#const: None, 583 + known_values: None, 584 + }), 585 + ); 586 + map.insert( 587 + ::jacquard_common::smol_str::SmolStr::new_static( 588 + "indexedAt", 589 + ), 590 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 591 + description: None, 592 + format: Some( 593 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 594 + ), 595 + default: None, 596 + min_length: None, 597 + max_length: None, 598 + min_graphemes: None, 599 + max_graphemes: None, 600 + r#enum: None, 601 + r#const: None, 602 + known_values: None, 603 + }), 604 + ); 605 + map.insert( 606 + ::jacquard_common::smol_str::SmolStr::new_static("path"), 607 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 608 + description: None, 609 + format: None, 610 + default: None, 611 + min_length: None, 612 + max_length: None, 613 + min_graphemes: None, 614 + max_graphemes: None, 615 + r#enum: None, 616 + r#const: None, 617 + known_values: None, 618 + }), 619 + ); 620 + map.insert( 621 + ::jacquard_common::smol_str::SmolStr::new_static("record"), 622 + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 623 + description: None, 624 + }), 625 + ); 626 + map.insert( 627 + ::jacquard_common::smol_str::SmolStr::new_static("rkey"), 628 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 629 + description: None, 630 + format: None, 631 + default: None, 632 + min_length: None, 633 + max_length: None, 634 + min_graphemes: None, 635 + max_graphemes: None, 636 + r#enum: None, 637 + r#const: None, 638 + known_values: None, 639 + }), 640 + ); 641 + map.insert( 642 + ::jacquard_common::smol_str::SmolStr::new_static("title"), 643 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 644 + description: None, 645 + format: None, 646 + default: None, 647 + min_length: None, 648 + max_length: None, 649 + min_graphemes: None, 650 + max_graphemes: None, 651 + r#enum: None, 652 + r#const: None, 653 + known_values: None, 654 + }), 655 + ); 656 + map.insert( 657 + ::jacquard_common::smol_str::SmolStr::new_static("uri"), 658 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 659 + description: None, 660 + format: Some( 661 + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 662 + ), 663 + default: None, 664 + min_length: None, 665 + max_length: None, 666 + min_graphemes: None, 667 + max_graphemes: None, 668 + r#enum: None, 669 + r#const: None, 670 + known_values: None, 671 + }), 672 + ); 673 + map 674 + }, 675 + }), 676 + ); 677 + map.insert( 678 + ::jacquard_common::smol_str::SmolStr::new_static("publicationView"), 679 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 680 + description: Some( 681 + ::jacquard_common::CowStr::new_static( 682 + "Hydrated view of a publication with domain info.", 683 + ), 684 + ), 685 + required: Some( 686 + vec![ 687 + ::jacquard_common::smol_str::SmolStr::new_static("uri"), 688 + ::jacquard_common::smol_str::SmolStr::new_static("cid"), 689 + ::jacquard_common::smol_str::SmolStr::new_static("did"), 690 + ::jacquard_common::smol_str::SmolStr::new_static("rkey"), 691 + ::jacquard_common::smol_str::SmolStr::new_static("name"), 692 + ::jacquard_common::smol_str::SmolStr::new_static("domain"), 693 + ::jacquard_common::smol_str::SmolStr::new_static("record"), 694 + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") 695 + ], 696 + ), 697 + nullable: None, 698 + properties: { 699 + #[allow(unused_mut)] 700 + let mut map = ::alloc::collections::BTreeMap::new(); 701 + map.insert( 702 + ::jacquard_common::smol_str::SmolStr::new_static("cid"), 703 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 704 + description: None, 705 + format: Some( 706 + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, 707 + ), 708 + default: None, 709 + min_length: None, 710 + max_length: None, 711 + min_graphemes: None, 712 + max_graphemes: None, 713 + r#enum: None, 714 + r#const: None, 715 + known_values: None, 716 + }), 717 + ); 718 + map.insert( 719 + ::jacquard_common::smol_str::SmolStr::new_static("did"), 720 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 721 + description: None, 722 + format: Some( 723 + ::jacquard_lexicon::lexicon::LexStringFormat::Did, 724 + ), 725 + default: None, 726 + min_length: None, 727 + max_length: None, 728 + min_graphemes: None, 729 + max_graphemes: None, 730 + r#enum: None, 731 + r#const: None, 732 + known_values: None, 733 + }), 734 + ); 735 + map.insert( 736 + ::jacquard_common::smol_str::SmolStr::new_static("domain"), 737 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 738 + description: None, 739 + format: None, 740 + default: None, 741 + min_length: None, 742 + max_length: None, 743 + min_graphemes: None, 744 + max_graphemes: None, 745 + r#enum: None, 746 + r#const: None, 747 + known_values: None, 748 + }), 749 + ); 750 + map.insert( 751 + ::jacquard_common::smol_str::SmolStr::new_static( 752 + "indexedAt", 753 + ), 754 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 755 + description: None, 756 + format: Some( 757 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 758 + ), 759 + default: None, 760 + min_length: None, 761 + max_length: None, 762 + min_graphemes: None, 763 + max_graphemes: None, 764 + r#enum: None, 765 + r#const: None, 766 + known_values: None, 767 + }), 768 + ); 769 + map.insert( 770 + ::jacquard_common::smol_str::SmolStr::new_static("name"), 771 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 772 + description: None, 773 + format: None, 774 + default: None, 775 + min_length: None, 776 + max_length: None, 777 + min_graphemes: None, 778 + max_graphemes: None, 779 + r#enum: None, 780 + r#const: None, 781 + known_values: None, 782 + }), 783 + ); 784 + map.insert( 785 + ::jacquard_common::smol_str::SmolStr::new_static( 786 + "notebookUri", 787 + ), 788 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 789 + description: None, 790 + format: Some( 791 + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 792 + ), 793 + default: None, 794 + min_length: None, 795 + max_length: None, 796 + min_graphemes: None, 797 + max_graphemes: None, 798 + r#enum: None, 799 + r#const: None, 800 + known_values: None, 801 + }), 802 + ); 803 + map.insert( 804 + ::jacquard_common::smol_str::SmolStr::new_static("record"), 805 + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 806 + description: None, 807 + }), 808 + ); 809 + map.insert( 810 + ::jacquard_common::smol_str::SmolStr::new_static("rkey"), 811 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 812 + description: None, 813 + format: None, 814 + default: None, 815 + min_length: None, 816 + max_length: None, 817 + min_graphemes: None, 818 + max_graphemes: None, 819 + r#enum: None, 820 + r#const: None, 821 + known_values: None, 822 + }), 823 + ); 824 + map.insert( 825 + ::jacquard_common::smol_str::SmolStr::new_static("uri"), 826 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 827 + description: None, 828 + format: Some( 829 + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 830 + ), 831 + default: None, 832 + min_length: None, 833 + max_length: None, 834 + min_graphemes: None, 835 + max_graphemes: None, 836 + r#enum: None, 837 + r#const: None, 838 + known_values: None, 839 + }), 840 + ); 841 + map 842 + }, 843 + }), 844 + ); 845 + map 846 + }, 847 + } 848 + } 849 + 850 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DocumentView<'a> { 851 + fn nsid() -> &'static str { 852 + "sh.weaver.domain.defs" 853 + } 854 + fn def_name() -> &'static str { 855 + "documentView" 856 + } 857 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 858 + lexicon_doc_sh_weaver_domain_defs() 859 + } 860 + fn validate( 861 + &self, 862 + ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 863 + Ok(()) 864 + } 865 + } 866 + 867 + /// Hydrated view of a publication with domain info. 868 + #[jacquard_derive::lexicon] 869 + #[derive( 870 + serde::Serialize, 871 + serde::Deserialize, 872 + Debug, 873 + Clone, 874 + PartialEq, 875 + Eq, 876 + jacquard_derive::IntoStatic 877 + )] 878 + #[serde(rename_all = "camelCase")] 879 + pub struct PublicationView<'a> { 880 + #[serde(borrow)] 881 + pub cid: jacquard_common::types::string::Cid<'a>, 882 + #[serde(borrow)] 883 + pub did: jacquard_common::types::string::Did<'a>, 884 + #[serde(borrow)] 885 + pub domain: jacquard_common::CowStr<'a>, 886 + pub indexed_at: jacquard_common::types::string::Datetime, 887 + #[serde(borrow)] 888 + pub name: jacquard_common::CowStr<'a>, 889 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 890 + #[serde(borrow)] 891 + pub notebook_uri: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 892 + #[serde(borrow)] 893 + pub record: jacquard_common::types::value::Data<'a>, 894 + #[serde(borrow)] 895 + pub rkey: jacquard_common::CowStr<'a>, 896 + #[serde(borrow)] 897 + pub uri: jacquard_common::types::string::AtUri<'a>, 898 + } 899 + 900 + pub mod publication_view_state { 901 + 902 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 903 + #[allow(unused)] 904 + use ::core::marker::PhantomData; 905 + mod sealed { 906 + pub trait Sealed {} 907 + } 908 + /// State trait tracking which required fields have been set 909 + pub trait State: sealed::Sealed { 910 + type Uri; 911 + type Rkey; 912 + type Did; 913 + type Cid; 914 + type Domain; 915 + type Record; 916 + type Name; 917 + type IndexedAt; 918 + } 919 + /// Empty state - all required fields are unset 920 + pub struct Empty(()); 921 + impl sealed::Sealed for Empty {} 922 + impl State for Empty { 923 + type Uri = Unset; 924 + type Rkey = Unset; 925 + type Did = Unset; 926 + type Cid = Unset; 927 + type Domain = Unset; 928 + type Record = Unset; 929 + type Name = Unset; 930 + type IndexedAt = Unset; 931 + } 932 + ///State transition - sets the `uri` field to Set 933 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 934 + impl<S: State> sealed::Sealed for SetUri<S> {} 935 + impl<S: State> State for SetUri<S> { 936 + type Uri = Set<members::uri>; 937 + type Rkey = S::Rkey; 938 + type Did = S::Did; 939 + type Cid = S::Cid; 940 + type Domain = S::Domain; 941 + type Record = S::Record; 942 + type Name = S::Name; 943 + type IndexedAt = S::IndexedAt; 944 + } 945 + ///State transition - sets the `rkey` field to Set 946 + pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 947 + impl<S: State> sealed::Sealed for SetRkey<S> {} 948 + impl<S: State> State for SetRkey<S> { 949 + type Uri = S::Uri; 950 + type Rkey = Set<members::rkey>; 951 + type Did = S::Did; 952 + type Cid = S::Cid; 953 + type Domain = S::Domain; 954 + type Record = S::Record; 955 + type Name = S::Name; 956 + type IndexedAt = S::IndexedAt; 957 + } 958 + ///State transition - sets the `did` field to Set 959 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 960 + impl<S: State> sealed::Sealed for SetDid<S> {} 961 + impl<S: State> State for SetDid<S> { 962 + type Uri = S::Uri; 963 + type Rkey = S::Rkey; 964 + type Did = Set<members::did>; 965 + type Cid = S::Cid; 966 + type Domain = S::Domain; 967 + type Record = S::Record; 968 + type Name = S::Name; 969 + type IndexedAt = S::IndexedAt; 970 + } 971 + ///State transition - sets the `cid` field to Set 972 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 973 + impl<S: State> sealed::Sealed for SetCid<S> {} 974 + impl<S: State> State for SetCid<S> { 975 + type Uri = S::Uri; 976 + type Rkey = S::Rkey; 977 + type Did = S::Did; 978 + type Cid = Set<members::cid>; 979 + type Domain = S::Domain; 980 + type Record = S::Record; 981 + type Name = S::Name; 982 + type IndexedAt = S::IndexedAt; 983 + } 984 + ///State transition - sets the `domain` field to Set 985 + pub struct SetDomain<S: State = Empty>(PhantomData<fn() -> S>); 986 + impl<S: State> sealed::Sealed for SetDomain<S> {} 987 + impl<S: State> State for SetDomain<S> { 988 + type Uri = S::Uri; 989 + type Rkey = S::Rkey; 990 + type Did = S::Did; 991 + type Cid = S::Cid; 992 + type Domain = Set<members::domain>; 993 + type Record = S::Record; 994 + type Name = S::Name; 995 + type IndexedAt = S::IndexedAt; 996 + } 997 + ///State transition - sets the `record` field to Set 998 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 999 + impl<S: State> sealed::Sealed for SetRecord<S> {} 1000 + impl<S: State> State for SetRecord<S> { 1001 + type Uri = S::Uri; 1002 + type Rkey = S::Rkey; 1003 + type Did = S::Did; 1004 + type Cid = S::Cid; 1005 + type Domain = S::Domain; 1006 + type Record = Set<members::record>; 1007 + type Name = S::Name; 1008 + type IndexedAt = S::IndexedAt; 1009 + } 1010 + ///State transition - sets the `name` field to Set 1011 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1012 + impl<S: State> sealed::Sealed for SetName<S> {} 1013 + impl<S: State> State for SetName<S> { 1014 + type Uri = S::Uri; 1015 + type Rkey = S::Rkey; 1016 + type Did = S::Did; 1017 + type Cid = S::Cid; 1018 + type Domain = S::Domain; 1019 + type Record = S::Record; 1020 + type Name = Set<members::name>; 1021 + type IndexedAt = S::IndexedAt; 1022 + } 1023 + ///State transition - sets the `indexed_at` field to Set 1024 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1025 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1026 + impl<S: State> State for SetIndexedAt<S> { 1027 + type Uri = S::Uri; 1028 + type Rkey = S::Rkey; 1029 + type Did = S::Did; 1030 + type Cid = S::Cid; 1031 + type Domain = S::Domain; 1032 + type Record = S::Record; 1033 + type Name = S::Name; 1034 + type IndexedAt = Set<members::indexed_at>; 1035 + } 1036 + /// Marker types for field names 1037 + #[allow(non_camel_case_types)] 1038 + pub mod members { 1039 + ///Marker type for the `uri` field 1040 + pub struct uri(()); 1041 + ///Marker type for the `rkey` field 1042 + pub struct rkey(()); 1043 + ///Marker type for the `did` field 1044 + pub struct did(()); 1045 + ///Marker type for the `cid` field 1046 + pub struct cid(()); 1047 + ///Marker type for the `domain` field 1048 + pub struct domain(()); 1049 + ///Marker type for the `record` field 1050 + pub struct record(()); 1051 + ///Marker type for the `name` field 1052 + pub struct name(()); 1053 + ///Marker type for the `indexed_at` field 1054 + pub struct indexed_at(()); 1055 + } 1056 + } 1057 + 1058 + /// Builder for constructing an instance of this type 1059 + pub struct PublicationViewBuilder<'a, S: publication_view_state::State> { 1060 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 1061 + __unsafe_private_named: ( 1062 + ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 1063 + ::core::option::Option<jacquard_common::types::string::Did<'a>>, 1064 + ::core::option::Option<jacquard_common::CowStr<'a>>, 1065 + ::core::option::Option<jacquard_common::types::string::Datetime>, 1066 + ::core::option::Option<jacquard_common::CowStr<'a>>, 1067 + ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 1068 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 1069 + ::core::option::Option<jacquard_common::CowStr<'a>>, 1070 + ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 1071 + ), 1072 + _phantom: ::core::marker::PhantomData<&'a ()>, 1073 + } 1074 + 1075 + impl<'a> PublicationView<'a> { 1076 + /// Create a new builder for this type 1077 + pub fn new() -> PublicationViewBuilder<'a, publication_view_state::Empty> { 1078 + PublicationViewBuilder::new() 1079 + } 1080 + } 1081 + 1082 + impl<'a> PublicationViewBuilder<'a, publication_view_state::Empty> { 1083 + /// Create a new builder with all fields unset 1084 + pub fn new() -> Self { 1085 + PublicationViewBuilder { 1086 + _phantom_state: ::core::marker::PhantomData, 1087 + __unsafe_private_named: ( 1088 + None, 1089 + None, 1090 + None, 1091 + None, 1092 + None, 1093 + None, 1094 + None, 1095 + None, 1096 + None, 1097 + ), 1098 + _phantom: ::core::marker::PhantomData, 1099 + } 1100 + } 1101 + } 1102 + 1103 + impl<'a, S> PublicationViewBuilder<'a, S> 1104 + where 1105 + S: publication_view_state::State, 1106 + S::Cid: publication_view_state::IsUnset, 1107 + { 1108 + /// Set the `cid` field (required) 1109 + pub fn cid( 1110 + mut self, 1111 + value: impl Into<jacquard_common::types::string::Cid<'a>>, 1112 + ) -> PublicationViewBuilder<'a, publication_view_state::SetCid<S>> { 1113 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 1114 + PublicationViewBuilder { 1115 + _phantom_state: ::core::marker::PhantomData, 1116 + __unsafe_private_named: self.__unsafe_private_named, 1117 + _phantom: ::core::marker::PhantomData, 1118 + } 1119 + } 1120 + } 1121 + 1122 + impl<'a, S> PublicationViewBuilder<'a, S> 1123 + where 1124 + S: publication_view_state::State, 1125 + S::Did: publication_view_state::IsUnset, 1126 + { 1127 + /// Set the `did` field (required) 1128 + pub fn did( 1129 + mut self, 1130 + value: impl Into<jacquard_common::types::string::Did<'a>>, 1131 + ) -> PublicationViewBuilder<'a, publication_view_state::SetDid<S>> { 1132 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 1133 + PublicationViewBuilder { 1134 + _phantom_state: ::core::marker::PhantomData, 1135 + __unsafe_private_named: self.__unsafe_private_named, 1136 + _phantom: ::core::marker::PhantomData, 1137 + } 1138 + } 1139 + } 1140 + 1141 + impl<'a, S> PublicationViewBuilder<'a, S> 1142 + where 1143 + S: publication_view_state::State, 1144 + S::Domain: publication_view_state::IsUnset, 1145 + { 1146 + /// Set the `domain` field (required) 1147 + pub fn domain( 1148 + mut self, 1149 + value: impl Into<jacquard_common::CowStr<'a>>, 1150 + ) -> PublicationViewBuilder<'a, publication_view_state::SetDomain<S>> { 1151 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 1152 + PublicationViewBuilder { 1153 + _phantom_state: ::core::marker::PhantomData, 1154 + __unsafe_private_named: self.__unsafe_private_named, 1155 + _phantom: ::core::marker::PhantomData, 1156 + } 1157 + } 1158 + } 1159 + 1160 + impl<'a, S> PublicationViewBuilder<'a, S> 1161 + where 1162 + S: publication_view_state::State, 1163 + S::IndexedAt: publication_view_state::IsUnset, 1164 + { 1165 + /// Set the `indexedAt` field (required) 1166 + pub fn indexed_at( 1167 + mut self, 1168 + value: impl Into<jacquard_common::types::string::Datetime>, 1169 + ) -> PublicationViewBuilder<'a, publication_view_state::SetIndexedAt<S>> { 1170 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 1171 + PublicationViewBuilder { 1172 + _phantom_state: ::core::marker::PhantomData, 1173 + __unsafe_private_named: self.__unsafe_private_named, 1174 + _phantom: ::core::marker::PhantomData, 1175 + } 1176 + } 1177 + } 1178 + 1179 + impl<'a, S> PublicationViewBuilder<'a, S> 1180 + where 1181 + S: publication_view_state::State, 1182 + S::Name: publication_view_state::IsUnset, 1183 + { 1184 + /// Set the `name` field (required) 1185 + pub fn name( 1186 + mut self, 1187 + value: impl Into<jacquard_common::CowStr<'a>>, 1188 + ) -> PublicationViewBuilder<'a, publication_view_state::SetName<S>> { 1189 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 1190 + PublicationViewBuilder { 1191 + _phantom_state: ::core::marker::PhantomData, 1192 + __unsafe_private_named: self.__unsafe_private_named, 1193 + _phantom: ::core::marker::PhantomData, 1194 + } 1195 + } 1196 + } 1197 + 1198 + impl<'a, S: publication_view_state::State> PublicationViewBuilder<'a, S> { 1199 + /// Set the `notebookUri` field (optional) 1200 + pub fn notebook_uri( 1201 + mut self, 1202 + value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>, 1203 + ) -> Self { 1204 + self.__unsafe_private_named.5 = value.into(); 1205 + self 1206 + } 1207 + /// Set the `notebookUri` field to an Option value (optional) 1208 + pub fn maybe_notebook_uri( 1209 + mut self, 1210 + value: Option<jacquard_common::types::string::AtUri<'a>>, 1211 + ) -> Self { 1212 + self.__unsafe_private_named.5 = value; 1213 + self 1214 + } 1215 + } 1216 + 1217 + impl<'a, S> PublicationViewBuilder<'a, S> 1218 + where 1219 + S: publication_view_state::State, 1220 + S::Record: publication_view_state::IsUnset, 1221 + { 1222 + /// Set the `record` field (required) 1223 + pub fn record( 1224 + mut self, 1225 + value: impl Into<jacquard_common::types::value::Data<'a>>, 1226 + ) -> PublicationViewBuilder<'a, publication_view_state::SetRecord<S>> { 1227 + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 1228 + PublicationViewBuilder { 1229 + _phantom_state: ::core::marker::PhantomData, 1230 + __unsafe_private_named: self.__unsafe_private_named, 1231 + _phantom: ::core::marker::PhantomData, 1232 + } 1233 + } 1234 + } 1235 + 1236 + impl<'a, S> PublicationViewBuilder<'a, S> 1237 + where 1238 + S: publication_view_state::State, 1239 + S::Rkey: publication_view_state::IsUnset, 1240 + { 1241 + /// Set the `rkey` field (required) 1242 + pub fn rkey( 1243 + mut self, 1244 + value: impl Into<jacquard_common::CowStr<'a>>, 1245 + ) -> PublicationViewBuilder<'a, publication_view_state::SetRkey<S>> { 1246 + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); 1247 + PublicationViewBuilder { 1248 + _phantom_state: ::core::marker::PhantomData, 1249 + __unsafe_private_named: self.__unsafe_private_named, 1250 + _phantom: ::core::marker::PhantomData, 1251 + } 1252 + } 1253 + } 1254 + 1255 + impl<'a, S> PublicationViewBuilder<'a, S> 1256 + where 1257 + S: publication_view_state::State, 1258 + S::Uri: publication_view_state::IsUnset, 1259 + { 1260 + /// Set the `uri` field (required) 1261 + pub fn uri( 1262 + mut self, 1263 + value: impl Into<jacquard_common::types::string::AtUri<'a>>, 1264 + ) -> PublicationViewBuilder<'a, publication_view_state::SetUri<S>> { 1265 + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); 1266 + PublicationViewBuilder { 1267 + _phantom_state: ::core::marker::PhantomData, 1268 + __unsafe_private_named: self.__unsafe_private_named, 1269 + _phantom: ::core::marker::PhantomData, 1270 + } 1271 + } 1272 + } 1273 + 1274 + impl<'a, S> PublicationViewBuilder<'a, S> 1275 + where 1276 + S: publication_view_state::State, 1277 + S::Uri: publication_view_state::IsSet, 1278 + S::Rkey: publication_view_state::IsSet, 1279 + S::Did: publication_view_state::IsSet, 1280 + S::Cid: publication_view_state::IsSet, 1281 + S::Domain: publication_view_state::IsSet, 1282 + S::Record: publication_view_state::IsSet, 1283 + S::Name: publication_view_state::IsSet, 1284 + S::IndexedAt: publication_view_state::IsSet, 1285 + { 1286 + /// Build the final struct 1287 + pub fn build(self) -> PublicationView<'a> { 1288 + PublicationView { 1289 + cid: self.__unsafe_private_named.0.unwrap(), 1290 + did: self.__unsafe_private_named.1.unwrap(), 1291 + domain: self.__unsafe_private_named.2.unwrap(), 1292 + indexed_at: self.__unsafe_private_named.3.unwrap(), 1293 + name: self.__unsafe_private_named.4.unwrap(), 1294 + notebook_uri: self.__unsafe_private_named.5, 1295 + record: self.__unsafe_private_named.6.unwrap(), 1296 + rkey: self.__unsafe_private_named.7.unwrap(), 1297 + uri: self.__unsafe_private_named.8.unwrap(), 1298 + extra_data: Default::default(), 1299 + } 1300 + } 1301 + /// Build the final struct with custom extra_data 1302 + pub fn build_with_data( 1303 + self, 1304 + extra_data: std::collections::BTreeMap< 1305 + jacquard_common::smol_str::SmolStr, 1306 + jacquard_common::types::value::Data<'a>, 1307 + >, 1308 + ) -> PublicationView<'a> { 1309 + PublicationView { 1310 + cid: self.__unsafe_private_named.0.unwrap(), 1311 + did: self.__unsafe_private_named.1.unwrap(), 1312 + domain: self.__unsafe_private_named.2.unwrap(), 1313 + indexed_at: self.__unsafe_private_named.3.unwrap(), 1314 + name: self.__unsafe_private_named.4.unwrap(), 1315 + notebook_uri: self.__unsafe_private_named.5, 1316 + record: self.__unsafe_private_named.6.unwrap(), 1317 + rkey: self.__unsafe_private_named.7.unwrap(), 1318 + uri: self.__unsafe_private_named.8.unwrap(), 1319 + extra_data: Some(extra_data), 1320 + } 1321 + } 1322 + } 1323 + 1324 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PublicationView<'a> { 1325 + fn nsid() -> &'static str { 1326 + "sh.weaver.domain.defs" 1327 + } 1328 + fn def_name() -> &'static str { 1329 + "publicationView" 1330 + } 1331 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1332 + lexicon_doc_sh_weaver_domain_defs() 1333 + } 1334 + fn validate( 1335 + &self, 1336 + ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1337 + Ok(()) 1338 + } 1339 + }
+280
crates/weaver-api/src/sh_weaver/domain/generate_document.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: sh.weaver.domain.generateDocument 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 GenerateDocument<'a> { 19 + #[serde(borrow)] 20 + pub entry: jacquard_common::types::string::AtUri<'a>, 21 + #[serde(borrow)] 22 + pub path: jacquard_common::CowStr<'a>, 23 + #[serde(borrow)] 24 + pub publication: jacquard_common::types::string::AtUri<'a>, 25 + } 26 + 27 + pub mod generate_document_state { 28 + 29 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 30 + #[allow(unused)] 31 + use ::core::marker::PhantomData; 32 + mod sealed { 33 + pub trait Sealed {} 34 + } 35 + /// State trait tracking which required fields have been set 36 + pub trait State: sealed::Sealed { 37 + type Publication; 38 + type Entry; 39 + type Path; 40 + } 41 + /// Empty state - all required fields are unset 42 + pub struct Empty(()); 43 + impl sealed::Sealed for Empty {} 44 + impl State for Empty { 45 + type Publication = Unset; 46 + type Entry = Unset; 47 + type Path = Unset; 48 + } 49 + ///State transition - sets the `publication` field to Set 50 + pub struct SetPublication<S: State = Empty>(PhantomData<fn() -> S>); 51 + impl<S: State> sealed::Sealed for SetPublication<S> {} 52 + impl<S: State> State for SetPublication<S> { 53 + type Publication = Set<members::publication>; 54 + type Entry = S::Entry; 55 + type Path = S::Path; 56 + } 57 + ///State transition - sets the `entry` field to Set 58 + pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 59 + impl<S: State> sealed::Sealed for SetEntry<S> {} 60 + impl<S: State> State for SetEntry<S> { 61 + type Publication = S::Publication; 62 + type Entry = Set<members::entry>; 63 + type Path = S::Path; 64 + } 65 + ///State transition - sets the `path` field to Set 66 + pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 67 + impl<S: State> sealed::Sealed for SetPath<S> {} 68 + impl<S: State> State for SetPath<S> { 69 + type Publication = S::Publication; 70 + type Entry = S::Entry; 71 + type Path = Set<members::path>; 72 + } 73 + /// Marker types for field names 74 + #[allow(non_camel_case_types)] 75 + pub mod members { 76 + ///Marker type for the `publication` field 77 + pub struct publication(()); 78 + ///Marker type for the `entry` field 79 + pub struct entry(()); 80 + ///Marker type for the `path` field 81 + pub struct path(()); 82 + } 83 + } 84 + 85 + /// Builder for constructing an instance of this type 86 + pub struct GenerateDocumentBuilder<'a, S: generate_document_state::State> { 87 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 88 + __unsafe_private_named: ( 89 + ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 90 + ::core::option::Option<jacquard_common::CowStr<'a>>, 91 + ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 92 + ), 93 + _phantom: ::core::marker::PhantomData<&'a ()>, 94 + } 95 + 96 + impl<'a> GenerateDocument<'a> { 97 + /// Create a new builder for this type 98 + pub fn new() -> GenerateDocumentBuilder<'a, generate_document_state::Empty> { 99 + GenerateDocumentBuilder::new() 100 + } 101 + } 102 + 103 + impl<'a> GenerateDocumentBuilder<'a, generate_document_state::Empty> { 104 + /// Create a new builder with all fields unset 105 + pub fn new() -> Self { 106 + GenerateDocumentBuilder { 107 + _phantom_state: ::core::marker::PhantomData, 108 + __unsafe_private_named: (None, None, None), 109 + _phantom: ::core::marker::PhantomData, 110 + } 111 + } 112 + } 113 + 114 + impl<'a, S> GenerateDocumentBuilder<'a, S> 115 + where 116 + S: generate_document_state::State, 117 + S::Entry: generate_document_state::IsUnset, 118 + { 119 + /// Set the `entry` field (required) 120 + pub fn entry( 121 + mut self, 122 + value: impl Into<jacquard_common::types::string::AtUri<'a>>, 123 + ) -> GenerateDocumentBuilder<'a, generate_document_state::SetEntry<S>> { 124 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 125 + GenerateDocumentBuilder { 126 + _phantom_state: ::core::marker::PhantomData, 127 + __unsafe_private_named: self.__unsafe_private_named, 128 + _phantom: ::core::marker::PhantomData, 129 + } 130 + } 131 + } 132 + 133 + impl<'a, S> GenerateDocumentBuilder<'a, S> 134 + where 135 + S: generate_document_state::State, 136 + S::Path: generate_document_state::IsUnset, 137 + { 138 + /// Set the `path` field (required) 139 + pub fn path( 140 + mut self, 141 + value: impl Into<jacquard_common::CowStr<'a>>, 142 + ) -> GenerateDocumentBuilder<'a, generate_document_state::SetPath<S>> { 143 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 144 + GenerateDocumentBuilder { 145 + _phantom_state: ::core::marker::PhantomData, 146 + __unsafe_private_named: self.__unsafe_private_named, 147 + _phantom: ::core::marker::PhantomData, 148 + } 149 + } 150 + } 151 + 152 + impl<'a, S> GenerateDocumentBuilder<'a, S> 153 + where 154 + S: generate_document_state::State, 155 + S::Publication: generate_document_state::IsUnset, 156 + { 157 + /// Set the `publication` field (required) 158 + pub fn publication( 159 + mut self, 160 + value: impl Into<jacquard_common::types::string::AtUri<'a>>, 161 + ) -> GenerateDocumentBuilder<'a, generate_document_state::SetPublication<S>> { 162 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 163 + GenerateDocumentBuilder { 164 + _phantom_state: ::core::marker::PhantomData, 165 + __unsafe_private_named: self.__unsafe_private_named, 166 + _phantom: ::core::marker::PhantomData, 167 + } 168 + } 169 + } 170 + 171 + impl<'a, S> GenerateDocumentBuilder<'a, S> 172 + where 173 + S: generate_document_state::State, 174 + S::Publication: generate_document_state::IsSet, 175 + S::Entry: generate_document_state::IsSet, 176 + S::Path: generate_document_state::IsSet, 177 + { 178 + /// Build the final struct 179 + pub fn build(self) -> GenerateDocument<'a> { 180 + GenerateDocument { 181 + entry: self.__unsafe_private_named.0.unwrap(), 182 + path: self.__unsafe_private_named.1.unwrap(), 183 + publication: self.__unsafe_private_named.2.unwrap(), 184 + } 185 + } 186 + } 187 + 188 + #[jacquard_derive::lexicon] 189 + #[derive( 190 + serde::Serialize, 191 + serde::Deserialize, 192 + Debug, 193 + Clone, 194 + PartialEq, 195 + Eq, 196 + jacquard_derive::IntoStatic 197 + )] 198 + #[serde(rename_all = "camelCase")] 199 + pub struct GenerateDocumentOutput<'a> { 200 + #[serde(borrow)] 201 + pub record: crate::site_standard::document::Document<'a>, 202 + } 203 + 204 + #[jacquard_derive::open_union] 205 + #[derive( 206 + serde::Serialize, 207 + serde::Deserialize, 208 + Debug, 209 + Clone, 210 + PartialEq, 211 + Eq, 212 + thiserror::Error, 213 + miette::Diagnostic, 214 + jacquard_derive::IntoStatic 215 + )] 216 + #[serde(tag = "error", content = "message")] 217 + #[serde(bound(deserialize = "'de: 'a"))] 218 + pub enum GenerateDocumentError<'a> { 219 + #[serde(rename = "PublicationNotFound")] 220 + PublicationNotFound(std::option::Option<jacquard_common::CowStr<'a>>), 221 + #[serde(rename = "EntryNotFound")] 222 + EntryNotFound(std::option::Option<jacquard_common::CowStr<'a>>), 223 + #[serde(rename = "NotebookNotLinked")] 224 + NotebookNotLinked(std::option::Option<jacquard_common::CowStr<'a>>), 225 + } 226 + 227 + impl core::fmt::Display for GenerateDocumentError<'_> { 228 + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 229 + match self { 230 + Self::PublicationNotFound(msg) => { 231 + write!(f, "PublicationNotFound")?; 232 + if let Some(msg) = msg { 233 + write!(f, ": {}", msg)?; 234 + } 235 + Ok(()) 236 + } 237 + Self::EntryNotFound(msg) => { 238 + write!(f, "EntryNotFound")?; 239 + if let Some(msg) = msg { 240 + write!(f, ": {}", msg)?; 241 + } 242 + Ok(()) 243 + } 244 + Self::NotebookNotLinked(msg) => { 245 + write!(f, "NotebookNotLinked")?; 246 + if let Some(msg) = msg { 247 + write!(f, ": {}", msg)?; 248 + } 249 + Ok(()) 250 + } 251 + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 252 + } 253 + } 254 + } 255 + 256 + /// Response type for 257 + ///sh.weaver.domain.generateDocument 258 + pub struct GenerateDocumentResponse; 259 + impl jacquard_common::xrpc::XrpcResp for GenerateDocumentResponse { 260 + const NSID: &'static str = "sh.weaver.domain.generateDocument"; 261 + const ENCODING: &'static str = "application/json"; 262 + type Output<'de> = GenerateDocumentOutput<'de>; 263 + type Err<'de> = GenerateDocumentError<'de>; 264 + } 265 + 266 + impl<'a> jacquard_common::xrpc::XrpcRequest for GenerateDocument<'a> { 267 + const NSID: &'static str = "sh.weaver.domain.generateDocument"; 268 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 269 + type Response = GenerateDocumentResponse; 270 + } 271 + 272 + /// Endpoint type for 273 + ///sh.weaver.domain.generateDocument 274 + pub struct GenerateDocumentRequest; 275 + impl jacquard_common::xrpc::XrpcEndpoint for GenerateDocumentRequest { 276 + const PATH: &'static str = "/xrpc/sh.weaver.domain.generateDocument"; 277 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 278 + type Request<'de> = GenerateDocument<'de>; 279 + type Response = GenerateDocumentResponse; 280 + }
+186
crates/weaver-api/src/sh_weaver/domain/resolve_by_domain.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: sh.weaver.domain.resolveByDomain 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 ResolveByDomain<'a> { 19 + #[serde(borrow)] 20 + pub domain: jacquard_common::CowStr<'a>, 21 + } 22 + 23 + pub mod resolve_by_domain_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 Domain; 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 Domain = Unset; 40 + } 41 + ///State transition - sets the `domain` field to Set 42 + pub struct SetDomain<S: State = Empty>(PhantomData<fn() -> S>); 43 + impl<S: State> sealed::Sealed for SetDomain<S> {} 44 + impl<S: State> State for SetDomain<S> { 45 + type Domain = Set<members::domain>; 46 + } 47 + /// Marker types for field names 48 + #[allow(non_camel_case_types)] 49 + pub mod members { 50 + ///Marker type for the `domain` field 51 + pub struct domain(()); 52 + } 53 + } 54 + 55 + /// Builder for constructing an instance of this type 56 + pub struct ResolveByDomainBuilder<'a, S: resolve_by_domain_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> ResolveByDomain<'a> { 63 + /// Create a new builder for this type 64 + pub fn new() -> ResolveByDomainBuilder<'a, resolve_by_domain_state::Empty> { 65 + ResolveByDomainBuilder::new() 66 + } 67 + } 68 + 69 + impl<'a> ResolveByDomainBuilder<'a, resolve_by_domain_state::Empty> { 70 + /// Create a new builder with all fields unset 71 + pub fn new() -> Self { 72 + ResolveByDomainBuilder { 73 + _phantom_state: ::core::marker::PhantomData, 74 + __unsafe_private_named: (None,), 75 + _phantom: ::core::marker::PhantomData, 76 + } 77 + } 78 + } 79 + 80 + impl<'a, S> ResolveByDomainBuilder<'a, S> 81 + where 82 + S: resolve_by_domain_state::State, 83 + S::Domain: resolve_by_domain_state::IsUnset, 84 + { 85 + /// Set the `domain` field (required) 86 + pub fn domain( 87 + mut self, 88 + value: impl Into<jacquard_common::CowStr<'a>>, 89 + ) -> ResolveByDomainBuilder<'a, resolve_by_domain_state::SetDomain<S>> { 90 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 91 + ResolveByDomainBuilder { 92 + _phantom_state: ::core::marker::PhantomData, 93 + __unsafe_private_named: self.__unsafe_private_named, 94 + _phantom: ::core::marker::PhantomData, 95 + } 96 + } 97 + } 98 + 99 + impl<'a, S> ResolveByDomainBuilder<'a, S> 100 + where 101 + S: resolve_by_domain_state::State, 102 + S::Domain: resolve_by_domain_state::IsSet, 103 + { 104 + /// Build the final struct 105 + pub fn build(self) -> ResolveByDomain<'a> { 106 + ResolveByDomain { 107 + domain: self.__unsafe_private_named.0.unwrap(), 108 + } 109 + } 110 + } 111 + 112 + #[jacquard_derive::lexicon] 113 + #[derive( 114 + serde::Serialize, 115 + serde::Deserialize, 116 + Debug, 117 + Clone, 118 + PartialEq, 119 + Eq, 120 + jacquard_derive::IntoStatic 121 + )] 122 + #[serde(rename_all = "camelCase")] 123 + pub struct ResolveByDomainOutput<'a> { 124 + #[serde(borrow)] 125 + pub publication: crate::sh_weaver::domain::PublicationView<'a>, 126 + } 127 + 128 + #[jacquard_derive::open_union] 129 + #[derive( 130 + serde::Serialize, 131 + serde::Deserialize, 132 + Debug, 133 + Clone, 134 + PartialEq, 135 + Eq, 136 + thiserror::Error, 137 + miette::Diagnostic, 138 + jacquard_derive::IntoStatic 139 + )] 140 + #[serde(tag = "error", content = "message")] 141 + #[serde(bound(deserialize = "'de: 'a"))] 142 + pub enum ResolveByDomainError<'a> { 143 + #[serde(rename = "DomainNotFound")] 144 + DomainNotFound(std::option::Option<jacquard_common::CowStr<'a>>), 145 + } 146 + 147 + impl core::fmt::Display for ResolveByDomainError<'_> { 148 + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 149 + match self { 150 + Self::DomainNotFound(msg) => { 151 + write!(f, "DomainNotFound")?; 152 + if let Some(msg) = msg { 153 + write!(f, ": {}", msg)?; 154 + } 155 + Ok(()) 156 + } 157 + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 158 + } 159 + } 160 + } 161 + 162 + /// Response type for 163 + ///sh.weaver.domain.resolveByDomain 164 + pub struct ResolveByDomainResponse; 165 + impl jacquard_common::xrpc::XrpcResp for ResolveByDomainResponse { 166 + const NSID: &'static str = "sh.weaver.domain.resolveByDomain"; 167 + const ENCODING: &'static str = "application/json"; 168 + type Output<'de> = ResolveByDomainOutput<'de>; 169 + type Err<'de> = ResolveByDomainError<'de>; 170 + } 171 + 172 + impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveByDomain<'a> { 173 + const NSID: &'static str = "sh.weaver.domain.resolveByDomain"; 174 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 175 + type Response = ResolveByDomainResponse; 176 + } 177 + 178 + /// Endpoint type for 179 + ///sh.weaver.domain.resolveByDomain 180 + pub struct ResolveByDomainRequest; 181 + impl jacquard_common::xrpc::XrpcEndpoint for ResolveByDomainRequest { 182 + const PATH: &'static str = "/xrpc/sh.weaver.domain.resolveByDomain"; 183 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 184 + type Request<'de> = ResolveByDomain<'de>; 185 + type Response = ResolveByDomainResponse; 186 + }
+233
crates/weaver-api/src/sh_weaver/domain/resolve_document.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: sh.weaver.domain.resolveDocument 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 ResolveDocument<'a> { 19 + #[serde(borrow)] 20 + pub path: jacquard_common::CowStr<'a>, 21 + #[serde(borrow)] 22 + pub publication: jacquard_common::types::string::AtUri<'a>, 23 + } 24 + 25 + pub mod resolve_document_state { 26 + 27 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 28 + #[allow(unused)] 29 + use ::core::marker::PhantomData; 30 + mod sealed { 31 + pub trait Sealed {} 32 + } 33 + /// State trait tracking which required fields have been set 34 + pub trait State: sealed::Sealed { 35 + type Path; 36 + type Publication; 37 + } 38 + /// Empty state - all required fields are unset 39 + pub struct Empty(()); 40 + impl sealed::Sealed for Empty {} 41 + impl State for Empty { 42 + type Path = Unset; 43 + type Publication = Unset; 44 + } 45 + ///State transition - sets the `path` field to Set 46 + pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 47 + impl<S: State> sealed::Sealed for SetPath<S> {} 48 + impl<S: State> State for SetPath<S> { 49 + type Path = Set<members::path>; 50 + type Publication = S::Publication; 51 + } 52 + ///State transition - sets the `publication` field to Set 53 + pub struct SetPublication<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetPublication<S> {} 55 + impl<S: State> State for SetPublication<S> { 56 + type Path = S::Path; 57 + type Publication = Set<members::publication>; 58 + } 59 + /// Marker types for field names 60 + #[allow(non_camel_case_types)] 61 + pub mod members { 62 + ///Marker type for the `path` field 63 + pub struct path(()); 64 + ///Marker type for the `publication` field 65 + pub struct publication(()); 66 + } 67 + } 68 + 69 + /// Builder for constructing an instance of this type 70 + pub struct ResolveDocumentBuilder<'a, S: resolve_document_state::State> { 71 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 72 + __unsafe_private_named: ( 73 + ::core::option::Option<jacquard_common::CowStr<'a>>, 74 + ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 75 + ), 76 + _phantom: ::core::marker::PhantomData<&'a ()>, 77 + } 78 + 79 + impl<'a> ResolveDocument<'a> { 80 + /// Create a new builder for this type 81 + pub fn new() -> ResolveDocumentBuilder<'a, resolve_document_state::Empty> { 82 + ResolveDocumentBuilder::new() 83 + } 84 + } 85 + 86 + impl<'a> ResolveDocumentBuilder<'a, resolve_document_state::Empty> { 87 + /// Create a new builder with all fields unset 88 + pub fn new() -> Self { 89 + ResolveDocumentBuilder { 90 + _phantom_state: ::core::marker::PhantomData, 91 + __unsafe_private_named: (None, None), 92 + _phantom: ::core::marker::PhantomData, 93 + } 94 + } 95 + } 96 + 97 + impl<'a, S> ResolveDocumentBuilder<'a, S> 98 + where 99 + S: resolve_document_state::State, 100 + S::Path: resolve_document_state::IsUnset, 101 + { 102 + /// Set the `path` field (required) 103 + pub fn path( 104 + mut self, 105 + value: impl Into<jacquard_common::CowStr<'a>>, 106 + ) -> ResolveDocumentBuilder<'a, resolve_document_state::SetPath<S>> { 107 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 108 + ResolveDocumentBuilder { 109 + _phantom_state: ::core::marker::PhantomData, 110 + __unsafe_private_named: self.__unsafe_private_named, 111 + _phantom: ::core::marker::PhantomData, 112 + } 113 + } 114 + } 115 + 116 + impl<'a, S> ResolveDocumentBuilder<'a, S> 117 + where 118 + S: resolve_document_state::State, 119 + S::Publication: resolve_document_state::IsUnset, 120 + { 121 + /// Set the `publication` field (required) 122 + pub fn publication( 123 + mut self, 124 + value: impl Into<jacquard_common::types::string::AtUri<'a>>, 125 + ) -> ResolveDocumentBuilder<'a, resolve_document_state::SetPublication<S>> { 126 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 127 + ResolveDocumentBuilder { 128 + _phantom_state: ::core::marker::PhantomData, 129 + __unsafe_private_named: self.__unsafe_private_named, 130 + _phantom: ::core::marker::PhantomData, 131 + } 132 + } 133 + } 134 + 135 + impl<'a, S> ResolveDocumentBuilder<'a, S> 136 + where 137 + S: resolve_document_state::State, 138 + S::Path: resolve_document_state::IsSet, 139 + S::Publication: resolve_document_state::IsSet, 140 + { 141 + /// Build the final struct 142 + pub fn build(self) -> ResolveDocument<'a> { 143 + ResolveDocument { 144 + path: self.__unsafe_private_named.0.unwrap(), 145 + publication: self.__unsafe_private_named.1.unwrap(), 146 + } 147 + } 148 + } 149 + 150 + #[jacquard_derive::lexicon] 151 + #[derive( 152 + serde::Serialize, 153 + serde::Deserialize, 154 + Debug, 155 + Clone, 156 + PartialEq, 157 + Eq, 158 + jacquard_derive::IntoStatic 159 + )] 160 + #[serde(rename_all = "camelCase")] 161 + pub struct ResolveDocumentOutput<'a> { 162 + #[serde(borrow)] 163 + pub document: crate::sh_weaver::domain::DocumentView<'a>, 164 + } 165 + 166 + #[jacquard_derive::open_union] 167 + #[derive( 168 + serde::Serialize, 169 + serde::Deserialize, 170 + Debug, 171 + Clone, 172 + PartialEq, 173 + Eq, 174 + thiserror::Error, 175 + miette::Diagnostic, 176 + jacquard_derive::IntoStatic 177 + )] 178 + #[serde(tag = "error", content = "message")] 179 + #[serde(bound(deserialize = "'de: 'a"))] 180 + pub enum ResolveDocumentError<'a> { 181 + #[serde(rename = "PublicationNotFound")] 182 + PublicationNotFound(std::option::Option<jacquard_common::CowStr<'a>>), 183 + #[serde(rename = "DocumentNotFound")] 184 + DocumentNotFound(std::option::Option<jacquard_common::CowStr<'a>>), 185 + } 186 + 187 + impl core::fmt::Display for ResolveDocumentError<'_> { 188 + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 189 + match self { 190 + Self::PublicationNotFound(msg) => { 191 + write!(f, "PublicationNotFound")?; 192 + if let Some(msg) = msg { 193 + write!(f, ": {}", msg)?; 194 + } 195 + Ok(()) 196 + } 197 + Self::DocumentNotFound(msg) => { 198 + write!(f, "DocumentNotFound")?; 199 + if let Some(msg) = msg { 200 + write!(f, ": {}", msg)?; 201 + } 202 + Ok(()) 203 + } 204 + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 205 + } 206 + } 207 + } 208 + 209 + /// Response type for 210 + ///sh.weaver.domain.resolveDocument 211 + pub struct ResolveDocumentResponse; 212 + impl jacquard_common::xrpc::XrpcResp for ResolveDocumentResponse { 213 + const NSID: &'static str = "sh.weaver.domain.resolveDocument"; 214 + const ENCODING: &'static str = "application/json"; 215 + type Output<'de> = ResolveDocumentOutput<'de>; 216 + type Err<'de> = ResolveDocumentError<'de>; 217 + } 218 + 219 + impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveDocument<'a> { 220 + const NSID: &'static str = "sh.weaver.domain.resolveDocument"; 221 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 222 + type Response = ResolveDocumentResponse; 223 + } 224 + 225 + /// Endpoint type for 226 + ///sh.weaver.domain.resolveDocument 227 + pub struct ResolveDocumentRequest; 228 + impl jacquard_common::xrpc::XrpcEndpoint for ResolveDocumentRequest { 229 + const PATH: &'static str = "/xrpc/sh.weaver.domain.resolveDocument"; 230 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 231 + type Request<'de> = ResolveDocument<'de>; 232 + type Response = ResolveDocumentResponse; 233 + }
+60 -60
crates/weaver-api/src/sh_weaver/edit.rs
··· 723 723 pub trait State: sealed::Sealed { 724 724 type Length; 725 725 type Author; 726 - type Head; 727 726 type LastUpdated; 727 + type Head; 728 728 } 729 729 /// Empty state - all required fields are unset 730 730 pub struct Empty(()); ··· 732 732 impl State for Empty { 733 733 type Length = Unset; 734 734 type Author = Unset; 735 - type Head = Unset; 736 735 type LastUpdated = Unset; 736 + type Head = Unset; 737 737 } 738 738 ///State transition - sets the `length` field to Set 739 739 pub struct SetLength<S: State = Empty>(PhantomData<fn() -> S>); ··· 741 741 impl<S: State> State for SetLength<S> { 742 742 type Length = Set<members::length>; 743 743 type Author = S::Author; 744 - type Head = S::Head; 745 744 type LastUpdated = S::LastUpdated; 745 + type Head = S::Head; 746 746 } 747 747 ///State transition - sets the `author` field to Set 748 748 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); ··· 750 750 impl<S: State> State for SetAuthor<S> { 751 751 type Length = S::Length; 752 752 type Author = Set<members::author>; 753 - type Head = S::Head; 754 753 type LastUpdated = S::LastUpdated; 755 - } 756 - ///State transition - sets the `head` field to Set 757 - pub struct SetHead<S: State = Empty>(PhantomData<fn() -> S>); 758 - impl<S: State> sealed::Sealed for SetHead<S> {} 759 - impl<S: State> State for SetHead<S> { 760 - type Length = S::Length; 761 - type Author = S::Author; 762 - type Head = Set<members::head>; 763 - type LastUpdated = S::LastUpdated; 754 + type Head = S::Head; 764 755 } 765 756 ///State transition - sets the `last_updated` field to Set 766 757 pub struct SetLastUpdated<S: State = Empty>(PhantomData<fn() -> S>); ··· 768 759 impl<S: State> State for SetLastUpdated<S> { 769 760 type Length = S::Length; 770 761 type Author = S::Author; 762 + type LastUpdated = Set<members::last_updated>; 771 763 type Head = S::Head; 772 - type LastUpdated = Set<members::last_updated>; 764 + } 765 + ///State transition - sets the `head` field to Set 766 + pub struct SetHead<S: State = Empty>(PhantomData<fn() -> S>); 767 + impl<S: State> sealed::Sealed for SetHead<S> {} 768 + impl<S: State> State for SetHead<S> { 769 + type Length = S::Length; 770 + type Author = S::Author; 771 + type LastUpdated = S::LastUpdated; 772 + type Head = Set<members::head>; 773 773 } 774 774 /// Marker types for field names 775 775 #[allow(non_camel_case_types)] ··· 778 778 pub struct length(()); 779 779 ///Marker type for the `author` field 780 780 pub struct author(()); 781 - ///Marker type for the `head` field 782 - pub struct head(()); 783 781 ///Marker type for the `last_updated` field 784 782 pub struct last_updated(()); 783 + ///Marker type for the `head` field 784 + pub struct head(()); 785 785 } 786 786 } 787 787 ··· 950 950 S: edit_branch_view_state::State, 951 951 S::Length: edit_branch_view_state::IsSet, 952 952 S::Author: edit_branch_view_state::IsSet, 953 - S::Head: edit_branch_view_state::IsSet, 954 953 S::LastUpdated: edit_branch_view_state::IsSet, 954 + S::Head: edit_branch_view_state::IsSet, 955 955 { 956 956 /// Build the final struct 957 957 pub fn build(self) -> EditBranchView<'a> { ··· 1053 1053 } 1054 1054 /// State trait tracking which required fields have been set 1055 1055 pub trait State: sealed::Sealed { 1056 + type CreatedAt; 1057 + type Author; 1056 1058 type Cid; 1059 + type Type; 1057 1060 type Uri; 1058 - type Author; 1059 - type CreatedAt; 1060 - type Type; 1061 1061 } 1062 1062 /// Empty state - all required fields are unset 1063 1063 pub struct Empty(()); 1064 1064 impl sealed::Sealed for Empty {} 1065 1065 impl State for Empty { 1066 - type Cid = Unset; 1067 - type Uri = Unset; 1066 + type CreatedAt = Unset; 1068 1067 type Author = Unset; 1069 - type CreatedAt = Unset; 1068 + type Cid = Unset; 1070 1069 type Type = Unset; 1070 + type Uri = Unset; 1071 1071 } 1072 - ///State transition - sets the `cid` field to Set 1073 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1074 - impl<S: State> sealed::Sealed for SetCid<S> {} 1075 - impl<S: State> State for SetCid<S> { 1076 - type Cid = Set<members::cid>; 1077 - type Uri = S::Uri; 1072 + ///State transition - sets the `created_at` field to Set 1073 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1074 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1075 + impl<S: State> State for SetCreatedAt<S> { 1076 + type CreatedAt = Set<members::created_at>; 1078 1077 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 1078 type Cid = S::Cid; 1087 - type Uri = Set<members::uri>; 1088 - type Author = S::Author; 1089 - type CreatedAt = S::CreatedAt; 1090 1079 type Type = S::Type; 1080 + type Uri = S::Uri; 1091 1081 } 1092 1082 ///State transition - sets the `author` field to Set 1093 1083 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1094 1084 impl<S: State> sealed::Sealed for SetAuthor<S> {} 1095 1085 impl<S: State> State for SetAuthor<S> { 1086 + type CreatedAt = S::CreatedAt; 1087 + type Author = Set<members::author>; 1096 1088 type Cid = S::Cid; 1089 + type Type = S::Type; 1097 1090 type Uri = S::Uri; 1098 - type Author = Set<members::author>; 1091 + } 1092 + ///State transition - sets the `cid` field to Set 1093 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1094 + impl<S: State> sealed::Sealed for SetCid<S> {} 1095 + impl<S: State> State for SetCid<S> { 1099 1096 type CreatedAt = S::CreatedAt; 1100 - type Type = S::Type; 1101 - } 1102 - ///State transition - sets the `created_at` field to Set 1103 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1104 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1105 - impl<S: State> State for SetCreatedAt<S> { 1106 - type Cid = S::Cid; 1107 - type Uri = S::Uri; 1108 1097 type Author = S::Author; 1109 - type CreatedAt = Set<members::created_at>; 1098 + type Cid = Set<members::cid>; 1110 1099 type Type = S::Type; 1100 + type Uri = S::Uri; 1111 1101 } 1112 1102 ///State transition - sets the `type` field to Set 1113 1103 pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 1114 1104 impl<S: State> sealed::Sealed for SetType<S> {} 1115 1105 impl<S: State> State for SetType<S> { 1106 + type CreatedAt = S::CreatedAt; 1107 + type Author = S::Author; 1116 1108 type Cid = S::Cid; 1109 + type Type = Set<members::r#type>; 1117 1110 type Uri = S::Uri; 1118 - type Author = S::Author; 1111 + } 1112 + ///State transition - sets the `uri` field to Set 1113 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1114 + impl<S: State> sealed::Sealed for SetUri<S> {} 1115 + impl<S: State> State for SetUri<S> { 1119 1116 type CreatedAt = S::CreatedAt; 1120 - type Type = Set<members::r#type>; 1117 + type Author = S::Author; 1118 + type Cid = S::Cid; 1119 + type Type = S::Type; 1120 + type Uri = Set<members::uri>; 1121 1121 } 1122 1122 /// Marker types for field names 1123 1123 #[allow(non_camel_case_types)] 1124 1124 pub mod members { 1125 + ///Marker type for the `created_at` field 1126 + pub struct created_at(()); 1127 + ///Marker type for the `author` field 1128 + pub struct author(()); 1125 1129 ///Marker type for the `cid` field 1126 1130 pub struct cid(()); 1131 + ///Marker type for the `type` field 1132 + pub struct r#type(()); 1127 1133 ///Marker type for the `uri` field 1128 1134 pub struct uri(()); 1129 - ///Marker type for the `author` field 1130 - pub struct author(()); 1131 - ///Marker type for the `created_at` field 1132 - pub struct created_at(()); 1133 - ///Marker type for the `type` field 1134 - pub struct r#type(()); 1135 1135 } 1136 1136 } 1137 1137 ··· 1348 1348 impl<'a, S> EditHistoryEntryBuilder<'a, S> 1349 1349 where 1350 1350 S: edit_history_entry_state::State, 1351 - S::Cid: edit_history_entry_state::IsSet, 1352 - S::Uri: edit_history_entry_state::IsSet, 1353 - S::Author: edit_history_entry_state::IsSet, 1354 1351 S::CreatedAt: edit_history_entry_state::IsSet, 1352 + S::Author: edit_history_entry_state::IsSet, 1353 + S::Cid: edit_history_entry_state::IsSet, 1355 1354 S::Type: edit_history_entry_state::IsSet, 1355 + S::Uri: edit_history_entry_state::IsSet, 1356 1356 { 1357 1357 /// Build the final struct 1358 1358 pub fn build(self) -> EditHistoryEntry<'a> {
+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 Counter; 590 589 type Peer; 590 + type Counter; 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 Counter = Unset; 597 596 type Peer = Unset; 598 - } 599 - ///State transition - sets the `counter` field to Set 600 - pub struct SetCounter<S: State = Empty>(PhantomData<fn() -> S>); 601 - impl<S: State> sealed::Sealed for SetCounter<S> {} 602 - impl<S: State> State for SetCounter<S> { 603 - type Counter = Set<members::counter>; 604 - type Peer = S::Peer; 597 + type Counter = Unset; 605 598 } 606 599 ///State transition - sets the `peer` field to Set 607 600 pub struct SetPeer<S: State = Empty>(PhantomData<fn() -> S>); 608 601 impl<S: State> sealed::Sealed for SetPeer<S> {} 609 602 impl<S: State> State for SetPeer<S> { 610 - type Counter = S::Counter; 611 603 type Peer = Set<members::peer>; 604 + type Counter = S::Counter; 605 + } 606 + ///State transition - sets the `counter` field to Set 607 + pub struct SetCounter<S: State = Empty>(PhantomData<fn() -> S>); 608 + impl<S: State> sealed::Sealed for SetCounter<S> {} 609 + impl<S: State> State for SetCounter<S> { 610 + type Peer = S::Peer; 611 + type Counter = Set<members::counter>; 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 `counter` field 617 - pub struct counter(()); 618 616 ///Marker type for the `peer` field 619 617 pub struct peer(()); 618 + ///Marker type for the `counter` field 619 + pub struct counter(()); 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::Counter: id_state::IsSet, 687 686 S::Peer: id_state::IsSet, 687 + S::Counter: id_state::IsSet, 688 688 { 689 689 /// Build the final struct 690 690 pub fn build(self) -> Id<'a> { ··· 1017 1017 } 1018 1018 /// State trait tracking which required fields have been set 1019 1019 pub trait State: sealed::Sealed { 1020 + type Peer; 1020 1021 type Counter; 1021 1022 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 + type Peer = Unset; 1028 1029 type Counter = Unset; 1029 1030 type ContainerType = Unset; 1030 - type Peer = Unset; 1031 + } 1032 + ///State transition - sets the `peer` field to Set 1033 + pub struct SetPeer<S: State = Empty>(PhantomData<fn() -> S>); 1034 + impl<S: State> sealed::Sealed for SetPeer<S> {} 1035 + impl<S: State> State for SetPeer<S> { 1036 + type Peer = Set<members::peer>; 1037 + type Counter = S::Counter; 1038 + type ContainerType = S::ContainerType; 1031 1039 } 1032 1040 ///State transition - sets the `counter` field to Set 1033 1041 pub struct SetCounter<S: State = Empty>(PhantomData<fn() -> S>); 1034 1042 impl<S: State> sealed::Sealed for SetCounter<S> {} 1035 1043 impl<S: State> State for SetCounter<S> { 1044 + type Peer = S::Peer; 1036 1045 type Counter = Set<members::counter>; 1037 1046 type ContainerType = S::ContainerType; 1038 - type Peer = S::Peer; 1039 1047 } 1040 1048 ///State transition - sets the `container_type` field to Set 1041 1049 pub struct SetContainerType<S: State = Empty>(PhantomData<fn() -> S>); 1042 1050 impl<S: State> sealed::Sealed for SetContainerType<S> {} 1043 1051 impl<S: State> State for SetContainerType<S> { 1044 - type Counter = S::Counter; 1045 - type ContainerType = Set<members::container_type>; 1046 1052 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 1053 type Counter = S::Counter; 1053 - type ContainerType = S::ContainerType; 1054 - type Peer = Set<members::peer>; 1054 + type ContainerType = Set<members::container_type>; 1055 1055 } 1056 1056 /// Marker types for field names 1057 1057 #[allow(non_camel_case_types)] 1058 1058 pub mod members { 1059 + ///Marker type for the `peer` field 1060 + pub struct peer(()); 1059 1061 ///Marker type for the `counter` field 1060 1062 pub struct counter(()); 1061 1063 ///Marker type for the `container_type` field 1062 1064 pub struct container_type(()); 1063 - ///Marker type for the `peer` field 1064 - pub struct peer(()); 1065 1065 } 1066 1066 } 1067 1067 ··· 1154 1154 impl<'a, S> NormalContainerIdBuilder<'a, S> 1155 1155 where 1156 1156 S: normal_container_id_state::State, 1157 + S::Peer: normal_container_id_state::IsSet, 1157 1158 S::Counter: normal_container_id_state::IsSet, 1158 1159 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 Doc; 51 50 type Root; 51 + type Doc; 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 Doc = Unset; 58 57 type Root = Unset; 59 - } 60 - ///State transition - sets the `doc` field to Set 61 - pub struct SetDoc<S: State = Empty>(PhantomData<fn() -> S>); 62 - impl<S: State> sealed::Sealed for SetDoc<S> {} 63 - impl<S: State> State for SetDoc<S> { 64 - type Doc = Set<members::doc>; 65 - type Root = S::Root; 58 + type Doc = Unset; 66 59 } 67 60 ///State transition - sets the `root` field to Set 68 61 pub struct SetRoot<S: State = Empty>(PhantomData<fn() -> S>); 69 62 impl<S: State> sealed::Sealed for SetRoot<S> {} 70 63 impl<S: State> State for SetRoot<S> { 71 - type Doc = S::Doc; 72 64 type Root = Set<members::root>; 65 + type Doc = S::Doc; 66 + } 67 + ///State transition - sets the `doc` field to Set 68 + pub struct SetDoc<S: State = Empty>(PhantomData<fn() -> S>); 69 + impl<S: State> sealed::Sealed for SetDoc<S> {} 70 + impl<S: State> State for SetDoc<S> { 71 + type Root = S::Root; 72 + type Doc = Set<members::doc>; 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 `doc` field 78 - pub struct doc(()); 79 77 ///Marker type for the `root` field 80 78 pub struct root(()); 79 + ///Marker type for the `doc` field 80 + pub struct doc(()); 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::Doc: diff_state::IsSet, 228 227 S::Root: diff_state::IsSet, 228 + S::Doc: diff_state::IsSet, 229 229 { 230 230 /// Build the final struct 231 231 pub fn build(self) -> Diff<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/edit/list_drafts.rs
··· 47 47 } 48 48 /// State trait tracking which required fields have been set 49 49 pub trait State: sealed::Sealed { 50 - type CreatedAt; 51 50 type Uri; 52 51 type Cid; 52 + type CreatedAt; 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 CreatedAt = Unset; 59 58 type Uri = Unset; 60 59 type Cid = Unset; 61 - } 62 - ///State transition - sets the `created_at` field to Set 63 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 64 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 65 - impl<S: State> State for SetCreatedAt<S> { 66 - type CreatedAt = Set<members::created_at>; 67 - type Uri = S::Uri; 68 - type Cid = S::Cid; 60 + type CreatedAt = Unset; 69 61 } 70 62 ///State transition - sets the `uri` field to Set 71 63 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 72 64 impl<S: State> sealed::Sealed for SetUri<S> {} 73 65 impl<S: State> State for SetUri<S> { 74 - type CreatedAt = S::CreatedAt; 75 66 type Uri = Set<members::uri>; 76 67 type Cid = S::Cid; 68 + type CreatedAt = S::CreatedAt; 77 69 } 78 70 ///State transition - sets the `cid` field to Set 79 71 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 80 72 impl<S: State> sealed::Sealed for SetCid<S> {} 81 73 impl<S: State> State for SetCid<S> { 82 - type CreatedAt = S::CreatedAt; 83 74 type Uri = S::Uri; 84 75 type Cid = Set<members::cid>; 76 + type CreatedAt = S::CreatedAt; 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 Uri = S::Uri; 83 + type Cid = S::Cid; 84 + type CreatedAt = Set<members::created_at>; 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 `created_at` field 90 - pub struct created_at(()); 91 89 ///Marker type for the `uri` field 92 90 pub struct uri(()); 93 91 ///Marker type for the `cid` field 94 92 pub struct cid(()); 93 + ///Marker type for the `created_at` field 94 + pub struct created_at(()); 95 95 } 96 96 } 97 97 ··· 241 241 impl<'a, S> DraftViewBuilder<'a, S> 242 242 where 243 243 S: draft_view_state::State, 244 - S::CreatedAt: draft_view_state::IsSet, 245 244 S::Uri: draft_view_state::IsSet, 246 245 S::Cid: draft_view_state::IsSet, 246 + S::CreatedAt: draft_view_state::IsSet, 247 247 { 248 248 /// Build the final struct 249 249 pub fn build(self) -> DraftView<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/edit/root.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Doc; 38 37 type Snapshot; 38 + type Doc; 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 Doc = Unset; 45 44 type Snapshot = Unset; 46 - } 47 - ///State transition - sets the `doc` field to Set 48 - pub struct SetDoc<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetDoc<S> {} 50 - impl<S: State> State for SetDoc<S> { 51 - type Doc = Set<members::doc>; 52 - type Snapshot = S::Snapshot; 45 + type Doc = Unset; 53 46 } 54 47 ///State transition - sets the `snapshot` field to Set 55 48 pub struct SetSnapshot<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetSnapshot<S> {} 57 50 impl<S: State> State for SetSnapshot<S> { 58 - type Doc = S::Doc; 59 51 type Snapshot = Set<members::snapshot>; 52 + type Doc = S::Doc; 53 + } 54 + ///State transition - sets the `doc` field to Set 55 + pub struct SetDoc<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetDoc<S> {} 57 + impl<S: State> State for SetDoc<S> { 58 + type Snapshot = S::Snapshot; 59 + type Doc = Set<members::doc>; 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 `doc` field 65 - pub struct doc(()); 66 64 ///Marker type for the `snapshot` field 67 65 pub struct snapshot(()); 66 + ///Marker type for the `doc` field 67 + pub struct doc(()); 68 68 } 69 69 } 70 70 ··· 137 137 impl<'a, S> RootBuilder<'a, S> 138 138 where 139 139 S: root_state::State, 140 - S::Doc: root_state::IsSet, 141 140 S::Snapshot: root_state::IsSet, 141 + S::Doc: root_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> Root<'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 Height; 316 315 type Width; 316 + type Height; 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 Height = Unset; 323 322 type Width = Unset; 324 - } 325 - ///State transition - sets the `height` field to Set 326 - pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 327 - impl<S: State> sealed::Sealed for SetHeight<S> {} 328 - impl<S: State> State for SetHeight<S> { 329 - type Height = Set<members::height>; 330 - type Width = S::Width; 323 + type Height = Unset; 331 324 } 332 325 ///State transition - sets the `width` field to Set 333 326 pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 334 327 impl<S: State> sealed::Sealed for SetWidth<S> {} 335 328 impl<S: State> State for SetWidth<S> { 336 - type Height = S::Height; 337 329 type Width = Set<members::width>; 330 + type Height = S::Height; 331 + } 332 + ///State transition - sets the `height` field to Set 333 + pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 334 + impl<S: State> sealed::Sealed for SetHeight<S> {} 335 + impl<S: State> State for SetHeight<S> { 336 + type Width = S::Width; 337 + type Height = Set<members::height>; 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 `height` field 343 - pub struct height(()); 344 342 ///Marker type for the `width` field 345 343 pub struct width(()); 344 + ///Marker type for the `height` field 345 + pub struct height(()); 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::Height: pixel_size_state::IsSet, 416 415 S::Width: pixel_size_state::IsSet, 416 + S::Height: pixel_size_state::IsSet, 417 417 { 418 418 /// Build the final struct 419 419 pub fn build(self) -> PixelSize<'a> {
+30 -30
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; 42 41 type Title; 42 + type Description; 43 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 - type Description = Unset; 50 49 type Title = Unset; 50 + type Description = Unset; 51 51 type Uri = Unset; 52 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; 60 - } 61 53 ///State transition - sets the `title` field to Set 62 54 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 63 55 impl<S: State> sealed::Sealed for SetTitle<S> {} 64 56 impl<S: State> State for SetTitle<S> { 65 - type Description = S::Description; 66 57 type Title = Set<members::title>; 58 + type Description = S::Description; 59 + type Uri = S::Uri; 60 + } 61 + ///State transition - sets the `description` field to Set 62 + pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 63 + impl<S: State> sealed::Sealed for SetDescription<S> {} 64 + impl<S: State> State for SetDescription<S> { 65 + type Title = S::Title; 66 + type Description = Set<members::description>; 67 67 type Uri = S::Uri; 68 68 } 69 69 ///State transition - sets the `uri` field to Set 70 70 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 71 71 impl<S: State> sealed::Sealed for SetUri<S> {} 72 72 impl<S: State> State for SetUri<S> { 73 - type Description = S::Description; 74 73 type Title = S::Title; 74 + type Description = S::Description; 75 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 `title` field 81 + pub struct title(()); 80 82 ///Marker type for the `description` field 81 83 pub struct description(()); 82 - ///Marker type for the `title` field 83 - pub struct title(()); 84 84 ///Marker type for the `uri` field 85 85 pub struct uri(()); 86 86 } ··· 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, 199 198 S::Title: external_embed_state::IsSet, 199 + S::Description: external_embed_state::IsSet, 200 200 S::Uri: external_embed_state::IsSet, 201 201 { 202 202 /// Build the final struct ··· 818 818 /// State trait tracking which required fields have been set 819 819 pub trait State: sealed::Sealed { 820 820 type Uri; 821 - type Description; 822 821 type Title; 822 + type Description; 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 828 type Uri = Unset; 829 - type Description = Unset; 830 829 type Title = Unset; 830 + type Description = Unset; 831 831 } 832 832 ///State transition - sets the `uri` field to Set 833 833 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 834 834 impl<S: State> sealed::Sealed for SetUri<S> {} 835 835 impl<S: State> State for SetUri<S> { 836 836 type Uri = Set<members::uri>; 837 - type Description = S::Description; 838 837 type Title = S::Title; 839 - } 840 - ///State transition - sets the `description` field to Set 841 - pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 842 - impl<S: State> sealed::Sealed for SetDescription<S> {} 843 - impl<S: State> State for SetDescription<S> { 844 - type Uri = S::Uri; 845 - type Description = Set<members::description>; 846 - type Title = S::Title; 838 + type Description = S::Description; 847 839 } 848 840 ///State transition - sets the `title` field to Set 849 841 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 850 842 impl<S: State> sealed::Sealed for SetTitle<S> {} 851 843 impl<S: State> State for SetTitle<S> { 852 844 type Uri = S::Uri; 853 - type Description = S::Description; 854 845 type Title = Set<members::title>; 846 + type Description = S::Description; 847 + } 848 + ///State transition - sets the `description` field to Set 849 + pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 850 + impl<S: State> sealed::Sealed for SetDescription<S> {} 851 + impl<S: State> State for SetDescription<S> { 852 + type Uri = S::Uri; 853 + type Title = S::Title; 854 + type Description = Set<members::description>; 855 855 } 856 856 /// Marker types for field names 857 857 #[allow(non_camel_case_types)] 858 858 pub mod members { 859 859 ///Marker type for the `uri` field 860 860 pub struct uri(()); 861 + ///Marker type for the `title` field 862 + pub struct title(()); 861 863 ///Marker type for the `description` field 862 864 pub struct description(()); 863 - ///Marker type for the `title` field 864 - pub struct title(()); 865 865 } 866 866 } 867 867 ··· 975 975 where 976 976 S: view_external_state::State, 977 977 S::Uri: view_external_state::IsSet, 978 - S::Description: view_external_state::IsSet, 979 978 S::Title: view_external_state::IsSet, 979 + S::Description: 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; 906 905 type Thumb; 907 906 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; 914 913 type Thumb = Unset; 915 914 type Fullsize = 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; 915 + type Alt = Unset; 924 916 } 925 917 ///State transition - sets the `thumb` field to Set 926 918 pub struct SetThumb<S: State = Empty>(PhantomData<fn() -> S>); 927 919 impl<S: State> sealed::Sealed for SetThumb<S> {} 928 920 impl<S: State> State for SetThumb<S> { 929 - type Alt = S::Alt; 930 921 type Thumb = Set<members::thumb>; 931 922 type Fullsize = S::Fullsize; 923 + type Alt = S::Alt; 932 924 } 933 925 ///State transition - sets the `fullsize` field to Set 934 926 pub struct SetFullsize<S: State = Empty>(PhantomData<fn() -> S>); 935 927 impl<S: State> sealed::Sealed for SetFullsize<S> {} 936 928 impl<S: State> State for SetFullsize<S> { 937 - type Alt = S::Alt; 938 929 type Thumb = S::Thumb; 939 930 type Fullsize = Set<members::fullsize>; 931 + 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 + type Thumb = S::Thumb; 938 + type Fullsize = S::Fullsize; 939 + type Alt = Set<members::alt>; 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(()); 946 944 ///Marker type for the `thumb` field 947 945 pub struct thumb(()); 948 946 ///Marker type for the `fullsize` field 949 947 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, 1077 1076 S::Thumb: view_image_state::IsSet, 1078 1077 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 Records; 37 36 type Media; 37 + type Records; 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 Records = Unset; 44 43 type Media = Unset; 45 - } 46 - ///State transition - sets the `records` field to Set 47 - pub struct SetRecords<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetRecords<S> {} 49 - impl<S: State> State for SetRecords<S> { 50 - type Records = Set<members::records>; 51 - type Media = S::Media; 44 + type Records = 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 Records = S::Records; 58 50 type Media = Set<members::media>; 51 + type Records = S::Records; 52 + } 53 + ///State transition - sets the `records` field to Set 54 + pub struct SetRecords<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetRecords<S> {} 56 + impl<S: State> State for SetRecords<S> { 57 + type Media = S::Media; 58 + type Records = Set<members::records>; 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 `records` field 64 - pub struct records(()); 65 63 ///Marker type for the `media` field 66 64 pub struct media(()); 65 + ///Marker type for the `records` field 66 + pub struct records(()); 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::Records: record_with_media_state::IsSet, 140 139 S::Media: record_with_media_state::IsSet, 140 + S::Records: record_with_media_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> RecordWithMedia<'a> {
+32 -32
crates/weaver-api/src/sh_weaver/embed/records.rs
··· 1572 1572 } 1573 1573 /// State trait tracking which required fields have been set 1574 1574 pub trait State: sealed::Sealed { 1575 - type Uri; 1576 1575 type NotFound; 1576 + type Uri; 1577 1577 } 1578 1578 /// Empty state - all required fields are unset 1579 1579 pub struct Empty(()); 1580 1580 impl sealed::Sealed for Empty {} 1581 1581 impl State for Empty { 1582 - type Uri = Unset; 1583 1582 type NotFound = Unset; 1584 - } 1585 - ///State transition - sets the `uri` field to Set 1586 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1587 - impl<S: State> sealed::Sealed for SetUri<S> {} 1588 - impl<S: State> State for SetUri<S> { 1589 - type Uri = Set<members::uri>; 1590 - type NotFound = S::NotFound; 1583 + type Uri = Unset; 1591 1584 } 1592 1585 ///State transition - sets the `not_found` field to Set 1593 1586 pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>); 1594 1587 impl<S: State> sealed::Sealed for SetNotFound<S> {} 1595 1588 impl<S: State> State for SetNotFound<S> { 1596 - type Uri = S::Uri; 1597 1589 type NotFound = Set<members::not_found>; 1590 + type Uri = S::Uri; 1591 + } 1592 + ///State transition - sets the `uri` field to Set 1593 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1594 + impl<S: State> sealed::Sealed for SetUri<S> {} 1595 + impl<S: State> State for SetUri<S> { 1596 + type NotFound = S::NotFound; 1597 + type Uri = Set<members::uri>; 1598 1598 } 1599 1599 /// Marker types for field names 1600 1600 #[allow(non_camel_case_types)] 1601 1601 pub mod members { 1602 + ///Marker type for the `not_found` field 1603 + pub struct not_found(()); 1602 1604 ///Marker type for the `uri` field 1603 1605 pub struct uri(()); 1604 - ///Marker type for the `not_found` field 1605 - pub struct not_found(()); 1606 1606 } 1607 1607 } 1608 1608 ··· 1675 1675 impl<'a, S> ViewNotFoundBuilder<'a, S> 1676 1676 where 1677 1677 S: view_not_found_state::State, 1678 - S::Uri: view_not_found_state::IsSet, 1679 1678 S::NotFound: view_not_found_state::IsSet, 1679 + S::Uri: view_not_found_state::IsSet, 1680 1680 { 1681 1681 /// Build the final struct 1682 1682 pub fn build(self) -> ViewNotFound<'a> { ··· 1771 1771 pub trait State: sealed::Sealed { 1772 1772 type Cid; 1773 1773 type Uri; 1774 - type Value; 1775 1774 type Author; 1775 + type Value; 1776 1776 type IndexedAt; 1777 1777 } 1778 1778 /// Empty state - all required fields are unset ··· 1781 1781 impl State for Empty { 1782 1782 type Cid = Unset; 1783 1783 type Uri = Unset; 1784 - type Value = Unset; 1785 1784 type Author = Unset; 1785 + type Value = Unset; 1786 1786 type IndexedAt = Unset; 1787 1787 } 1788 1788 ///State transition - sets the `cid` field to Set ··· 1791 1791 impl<S: State> State for SetCid<S> { 1792 1792 type Cid = Set<members::cid>; 1793 1793 type Uri = S::Uri; 1794 - type Value = S::Value; 1795 1794 type Author = S::Author; 1795 + type Value = S::Value; 1796 1796 type IndexedAt = S::IndexedAt; 1797 1797 } 1798 1798 ///State transition - sets the `uri` field to Set ··· 1801 1801 impl<S: State> State for SetUri<S> { 1802 1802 type Cid = S::Cid; 1803 1803 type Uri = Set<members::uri>; 1804 - type Value = S::Value; 1805 1804 type Author = S::Author; 1806 - type IndexedAt = S::IndexedAt; 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>; 1815 - type Author = S::Author; 1805 + type Value = S::Value; 1816 1806 type IndexedAt = S::IndexedAt; 1817 1807 } 1818 1808 ///State transition - sets the `author` field to Set ··· 1821 1811 impl<S: State> State for SetAuthor<S> { 1822 1812 type Cid = S::Cid; 1823 1813 type Uri = S::Uri; 1824 - type Value = S::Value; 1825 1814 type Author = Set<members::author>; 1815 + type Value = S::Value; 1816 + type IndexedAt = S::IndexedAt; 1817 + } 1818 + ///State transition - sets the `value` field to Set 1819 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1820 + impl<S: State> sealed::Sealed for SetValue<S> {} 1821 + impl<S: State> State for SetValue<S> { 1822 + type Cid = S::Cid; 1823 + type Uri = S::Uri; 1824 + type Author = S::Author; 1825 + type Value = Set<members::value>; 1826 1826 type IndexedAt = S::IndexedAt; 1827 1827 } 1828 1828 ///State transition - sets the `indexed_at` field to Set ··· 1831 1831 impl<S: State> State for SetIndexedAt<S> { 1832 1832 type Cid = S::Cid; 1833 1833 type Uri = S::Uri; 1834 - type Value = S::Value; 1835 1834 type Author = S::Author; 1835 + type Value = S::Value; 1836 1836 type IndexedAt = Set<members::indexed_at>; 1837 1837 } 1838 1838 /// Marker types for field names ··· 1842 1842 pub struct cid(()); 1843 1843 ///Marker type for the `uri` field 1844 1844 pub struct uri(()); 1845 + ///Marker type for the `author` field 1846 + pub struct author(()); 1845 1847 ///Marker type for the `value` field 1846 1848 pub struct value(()); 1847 - ///Marker type for the `author` field 1848 - pub struct author(()); 1849 1849 ///Marker type for the `indexed_at` field 1850 1850 pub struct indexed_at(()); 1851 1851 } ··· 2094 2094 S: view_record_state::State, 2095 2095 S::Cid: view_record_state::IsSet, 2096 2096 S::Uri: view_record_state::IsSet, 2097 - S::Value: view_record_state::IsSet, 2098 2097 S::Author: view_record_state::IsSet, 2098 + S::Value: view_record_state::IsSet, 2099 2099 S::IndexedAt: view_record_state::IsSet, 2100 2100 { 2101 2101 /// Build the final struct
+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 Cid; 944 943 type Playlist; 944 + type Cid; 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 Cid = Unset; 951 950 type Playlist = Unset; 952 - } 953 - ///State transition - sets the `cid` field to Set 954 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 955 - impl<S: State> sealed::Sealed for SetCid<S> {} 956 - impl<S: State> State for SetCid<S> { 957 - type Cid = Set<members::cid>; 958 - type Playlist = S::Playlist; 951 + type Cid = Unset; 959 952 } 960 953 ///State transition - sets the `playlist` field to Set 961 954 pub struct SetPlaylist<S: State = Empty>(PhantomData<fn() -> S>); 962 955 impl<S: State> sealed::Sealed for SetPlaylist<S> {} 963 956 impl<S: State> State for SetPlaylist<S> { 964 - type Cid = S::Cid; 965 957 type Playlist = Set<members::playlist>; 958 + type Cid = S::Cid; 959 + } 960 + ///State transition - sets the `cid` field to Set 961 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 962 + impl<S: State> sealed::Sealed for SetCid<S> {} 963 + impl<S: State> State for SetCid<S> { 964 + type Playlist = S::Playlist; 965 + type Cid = Set<members::cid>; 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 `cid` field 971 - pub struct cid(()); 972 970 ///Marker type for the `playlist` field 973 971 pub struct playlist(()); 972 + ///Marker type for the `cid` field 973 + pub struct cid(()); 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::Cid: view_state::IsSet, 1112 1111 S::Playlist: view_state::IsSet, 1112 + S::Cid: view_state::IsSet, 1113 1113 { 1114 1114 /// Build the final struct 1115 1115 pub fn build(self) -> View<'a> {
+86 -86
crates/weaver-api/src/sh_weaver/graph.rs
··· 883 883 } 884 884 /// State trait tracking which required fields have been set 885 885 pub trait State: sealed::Sealed { 886 - type Subject; 887 886 type Uri; 887 + type Subject; 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 Subject = Unset; 894 893 type Uri = Unset; 895 - } 896 - ///State transition - sets the `subject` field to Set 897 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 898 - impl<S: State> sealed::Sealed for SetSubject<S> {} 899 - impl<S: State> State for SetSubject<S> { 900 - type Subject = Set<members::subject>; 901 - type Uri = S::Uri; 894 + type Subject = Unset; 902 895 } 903 896 ///State transition - sets the `uri` field to Set 904 897 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 905 898 impl<S: State> sealed::Sealed for SetUri<S> {} 906 899 impl<S: State> State for SetUri<S> { 907 - type Subject = S::Subject; 908 900 type Uri = Set<members::uri>; 901 + type Subject = S::Subject; 902 + } 903 + ///State transition - sets the `subject` field to Set 904 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 905 + impl<S: State> sealed::Sealed for SetSubject<S> {} 906 + impl<S: State> State for SetSubject<S> { 907 + type Uri = S::Uri; 908 + type Subject = Set<members::subject>; 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 `subject` field 914 - pub struct subject(()); 915 913 ///Marker type for the `uri` field 916 914 pub struct uri(()); 915 + ///Marker type for the `subject` field 916 + pub struct subject(()); 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::Subject: list_item_view_state::IsSet, 1010 1009 S::Uri: list_item_view_state::IsSet, 1010 + S::Subject: 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 ItemCount; 1216 + type Creator; 1215 1217 type Name; 1216 - type Purpose; 1217 1218 type IndexedAt; 1218 - type Creator; 1219 1219 type Uri; 1220 - type ItemCount; 1220 + type Purpose; 1221 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 ItemCount = Unset; 1228 + type Creator = Unset; 1227 1229 type Name = Unset; 1228 - type Purpose = Unset; 1229 1230 type IndexedAt = Unset; 1230 - type Creator = Unset; 1231 1231 type Uri = Unset; 1232 - type ItemCount = Unset; 1232 + type Purpose = Unset; 1233 1233 type Cid = Unset; 1234 1234 } 1235 - ///State transition - sets the `name` field to Set 1236 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1237 - impl<S: State> sealed::Sealed for SetName<S> {} 1238 - impl<S: State> State for SetName<S> { 1239 - type Name = Set<members::name>; 1240 - type Purpose = S::Purpose; 1235 + ///State transition - sets the `item_count` field to Set 1236 + pub struct SetItemCount<S: State = Empty>(PhantomData<fn() -> S>); 1237 + impl<S: State> sealed::Sealed for SetItemCount<S> {} 1238 + impl<S: State> State for SetItemCount<S> { 1239 + type ItemCount = Set<members::item_count>; 1240 + type Creator = S::Creator; 1241 + type Name = S::Name; 1241 1242 type IndexedAt = S::IndexedAt; 1242 - type Creator = S::Creator; 1243 1243 type Uri = S::Uri; 1244 - type ItemCount = S::ItemCount; 1244 + type Purpose = S::Purpose; 1245 1245 type Cid = S::Cid; 1246 1246 } 1247 - ///State transition - sets the `purpose` field to Set 1248 - pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1249 - impl<S: State> sealed::Sealed for SetPurpose<S> {} 1250 - impl<S: State> State for SetPurpose<S> { 1247 + ///State transition - sets the `creator` field to Set 1248 + pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1249 + impl<S: State> sealed::Sealed for SetCreator<S> {} 1250 + impl<S: State> State for SetCreator<S> { 1251 + type ItemCount = S::ItemCount; 1252 + type Creator = Set<members::creator>; 1251 1253 type Name = S::Name; 1252 - type Purpose = Set<members::purpose>; 1253 1254 type IndexedAt = S::IndexedAt; 1254 - type Creator = S::Creator; 1255 1255 type Uri = S::Uri; 1256 + type Purpose = S::Purpose; 1257 + type Cid = S::Cid; 1258 + } 1259 + ///State transition - sets the `name` field to Set 1260 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1261 + impl<S: State> sealed::Sealed for SetName<S> {} 1262 + impl<S: State> State for SetName<S> { 1256 1263 type ItemCount = S::ItemCount; 1264 + type Creator = S::Creator; 1265 + type Name = Set<members::name>; 1266 + type IndexedAt = S::IndexedAt; 1267 + type Uri = S::Uri; 1268 + type Purpose = S::Purpose; 1257 1269 type Cid = S::Cid; 1258 1270 } 1259 1271 ///State transition - sets the `indexed_at` field to Set 1260 1272 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1261 1273 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1262 1274 impl<S: State> State for SetIndexedAt<S> { 1275 + type ItemCount = S::ItemCount; 1276 + type Creator = S::Creator; 1263 1277 type Name = S::Name; 1264 - type Purpose = S::Purpose; 1265 1278 type IndexedAt = Set<members::indexed_at>; 1266 - type Creator = S::Creator; 1267 1279 type Uri = S::Uri; 1268 - type ItemCount = S::ItemCount; 1269 - type Cid = S::Cid; 1270 - } 1271 - ///State transition - sets the `creator` field to Set 1272 - pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1273 - impl<S: State> sealed::Sealed for SetCreator<S> {} 1274 - impl<S: State> State for SetCreator<S> { 1275 - type Name = S::Name; 1276 1280 type Purpose = S::Purpose; 1277 - type IndexedAt = S::IndexedAt; 1278 - type Creator = Set<members::creator>; 1279 - type Uri = S::Uri; 1280 - type ItemCount = S::ItemCount; 1281 1281 type Cid = S::Cid; 1282 1282 } 1283 1283 ///State transition - sets the `uri` field to Set 1284 1284 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1285 1285 impl<S: State> sealed::Sealed for SetUri<S> {} 1286 1286 impl<S: State> State for SetUri<S> { 1287 + type ItemCount = S::ItemCount; 1288 + type Creator = S::Creator; 1287 1289 type Name = S::Name; 1288 - type Purpose = S::Purpose; 1289 1290 type IndexedAt = S::IndexedAt; 1290 - type Creator = S::Creator; 1291 1291 type Uri = Set<members::uri>; 1292 - type ItemCount = S::ItemCount; 1292 + type Purpose = S::Purpose; 1293 1293 type Cid = S::Cid; 1294 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> { 1295 + ///State transition - sets the `purpose` field to Set 1296 + pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1297 + impl<S: State> sealed::Sealed for SetPurpose<S> {} 1298 + impl<S: State> State for SetPurpose<S> { 1299 + type ItemCount = S::ItemCount; 1300 + type Creator = S::Creator; 1299 1301 type Name = S::Name; 1300 - type Purpose = S::Purpose; 1301 1302 type IndexedAt = S::IndexedAt; 1302 - type Creator = S::Creator; 1303 1303 type Uri = S::Uri; 1304 - type ItemCount = Set<members::item_count>; 1304 + type Purpose = Set<members::purpose>; 1305 1305 type Cid = S::Cid; 1306 1306 } 1307 1307 ///State transition - sets the `cid` field to Set 1308 1308 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1309 1309 impl<S: State> sealed::Sealed for SetCid<S> {} 1310 1310 impl<S: State> State for SetCid<S> { 1311 + type ItemCount = S::ItemCount; 1312 + type Creator = S::Creator; 1311 1313 type Name = S::Name; 1312 - type Purpose = S::Purpose; 1313 1314 type IndexedAt = S::IndexedAt; 1314 - type Creator = S::Creator; 1315 1315 type Uri = S::Uri; 1316 - type ItemCount = S::ItemCount; 1316 + type Purpose = S::Purpose; 1317 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 `item_count` field 1323 + pub struct item_count(()); 1324 + ///Marker type for the `creator` field 1325 + pub struct creator(()); 1322 1326 ///Marker type for the `name` field 1323 1327 pub struct name(()); 1324 - ///Marker type for the `purpose` field 1325 - pub struct purpose(()); 1326 1328 ///Marker type for the `indexed_at` field 1327 1329 pub struct indexed_at(()); 1328 - ///Marker type for the `creator` field 1329 - pub struct creator(()); 1330 1330 ///Marker type for the `uri` field 1331 1331 pub struct uri(()); 1332 - ///Marker type for the `item_count` field 1333 - pub struct item_count(()); 1332 + ///Marker type for the `purpose` field 1333 + pub struct purpose(()); 1334 1334 ///Marker type for the `cid` field 1335 1335 pub struct cid(()); 1336 1336 } ··· 1576 1576 impl<'a, S> ListViewBuilder<'a, S> 1577 1577 where 1578 1578 S: list_view_state::State, 1579 + S::ItemCount: list_view_state::IsSet, 1580 + S::Creator: list_view_state::IsSet, 1579 1581 S::Name: list_view_state::IsSet, 1580 - S::Purpose: list_view_state::IsSet, 1581 1582 S::IndexedAt: list_view_state::IsSet, 1582 - S::Creator: list_view_state::IsSet, 1583 1583 S::Uri: list_view_state::IsSet, 1584 - S::ItemCount: list_view_state::IsSet, 1584 + S::Purpose: list_view_state::IsSet, 1585 1585 S::Cid: list_view_state::IsSet, 1586 1586 { 1587 1587 /// Build the final struct ··· 1953 1953 /// State trait tracking which required fields have been set 1954 1954 pub trait State: sealed::Sealed { 1955 1955 type Tag; 1956 - type Uri; 1957 1956 type CreatedAt; 1958 1957 type AppliedBy; 1958 + type Uri; 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 1964 type Tag = Unset; 1965 - type Uri = Unset; 1966 1965 type CreatedAt = Unset; 1967 1966 type AppliedBy = Unset; 1967 + type Uri = Unset; 1968 1968 } 1969 1969 ///State transition - sets the `tag` field to Set 1970 1970 pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 1971 1971 impl<S: State> sealed::Sealed for SetTag<S> {} 1972 1972 impl<S: State> State for SetTag<S> { 1973 1973 type Tag = Set<members::tag>; 1974 - type Uri = S::Uri; 1975 1974 type CreatedAt = S::CreatedAt; 1976 1975 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; 1976 + type Uri = S::Uri; 1986 1977 } 1987 1978 ///State transition - sets the `created_at` field to Set 1988 1979 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1989 1980 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1990 1981 impl<S: State> State for SetCreatedAt<S> { 1991 1982 type Tag = S::Tag; 1992 - type Uri = S::Uri; 1993 1983 type CreatedAt = Set<members::created_at>; 1994 1984 type AppliedBy = S::AppliedBy; 1985 + type Uri = S::Uri; 1995 1986 } 1996 1987 ///State transition - sets the `applied_by` field to Set 1997 1988 pub struct SetAppliedBy<S: State = Empty>(PhantomData<fn() -> S>); 1998 1989 impl<S: State> sealed::Sealed for SetAppliedBy<S> {} 1999 1990 impl<S: State> State for SetAppliedBy<S> { 2000 1991 type Tag = S::Tag; 1992 + type CreatedAt = S::CreatedAt; 1993 + type AppliedBy = Set<members::applied_by>; 2001 1994 type Uri = S::Uri; 1995 + } 1996 + ///State transition - sets the `uri` field to Set 1997 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1998 + impl<S: State> sealed::Sealed for SetUri<S> {} 1999 + impl<S: State> State for SetUri<S> { 2000 + type Tag = S::Tag; 2002 2001 type CreatedAt = S::CreatedAt; 2003 - type AppliedBy = Set<members::applied_by>; 2002 + type AppliedBy = S::AppliedBy; 2003 + type Uri = Set<members::uri>; 2004 2004 } 2005 2005 /// Marker types for field names 2006 2006 #[allow(non_camel_case_types)] 2007 2007 pub mod members { 2008 2008 ///Marker type for the `tag` field 2009 2009 pub struct tag(()); 2010 - ///Marker type for the `uri` field 2011 - pub struct uri(()); 2012 2010 ///Marker type for the `created_at` field 2013 2011 pub struct created_at(()); 2014 2012 ///Marker type for the `applied_by` field 2015 2013 pub struct applied_by(()); 2014 + ///Marker type for the `uri` field 2015 + pub struct uri(()); 2016 2016 } 2017 2017 } 2018 2018 ··· 2126 2126 where 2127 2127 S: tag_application_view_state::State, 2128 2128 S::Tag: tag_application_view_state::IsSet, 2129 - S::Uri: tag_application_view_state::IsSet, 2130 2129 S::CreatedAt: tag_application_view_state::IsSet, 2131 2130 S::AppliedBy: tag_application_view_state::IsSet, 2131 + S::Uri: 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 Subject; 42 41 type CreatedAt; 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 Subject = Unset; 49 48 type CreatedAt = Unset; 50 - } 51 - ///State transition - sets the `subject` field to Set 52 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetSubject<S> {} 54 - impl<S: State> State for SetSubject<S> { 55 - type Subject = Set<members::subject>; 56 - type CreatedAt = S::CreatedAt; 49 + type Subject = Unset; 57 50 } 58 51 ///State transition - sets the `created_at` field to Set 59 52 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 60 53 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 61 54 impl<S: State> State for SetCreatedAt<S> { 62 - type Subject = S::Subject; 63 55 type CreatedAt = Set<members::created_at>; 56 + type Subject = S::Subject; 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 CreatedAt = S::CreatedAt; 63 + type Subject = Set<members::subject>; 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 `subject` field 69 - pub struct subject(()); 70 68 ///Marker type for the `created_at` field 71 69 pub struct created_at(()); 70 + ///Marker type for the `subject` field 71 + pub struct subject(()); 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::Subject: bookmark_state::IsSet, 162 161 S::CreatedAt: bookmark_state::IsSet, 162 + S::Subject: bookmark_state::IsSet, 163 163 { 164 164 /// Build the final struct 165 165 pub fn build(self) -> Bookmark<'a> {
+24 -24
crates/weaver-api/src/sh_weaver/graph/list.rs
··· 129 129 } 130 130 /// State trait tracking which required fields have been set 131 131 pub trait State: sealed::Sealed { 132 - type Name; 133 - type Purpose; 134 132 type CreatedAt; 133 + type Purpose; 134 + type Name; 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 + type CreatedAt = Unset; 141 + type Purpose = Unset; 140 142 type Name = Unset; 141 - type Purpose = Unset; 142 - type CreatedAt = Unset; 143 143 } 144 - ///State transition - sets the `name` field to Set 145 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 146 - impl<S: State> sealed::Sealed for SetName<S> {} 147 - impl<S: State> State for SetName<S> { 148 - type Name = Set<members::name>; 144 + ///State transition - sets the `created_at` field to Set 145 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 146 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 147 + impl<S: State> State for SetCreatedAt<S> { 148 + type CreatedAt = Set<members::created_at>; 149 149 type Purpose = S::Purpose; 150 - type CreatedAt = S::CreatedAt; 150 + type Name = S::Name; 151 151 } 152 152 ///State transition - sets the `purpose` field to Set 153 153 pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 154 154 impl<S: State> sealed::Sealed for SetPurpose<S> {} 155 155 impl<S: State> State for SetPurpose<S> { 156 - type Name = S::Name; 157 - type Purpose = Set<members::purpose>; 158 156 type CreatedAt = S::CreatedAt; 157 + type Purpose = Set<members::purpose>; 158 + type Name = S::Name; 159 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; 160 + ///State transition - sets the `name` field to Set 161 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 162 + impl<S: State> sealed::Sealed for SetName<S> {} 163 + impl<S: State> State for SetName<S> { 164 + type CreatedAt = S::CreatedAt; 165 165 type Purpose = S::Purpose; 166 - type CreatedAt = Set<members::created_at>; 166 + type Name = Set<members::name>; 167 167 } 168 168 /// Marker types for field names 169 169 #[allow(non_camel_case_types)] 170 170 pub mod members { 171 + ///Marker type for the `created_at` field 172 + pub struct created_at(()); 173 + ///Marker type for the `purpose` field 174 + pub struct purpose(()); 171 175 ///Marker type for the `name` field 172 176 pub struct name(()); 173 - ///Marker type for the `purpose` field 174 - pub struct purpose(()); 175 - ///Marker type for the `created_at` field 176 - pub struct created_at(()); 177 177 } 178 178 } 179 179 ··· 306 306 impl<'a, S> ListBuilder<'a, S> 307 307 where 308 308 S: list_state::State, 309 - S::Name: list_state::IsSet, 310 - S::Purpose: list_state::IsSet, 311 309 S::CreatedAt: list_state::IsSet, 310 + S::Purpose: list_state::IsSet, 311 + S::Name: list_state::IsSet, 312 312 { 313 313 /// Build the final struct 314 314 pub fn build(self) -> List<'a> {
+15 -15
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; 40 41 type CreatedAt; 41 42 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 Subject = Unset; 48 49 type CreatedAt = Unset; 49 50 type List = Unset; 50 - type Subject = Unset; 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>; 57 + type CreatedAt = S::CreatedAt; 58 + type List = S::List; 51 59 } 52 60 ///State transition - sets the `created_at` field to Set 53 61 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 54 62 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 55 63 impl<S: State> State for SetCreatedAt<S> { 64 + type Subject = S::Subject; 56 65 type CreatedAt = Set<members::created_at>; 57 66 type List = S::List; 58 - type Subject = S::Subject; 59 67 } 60 68 ///State transition - sets the `list` field to Set 61 69 pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 62 70 impl<S: State> sealed::Sealed for SetList<S> {} 63 71 impl<S: State> State for SetList<S> { 64 - type CreatedAt = S::CreatedAt; 65 - type List = Set<members::list>; 66 72 type Subject = S::Subject; 67 - } 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 73 type CreatedAt = S::CreatedAt; 73 - type List = S::List; 74 - type Subject = Set<members::subject>; 74 + type List = Set<members::list>; 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 `subject` field 80 + pub struct subject(()); 79 81 ///Marker type for the `created_at` field 80 82 pub struct created_at(()); 81 83 ///Marker type for the `list` field 82 84 pub struct list(()); 83 - ///Marker type for the `subject` field 84 - pub struct subject(()); 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, 177 178 S::CreatedAt: listitem_state::IsSet, 178 179 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> {
+13 -13
crates/weaver-api/src/sh_weaver/graph/subscribe.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Notebook; 38 37 type CreatedAt; 38 + type Notebook; 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 Notebook = Unset; 45 44 type CreatedAt = Unset; 46 - } 47 - ///State transition - sets the `notebook` field to Set 48 - pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetNotebook<S> {} 50 - impl<S: State> State for SetNotebook<S> { 51 - type Notebook = Set<members::notebook>; 52 - type CreatedAt = S::CreatedAt; 45 + type Notebook = 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 Notebook = S::Notebook; 59 51 type CreatedAt = Set<members::created_at>; 52 + type Notebook = S::Notebook; 53 + } 54 + ///State transition - sets the `notebook` field to Set 55 + pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetNotebook<S> {} 57 + impl<S: State> State for SetNotebook<S> { 58 + type CreatedAt = S::CreatedAt; 59 + type Notebook = Set<members::notebook>; 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 `notebook` field 65 - pub struct notebook(()); 66 64 ///Marker type for the `created_at` field 67 65 pub struct created_at(()); 66 + ///Marker type for the `notebook` field 67 + pub struct notebook(()); 68 68 } 69 69 } 70 70 ··· 137 137 impl<'a, S> SubscribeBuilder<'a, S> 138 138 where 139 139 S: subscribe_state::State, 140 - S::Notebook: subscribe_state::IsSet, 141 140 S::CreatedAt: subscribe_state::IsSet, 141 + S::Notebook: subscribe_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> Subscribe<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/graph/tag.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 - type Tag; 41 40 type Subject; 42 41 type CreatedAt; 42 + type Tag; 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 Tag = Unset; 49 48 type Subject = Unset; 50 49 type CreatedAt = Unset; 51 - } 52 - ///State transition - sets the `tag` field to Set 53 - pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 54 - impl<S: State> sealed::Sealed for SetTag<S> {} 55 - impl<S: State> State for SetTag<S> { 56 - type Tag = Set<members::tag>; 57 - type Subject = S::Subject; 58 - type CreatedAt = S::CreatedAt; 50 + type Tag = Unset; 59 51 } 60 52 ///State transition - sets the `subject` field to Set 61 53 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 62 54 impl<S: State> sealed::Sealed for SetSubject<S> {} 63 55 impl<S: State> State for SetSubject<S> { 64 - type Tag = S::Tag; 65 56 type Subject = Set<members::subject>; 66 57 type CreatedAt = S::CreatedAt; 58 + type Tag = S::Tag; 67 59 } 68 60 ///State transition - sets the `created_at` field to Set 69 61 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 70 62 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 71 63 impl<S: State> State for SetCreatedAt<S> { 72 - type Tag = S::Tag; 73 64 type Subject = S::Subject; 74 65 type CreatedAt = Set<members::created_at>; 66 + type Tag = S::Tag; 67 + } 68 + ///State transition - sets the `tag` field to Set 69 + pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 70 + impl<S: State> sealed::Sealed for SetTag<S> {} 71 + impl<S: State> State for SetTag<S> { 72 + type Subject = S::Subject; 73 + type CreatedAt = S::CreatedAt; 74 + type Tag = Set<members::tag>; 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 `tag` field 80 - pub struct tag(()); 81 79 ///Marker type for the `subject` field 82 80 pub struct subject(()); 83 81 ///Marker type for the `created_at` field 84 82 pub struct created_at(()); 83 + ///Marker type for the `tag` field 84 + pub struct tag(()); 85 85 } 86 86 } 87 87 ··· 174 174 impl<'a, S> TagBuilder<'a, S> 175 175 where 176 176 S: tag_state::State, 177 - S::Tag: tag_state::IsSet, 178 177 S::Subject: tag_state::IsSet, 179 178 S::CreatedAt: tag_state::IsSet, 179 + S::Tag: tag_state::IsSet, 180 180 { 181 181 /// Build the final struct 182 182 pub fn build(self) -> Tag<'a> {
+272 -272
crates/weaver-api/src/sh_weaver/notebook.rs
··· 2174 2174 } 2175 2175 /// State trait tracking which required fields have been set 2176 2176 pub trait State: sealed::Sealed { 2177 - type Index; 2178 2177 type Entry; 2178 + type Index; 2179 2179 } 2180 2180 /// Empty state - all required fields are unset 2181 2181 pub struct Empty(()); 2182 2182 impl sealed::Sealed for Empty {} 2183 2183 impl State for Empty { 2184 + type Entry = Unset; 2184 2185 type Index = Unset; 2185 - type Entry = Unset; 2186 - } 2187 - ///State transition - sets the `index` field to Set 2188 - pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 2189 - impl<S: State> sealed::Sealed for SetIndex<S> {} 2190 - impl<S: State> State for SetIndex<S> { 2191 - type Index = Set<members::index>; 2192 - type Entry = S::Entry; 2193 2186 } 2194 2187 ///State transition - sets the `entry` field to Set 2195 2188 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 2196 2189 impl<S: State> sealed::Sealed for SetEntry<S> {} 2197 2190 impl<S: State> State for SetEntry<S> { 2198 - type Index = S::Index; 2199 2191 type Entry = Set<members::entry>; 2192 + type Index = S::Index; 2193 + } 2194 + ///State transition - sets the `index` field to Set 2195 + pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 2196 + impl<S: State> sealed::Sealed for SetIndex<S> {} 2197 + impl<S: State> State for SetIndex<S> { 2198 + type Entry = S::Entry; 2199 + type Index = Set<members::index>; 2200 2200 } 2201 2201 /// Marker types for field names 2202 2202 #[allow(non_camel_case_types)] 2203 2203 pub mod members { 2204 + ///Marker type for the `entry` field 2205 + pub struct entry(()); 2204 2206 ///Marker type for the `index` field 2205 2207 pub struct index(()); 2206 - ///Marker type for the `entry` field 2207 - pub struct entry(()); 2208 2208 } 2209 2209 } 2210 2210 ··· 2317 2317 impl<'a, S> BookEntryViewBuilder<'a, S> 2318 2318 where 2319 2319 S: book_entry_view_state::State, 2320 - S::Index: book_entry_view_state::IsSet, 2321 2320 S::Entry: book_entry_view_state::IsSet, 2321 + S::Index: book_entry_view_state::IsSet, 2322 2322 { 2323 2323 /// Build the final struct 2324 2324 pub fn build(self) -> BookEntryView<'a> { ··· 2399 2399 } 2400 2400 /// State trait tracking which required fields have been set 2401 2401 pub trait State: sealed::Sealed { 2402 - type Index; 2403 2402 type Entry; 2403 + type Index; 2404 2404 } 2405 2405 /// Empty state - all required fields are unset 2406 2406 pub struct Empty(()); 2407 2407 impl sealed::Sealed for Empty {} 2408 2408 impl State for Empty { 2409 - type Index = Unset; 2410 2409 type Entry = Unset; 2411 - } 2412 - ///State transition - sets the `index` field to Set 2413 - pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 2414 - impl<S: State> sealed::Sealed for SetIndex<S> {} 2415 - impl<S: State> State for SetIndex<S> { 2416 - type Index = Set<members::index>; 2417 - type Entry = S::Entry; 2410 + type Index = Unset; 2418 2411 } 2419 2412 ///State transition - sets the `entry` field to Set 2420 2413 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 2421 2414 impl<S: State> sealed::Sealed for SetEntry<S> {} 2422 2415 impl<S: State> State for SetEntry<S> { 2423 - type Index = S::Index; 2424 2416 type Entry = Set<members::entry>; 2417 + type Index = S::Index; 2418 + } 2419 + ///State transition - sets the `index` field to Set 2420 + pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 2421 + impl<S: State> sealed::Sealed for SetIndex<S> {} 2422 + impl<S: State> State for SetIndex<S> { 2423 + type Entry = S::Entry; 2424 + type Index = Set<members::index>; 2425 2425 } 2426 2426 /// Marker types for field names 2427 2427 #[allow(non_camel_case_types)] 2428 2428 pub mod members { 2429 + ///Marker type for the `entry` field 2430 + pub struct entry(()); 2429 2431 ///Marker type for the `index` field 2430 2432 pub struct index(()); 2431 - ///Marker type for the `entry` field 2432 - pub struct entry(()); 2433 2433 } 2434 2434 } 2435 2435 ··· 2542 2542 impl<'a, S> ChapterEntryViewBuilder<'a, S> 2543 2543 where 2544 2544 S: chapter_entry_view_state::State, 2545 - S::Index: chapter_entry_view_state::IsSet, 2546 2545 S::Entry: chapter_entry_view_state::IsSet, 2546 + S::Index: chapter_entry_view_state::IsSet, 2547 2547 { 2548 2548 /// Build the final struct 2549 2549 pub fn build(self) -> ChapterEntryView<'a> { ··· 2634 2634 } 2635 2635 /// State trait tracking which required fields have been set 2636 2636 pub trait State: sealed::Sealed { 2637 - type Cid; 2638 - type Authors; 2639 2637 type Record; 2638 + type Notebook; 2639 + type Cid; 2640 2640 type IndexedAt; 2641 + type Authors; 2641 2642 type Uri; 2642 - type Notebook; 2643 2643 } 2644 2644 /// Empty state - all required fields are unset 2645 2645 pub struct Empty(()); 2646 2646 impl sealed::Sealed for Empty {} 2647 2647 impl State for Empty { 2648 - type Cid = Unset; 2649 - type Authors = Unset; 2650 2648 type Record = Unset; 2649 + type Notebook = Unset; 2650 + type Cid = Unset; 2651 2651 type IndexedAt = Unset; 2652 + type Authors = Unset; 2652 2653 type Uri = Unset; 2653 - type Notebook = Unset; 2654 - } 2655 - ///State transition - sets the `cid` field to Set 2656 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2657 - impl<S: State> sealed::Sealed for SetCid<S> {} 2658 - impl<S: State> State for SetCid<S> { 2659 - type Cid = Set<members::cid>; 2660 - type Authors = S::Authors; 2661 - type Record = S::Record; 2662 - type IndexedAt = S::IndexedAt; 2663 - type Uri = S::Uri; 2664 - type Notebook = S::Notebook; 2665 - } 2666 - ///State transition - sets the `authors` field to Set 2667 - pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 2668 - impl<S: State> sealed::Sealed for SetAuthors<S> {} 2669 - impl<S: State> State for SetAuthors<S> { 2670 - type Cid = S::Cid; 2671 - type Authors = Set<members::authors>; 2672 - type Record = S::Record; 2673 - type IndexedAt = S::IndexedAt; 2674 - type Uri = S::Uri; 2675 - type Notebook = S::Notebook; 2676 2654 } 2677 2655 ///State transition - sets the `record` field to Set 2678 2656 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 2679 2657 impl<S: State> sealed::Sealed for SetRecord<S> {} 2680 2658 impl<S: State> State for SetRecord<S> { 2659 + type Record = Set<members::record>; 2660 + type Notebook = S::Notebook; 2681 2661 type Cid = S::Cid; 2662 + type IndexedAt = S::IndexedAt; 2682 2663 type Authors = S::Authors; 2683 - type Record = Set<members::record>; 2664 + type Uri = S::Uri; 2665 + } 2666 + ///State transition - sets the `notebook` field to Set 2667 + pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 2668 + impl<S: State> sealed::Sealed for SetNotebook<S> {} 2669 + impl<S: State> State for SetNotebook<S> { 2670 + type Record = S::Record; 2671 + type Notebook = Set<members::notebook>; 2672 + type Cid = S::Cid; 2684 2673 type IndexedAt = S::IndexedAt; 2674 + type Authors = S::Authors; 2685 2675 type Uri = S::Uri; 2676 + } 2677 + ///State transition - sets the `cid` field to Set 2678 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2679 + impl<S: State> sealed::Sealed for SetCid<S> {} 2680 + impl<S: State> State for SetCid<S> { 2681 + type Record = S::Record; 2686 2682 type Notebook = S::Notebook; 2683 + type Cid = Set<members::cid>; 2684 + type IndexedAt = S::IndexedAt; 2685 + type Authors = S::Authors; 2686 + type Uri = S::Uri; 2687 2687 } 2688 2688 ///State transition - sets the `indexed_at` field to Set 2689 2689 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2690 2690 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2691 2691 impl<S: State> State for SetIndexedAt<S> { 2692 + type Record = S::Record; 2693 + type Notebook = S::Notebook; 2692 2694 type Cid = S::Cid; 2693 - type Authors = S::Authors; 2694 - type Record = S::Record; 2695 2695 type IndexedAt = Set<members::indexed_at>; 2696 + type Authors = S::Authors; 2696 2697 type Uri = S::Uri; 2698 + } 2699 + ///State transition - sets the `authors` field to Set 2700 + pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 2701 + impl<S: State> sealed::Sealed for SetAuthors<S> {} 2702 + impl<S: State> State for SetAuthors<S> { 2703 + type Record = S::Record; 2697 2704 type Notebook = S::Notebook; 2705 + type Cid = S::Cid; 2706 + type IndexedAt = S::IndexedAt; 2707 + type Authors = Set<members::authors>; 2708 + type Uri = S::Uri; 2698 2709 } 2699 2710 ///State transition - sets the `uri` field to Set 2700 2711 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2701 2712 impl<S: State> sealed::Sealed for SetUri<S> {} 2702 2713 impl<S: State> State for SetUri<S> { 2703 - type Cid = S::Cid; 2704 - type Authors = S::Authors; 2705 2714 type Record = S::Record; 2706 - type IndexedAt = S::IndexedAt; 2707 - type Uri = Set<members::uri>; 2708 2715 type Notebook = S::Notebook; 2709 - } 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> { 2714 2716 type Cid = S::Cid; 2715 - type Authors = S::Authors; 2716 - type Record = S::Record; 2717 2717 type IndexedAt = S::IndexedAt; 2718 - type Uri = S::Uri; 2719 - type Notebook = Set<members::notebook>; 2718 + type Authors = S::Authors; 2719 + type Uri = Set<members::uri>; 2720 2720 } 2721 2721 /// Marker types for field names 2722 2722 #[allow(non_camel_case_types)] 2723 2723 pub mod members { 2724 - ///Marker type for the `cid` field 2725 - pub struct cid(()); 2726 - ///Marker type for the `authors` field 2727 - pub struct authors(()); 2728 2724 ///Marker type for the `record` field 2729 2725 pub struct record(()); 2726 + ///Marker type for the `notebook` field 2727 + pub struct notebook(()); 2728 + ///Marker type for the `cid` field 2729 + pub struct cid(()); 2730 2730 ///Marker type for the `indexed_at` field 2731 2731 pub struct indexed_at(()); 2732 + ///Marker type for the `authors` field 2733 + pub struct authors(()); 2732 2734 ///Marker type for the `uri` field 2733 2735 pub struct uri(()); 2734 - ///Marker type for the `notebook` field 2735 - pub struct notebook(()); 2736 2736 } 2737 2737 } 2738 2738 ··· 2949 2949 impl<'a, S> ChapterViewBuilder<'a, S> 2950 2950 where 2951 2951 S: chapter_view_state::State, 2952 - S::Cid: chapter_view_state::IsSet, 2953 - S::Authors: chapter_view_state::IsSet, 2954 2952 S::Record: chapter_view_state::IsSet, 2953 + S::Notebook: chapter_view_state::IsSet, 2954 + S::Cid: chapter_view_state::IsSet, 2955 2955 S::IndexedAt: chapter_view_state::IsSet, 2956 + S::Authors: chapter_view_state::IsSet, 2956 2957 S::Uri: chapter_view_state::IsSet, 2957 - S::Notebook: chapter_view_state::IsSet, 2958 2958 { 2959 2959 /// Build the final struct 2960 2960 pub fn build(self) -> ChapterView<'a> { ··· 3338 3338 } 3339 3339 /// State trait tracking which required fields have been set 3340 3340 pub trait State: sealed::Sealed { 3341 - type IndexedAt; 3342 - type Authors; 3343 - type Record; 3344 3341 type Uri; 3345 3342 type Cid; 3343 + type Record; 3344 + type IndexedAt; 3345 + type Authors; 3346 3346 } 3347 3347 /// Empty state - all required fields are unset 3348 3348 pub struct Empty(()); 3349 3349 impl sealed::Sealed for Empty {} 3350 3350 impl State for Empty { 3351 - type IndexedAt = Unset; 3352 - type Authors = Unset; 3353 - type Record = Unset; 3354 3351 type Uri = Unset; 3355 3352 type Cid = Unset; 3356 - } 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; 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>; 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> { 3381 - type IndexedAt = S::IndexedAt; 3382 - type Authors = S::Authors; 3383 - type Record = Set<members::record>; 3384 - type Uri = S::Uri; 3385 - type Cid = S::Cid; 3353 + type Record = Unset; 3354 + type IndexedAt = Unset; 3355 + type Authors = Unset; 3386 3356 } 3387 3357 ///State transition - sets the `uri` field to Set 3388 3358 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3389 3359 impl<S: State> sealed::Sealed for SetUri<S> {} 3390 3360 impl<S: State> State for SetUri<S> { 3391 - type IndexedAt = S::IndexedAt; 3392 - type Authors = S::Authors; 3393 - type Record = S::Record; 3394 3361 type Uri = Set<members::uri>; 3395 3362 type Cid = S::Cid; 3363 + type Record = S::Record; 3364 + type IndexedAt = S::IndexedAt; 3365 + type Authors = S::Authors; 3396 3366 } 3397 3367 ///State transition - sets the `cid` field to Set 3398 3368 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3399 3369 impl<S: State> sealed::Sealed for SetCid<S> {} 3400 3370 impl<S: State> State for SetCid<S> { 3371 + type Uri = S::Uri; 3372 + type Cid = Set<members::cid>; 3373 + type Record = S::Record; 3401 3374 type IndexedAt = S::IndexedAt; 3402 3375 type Authors = S::Authors; 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> { 3381 + type Uri = S::Uri; 3382 + type Cid = S::Cid; 3383 + type Record = Set<members::record>; 3384 + type IndexedAt = S::IndexedAt; 3385 + type Authors = S::Authors; 3386 + } 3387 + ///State transition - sets the `indexed_at` field to Set 3388 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3389 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3390 + impl<S: State> State for SetIndexedAt<S> { 3391 + type Uri = S::Uri; 3392 + type Cid = S::Cid; 3403 3393 type Record = S::Record; 3394 + type IndexedAt = Set<members::indexed_at>; 3395 + type Authors = S::Authors; 3396 + } 3397 + ///State transition - sets the `authors` field to Set 3398 + pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 3399 + impl<S: State> sealed::Sealed for SetAuthors<S> {} 3400 + impl<S: State> State for SetAuthors<S> { 3404 3401 type Uri = S::Uri; 3405 - type Cid = Set<members::cid>; 3402 + type Cid = S::Cid; 3403 + type Record = S::Record; 3404 + type IndexedAt = S::IndexedAt; 3405 + type Authors = Set<members::authors>; 3406 3406 } 3407 3407 /// Marker types for field names 3408 3408 #[allow(non_camel_case_types)] 3409 3409 pub mod members { 3410 - ///Marker type for the `indexed_at` field 3411 - pub struct indexed_at(()); 3412 - ///Marker type for the `authors` field 3413 - pub struct authors(()); 3414 - ///Marker type for the `record` field 3415 - pub struct record(()); 3416 3410 ///Marker type for the `uri` field 3417 3411 pub struct uri(()); 3418 3412 ///Marker type for the `cid` field 3419 3413 pub struct cid(()); 3414 + ///Marker type for the `record` field 3415 + pub struct record(()); 3416 + ///Marker type for the `indexed_at` field 3417 + pub struct indexed_at(()); 3418 + ///Marker type for the `authors` field 3419 + pub struct authors(()); 3420 3420 } 3421 3421 } 3422 3422 ··· 3753 3753 impl<'a, S> EntryViewBuilder<'a, S> 3754 3754 where 3755 3755 S: entry_view_state::State, 3756 - S::IndexedAt: entry_view_state::IsSet, 3757 - S::Authors: entry_view_state::IsSet, 3758 - S::Record: entry_view_state::IsSet, 3759 3756 S::Uri: entry_view_state::IsSet, 3760 3757 S::Cid: entry_view_state::IsSet, 3758 + S::Record: entry_view_state::IsSet, 3759 + S::IndexedAt: entry_view_state::IsSet, 3760 + S::Authors: entry_view_state::IsSet, 3761 3761 { 3762 3762 /// Build the final struct 3763 3763 pub fn build(self) -> EntryView<'a> { ··· 4049 4049 } 4050 4050 /// State trait tracking which required fields have been set 4051 4051 pub trait State: sealed::Sealed { 4052 - type Uri; 4053 4052 type Title; 4053 + type Uri; 4054 4054 } 4055 4055 /// Empty state - all required fields are unset 4056 4056 pub struct Empty(()); 4057 4057 impl sealed::Sealed for Empty {} 4058 4058 impl State for Empty { 4059 - type Uri = Unset; 4060 4059 type Title = Unset; 4061 - } 4062 - ///State transition - sets the `uri` field to Set 4063 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4064 - impl<S: State> sealed::Sealed for SetUri<S> {} 4065 - impl<S: State> State for SetUri<S> { 4066 - type Uri = Set<members::uri>; 4067 - type Title = S::Title; 4060 + type Uri = Unset; 4068 4061 } 4069 4062 ///State transition - sets the `title` field to Set 4070 4063 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 4071 4064 impl<S: State> sealed::Sealed for SetTitle<S> {} 4072 4065 impl<S: State> State for SetTitle<S> { 4073 - type Uri = S::Uri; 4074 4066 type Title = Set<members::title>; 4067 + type Uri = S::Uri; 4068 + } 4069 + ///State transition - sets the `uri` field to Set 4070 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4071 + impl<S: State> sealed::Sealed for SetUri<S> {} 4072 + impl<S: State> State for SetUri<S> { 4073 + type Title = S::Title; 4074 + type Uri = Set<members::uri>; 4075 4075 } 4076 4076 /// Marker types for field names 4077 4077 #[allow(non_camel_case_types)] 4078 4078 pub mod members { 4079 + ///Marker type for the `title` field 4080 + pub struct title(()); 4079 4081 ///Marker type for the `uri` field 4080 4082 pub struct uri(()); 4081 - ///Marker type for the `title` field 4082 - pub struct title(()); 4083 4083 } 4084 4084 } 4085 4085 ··· 4169 4169 impl<'a, S> FeedNotebookContextBuilder<'a, S> 4170 4170 where 4171 4171 S: feed_notebook_context_state::State, 4172 - S::Uri: feed_notebook_context_state::IsSet, 4173 4172 S::Title: feed_notebook_context_state::IsSet, 4173 + S::Uri: feed_notebook_context_state::IsSet, 4174 4174 { 4175 4175 /// Build the final struct 4176 4176 pub fn build(self) -> FeedNotebookContext<'a> { ··· 4309 4309 /// State trait tracking which required fields have been set 4310 4310 pub trait State: sealed::Sealed { 4311 4311 type Record; 4312 + type IndexedAt; 4312 4313 type Cid; 4313 - type Uri; 4314 4314 type Authors; 4315 - type IndexedAt; 4315 + type Uri; 4316 4316 } 4317 4317 /// Empty state - all required fields are unset 4318 4318 pub struct Empty(()); 4319 4319 impl sealed::Sealed for Empty {} 4320 4320 impl State for Empty { 4321 4321 type Record = Unset; 4322 + type IndexedAt = Unset; 4322 4323 type Cid = Unset; 4323 - type Uri = Unset; 4324 4324 type Authors = Unset; 4325 - type IndexedAt = Unset; 4325 + type Uri = Unset; 4326 4326 } 4327 4327 ///State transition - sets the `record` field to Set 4328 4328 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 4329 4329 impl<S: State> sealed::Sealed for SetRecord<S> {} 4330 4330 impl<S: State> State for SetRecord<S> { 4331 4331 type Record = Set<members::record>; 4332 + type IndexedAt = S::IndexedAt; 4332 4333 type Cid = S::Cid; 4334 + type Authors = S::Authors; 4333 4335 type Uri = S::Uri; 4336 + } 4337 + ///State transition - sets the `indexed_at` field to Set 4338 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 4339 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 4340 + impl<S: State> State for SetIndexedAt<S> { 4341 + type Record = S::Record; 4342 + type IndexedAt = Set<members::indexed_at>; 4343 + type Cid = S::Cid; 4334 4344 type Authors = S::Authors; 4335 - type IndexedAt = S::IndexedAt; 4345 + type Uri = S::Uri; 4336 4346 } 4337 4347 ///State transition - sets the `cid` field to Set 4338 4348 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 4339 4349 impl<S: State> sealed::Sealed for SetCid<S> {} 4340 4350 impl<S: State> State for SetCid<S> { 4341 4351 type Record = S::Record; 4342 - type Cid = Set<members::cid>; 4343 - type Uri = S::Uri; 4344 - type Authors = S::Authors; 4345 4352 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> { 4351 - type Record = S::Record; 4352 - type Cid = S::Cid; 4353 - type Uri = Set<members::uri>; 4353 + type Cid = Set<members::cid>; 4354 4354 type Authors = S::Authors; 4355 - type IndexedAt = S::IndexedAt; 4355 + type Uri = S::Uri; 4356 4356 } 4357 4357 ///State transition - sets the `authors` field to Set 4358 4358 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 4359 4359 impl<S: State> sealed::Sealed for SetAuthors<S> {} 4360 4360 impl<S: State> State for SetAuthors<S> { 4361 4361 type Record = S::Record; 4362 + type IndexedAt = S::IndexedAt; 4362 4363 type Cid = S::Cid; 4363 - type Uri = S::Uri; 4364 4364 type Authors = Set<members::authors>; 4365 - type IndexedAt = S::IndexedAt; 4365 + type Uri = S::Uri; 4366 4366 } 4367 - ///State transition - sets the `indexed_at` field to Set 4368 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 4369 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 4370 - impl<S: State> State for SetIndexedAt<S> { 4367 + ///State transition - sets the `uri` field to Set 4368 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4369 + impl<S: State> sealed::Sealed for SetUri<S> {} 4370 + impl<S: State> State for SetUri<S> { 4371 4371 type Record = S::Record; 4372 + type IndexedAt = S::IndexedAt; 4372 4373 type Cid = S::Cid; 4373 - type Uri = S::Uri; 4374 4374 type Authors = S::Authors; 4375 - type IndexedAt = Set<members::indexed_at>; 4375 + type Uri = Set<members::uri>; 4376 4376 } 4377 4377 /// Marker types for field names 4378 4378 #[allow(non_camel_case_types)] 4379 4379 pub mod members { 4380 4380 ///Marker type for the `record` field 4381 4381 pub struct record(()); 4382 + ///Marker type for the `indexed_at` field 4383 + pub struct indexed_at(()); 4382 4384 ///Marker type for the `cid` field 4383 4385 pub struct cid(()); 4384 - ///Marker type for the `uri` field 4385 - pub struct uri(()); 4386 4386 ///Marker type for the `authors` field 4387 4387 pub struct authors(()); 4388 - ///Marker type for the `indexed_at` field 4389 - pub struct indexed_at(()); 4388 + ///Marker type for the `uri` field 4389 + pub struct uri(()); 4390 4390 } 4391 4391 } 4392 4392 ··· 4754 4754 where 4755 4755 S: notebook_view_state::State, 4756 4756 S::Record: notebook_view_state::IsSet, 4757 + S::IndexedAt: notebook_view_state::IsSet, 4757 4758 S::Cid: notebook_view_state::IsSet, 4758 - S::Uri: notebook_view_state::IsSet, 4759 4759 S::Authors: notebook_view_state::IsSet, 4760 - S::IndexedAt: notebook_view_state::IsSet, 4760 + S::Uri: notebook_view_state::IsSet, 4761 4761 { 4762 4762 /// Build the final struct 4763 4763 pub fn build(self) -> NotebookView<'a> { ··· 4872 4872 } 4873 4873 /// State trait tracking which required fields have been set 4874 4874 pub trait State: sealed::Sealed { 4875 + type IndexedAt; 4875 4876 type Notebook; 4876 4877 type Uri; 4877 - type Record; 4878 4878 type Cid; 4879 - type IndexedAt; 4879 + type Record; 4880 4880 } 4881 4881 /// Empty state - all required fields are unset 4882 4882 pub struct Empty(()); 4883 4883 impl sealed::Sealed for Empty {} 4884 4884 impl State for Empty { 4885 + type IndexedAt = Unset; 4885 4886 type Notebook = Unset; 4886 4887 type Uri = Unset; 4887 - type Record = Unset; 4888 4888 type Cid = Unset; 4889 - type IndexedAt = Unset; 4889 + type Record = Unset; 4890 + } 4891 + ///State transition - sets the `indexed_at` field to Set 4892 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 4893 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 4894 + impl<S: State> State for SetIndexedAt<S> { 4895 + type IndexedAt = Set<members::indexed_at>; 4896 + type Notebook = S::Notebook; 4897 + type Uri = S::Uri; 4898 + type Cid = S::Cid; 4899 + type Record = S::Record; 4890 4900 } 4891 4901 ///State transition - sets the `notebook` field to Set 4892 4902 pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 4893 4903 impl<S: State> sealed::Sealed for SetNotebook<S> {} 4894 4904 impl<S: State> State for SetNotebook<S> { 4905 + type IndexedAt = S::IndexedAt; 4895 4906 type Notebook = Set<members::notebook>; 4896 4907 type Uri = S::Uri; 4897 - type Record = S::Record; 4898 4908 type Cid = S::Cid; 4899 - type IndexedAt = S::IndexedAt; 4909 + type Record = S::Record; 4900 4910 } 4901 4911 ///State transition - sets the `uri` field to Set 4902 4912 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4903 4913 impl<S: State> sealed::Sealed for SetUri<S> {} 4904 4914 impl<S: State> State for SetUri<S> { 4905 - type Notebook = S::Notebook; 4906 - type Uri = Set<members::uri>; 4907 - type Record = S::Record; 4908 - type Cid = S::Cid; 4909 4915 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 4916 type Notebook = S::Notebook; 4916 - type Uri = S::Uri; 4917 - type Record = Set<members::record>; 4917 + type Uri = Set<members::uri>; 4918 4918 type Cid = S::Cid; 4919 - type IndexedAt = S::IndexedAt; 4919 + type Record = S::Record; 4920 4920 } 4921 4921 ///State transition - sets the `cid` field to Set 4922 4922 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 4923 4923 impl<S: State> sealed::Sealed for SetCid<S> {} 4924 4924 impl<S: State> State for SetCid<S> { 4925 + type IndexedAt = S::IndexedAt; 4925 4926 type Notebook = S::Notebook; 4926 4927 type Uri = S::Uri; 4928 + type Cid = Set<members::cid>; 4927 4929 type Record = S::Record; 4928 - type Cid = Set<members::cid>; 4929 - type IndexedAt = S::IndexedAt; 4930 4930 } 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> { 4931 + ///State transition - sets the `record` field to Set 4932 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 4933 + impl<S: State> sealed::Sealed for SetRecord<S> {} 4934 + impl<S: State> State for SetRecord<S> { 4935 + type IndexedAt = S::IndexedAt; 4935 4936 type Notebook = S::Notebook; 4936 4937 type Uri = S::Uri; 4937 - type Record = S::Record; 4938 4938 type Cid = S::Cid; 4939 - type IndexedAt = Set<members::indexed_at>; 4939 + type Record = Set<members::record>; 4940 4940 } 4941 4941 /// Marker types for field names 4942 4942 #[allow(non_camel_case_types)] 4943 4943 pub mod members { 4944 + ///Marker type for the `indexed_at` field 4945 + pub struct indexed_at(()); 4944 4946 ///Marker type for the `notebook` field 4945 4947 pub struct notebook(()); 4946 4948 ///Marker type for the `uri` field 4947 4949 pub struct uri(()); 4950 + ///Marker type for the `cid` field 4951 + pub struct cid(()); 4948 4952 ///Marker type for the `record` field 4949 4953 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(()); 4954 4954 } 4955 4955 } 4956 4956 ··· 5137 5137 impl<'a, S> PageViewBuilder<'a, S> 5138 5138 where 5139 5139 S: page_view_state::State, 5140 + S::IndexedAt: page_view_state::IsSet, 5140 5141 S::Notebook: page_view_state::IsSet, 5141 5142 S::Uri: page_view_state::IsSet, 5142 - S::Record: page_view_state::IsSet, 5143 5143 S::Cid: page_view_state::IsSet, 5144 - S::IndexedAt: page_view_state::IsSet, 5144 + S::Record: page_view_state::IsSet, 5145 5145 { 5146 5146 /// Build the final struct 5147 5147 pub fn build(self) -> PageView<'a> { ··· 5233 5233 } 5234 5234 /// State trait tracking which required fields have been set 5235 5235 pub trait State: sealed::Sealed { 5236 - type GrantedAt; 5237 - type Scope; 5238 5236 type Did; 5237 + type Scope; 5238 + type GrantedAt; 5239 5239 type Source; 5240 5240 } 5241 5241 /// Empty state - all required fields are unset 5242 5242 pub struct Empty(()); 5243 5243 impl sealed::Sealed for Empty {} 5244 5244 impl State for Empty { 5245 - type GrantedAt = Unset; 5246 - type Scope = Unset; 5247 5245 type Did = Unset; 5246 + type Scope = Unset; 5247 + type GrantedAt = Unset; 5248 5248 type Source = Unset; 5249 5249 } 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>; 5250 + ///State transition - sets the `did` field to Set 5251 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 5252 + impl<S: State> sealed::Sealed for SetDid<S> {} 5253 + impl<S: State> State for SetDid<S> { 5254 + type Did = Set<members::did>; 5255 5255 type Scope = S::Scope; 5256 - type Did = S::Did; 5256 + type GrantedAt = S::GrantedAt; 5257 5257 type Source = S::Source; 5258 5258 } 5259 5259 ///State transition - sets the `scope` field to Set 5260 5260 pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 5261 5261 impl<S: State> sealed::Sealed for SetScope<S> {} 5262 5262 impl<S: State> State for SetScope<S> { 5263 - type GrantedAt = S::GrantedAt; 5264 - type Scope = Set<members::scope>; 5265 5263 type Did = S::Did; 5264 + type Scope = Set<members::scope>; 5265 + type GrantedAt = S::GrantedAt; 5266 5266 type Source = S::Source; 5267 5267 } 5268 - ///State transition - sets the `did` field to Set 5269 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 5270 - impl<S: State> sealed::Sealed for SetDid<S> {} 5271 - impl<S: State> State for SetDid<S> { 5272 - type GrantedAt = S::GrantedAt; 5268 + ///State transition - sets the `granted_at` field to Set 5269 + pub struct SetGrantedAt<S: State = Empty>(PhantomData<fn() -> S>); 5270 + impl<S: State> sealed::Sealed for SetGrantedAt<S> {} 5271 + impl<S: State> State for SetGrantedAt<S> { 5272 + type Did = S::Did; 5273 5273 type Scope = S::Scope; 5274 - type Did = Set<members::did>; 5274 + type GrantedAt = Set<members::granted_at>; 5275 5275 type Source = S::Source; 5276 5276 } 5277 5277 ///State transition - sets the `source` field to Set 5278 5278 pub struct SetSource<S: State = Empty>(PhantomData<fn() -> S>); 5279 5279 impl<S: State> sealed::Sealed for SetSource<S> {} 5280 5280 impl<S: State> State for SetSource<S> { 5281 - type GrantedAt = S::GrantedAt; 5282 - type Scope = S::Scope; 5283 5281 type Did = S::Did; 5282 + type Scope = S::Scope; 5283 + type GrantedAt = S::GrantedAt; 5284 5284 type Source = Set<members::source>; 5285 5285 } 5286 5286 /// Marker types for field names 5287 5287 #[allow(non_camel_case_types)] 5288 5288 pub mod members { 5289 - ///Marker type for the `granted_at` field 5290 - pub struct granted_at(()); 5291 - ///Marker type for the `scope` field 5292 - pub struct scope(()); 5293 5289 ///Marker type for the `did` field 5294 5290 pub struct did(()); 5291 + ///Marker type for the `scope` field 5292 + pub struct scope(()); 5293 + ///Marker type for the `granted_at` field 5294 + pub struct granted_at(()); 5295 5295 ///Marker type for the `source` field 5296 5296 pub struct source(()); 5297 5297 } ··· 5406 5406 impl<'a, S> PermissionGrantBuilder<'a, S> 5407 5407 where 5408 5408 S: permission_grant_state::State, 5409 - S::GrantedAt: permission_grant_state::IsSet, 5410 - S::Scope: permission_grant_state::IsSet, 5411 5409 S::Did: permission_grant_state::IsSet, 5410 + S::Scope: permission_grant_state::IsSet, 5411 + S::GrantedAt: permission_grant_state::IsSet, 5412 5412 S::Source: permission_grant_state::IsSet, 5413 5413 { 5414 5414 /// Build the final struct ··· 5758 5758 } 5759 5759 /// State trait tracking which required fields have been set 5760 5760 pub trait State: sealed::Sealed { 5761 - type Publisher; 5762 5761 type PublishedAt; 5763 - type Cid; 5762 + type Publisher; 5764 5763 type Uri; 5764 + type Cid; 5765 5765 } 5766 5766 /// Empty state - all required fields are unset 5767 5767 pub struct Empty(()); 5768 5768 impl sealed::Sealed for Empty {} 5769 5769 impl State for Empty { 5770 - type Publisher = Unset; 5771 5770 type PublishedAt = Unset; 5772 - type Cid = Unset; 5771 + type Publisher = Unset; 5773 5772 type Uri = Unset; 5774 - } 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>; 5780 - type PublishedAt = S::PublishedAt; 5781 - type Cid = S::Cid; 5782 - type Uri = S::Uri; 5773 + type Cid = Unset; 5783 5774 } 5784 5775 ///State transition - sets the `published_at` field to Set 5785 5776 pub struct SetPublishedAt<S: State = Empty>(PhantomData<fn() -> S>); 5786 5777 impl<S: State> sealed::Sealed for SetPublishedAt<S> {} 5787 5778 impl<S: State> State for SetPublishedAt<S> { 5788 - type Publisher = S::Publisher; 5789 5779 type PublishedAt = Set<members::published_at>; 5790 - type Cid = S::Cid; 5780 + type Publisher = S::Publisher; 5791 5781 type Uri = S::Uri; 5782 + type Cid = S::Cid; 5792 5783 } 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> { 5797 - type Publisher = S::Publisher; 5784 + ///State transition - sets the `publisher` field to Set 5785 + pub struct SetPublisher<S: State = Empty>(PhantomData<fn() -> S>); 5786 + impl<S: State> sealed::Sealed for SetPublisher<S> {} 5787 + impl<S: State> State for SetPublisher<S> { 5798 5788 type PublishedAt = S::PublishedAt; 5799 - type Cid = Set<members::cid>; 5789 + type Publisher = Set<members::publisher>; 5800 5790 type Uri = S::Uri; 5791 + type Cid = S::Cid; 5801 5792 } 5802 5793 ///State transition - sets the `uri` field to Set 5803 5794 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 5804 5795 impl<S: State> sealed::Sealed for SetUri<S> {} 5805 5796 impl<S: State> State for SetUri<S> { 5806 - type Publisher = S::Publisher; 5807 5797 type PublishedAt = S::PublishedAt; 5808 - type Cid = S::Cid; 5798 + type Publisher = S::Publisher; 5809 5799 type Uri = Set<members::uri>; 5800 + type Cid = S::Cid; 5801 + } 5802 + ///State transition - sets the `cid` field to Set 5803 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 5804 + impl<S: State> sealed::Sealed for SetCid<S> {} 5805 + impl<S: State> State for SetCid<S> { 5806 + type PublishedAt = S::PublishedAt; 5807 + type Publisher = S::Publisher; 5808 + type Uri = S::Uri; 5809 + type Cid = Set<members::cid>; 5810 5810 } 5811 5811 /// Marker types for field names 5812 5812 #[allow(non_camel_case_types)] 5813 5813 pub mod members { 5814 + ///Marker type for the `published_at` field 5815 + pub struct published_at(()); 5814 5816 ///Marker type for the `publisher` field 5815 5817 pub struct publisher(()); 5816 - ///Marker type for the `published_at` field 5817 - pub struct published_at(()); 5818 + ///Marker type for the `uri` field 5819 + pub struct uri(()); 5818 5820 ///Marker type for the `cid` field 5819 5821 pub struct cid(()); 5820 - ///Marker type for the `uri` field 5821 - pub struct uri(()); 5822 5822 } 5823 5823 } 5824 5824 ··· 5991 5991 impl<'a, S> PublishedVersionViewBuilder<'a, S> 5992 5992 where 5993 5993 S: published_version_view_state::State, 5994 - S::Publisher: published_version_view_state::IsSet, 5995 5994 S::PublishedAt: published_version_view_state::IsSet, 5996 - S::Cid: published_version_view_state::IsSet, 5995 + S::Publisher: published_version_view_state::IsSet, 5997 5996 S::Uri: published_version_view_state::IsSet, 5997 + S::Cid: published_version_view_state::IsSet, 5998 5998 { 5999 5999 /// Build the final struct 6000 6000 pub fn build(self) -> PublishedVersionView<'a> { ··· 6418 6418 } 6419 6419 /// State trait tracking which required fields have been set 6420 6420 pub trait State: sealed::Sealed { 6421 - type By; 6422 6421 type IndexedAt; 6422 + type By; 6423 6423 } 6424 6424 /// Empty state - all required fields are unset 6425 6425 pub struct Empty(()); 6426 6426 impl sealed::Sealed for Empty {} 6427 6427 impl State for Empty { 6428 - type By = Unset; 6429 6428 type IndexedAt = 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 + type By = Unset; 6437 6430 } 6438 6431 ///State transition - sets the `indexed_at` field to Set 6439 6432 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 6440 6433 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 6441 6434 impl<S: State> State for SetIndexedAt<S> { 6442 - type By = S::By; 6443 6435 type IndexedAt = Set<members::indexed_at>; 6436 + type By = S::By; 6437 + } 6438 + ///State transition - sets the `by` field to Set 6439 + pub struct SetBy<S: State = Empty>(PhantomData<fn() -> S>); 6440 + impl<S: State> sealed::Sealed for SetBy<S> {} 6441 + impl<S: State> State for SetBy<S> { 6442 + type IndexedAt = S::IndexedAt; 6443 + type By = Set<members::by>; 6444 6444 } 6445 6445 /// Marker types for field names 6446 6446 #[allow(non_camel_case_types)] 6447 6447 pub mod members { 6448 - ///Marker type for the `by` field 6449 - pub struct by(()); 6450 6448 ///Marker type for the `indexed_at` field 6451 6449 pub struct indexed_at(()); 6450 + ///Marker type for the `by` field 6451 + pub struct by(()); 6452 6452 } 6453 6453 } 6454 6454 ··· 6521 6521 impl<'a, S> ReasonLikeBuilder<'a, S> 6522 6522 where 6523 6523 S: reason_like_state::State, 6524 - S::By: reason_like_state::IsSet, 6525 6524 S::IndexedAt: reason_like_state::IsSet, 6525 + S::By: reason_like_state::IsSet, 6526 6526 { 6527 6527 /// Build the final struct 6528 6528 pub fn build(self) -> ReasonLike<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/notebook/book.rs
··· 63 63 } 64 64 /// State trait tracking which required fields have been set 65 65 pub trait State: sealed::Sealed { 66 - type Authors; 67 66 type EntryList; 67 + type Authors; 68 68 } 69 69 /// Empty state - all required fields are unset 70 70 pub struct Empty(()); 71 71 impl sealed::Sealed for Empty {} 72 72 impl State for Empty { 73 - type Authors = Unset; 74 73 type EntryList = Unset; 75 - } 76 - ///State transition - sets the `authors` field to Set 77 - pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 78 - impl<S: State> sealed::Sealed for SetAuthors<S> {} 79 - impl<S: State> State for SetAuthors<S> { 80 - type Authors = Set<members::authors>; 81 - type EntryList = S::EntryList; 74 + type Authors = Unset; 82 75 } 83 76 ///State transition - sets the `entry_list` field to Set 84 77 pub struct SetEntryList<S: State = Empty>(PhantomData<fn() -> S>); 85 78 impl<S: State> sealed::Sealed for SetEntryList<S> {} 86 79 impl<S: State> State for SetEntryList<S> { 87 - type Authors = S::Authors; 88 80 type EntryList = Set<members::entry_list>; 81 + type Authors = S::Authors; 82 + } 83 + ///State transition - sets the `authors` field to Set 84 + pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 85 + impl<S: State> sealed::Sealed for SetAuthors<S> {} 86 + impl<S: State> State for SetAuthors<S> { 87 + type EntryList = S::EntryList; 88 + type Authors = Set<members::authors>; 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 `authors` field 94 - pub struct authors(()); 95 93 ///Marker type for the `entry_list` field 96 94 pub struct entry_list(()); 95 + ///Marker type for the `authors` field 96 + pub struct authors(()); 97 97 } 98 98 } 99 99 ··· 352 352 impl<'a, S> BookBuilder<'a, S> 353 353 where 354 354 S: book_state::State, 355 - S::Authors: book_state::IsSet, 356 355 S::EntryList: book_state::IsSet, 356 + S::Authors: book_state::IsSet, 357 357 { 358 358 /// Build the final struct 359 359 pub fn build(self) -> Book<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs
··· 38 38 } 39 39 /// State trait tracking which required fields have been set 40 40 pub trait State: sealed::Sealed { 41 + type Colours; 41 42 type Name; 42 43 type Variant; 43 - type Colours; 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 Colours = Unset; 49 50 type Name = Unset; 50 51 type Variant = Unset; 51 - type Colours = Unset; 52 + } 53 + ///State transition - sets the `colours` field to Set 54 + pub struct SetColours<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetColours<S> {} 56 + impl<S: State> State for SetColours<S> { 57 + type Colours = Set<members::colours>; 58 + type Name = S::Name; 59 + type Variant = S::Variant; 52 60 } 53 61 ///State transition - sets the `name` field to Set 54 62 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 55 63 impl<S: State> sealed::Sealed for SetName<S> {} 56 64 impl<S: State> State for SetName<S> { 65 + type Colours = S::Colours; 57 66 type Name = Set<members::name>; 58 67 type Variant = S::Variant; 59 - type Colours = S::Colours; 60 68 } 61 69 ///State transition - sets the `variant` field to Set 62 70 pub struct SetVariant<S: State = Empty>(PhantomData<fn() -> S>); 63 71 impl<S: State> sealed::Sealed for SetVariant<S> {} 64 72 impl<S: State> State for SetVariant<S> { 65 - type Name = S::Name; 66 - type Variant = Set<members::variant>; 67 73 type Colours = S::Colours; 68 - } 69 - ///State transition - sets the `colours` field to Set 70 - pub struct SetColours<S: State = Empty>(PhantomData<fn() -> S>); 71 - impl<S: State> sealed::Sealed for SetColours<S> {} 72 - impl<S: State> State for SetColours<S> { 73 74 type Name = S::Name; 74 - type Variant = S::Variant; 75 - type Colours = Set<members::colours>; 75 + type Variant = Set<members::variant>; 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 `colours` field 81 + pub struct colours(()); 80 82 ///Marker type for the `name` field 81 83 pub struct name(()); 82 84 ///Marker type for the `variant` field 83 85 pub struct variant(()); 84 - ///Marker type for the `colours` field 85 - pub struct colours(()); 86 86 } 87 87 } 88 88 ··· 175 175 impl<'a, S> ColourSchemeBuilder<'a, S> 176 176 where 177 177 S: colour_scheme_state::State, 178 + S::Colours: colour_scheme_state::IsSet, 178 179 S::Name: colour_scheme_state::IsSet, 179 180 S::Variant: colour_scheme_state::IsSet, 180 - S::Colours: colour_scheme_state::IsSet, 181 181 { 182 182 /// Build the final struct 183 183 pub fn build(self) -> ColourScheme<'a> {
+26 -26
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; 63 + type CreatedAt; 64 64 type Title; 65 65 type Content; 66 - type CreatedAt; 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 Path = Unset; 72 + type CreatedAt = Unset; 73 73 type Title = Unset; 74 74 type Content = Unset; 75 - type CreatedAt = Unset; 75 + type Path = Unset; 76 76 } 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>; 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 82 type Title = S::Title; 83 83 type Content = S::Content; 84 - type CreatedAt = S::CreatedAt; 84 + type Path = S::Path; 85 85 } 86 86 ///State transition - sets the `title` field to Set 87 87 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 88 88 impl<S: State> sealed::Sealed for SetTitle<S> {} 89 89 impl<S: State> State for SetTitle<S> { 90 - type Path = S::Path; 90 + type CreatedAt = S::CreatedAt; 91 91 type Title = Set<members::title>; 92 92 type Content = S::Content; 93 - type CreatedAt = S::CreatedAt; 93 + type Path = S::Path; 94 94 } 95 95 ///State transition - sets the `content` field to Set 96 96 pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 97 97 impl<S: State> sealed::Sealed for SetContent<S> {} 98 98 impl<S: State> State for SetContent<S> { 99 - type Path = S::Path; 99 + type CreatedAt = S::CreatedAt; 100 100 type Title = S::Title; 101 101 type Content = Set<members::content>; 102 - type CreatedAt = S::CreatedAt; 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 102 type Path = S::Path; 103 + } 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> { 108 + type CreatedAt = S::CreatedAt; 109 109 type Title = S::Title; 110 110 type Content = S::Content; 111 - type CreatedAt = Set<members::created_at>; 111 + type Path = Set<members::path>; 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 `path` field 117 - pub struct path(()); 116 + ///Marker type for the `created_at` field 117 + pub struct created_at(()); 118 118 ///Marker type for the `title` field 119 119 pub struct title(()); 120 120 ///Marker type for the `content` field 121 121 pub struct content(()); 122 - ///Marker type for the `created_at` field 123 - pub struct created_at(()); 122 + ///Marker type for the `path` field 123 + pub struct path(()); 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::Path: entry_state::IsSet, 361 + S::CreatedAt: entry_state::IsSet, 362 362 S::Title: entry_state::IsSet, 363 363 S::Content: entry_state::IsSet, 364 - S::CreatedAt: entry_state::IsSet, 364 + S::Path: 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 Uri; 192 191 type Cid; 192 + type Uri; 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 Uri = Unset; 199 198 type Cid = Unset; 200 - } 201 - ///State transition - sets the `uri` field to Set 202 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 203 - impl<S: State> sealed::Sealed for SetUri<S> {} 204 - impl<S: State> State for SetUri<S> { 205 - type Uri = Set<members::uri>; 206 - type Cid = S::Cid; 199 + type Uri = Unset; 207 200 } 208 201 ///State transition - sets the `cid` field to Set 209 202 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 210 203 impl<S: State> sealed::Sealed for SetCid<S> {} 211 204 impl<S: State> State for SetCid<S> { 212 - type Uri = S::Uri; 213 205 type Cid = Set<members::cid>; 206 + type Uri = S::Uri; 207 + } 208 + ///State transition - sets the `uri` field to Set 209 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 210 + impl<S: State> sealed::Sealed for SetUri<S> {} 211 + impl<S: State> State for SetUri<S> { 212 + type Cid = S::Cid; 213 + type Uri = Set<members::uri>; 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 `uri` field 219 - pub struct uri(()); 220 218 ///Marker type for the `cid` field 221 219 pub struct cid(()); 220 + ///Marker type for the `uri` field 221 + pub struct uri(()); 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::Uri: notebook_ref_state::IsSet, 332 331 S::Cid: notebook_ref_state::IsSet, 332 + S::Uri: 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_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 Progress; 218 217 type Notebook; 218 + type Progress; 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 Progress = Unset; 225 224 type Notebook = Unset; 226 - } 227 - ///State transition - sets the `progress` field to Set 228 - pub struct SetProgress<S: State = Empty>(PhantomData<fn() -> S>); 229 - impl<S: State> sealed::Sealed for SetProgress<S> {} 230 - impl<S: State> State for SetProgress<S> { 231 - type Progress = Set<members::progress>; 232 - type Notebook = S::Notebook; 225 + type Progress = Unset; 233 226 } 234 227 ///State transition - sets the `notebook` field to Set 235 228 pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 236 229 impl<S: State> sealed::Sealed for SetNotebook<S> {} 237 230 impl<S: State> State for SetNotebook<S> { 238 - type Progress = S::Progress; 239 231 type Notebook = Set<members::notebook>; 232 + type Progress = S::Progress; 233 + } 234 + ///State transition - sets the `progress` field to Set 235 + pub struct SetProgress<S: State = Empty>(PhantomData<fn() -> S>); 236 + impl<S: State> sealed::Sealed for SetProgress<S> {} 237 + impl<S: State> State for SetProgress<S> { 238 + type Notebook = S::Notebook; 239 + type Progress = Set<members::progress>; 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 `progress` field 245 - pub struct progress(()); 246 244 ///Marker type for the `notebook` field 247 245 pub struct notebook(()); 246 + ///Marker type for the `progress` field 247 + pub struct progress(()); 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::Progress: reading_history_item_state::IsSet, 341 340 S::Notebook: reading_history_item_state::IsSet, 341 + S::Progress: reading_history_item_state::IsSet, 342 342 { 343 343 /// Build the final struct 344 344 pub fn build(self) -> ReadingHistoryItem<'a> {
+15 -15
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; 37 38 type Notebook; 38 39 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 Actor = Unset; 45 46 type Notebook = Unset; 46 47 type Entry = Unset; 47 - type Actor = Unset; 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>; 54 + type Notebook = S::Notebook; 55 + type Entry = S::Entry; 48 56 } 49 57 ///State transition - sets the `notebook` field to Set 50 58 pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 51 59 impl<S: State> sealed::Sealed for SetNotebook<S> {} 52 60 impl<S: State> State for SetNotebook<S> { 61 + type Actor = S::Actor; 53 62 type Notebook = Set<members::notebook>; 54 63 type Entry = S::Entry; 55 - type Actor = S::Actor; 56 64 } 57 65 ///State transition - sets the `entry` field to Set 58 66 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 59 67 impl<S: State> sealed::Sealed for SetEntry<S> {} 60 68 impl<S: State> State for SetEntry<S> { 61 - type Notebook = S::Notebook; 62 - type Entry = Set<members::entry>; 63 69 type Actor = S::Actor; 64 - } 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 70 type Notebook = S::Notebook; 70 - type Entry = S::Entry; 71 - type Actor = Set<members::actor>; 71 + type Entry = Set<members::entry>; 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 `actor` field 77 + pub struct actor(()); 76 78 ///Marker type for the `notebook` field 77 79 pub struct notebook(()); 78 80 ///Marker type for the `entry` field 79 81 pub struct entry(()); 80 - ///Marker type for the `actor` field 81 - pub struct actor(()); 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, 174 175 S::Notebook: resolve_entry_state::IsSet, 175 176 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> {
+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 Actor; 42 41 type Name; 42 + type Actor; 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 Actor = Unset; 49 48 type Name = Unset; 50 - } 51 - ///State transition - sets the `actor` field to Set 52 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetActor<S> {} 54 - impl<S: State> State for SetActor<S> { 55 - type Actor = Set<members::actor>; 56 - type Name = S::Name; 49 + type Actor = Unset; 57 50 } 58 51 ///State transition - sets the `name` field to Set 59 52 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 60 53 impl<S: State> sealed::Sealed for SetName<S> {} 61 54 impl<S: State> State for SetName<S> { 62 - type Actor = S::Actor; 63 55 type Name = Set<members::name>; 56 + type Actor = S::Actor; 57 + } 58 + ///State transition - sets the `actor` field to Set 59 + pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 60 + impl<S: State> sealed::Sealed for SetActor<S> {} 61 + impl<S: State> State for SetActor<S> { 62 + type Name = S::Name; 63 + type Actor = Set<members::actor>; 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 `actor` field 69 - pub struct actor(()); 70 68 ///Marker type for the `name` field 71 69 pub struct name(()); 70 + ///Marker type for the `actor` field 71 + pub struct actor(()); 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::Actor: resolve_notebook_state::IsSet, 179 178 S::Name: resolve_notebook_state::IsSet, 179 + S::Actor: resolve_notebook_state::IsSet, 180 180 { 181 181 /// Build the final struct 182 182 pub fn build(self) -> ResolveNotebook<'a> {
+78 -78
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; 39 40 type Name; 40 41 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; 47 48 type Name = Unset; 48 49 type Did = Unset; 49 - type Content = 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; 50 58 } 51 59 ///State transition - sets the `name` field to Set 52 60 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 53 61 impl<S: State> sealed::Sealed for SetName<S> {} 54 62 impl<S: State> State for SetName<S> { 63 + type Content = S::Content; 55 64 type Name = Set<members::name>; 56 65 type Did = S::Did; 57 - type Content = S::Content; 58 66 } 59 67 ///State transition - sets the `did` field to Set 60 68 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 61 69 impl<S: State> sealed::Sealed for SetDid<S> {} 62 70 impl<S: State> State for SetDid<S> { 63 - type Name = S::Name; 64 - type Did = Set<members::did>; 65 71 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 72 type Name = S::Name; 72 - type Did = S::Did; 73 - type Content = Set<members::content>; 73 + type Did = Set<members::did>; 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(()); 78 80 ///Marker type for the `name` field 79 81 pub struct name(()); 80 82 ///Marker type for the `did` field 81 83 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, 176 177 S::Name: code_theme_file_state::IsSet, 177 178 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> { ··· 837 837 } 838 838 /// State trait tracking which required fields have been set 839 839 pub trait State: sealed::Sealed { 840 + type Did; 840 841 type Content; 841 842 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 + type Did = Unset; 848 849 type Content = Unset; 849 850 type Name = Unset; 850 - type Did = Unset; 851 + } 852 + ///State transition - sets the `did` field to Set 853 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 854 + impl<S: State> sealed::Sealed for SetDid<S> {} 855 + impl<S: State> State for SetDid<S> { 856 + type Did = Set<members::did>; 857 + type Content = S::Content; 858 + type Name = S::Name; 851 859 } 852 860 ///State transition - sets the `content` field to Set 853 861 pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 854 862 impl<S: State> sealed::Sealed for SetContent<S> {} 855 863 impl<S: State> State for SetContent<S> { 864 + type Did = S::Did; 856 865 type Content = Set<members::content>; 857 866 type Name = S::Name; 858 - type Did = S::Did; 859 867 } 860 868 ///State transition - sets the `name` field to Set 861 869 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 862 870 impl<S: State> sealed::Sealed for SetName<S> {} 863 871 impl<S: State> State for SetName<S> { 864 - type Content = S::Content; 865 - type Name = Set<members::name>; 866 872 type Did = S::Did; 867 - } 868 - ///State transition - sets the `did` field to Set 869 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 870 - impl<S: State> sealed::Sealed for SetDid<S> {} 871 - impl<S: State> State for SetDid<S> { 872 873 type Content = S::Content; 873 - type Name = S::Name; 874 - type Did = Set<members::did>; 874 + type Name = Set<members::name>; 875 875 } 876 876 /// Marker types for field names 877 877 #[allow(non_camel_case_types)] 878 878 pub mod members { 879 + ///Marker type for the `did` field 880 + pub struct did(()); 879 881 ///Marker type for the `content` field 880 882 pub struct content(()); 881 883 ///Marker type for the `name` field 882 884 pub struct name(()); 883 - ///Marker type for the `did` field 884 - pub struct did(()); 885 885 } 886 886 } 887 887 ··· 974 974 impl<'a, S> FontFileBuilder<'a, S> 975 975 where 976 976 S: font_file_state::State, 977 + S::Did: font_file_state::IsSet, 977 978 S::Content: font_file_state::IsSet, 978 979 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> { ··· 1068 1068 /// State trait tracking which required fields have been set 1069 1069 pub trait State: sealed::Sealed { 1070 1070 type DarkScheme; 1071 + type LightScheme; 1072 + type Spacing; 1071 1073 type DarkCodeTheme; 1072 - type Spacing; 1073 - type LightScheme; 1074 - type Fonts; 1075 1074 type LightCodeTheme; 1075 + type Fonts; 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 1081 type DarkScheme = Unset; 1082 - type DarkCodeTheme = Unset; 1083 - type Spacing = Unset; 1084 1082 type LightScheme = Unset; 1085 - type Fonts = Unset; 1083 + type Spacing = Unset; 1084 + type DarkCodeTheme = Unset; 1086 1085 type LightCodeTheme = Unset; 1086 + type Fonts = Unset; 1087 1087 } 1088 1088 ///State transition - sets the `dark_scheme` field to Set 1089 1089 pub struct SetDarkScheme<S: State = Empty>(PhantomData<fn() -> S>); 1090 1090 impl<S: State> sealed::Sealed for SetDarkScheme<S> {} 1091 1091 impl<S: State> State for SetDarkScheme<S> { 1092 1092 type DarkScheme = Set<members::dark_scheme>; 1093 - type DarkCodeTheme = S::DarkCodeTheme; 1094 - type Spacing = S::Spacing; 1095 1093 type LightScheme = S::LightScheme; 1096 - type Fonts = S::Fonts; 1094 + type Spacing = S::Spacing; 1095 + type DarkCodeTheme = S::DarkCodeTheme; 1097 1096 type LightCodeTheme = S::LightCodeTheme; 1097 + type Fonts = S::Fonts; 1098 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> { 1099 + ///State transition - sets the `light_scheme` field to Set 1100 + pub struct SetLightScheme<S: State = Empty>(PhantomData<fn() -> S>); 1101 + impl<S: State> sealed::Sealed for SetLightScheme<S> {} 1102 + impl<S: State> State for SetLightScheme<S> { 1103 1103 type DarkScheme = S::DarkScheme; 1104 - type DarkCodeTheme = Set<members::dark_code_theme>; 1104 + type LightScheme = Set<members::light_scheme>; 1105 1105 type Spacing = S::Spacing; 1106 - type LightScheme = S::LightScheme; 1106 + type DarkCodeTheme = S::DarkCodeTheme; 1107 + type LightCodeTheme = S::LightCodeTheme; 1107 1108 type Fonts = S::Fonts; 1108 - type LightCodeTheme = S::LightCodeTheme; 1109 1109 } 1110 1110 ///State transition - sets the `spacing` field to Set 1111 1111 pub struct SetSpacing<S: State = Empty>(PhantomData<fn() -> S>); 1112 1112 impl<S: State> sealed::Sealed for SetSpacing<S> {} 1113 1113 impl<S: State> State for SetSpacing<S> { 1114 1114 type DarkScheme = S::DarkScheme; 1115 - type DarkCodeTheme = S::DarkCodeTheme; 1115 + type LightScheme = S::LightScheme; 1116 1116 type Spacing = Set<members::spacing>; 1117 + type DarkCodeTheme = S::DarkCodeTheme; 1118 + type LightCodeTheme = S::LightCodeTheme; 1119 + type Fonts = S::Fonts; 1120 + } 1121 + ///State transition - sets the `dark_code_theme` field to Set 1122 + pub struct SetDarkCodeTheme<S: State = Empty>(PhantomData<fn() -> S>); 1123 + impl<S: State> sealed::Sealed for SetDarkCodeTheme<S> {} 1124 + impl<S: State> State for SetDarkCodeTheme<S> { 1125 + type DarkScheme = S::DarkScheme; 1117 1126 type LightScheme = S::LightScheme; 1118 - type Fonts = S::Fonts; 1127 + type Spacing = S::Spacing; 1128 + type DarkCodeTheme = Set<members::dark_code_theme>; 1119 1129 type LightCodeTheme = S::LightCodeTheme; 1130 + type Fonts = S::Fonts; 1120 1131 } 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> { 1132 + ///State transition - sets the `light_code_theme` field to Set 1133 + pub struct SetLightCodeTheme<S: State = Empty>(PhantomData<fn() -> S>); 1134 + impl<S: State> sealed::Sealed for SetLightCodeTheme<S> {} 1135 + impl<S: State> State for SetLightCodeTheme<S> { 1125 1136 type DarkScheme = S::DarkScheme; 1126 - type DarkCodeTheme = S::DarkCodeTheme; 1137 + type LightScheme = S::LightScheme; 1127 1138 type Spacing = S::Spacing; 1128 - type LightScheme = Set<members::light_scheme>; 1139 + type DarkCodeTheme = S::DarkCodeTheme; 1140 + type LightCodeTheme = Set<members::light_code_theme>; 1129 1141 type Fonts = S::Fonts; 1130 - type LightCodeTheme = S::LightCodeTheme; 1131 1142 } 1132 1143 ///State transition - sets the `fonts` field to Set 1133 1144 pub struct SetFonts<S: State = Empty>(PhantomData<fn() -> S>); 1134 1145 impl<S: State> sealed::Sealed for SetFonts<S> {} 1135 1146 impl<S: State> State for SetFonts<S> { 1136 1147 type DarkScheme = S::DarkScheme; 1137 - type DarkCodeTheme = S::DarkCodeTheme; 1148 + type LightScheme = S::LightScheme; 1138 1149 type Spacing = S::Spacing; 1139 - type LightScheme = S::LightScheme; 1140 - type Fonts = Set<members::fonts>; 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> { 1147 - type DarkScheme = S::DarkScheme; 1148 1150 type DarkCodeTheme = S::DarkCodeTheme; 1149 - type Spacing = S::Spacing; 1150 - type LightScheme = S::LightScheme; 1151 - type Fonts = S::Fonts; 1152 - type LightCodeTheme = Set<members::light_code_theme>; 1151 + type LightCodeTheme = S::LightCodeTheme; 1152 + type Fonts = Set<members::fonts>; 1153 1153 } 1154 1154 /// Marker types for field names 1155 1155 #[allow(non_camel_case_types)] 1156 1156 pub mod members { 1157 1157 ///Marker type for the `dark_scheme` field 1158 1158 pub struct dark_scheme(()); 1159 - ///Marker type for the `dark_code_theme` field 1160 - pub struct dark_code_theme(()); 1161 - ///Marker type for the `spacing` field 1162 - pub struct spacing(()); 1163 1159 ///Marker type for the `light_scheme` field 1164 1160 pub struct light_scheme(()); 1165 - ///Marker type for the `fonts` field 1166 - pub struct fonts(()); 1161 + ///Marker type for the `spacing` field 1162 + pub struct spacing(()); 1163 + ///Marker type for the `dark_code_theme` field 1164 + pub struct dark_code_theme(()); 1167 1165 ///Marker type for the `light_code_theme` field 1168 1166 pub struct light_code_theme(()); 1167 + ///Marker type for the `fonts` field 1168 + pub struct fonts(()); 1169 1169 } 1170 1170 } 1171 1171 ··· 1339 1339 where 1340 1340 S: theme_state::State, 1341 1341 S::DarkScheme: theme_state::IsSet, 1342 - S::DarkCodeTheme: theme_state::IsSet, 1343 - S::Spacing: theme_state::IsSet, 1344 1342 S::LightScheme: theme_state::IsSet, 1345 - S::Fonts: theme_state::IsSet, 1343 + S::Spacing: theme_state::IsSet, 1344 + S::DarkCodeTheme: theme_state::IsSet, 1346 1345 S::LightCodeTheme: theme_state::IsSet, 1346 + S::Fonts: theme_state::IsSet, 1347 1347 { 1348 1348 /// Build the final struct 1349 1349 pub fn build(self) -> Theme<'a> {
+108 -108
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 55 type Uri; 57 - type Cid; 58 - type Author; 59 56 type IndexedAt; 57 + type Author; 58 + type Cid; 59 + type Reason; 60 60 type IsRead; 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 66 type Uri = Unset; 68 - type Cid = Unset; 69 - type Author = Unset; 70 67 type IndexedAt = Unset; 68 + type Author = Unset; 69 + type Cid = Unset; 70 + type Reason = Unset; 71 71 type IsRead = 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 72 } 84 73 ///State transition - sets the `uri` field to Set 85 74 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 86 75 impl<S: State> sealed::Sealed for SetUri<S> {} 87 76 impl<S: State> State for SetUri<S> { 88 - type Reason = S::Reason; 89 77 type Uri = Set<members::uri>; 90 - type Cid = S::Cid; 91 - type Author = S::Author; 92 78 type IndexedAt = S::IndexedAt; 79 + type Author = S::Author; 80 + type Cid = S::Cid; 81 + type Reason = S::Reason; 93 82 type IsRead = S::IsRead; 94 83 } 95 - ///State transition - sets the `cid` field to Set 96 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 97 - impl<S: State> sealed::Sealed for SetCid<S> {} 98 - impl<S: State> State for SetCid<S> { 99 - type Reason = S::Reason; 84 + ///State transition - sets the `indexed_at` field to Set 85 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 86 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 87 + impl<S: State> State for SetIndexedAt<S> { 100 88 type Uri = S::Uri; 101 - type Cid = Set<members::cid>; 89 + type IndexedAt = Set<members::indexed_at>; 102 90 type Author = S::Author; 103 - type IndexedAt = S::IndexedAt; 91 + type Cid = S::Cid; 92 + type Reason = S::Reason; 104 93 type IsRead = S::IsRead; 105 94 } 106 95 ///State transition - sets the `author` field to Set 107 96 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 108 97 impl<S: State> sealed::Sealed for SetAuthor<S> {} 109 98 impl<S: State> State for SetAuthor<S> { 110 - type Reason = S::Reason; 111 99 type Uri = S::Uri; 112 - type Cid = S::Cid; 100 + type IndexedAt = S::IndexedAt; 113 101 type Author = Set<members::author>; 102 + type Cid = S::Cid; 103 + type Reason = S::Reason; 104 + type IsRead = S::IsRead; 105 + } 106 + ///State transition - sets the `cid` field to Set 107 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 108 + impl<S: State> sealed::Sealed for SetCid<S> {} 109 + impl<S: State> State for SetCid<S> { 110 + type Uri = S::Uri; 114 111 type IndexedAt = S::IndexedAt; 112 + type Author = S::Author; 113 + type Cid = Set<members::cid>; 114 + type Reason = S::Reason; 115 115 type IsRead = S::IsRead; 116 116 } 117 - ///State transition - sets the `indexed_at` field to Set 118 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 119 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 120 - impl<S: State> State for SetIndexedAt<S> { 121 - type Reason = S::Reason; 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> { 122 121 type Uri = S::Uri; 123 - type Cid = S::Cid; 122 + type IndexedAt = S::IndexedAt; 124 123 type Author = S::Author; 125 - type IndexedAt = Set<members::indexed_at>; 124 + type Cid = S::Cid; 125 + type Reason = Set<members::reason>; 126 126 type IsRead = S::IsRead; 127 127 } 128 128 ///State transition - sets the `is_read` field to Set 129 129 pub struct SetIsRead<S: State = Empty>(PhantomData<fn() -> S>); 130 130 impl<S: State> sealed::Sealed for SetIsRead<S> {} 131 131 impl<S: State> State for SetIsRead<S> { 132 - type Reason = S::Reason; 133 132 type Uri = S::Uri; 134 - type Cid = S::Cid; 133 + type IndexedAt = S::IndexedAt; 135 134 type Author = S::Author; 136 - type IndexedAt = S::IndexedAt; 135 + type Cid = S::Cid; 136 + type Reason = S::Reason; 137 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 142 ///Marker type for the `uri` field 145 143 pub struct uri(()); 144 + ///Marker type for the `indexed_at` field 145 + pub struct indexed_at(()); 146 + ///Marker type for the `author` field 147 + pub struct author(()); 146 148 ///Marker type for the `cid` field 147 149 pub struct cid(()); 148 - ///Marker type for the `author` field 149 - pub struct author(()); 150 - ///Marker type for the `indexed_at` field 151 - pub struct indexed_at(()); 150 + ///Marker type for the `reason` field 151 + pub struct reason(()); 152 152 ///Marker type for the `is_read` field 153 153 pub struct is_read(()); 154 154 } ··· 343 343 impl<'a, S> NotificationBuilder<'a, S> 344 344 where 345 345 S: notification_state::State, 346 - S::Reason: notification_state::IsSet, 347 346 S::Uri: notification_state::IsSet, 348 - S::Cid: notification_state::IsSet, 349 - S::Author: notification_state::IsSet, 350 347 S::IndexedAt: notification_state::IsSet, 348 + S::Author: notification_state::IsSet, 349 + S::Cid: notification_state::IsSet, 350 + S::Reason: notification_state::IsSet, 351 351 S::IsRead: notification_state::IsSet, 352 352 { 353 353 /// Build the final struct ··· 801 801 } 802 802 /// State trait tracking which required fields have been set 803 803 pub trait State: sealed::Sealed { 804 - type Subject; 805 - type Actors; 806 804 type MostRecentAt; 807 - type Reason; 808 805 type Count; 806 + type Subject; 807 + type Reason; 808 + type Actors; 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 814 type MostRecentAt = Unset; 817 - type Reason = Unset; 818 815 type Count = Unset; 819 - } 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 - type Actors = S::Actors; 826 - type MostRecentAt = S::MostRecentAt; 827 - type Reason = S::Reason; 828 - type Count = S::Count; 829 - } 830 - ///State transition - sets the `actors` field to Set 831 - pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>); 832 - impl<S: State> sealed::Sealed for SetActors<S> {} 833 - impl<S: State> State for SetActors<S> { 834 - type Subject = S::Subject; 835 - type Actors = Set<members::actors>; 836 - type MostRecentAt = S::MostRecentAt; 837 - type Reason = S::Reason; 838 - type Count = S::Count; 816 + type Subject = Unset; 817 + type Reason = Unset; 818 + type Actors = Unset; 839 819 } 840 820 ///State transition - sets the `most_recent_at` field to Set 841 821 pub struct SetMostRecentAt<S: State = Empty>(PhantomData<fn() -> S>); 842 822 impl<S: State> sealed::Sealed for SetMostRecentAt<S> {} 843 823 impl<S: State> State for SetMostRecentAt<S> { 824 + type MostRecentAt = Set<members::most_recent_at>; 825 + type Count = S::Count; 844 826 type Subject = S::Subject; 827 + type Reason = S::Reason; 845 828 type Actors = S::Actors; 846 - type MostRecentAt = Set<members::most_recent_at>; 829 + } 830 + ///State transition - sets the `count` field to Set 831 + pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 832 + impl<S: State> sealed::Sealed for SetCount<S> {} 833 + impl<S: State> State for SetCount<S> { 834 + type MostRecentAt = S::MostRecentAt; 835 + type Count = Set<members::count>; 836 + type Subject = S::Subject; 847 837 type Reason = S::Reason; 838 + type Actors = S::Actors; 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 + type MostRecentAt = S::MostRecentAt; 848 845 type Count = S::Count; 846 + type Subject = Set<members::subject>; 847 + type Reason = S::Reason; 848 + type Actors = S::Actors; 849 849 } 850 850 ///State transition - sets the `reason` field to Set 851 851 pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 852 852 impl<S: State> sealed::Sealed for SetReason<S> {} 853 853 impl<S: State> State for SetReason<S> { 854 - type Subject = S::Subject; 855 - type Actors = S::Actors; 856 854 type MostRecentAt = S::MostRecentAt; 857 - type Reason = Set<members::reason>; 858 855 type Count = S::Count; 859 - } 860 - ///State transition - sets the `count` field to Set 861 - pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 862 - impl<S: State> sealed::Sealed for SetCount<S> {} 863 - impl<S: State> State for SetCount<S> { 864 856 type Subject = S::Subject; 857 + type Reason = Set<members::reason>; 865 858 type Actors = S::Actors; 859 + } 860 + ///State transition - sets the `actors` field to Set 861 + pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>); 862 + impl<S: State> sealed::Sealed for SetActors<S> {} 863 + impl<S: State> State for SetActors<S> { 866 864 type MostRecentAt = S::MostRecentAt; 865 + type Count = S::Count; 866 + type Subject = S::Subject; 867 867 type Reason = S::Reason; 868 - type Count = Set<members::count>; 868 + type Actors = Set<members::actors>; 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 873 ///Marker type for the `most_recent_at` field 878 874 pub struct most_recent_at(()); 875 + ///Marker type for the `count` field 876 + pub struct count(()); 877 + ///Marker type for the `subject` field 878 + pub struct subject(()); 879 879 ///Marker type for the `reason` field 880 880 pub struct reason(()); 881 - ///Marker type for the `count` field 882 - pub struct count(()); 881 + ///Marker type for the `actors` field 882 + pub struct actors(()); 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::Subject: notification_group_state::IsSet, 1030 - S::Actors: notification_group_state::IsSet, 1031 1029 S::MostRecentAt: notification_group_state::IsSet, 1032 - S::Reason: notification_group_state::IsSet, 1033 1030 S::Count: notification_group_state::IsSet, 1031 + S::Subject: notification_group_state::IsSet, 1032 + S::Reason: notification_group_state::IsSet, 1033 + S::Actors: notification_group_state::IsSet, 1034 1034 { 1035 1035 /// Build the final struct 1036 1036 pub fn build(self) -> NotificationGroup<'a> { ··· 1292 1292 } 1293 1293 /// State trait tracking which required fields have been set 1294 1294 pub trait State: sealed::Sealed { 1295 - type NewEntries; 1296 1295 type UpdatedAt; 1296 + type NewEntries; 1297 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 - type NewEntries = Unset; 1304 1303 type UpdatedAt = Unset; 1304 + type NewEntries = Unset; 1305 1305 type Notebook = Unset; 1306 1306 } 1307 + ///State transition - sets the `updated_at` field to Set 1308 + pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1309 + impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 1310 + impl<S: State> State for SetUpdatedAt<S> { 1311 + type UpdatedAt = Set<members::updated_at>; 1312 + type NewEntries = S::NewEntries; 1313 + type Notebook = S::Notebook; 1314 + } 1307 1315 ///State transition - sets the `new_entries` field to Set 1308 1316 pub struct SetNewEntries<S: State = Empty>(PhantomData<fn() -> S>); 1309 1317 impl<S: State> sealed::Sealed for SetNewEntries<S> {} 1310 1318 impl<S: State> State for SetNewEntries<S> { 1311 - type NewEntries = Set<members::new_entries>; 1312 1319 type UpdatedAt = S::UpdatedAt; 1313 - type Notebook = S::Notebook; 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>; 1320 + type NewEntries = Set<members::new_entries>; 1321 1321 type Notebook = S::Notebook; 1322 1322 } 1323 1323 ///State transition - sets the `notebook` field to Set 1324 1324 pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 1325 1325 impl<S: State> sealed::Sealed for SetNotebook<S> {} 1326 1326 impl<S: State> State for SetNotebook<S> { 1327 - type NewEntries = S::NewEntries; 1328 1327 type UpdatedAt = S::UpdatedAt; 1328 + type NewEntries = S::NewEntries; 1329 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 - ///Marker type for the `new_entries` field 1335 - pub struct new_entries(()); 1336 1334 ///Marker type for the `updated_at` field 1337 1335 pub struct updated_at(()); 1336 + ///Marker type for the `new_entries` field 1337 + pub struct new_entries(()); 1338 1338 ///Marker type for the `notebook` field 1339 1339 pub struct notebook(()); 1340 1340 } ··· 1461 1461 impl<'a, S> SubscriptionUpdateViewBuilder<'a, S> 1462 1462 where 1463 1463 S: subscription_update_view_state::State, 1464 - S::NewEntries: subscription_update_view_state::IsSet, 1465 1464 S::UpdatedAt: subscription_update_view_state::IsSet, 1465 + S::NewEntries: subscription_update_view_state::IsSet, 1466 1466 S::Notebook: subscription_update_view_state::IsSet, 1467 1467 { 1468 1468 /// Build the final struct
+1
crates/weaver-api/src/site_standard.rs
··· 4 4 // Any manual changes will be overwritten on the next regeneration. 5 5 6 6 pub mod document; 7 + pub mod graph; 7 8 pub mod publication; 8 9 pub mod theme;
+349 -244
crates/weaver-api/src/site_standard/document.rs
··· 5 5 // This file was automatically generated from Lexicon schemas. 6 6 // Any manual changes will be overwritten on the next regeneration. 7 7 8 + /// A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently. 8 9 #[jacquard_derive::lexicon] 9 10 #[derive( 10 11 serde::Serialize, ··· 17 18 )] 18 19 #[serde(rename_all = "camelCase")] 19 20 pub struct Document<'a> { 21 + /// Strong reference to a Bluesky post. Useful to keep track of comments off-platform. 20 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 23 #[serde(borrow)] 22 24 pub bsky_post_ref: std::option::Option< 23 25 crate::com_atproto::repo::strong_ref::StrongRef<'a>, 24 26 >, 27 + /// Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats. 25 28 #[serde(skip_serializing_if = "std::option::Option::is_none")] 26 29 #[serde(borrow)] 27 - pub content: std::option::Option<Vec<jacquard_common::types::value::Data<'a>>>, 30 + pub content: std::option::Option<jacquard_common::types::value::Data<'a>>, 31 + /// Image to used for thumbnail or cover image. Less than 1MB is size. 28 32 #[serde(skip_serializing_if = "std::option::Option::is_none")] 29 33 #[serde(borrow)] 30 34 pub cover_image: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 35 + /// A brief description or excerpt from the document. 31 36 #[serde(skip_serializing_if = "std::option::Option::is_none")] 32 37 #[serde(borrow)] 33 38 pub description: std::option::Option<jacquard_common::CowStr<'a>>, 34 - /// combined with the publications url to construct a full url to the document 39 + /// Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash. 35 40 #[serde(skip_serializing_if = "std::option::Option::is_none")] 36 41 #[serde(borrow)] 37 42 pub path: std::option::Option<jacquard_common::CowStr<'a>>, 43 + /// Timestamp of the documents publish time. 44 + pub published_at: jacquard_common::types::string::Datetime, 45 + /// Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes. 38 46 #[serde(borrow)] 39 - pub publication: jacquard_common::types::string::AtUri<'a>, 40 - pub published_at: jacquard_common::types::string::Datetime, 47 + pub site: jacquard_common::types::string::Uri<'a>, 48 + /// Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags. 41 49 #[serde(skip_serializing_if = "std::option::Option::is_none")] 42 50 #[serde(borrow)] 43 51 pub tags: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 52 + /// Plaintext representation of the documents contents. Should not contain markdown or other formatting. 44 53 #[serde(skip_serializing_if = "std::option::Option::is_none")] 45 54 #[serde(borrow)] 46 55 pub text_content: std::option::Option<jacquard_common::CowStr<'a>>, 56 + /// Title of the document. 47 57 #[serde(borrow)] 48 58 pub title: jacquard_common::CowStr<'a>, 59 + /// Timestamp of the documents last edit. 49 60 #[serde(skip_serializing_if = "std::option::Option::is_none")] 50 61 pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>, 51 62 } ··· 61 72 /// State trait tracking which required fields have been set 62 73 pub trait State: sealed::Sealed { 63 74 type PublishedAt; 64 - type Publication; 75 + type Site; 65 76 type Title; 66 77 } 67 78 /// Empty state - all required fields are unset ··· 69 80 impl sealed::Sealed for Empty {} 70 81 impl State for Empty { 71 82 type PublishedAt = Unset; 72 - type Publication = Unset; 83 + type Site = Unset; 73 84 type Title = Unset; 74 85 } 75 86 ///State transition - sets the `published_at` field to Set ··· 77 88 impl<S: State> sealed::Sealed for SetPublishedAt<S> {} 78 89 impl<S: State> State for SetPublishedAt<S> { 79 90 type PublishedAt = Set<members::published_at>; 80 - type Publication = S::Publication; 91 + type Site = S::Site; 81 92 type Title = S::Title; 82 93 } 83 - ///State transition - sets the `publication` field to Set 84 - pub struct SetPublication<S: State = Empty>(PhantomData<fn() -> S>); 85 - impl<S: State> sealed::Sealed for SetPublication<S> {} 86 - impl<S: State> State for SetPublication<S> { 94 + ///State transition - sets the `site` field to Set 95 + pub struct SetSite<S: State = Empty>(PhantomData<fn() -> S>); 96 + impl<S: State> sealed::Sealed for SetSite<S> {} 97 + impl<S: State> State for SetSite<S> { 87 98 type PublishedAt = S::PublishedAt; 88 - type Publication = Set<members::publication>; 99 + type Site = Set<members::site>; 89 100 type Title = S::Title; 90 101 } 91 102 ///State transition - sets the `title` field to Set ··· 93 104 impl<S: State> sealed::Sealed for SetTitle<S> {} 94 105 impl<S: State> State for SetTitle<S> { 95 106 type PublishedAt = S::PublishedAt; 96 - type Publication = S::Publication; 107 + type Site = S::Site; 97 108 type Title = Set<members::title>; 98 109 } 99 110 /// Marker types for field names ··· 101 112 pub mod members { 102 113 ///Marker type for the `published_at` field 103 114 pub struct published_at(()); 104 - ///Marker type for the `publication` field 105 - pub struct publication(()); 115 + ///Marker type for the `site` field 116 + pub struct site(()); 106 117 ///Marker type for the `title` field 107 118 pub struct title(()); 108 119 } ··· 113 124 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 114 125 __unsafe_private_named: ( 115 126 ::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 116 - ::core::option::Option<Vec<jacquard_common::types::value::Data<'a>>>, 127 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 117 128 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 118 129 ::core::option::Option<jacquard_common::CowStr<'a>>, 119 130 ::core::option::Option<jacquard_common::CowStr<'a>>, 120 - ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 121 131 ::core::option::Option<jacquard_common::types::string::Datetime>, 132 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 122 133 ::core::option::Option<Vec<jacquard_common::CowStr<'a>>>, 123 134 ::core::option::Option<jacquard_common::CowStr<'a>>, 124 135 ::core::option::Option<jacquard_common::CowStr<'a>>, ··· 180 191 /// Set the `content` field (optional) 181 192 pub fn content( 182 193 mut self, 183 - value: impl Into<Option<Vec<jacquard_common::types::value::Data<'a>>>>, 194 + value: impl Into<Option<jacquard_common::types::value::Data<'a>>>, 184 195 ) -> Self { 185 196 self.__unsafe_private_named.1 = value.into(); 186 197 self ··· 188 199 /// Set the `content` field to an Option value (optional) 189 200 pub fn maybe_content( 190 201 mut self, 191 - value: Option<Vec<jacquard_common::types::value::Data<'a>>>, 202 + value: Option<jacquard_common::types::value::Data<'a>>, 192 203 ) -> Self { 193 204 self.__unsafe_private_named.1 = value; 194 205 self ··· 252 263 impl<'a, S> DocumentBuilder<'a, S> 253 264 where 254 265 S: document_state::State, 255 - S::Publication: document_state::IsUnset, 266 + S::PublishedAt: document_state::IsUnset, 256 267 { 257 - /// Set the `publication` field (required) 258 - pub fn publication( 268 + /// Set the `publishedAt` field (required) 269 + pub fn published_at( 259 270 mut self, 260 - value: impl Into<jacquard_common::types::string::AtUri<'a>>, 261 - ) -> DocumentBuilder<'a, document_state::SetPublication<S>> { 271 + value: impl Into<jacquard_common::types::string::Datetime>, 272 + ) -> DocumentBuilder<'a, document_state::SetPublishedAt<S>> { 262 273 self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 263 274 DocumentBuilder { 264 275 _phantom_state: ::core::marker::PhantomData, ··· 271 282 impl<'a, S> DocumentBuilder<'a, S> 272 283 where 273 284 S: document_state::State, 274 - S::PublishedAt: document_state::IsUnset, 285 + S::Site: document_state::IsUnset, 275 286 { 276 - /// Set the `publishedAt` field (required) 277 - pub fn published_at( 287 + /// Set the `site` field (required) 288 + pub fn site( 278 289 mut self, 279 - value: impl Into<jacquard_common::types::string::Datetime>, 280 - ) -> DocumentBuilder<'a, document_state::SetPublishedAt<S>> { 290 + value: impl Into<jacquard_common::types::string::Uri<'a>>, 291 + ) -> DocumentBuilder<'a, document_state::SetSite<S>> { 281 292 self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 282 293 DocumentBuilder { 283 294 _phantom_state: ::core::marker::PhantomData, ··· 367 378 where 368 379 S: document_state::State, 369 380 S::PublishedAt: document_state::IsSet, 370 - S::Publication: document_state::IsSet, 381 + S::Site: document_state::IsSet, 371 382 S::Title: document_state::IsSet, 372 383 { 373 384 /// Build the final struct ··· 378 389 cover_image: self.__unsafe_private_named.2, 379 390 description: self.__unsafe_private_named.3, 380 391 path: self.__unsafe_private_named.4, 381 - publication: self.__unsafe_private_named.5.unwrap(), 382 - published_at: self.__unsafe_private_named.6.unwrap(), 392 + published_at: self.__unsafe_private_named.5.unwrap(), 393 + site: self.__unsafe_private_named.6.unwrap(), 383 394 tags: self.__unsafe_private_named.7, 384 395 text_content: self.__unsafe_private_named.8, 385 396 title: self.__unsafe_private_named.9.unwrap(), ··· 401 412 cover_image: self.__unsafe_private_named.2, 402 413 description: self.__unsafe_private_named.3, 403 414 path: self.__unsafe_private_named.4, 404 - publication: self.__unsafe_private_named.5.unwrap(), 405 - published_at: self.__unsafe_private_named.6.unwrap(), 415 + published_at: self.__unsafe_private_named.5.unwrap(), 416 + site: self.__unsafe_private_named.6.unwrap(), 406 417 tags: self.__unsafe_private_named.7, 407 418 text_content: self.__unsafe_private_named.8, 408 419 title: self.__unsafe_private_named.9.unwrap(), ··· 412 423 } 413 424 } 414 425 415 - fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconDoc< 416 - 'static, 417 - > { 418 - ::jacquard_lexicon::lexicon::LexiconDoc { 419 - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 420 - id: ::jacquard_common::CowStr::new_static("site.standard.document"), 421 - revision: None, 422 - description: None, 423 - defs: { 424 - let mut map = ::alloc::collections::BTreeMap::new(); 425 - map.insert( 426 - ::jacquard_common::smol_str::SmolStr::new_static("main"), 427 - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 428 - description: None, 429 - required: Some( 430 - vec![ 431 - ::jacquard_common::smol_str::SmolStr::new_static("publication"), 432 - ::jacquard_common::smol_str::SmolStr::new_static("title"), 433 - ::jacquard_common::smol_str::SmolStr::new_static("publishedAt") 434 - ], 435 - ), 436 - nullable: None, 437 - properties: { 438 - #[allow(unused_mut)] 439 - let mut map = ::alloc::collections::BTreeMap::new(); 440 - map.insert( 441 - ::jacquard_common::smol_str::SmolStr::new_static( 442 - "bskyPostRef", 443 - ), 444 - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 445 - description: None, 446 - r#ref: ::jacquard_common::CowStr::new_static( 447 - "com.atproto.repo.strongRef", 448 - ), 449 - }), 450 - ); 451 - map.insert( 452 - ::jacquard_common::smol_str::SmolStr::new_static("content"), 453 - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 454 - description: None, 455 - items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { 456 - description: None, 457 - refs: vec![], 458 - closed: Some(false), 459 - }), 460 - min_length: None, 461 - max_length: None, 462 - }), 463 - ); 464 - map.insert( 465 - ::jacquard_common::smol_str::SmolStr::new_static( 466 - "coverImage", 467 - ), 468 - ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 469 - description: None, 470 - accept: None, 471 - max_size: None, 472 - }), 473 - ); 474 - map.insert( 475 - ::jacquard_common::smol_str::SmolStr::new_static( 476 - "description", 477 - ), 478 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 479 - description: None, 480 - format: None, 481 - default: None, 482 - min_length: None, 483 - max_length: Some(3000usize), 484 - min_graphemes: None, 485 - max_graphemes: Some(300usize), 486 - r#enum: None, 487 - r#const: None, 488 - known_values: None, 489 - }), 490 - ); 491 - map.insert( 492 - ::jacquard_common::smol_str::SmolStr::new_static("path"), 493 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 494 - description: Some( 495 - ::jacquard_common::CowStr::new_static( 496 - "combined with the publications url to construct a full url to the document", 497 - ), 498 - ), 499 - format: None, 500 - default: None, 501 - min_length: None, 502 - max_length: None, 503 - min_graphemes: None, 504 - max_graphemes: None, 505 - r#enum: None, 506 - r#const: None, 507 - known_values: None, 508 - }), 509 - ); 510 - map.insert( 511 - ::jacquard_common::smol_str::SmolStr::new_static( 512 - "publication", 513 - ), 514 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 515 - description: None, 516 - format: Some( 517 - ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 518 - ), 519 - default: None, 520 - min_length: None, 521 - max_length: None, 522 - min_graphemes: None, 523 - max_graphemes: None, 524 - r#enum: None, 525 - r#const: None, 526 - known_values: None, 527 - }), 528 - ); 529 - map.insert( 530 - ::jacquard_common::smol_str::SmolStr::new_static( 531 - "publishedAt", 532 - ), 533 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 534 - description: None, 535 - format: Some( 536 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 537 - ), 538 - default: None, 539 - min_length: None, 540 - max_length: None, 541 - min_graphemes: None, 542 - max_graphemes: None, 543 - r#enum: None, 544 - r#const: None, 545 - known_values: None, 546 - }), 547 - ); 548 - map.insert( 549 - ::jacquard_common::smol_str::SmolStr::new_static("tags"), 550 - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 551 - description: None, 552 - items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 553 - description: None, 554 - format: None, 555 - default: None, 556 - min_length: None, 557 - max_length: Some(100usize), 558 - min_graphemes: None, 559 - max_graphemes: Some(50usize), 560 - r#enum: None, 561 - r#const: None, 562 - known_values: None, 563 - }), 564 - min_length: None, 565 - max_length: None, 566 - }), 567 - ); 568 - map.insert( 569 - ::jacquard_common::smol_str::SmolStr::new_static( 570 - "textContent", 571 - ), 572 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 573 - description: None, 574 - format: None, 575 - default: None, 576 - min_length: None, 577 - max_length: None, 578 - min_graphemes: None, 579 - max_graphemes: None, 580 - r#enum: None, 581 - r#const: None, 582 - known_values: None, 583 - }), 584 - ); 585 - map.insert( 586 - ::jacquard_common::smol_str::SmolStr::new_static("title"), 587 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 588 - description: None, 589 - format: None, 590 - default: None, 591 - min_length: None, 592 - max_length: Some(1280usize), 593 - min_graphemes: None, 594 - max_graphemes: Some(128usize), 595 - r#enum: None, 596 - r#const: None, 597 - known_values: None, 598 - }), 599 - ); 600 - map.insert( 601 - ::jacquard_common::smol_str::SmolStr::new_static( 602 - "updatedAt", 603 - ), 604 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 605 - description: None, 606 - format: Some( 607 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 608 - ), 609 - default: None, 610 - min_length: None, 611 - max_length: None, 612 - min_graphemes: None, 613 - max_graphemes: None, 614 - r#enum: None, 615 - r#const: None, 616 - known_values: None, 617 - }), 618 - ); 619 - map 620 - }, 621 - }), 622 - ); 623 - map 624 - }, 426 + impl<'a> Document<'a> { 427 + pub fn uri( 428 + uri: impl Into<jacquard_common::CowStr<'a>>, 429 + ) -> Result< 430 + jacquard_common::types::uri::RecordUri<'a, DocumentRecord>, 431 + jacquard_common::types::uri::UriError, 432 + > { 433 + jacquard_common::types::uri::RecordUri::try_from_uri( 434 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 435 + ) 436 + } 437 + } 438 + 439 + /// Typed wrapper for GetRecord response with this collection's record type. 440 + #[derive( 441 + serde::Serialize, 442 + serde::Deserialize, 443 + Debug, 444 + Clone, 445 + PartialEq, 446 + Eq, 447 + jacquard_derive::IntoStatic 448 + )] 449 + #[serde(rename_all = "camelCase")] 450 + pub struct DocumentGetRecordOutput<'a> { 451 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 452 + #[serde(borrow)] 453 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 454 + #[serde(borrow)] 455 + pub uri: jacquard_common::types::string::AtUri<'a>, 456 + #[serde(borrow)] 457 + pub value: Document<'a>, 458 + } 459 + 460 + impl From<DocumentGetRecordOutput<'_>> for Document<'_> { 461 + fn from(output: DocumentGetRecordOutput<'_>) -> Self { 462 + use jacquard_common::IntoStatic; 463 + output.value.into_static() 625 464 } 465 + } 466 + 467 + impl jacquard_common::types::collection::Collection for Document<'_> { 468 + const NSID: &'static str = "site.standard.document"; 469 + type Record = DocumentRecord; 470 + } 471 + 472 + /// Marker type for deserializing records from this collection. 473 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 474 + pub struct DocumentRecord; 475 + impl jacquard_common::xrpc::XrpcResp for DocumentRecord { 476 + const NSID: &'static str = "site.standard.document"; 477 + const ENCODING: &'static str = "application/json"; 478 + type Output<'de> = DocumentGetRecordOutput<'de>; 479 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 480 + } 481 + 482 + impl jacquard_common::types::collection::Collection for DocumentRecord { 483 + const NSID: &'static str = "site.standard.document"; 484 + type Record = DocumentRecord; 626 485 } 627 486 628 487 impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Document<'a> { ··· 701 560 } 702 561 } 703 562 Ok(()) 563 + } 564 + } 565 + 566 + fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconDoc< 567 + 'static, 568 + > { 569 + ::jacquard_lexicon::lexicon::LexiconDoc { 570 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 571 + id: ::jacquard_common::CowStr::new_static("site.standard.document"), 572 + revision: None, 573 + description: None, 574 + defs: { 575 + let mut map = ::alloc::collections::BTreeMap::new(); 576 + map.insert( 577 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 578 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 579 + description: Some( 580 + ::jacquard_common::CowStr::new_static( 581 + "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently.", 582 + ), 583 + ), 584 + key: Some(::jacquard_common::CowStr::new_static("tid")), 585 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 586 + description: None, 587 + required: Some( 588 + vec![ 589 + ::jacquard_common::smol_str::SmolStr::new_static("site"), 590 + ::jacquard_common::smol_str::SmolStr::new_static("title"), 591 + ::jacquard_common::smol_str::SmolStr::new_static("publishedAt") 592 + ], 593 + ), 594 + nullable: None, 595 + properties: { 596 + #[allow(unused_mut)] 597 + let mut map = ::alloc::collections::BTreeMap::new(); 598 + map.insert( 599 + ::jacquard_common::smol_str::SmolStr::new_static( 600 + "bskyPostRef", 601 + ), 602 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 603 + description: None, 604 + r#ref: ::jacquard_common::CowStr::new_static( 605 + "com.atproto.repo.strongRef", 606 + ), 607 + }), 608 + ); 609 + map.insert( 610 + ::jacquard_common::smol_str::SmolStr::new_static("content"), 611 + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 612 + description: Some( 613 + ::jacquard_common::CowStr::new_static( 614 + "Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats.", 615 + ), 616 + ), 617 + refs: vec![], 618 + closed: Some(false), 619 + }), 620 + ); 621 + map.insert( 622 + ::jacquard_common::smol_str::SmolStr::new_static( 623 + "coverImage", 624 + ), 625 + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 626 + description: None, 627 + accept: None, 628 + max_size: None, 629 + }), 630 + ); 631 + map.insert( 632 + ::jacquard_common::smol_str::SmolStr::new_static( 633 + "description", 634 + ), 635 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 636 + description: Some( 637 + ::jacquard_common::CowStr::new_static( 638 + "A brief description or excerpt from the document.", 639 + ), 640 + ), 641 + format: None, 642 + default: None, 643 + min_length: None, 644 + max_length: Some(3000usize), 645 + min_graphemes: None, 646 + max_graphemes: Some(300usize), 647 + r#enum: None, 648 + r#const: None, 649 + known_values: None, 650 + }), 651 + ); 652 + map.insert( 653 + ::jacquard_common::smol_str::SmolStr::new_static("path"), 654 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 655 + description: Some( 656 + ::jacquard_common::CowStr::new_static( 657 + "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash.", 658 + ), 659 + ), 660 + format: None, 661 + default: None, 662 + min_length: None, 663 + max_length: None, 664 + min_graphemes: None, 665 + max_graphemes: None, 666 + r#enum: None, 667 + r#const: None, 668 + known_values: None, 669 + }), 670 + ); 671 + map.insert( 672 + ::jacquard_common::smol_str::SmolStr::new_static( 673 + "publishedAt", 674 + ), 675 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 676 + description: Some( 677 + ::jacquard_common::CowStr::new_static( 678 + "Timestamp of the documents publish time.", 679 + ), 680 + ), 681 + format: Some( 682 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 683 + ), 684 + default: None, 685 + min_length: None, 686 + max_length: None, 687 + min_graphemes: None, 688 + max_graphemes: None, 689 + r#enum: None, 690 + r#const: None, 691 + known_values: None, 692 + }), 693 + ); 694 + map.insert( 695 + ::jacquard_common::smol_str::SmolStr::new_static("site"), 696 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 697 + description: Some( 698 + ::jacquard_common::CowStr::new_static( 699 + "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes.", 700 + ), 701 + ), 702 + format: Some( 703 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 704 + ), 705 + default: None, 706 + min_length: None, 707 + max_length: None, 708 + min_graphemes: None, 709 + max_graphemes: None, 710 + r#enum: None, 711 + r#const: None, 712 + known_values: None, 713 + }), 714 + ); 715 + map.insert( 716 + ::jacquard_common::smol_str::SmolStr::new_static("tags"), 717 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 718 + description: Some( 719 + ::jacquard_common::CowStr::new_static( 720 + "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags.", 721 + ), 722 + ), 723 + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 724 + description: None, 725 + format: None, 726 + default: None, 727 + min_length: None, 728 + max_length: Some(100usize), 729 + min_graphemes: None, 730 + max_graphemes: Some(50usize), 731 + r#enum: None, 732 + r#const: None, 733 + known_values: None, 734 + }), 735 + min_length: None, 736 + max_length: None, 737 + }), 738 + ); 739 + map.insert( 740 + ::jacquard_common::smol_str::SmolStr::new_static( 741 + "textContent", 742 + ), 743 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 744 + description: Some( 745 + ::jacquard_common::CowStr::new_static( 746 + "Plaintext representation of the documents contents. Should not contain markdown or other formatting.", 747 + ), 748 + ), 749 + format: None, 750 + default: None, 751 + min_length: None, 752 + max_length: None, 753 + min_graphemes: None, 754 + max_graphemes: None, 755 + r#enum: None, 756 + r#const: None, 757 + known_values: None, 758 + }), 759 + ); 760 + map.insert( 761 + ::jacquard_common::smol_str::SmolStr::new_static("title"), 762 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 763 + description: Some( 764 + ::jacquard_common::CowStr::new_static( 765 + "Title of the document.", 766 + ), 767 + ), 768 + format: None, 769 + default: None, 770 + min_length: None, 771 + max_length: Some(1280usize), 772 + min_graphemes: None, 773 + max_graphemes: Some(128usize), 774 + r#enum: None, 775 + r#const: None, 776 + known_values: None, 777 + }), 778 + ); 779 + map.insert( 780 + ::jacquard_common::smol_str::SmolStr::new_static( 781 + "updatedAt", 782 + ), 783 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 784 + description: Some( 785 + ::jacquard_common::CowStr::new_static( 786 + "Timestamp of the documents last edit.", 787 + ), 788 + ), 789 + format: Some( 790 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 791 + ), 792 + default: None, 793 + min_length: None, 794 + max_length: None, 795 + min_graphemes: None, 796 + max_graphemes: None, 797 + r#enum: None, 798 + r#const: None, 799 + known_values: None, 800 + }), 801 + ); 802 + map 803 + }, 804 + }), 805 + }), 806 + ); 807 + map 808 + }, 704 809 } 705 810 }
+6
crates/weaver-api/src/site_standard/graph.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // This file was automatically generated from Lexicon schemas. 4 + // Any manual changes will be overwritten on the next regeneration. 5 + 6 + pub mod subscription;
+270
crates/weaver-api/src/site_standard/graph/subscription.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: site.standard.graph.subscription 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Record declaring a subscription to a publication 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, 12 + serde::Deserialize, 13 + Debug, 14 + Clone, 15 + PartialEq, 16 + Eq, 17 + jacquard_derive::IntoStatic 18 + )] 19 + #[serde(rename_all = "camelCase")] 20 + pub struct Subscription<'a> { 21 + /// AT-URI reference to the publication record being subscribed to (ex: at://did:plc:abc123/site.standard.publication/xyz789). 22 + #[serde(borrow)] 23 + pub publication: jacquard_common::types::string::AtUri<'a>, 24 + } 25 + 26 + pub mod subscription_state { 27 + 28 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 29 + #[allow(unused)] 30 + use ::core::marker::PhantomData; 31 + mod sealed { 32 + pub trait Sealed {} 33 + } 34 + /// State trait tracking which required fields have been set 35 + pub trait State: sealed::Sealed { 36 + type Publication; 37 + } 38 + /// Empty state - all required fields are unset 39 + pub struct Empty(()); 40 + impl sealed::Sealed for Empty {} 41 + impl State for Empty { 42 + type Publication = Unset; 43 + } 44 + ///State transition - sets the `publication` field to Set 45 + pub struct SetPublication<S: State = Empty>(PhantomData<fn() -> S>); 46 + impl<S: State> sealed::Sealed for SetPublication<S> {} 47 + impl<S: State> State for SetPublication<S> { 48 + type Publication = Set<members::publication>; 49 + } 50 + /// Marker types for field names 51 + #[allow(non_camel_case_types)] 52 + pub mod members { 53 + ///Marker type for the `publication` field 54 + pub struct publication(()); 55 + } 56 + } 57 + 58 + /// Builder for constructing an instance of this type 59 + pub struct SubscriptionBuilder<'a, S: subscription_state::State> { 60 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 61 + __unsafe_private_named: ( 62 + ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 63 + ), 64 + _phantom: ::core::marker::PhantomData<&'a ()>, 65 + } 66 + 67 + impl<'a> Subscription<'a> { 68 + /// Create a new builder for this type 69 + pub fn new() -> SubscriptionBuilder<'a, subscription_state::Empty> { 70 + SubscriptionBuilder::new() 71 + } 72 + } 73 + 74 + impl<'a> SubscriptionBuilder<'a, subscription_state::Empty> { 75 + /// Create a new builder with all fields unset 76 + pub fn new() -> Self { 77 + SubscriptionBuilder { 78 + _phantom_state: ::core::marker::PhantomData, 79 + __unsafe_private_named: (None,), 80 + _phantom: ::core::marker::PhantomData, 81 + } 82 + } 83 + } 84 + 85 + impl<'a, S> SubscriptionBuilder<'a, S> 86 + where 87 + S: subscription_state::State, 88 + S::Publication: subscription_state::IsUnset, 89 + { 90 + /// Set the `publication` field (required) 91 + pub fn publication( 92 + mut self, 93 + value: impl Into<jacquard_common::types::string::AtUri<'a>>, 94 + ) -> SubscriptionBuilder<'a, subscription_state::SetPublication<S>> { 95 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 96 + SubscriptionBuilder { 97 + _phantom_state: ::core::marker::PhantomData, 98 + __unsafe_private_named: self.__unsafe_private_named, 99 + _phantom: ::core::marker::PhantomData, 100 + } 101 + } 102 + } 103 + 104 + impl<'a, S> SubscriptionBuilder<'a, S> 105 + where 106 + S: subscription_state::State, 107 + S::Publication: subscription_state::IsSet, 108 + { 109 + /// Build the final struct 110 + pub fn build(self) -> Subscription<'a> { 111 + Subscription { 112 + publication: self.__unsafe_private_named.0.unwrap(), 113 + extra_data: Default::default(), 114 + } 115 + } 116 + /// Build the final struct with custom extra_data 117 + pub fn build_with_data( 118 + self, 119 + extra_data: std::collections::BTreeMap< 120 + jacquard_common::smol_str::SmolStr, 121 + jacquard_common::types::value::Data<'a>, 122 + >, 123 + ) -> Subscription<'a> { 124 + Subscription { 125 + publication: self.__unsafe_private_named.0.unwrap(), 126 + extra_data: Some(extra_data), 127 + } 128 + } 129 + } 130 + 131 + impl<'a> Subscription<'a> { 132 + pub fn uri( 133 + uri: impl Into<jacquard_common::CowStr<'a>>, 134 + ) -> Result< 135 + jacquard_common::types::uri::RecordUri<'a, SubscriptionRecord>, 136 + jacquard_common::types::uri::UriError, 137 + > { 138 + jacquard_common::types::uri::RecordUri::try_from_uri( 139 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 140 + ) 141 + } 142 + } 143 + 144 + /// Typed wrapper for GetRecord response with this collection's record type. 145 + #[derive( 146 + serde::Serialize, 147 + serde::Deserialize, 148 + Debug, 149 + Clone, 150 + PartialEq, 151 + Eq, 152 + jacquard_derive::IntoStatic 153 + )] 154 + #[serde(rename_all = "camelCase")] 155 + pub struct SubscriptionGetRecordOutput<'a> { 156 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 157 + #[serde(borrow)] 158 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 159 + #[serde(borrow)] 160 + pub uri: jacquard_common::types::string::AtUri<'a>, 161 + #[serde(borrow)] 162 + pub value: Subscription<'a>, 163 + } 164 + 165 + impl From<SubscriptionGetRecordOutput<'_>> for Subscription<'_> { 166 + fn from(output: SubscriptionGetRecordOutput<'_>) -> Self { 167 + use jacquard_common::IntoStatic; 168 + output.value.into_static() 169 + } 170 + } 171 + 172 + impl jacquard_common::types::collection::Collection for Subscription<'_> { 173 + const NSID: &'static str = "site.standard.graph.subscription"; 174 + type Record = SubscriptionRecord; 175 + } 176 + 177 + /// Marker type for deserializing records from this collection. 178 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 179 + pub struct SubscriptionRecord; 180 + impl jacquard_common::xrpc::XrpcResp for SubscriptionRecord { 181 + const NSID: &'static str = "site.standard.graph.subscription"; 182 + const ENCODING: &'static str = "application/json"; 183 + type Output<'de> = SubscriptionGetRecordOutput<'de>; 184 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 185 + } 186 + 187 + impl jacquard_common::types::collection::Collection for SubscriptionRecord { 188 + const NSID: &'static str = "site.standard.graph.subscription"; 189 + type Record = SubscriptionRecord; 190 + } 191 + 192 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Subscription<'a> { 193 + fn nsid() -> &'static str { 194 + "site.standard.graph.subscription" 195 + } 196 + fn def_name() -> &'static str { 197 + "main" 198 + } 199 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 200 + lexicon_doc_site_standard_graph_subscription() 201 + } 202 + fn validate( 203 + &self, 204 + ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 205 + Ok(()) 206 + } 207 + } 208 + 209 + fn lexicon_doc_site_standard_graph_subscription() -> ::jacquard_lexicon::lexicon::LexiconDoc< 210 + 'static, 211 + > { 212 + ::jacquard_lexicon::lexicon::LexiconDoc { 213 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 214 + id: ::jacquard_common::CowStr::new_static("site.standard.graph.subscription"), 215 + revision: None, 216 + description: None, 217 + defs: { 218 + let mut map = ::alloc::collections::BTreeMap::new(); 219 + map.insert( 220 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 221 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 222 + description: Some( 223 + ::jacquard_common::CowStr::new_static( 224 + "Record declaring a subscription to a publication", 225 + ), 226 + ), 227 + key: Some(::jacquard_common::CowStr::new_static("tid")), 228 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 229 + description: None, 230 + required: Some( 231 + vec![ 232 + ::jacquard_common::smol_str::SmolStr::new_static("publication") 233 + ], 234 + ), 235 + nullable: None, 236 + properties: { 237 + #[allow(unused_mut)] 238 + let mut map = ::alloc::collections::BTreeMap::new(); 239 + map.insert( 240 + ::jacquard_common::smol_str::SmolStr::new_static( 241 + "publication", 242 + ), 243 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 244 + description: Some( 245 + ::jacquard_common::CowStr::new_static( 246 + "AT-URI reference to the publication record being subscribed to (ex: at://did:plc:abc123/site.standard.publication/xyz789).", 247 + ), 248 + ), 249 + format: Some( 250 + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 251 + ), 252 + default: None, 253 + min_length: None, 254 + max_length: None, 255 + min_graphemes: None, 256 + max_graphemes: None, 257 + r#enum: None, 258 + r#const: None, 259 + known_values: None, 260 + }), 261 + ); 262 + map 263 + }, 264 + }), 265 + }), 266 + ); 267 + map 268 + }, 269 + } 270 + }
+224 -130
crates/weaver-api/src/site_standard/publication.rs
··· 5 5 // This file was automatically generated from Lexicon schemas. 6 6 // Any manual changes will be overwritten on the next regeneration. 7 7 8 + /// A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings. 8 9 #[jacquard_derive::lexicon] 9 10 #[derive( 10 11 serde::Serialize, ··· 17 18 )] 18 19 #[serde(rename_all = "camelCase")] 19 20 pub struct Publication<'a> { 21 + /// Simplified publication theme for tools and apps to utilize when displaying content. 20 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 23 #[serde(borrow)] 22 24 pub basic_theme: std::option::Option<crate::site_standard::theme::basic::Basic<'a>>, 25 + /// Brief description of the publication. 23 26 #[serde(skip_serializing_if = "std::option::Option::is_none")] 24 27 #[serde(borrow)] 25 28 pub description: std::option::Option<jacquard_common::CowStr<'a>>, 29 + /// Square image to identify the publication. Should be at least 256x256. 26 30 #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 31 #[serde(borrow)] 28 32 pub icon: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 33 + /// Name of the publication. 29 34 #[serde(borrow)] 30 35 pub name: jacquard_common::CowStr<'a>, 36 + /// Object containing platform specific preferences (with a few shared properties). 31 37 #[serde(skip_serializing_if = "std::option::Option::is_none")] 32 38 #[serde(borrow)] 33 39 pub preferences: std::option::Option< 34 40 crate::site_standard::publication::Preferences<'a>, 35 41 >, 42 + /// Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path. 36 43 #[serde(borrow)] 37 44 pub url: jacquard_common::types::string::Uri<'a>, 38 45 } ··· 265 272 } 266 273 } 267 274 268 - fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::LexiconDoc< 269 - 'static, 270 - > { 271 - ::jacquard_lexicon::lexicon::LexiconDoc { 272 - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 273 - id: ::jacquard_common::CowStr::new_static("site.standard.publication"), 274 - revision: None, 275 - description: None, 276 - defs: { 277 - let mut map = ::alloc::collections::BTreeMap::new(); 278 - map.insert( 279 - ::jacquard_common::smol_str::SmolStr::new_static("main"), 280 - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 281 - description: None, 282 - required: Some( 283 - vec![ 284 - ::jacquard_common::smol_str::SmolStr::new_static("url"), 285 - ::jacquard_common::smol_str::SmolStr::new_static("name") 286 - ], 287 - ), 288 - nullable: None, 289 - properties: { 290 - #[allow(unused_mut)] 291 - let mut map = ::alloc::collections::BTreeMap::new(); 292 - map.insert( 293 - ::jacquard_common::smol_str::SmolStr::new_static( 294 - "basicTheme", 295 - ), 296 - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 297 - description: None, 298 - r#ref: ::jacquard_common::CowStr::new_static( 299 - "site.standard.theme.basic", 300 - ), 301 - }), 302 - ); 303 - map.insert( 304 - ::jacquard_common::smol_str::SmolStr::new_static( 305 - "description", 306 - ), 307 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 308 - description: None, 309 - format: None, 310 - default: None, 311 - min_length: None, 312 - max_length: Some(3000usize), 313 - min_graphemes: None, 314 - max_graphemes: Some(300usize), 315 - r#enum: None, 316 - r#const: None, 317 - known_values: None, 318 - }), 319 - ); 320 - map.insert( 321 - ::jacquard_common::smol_str::SmolStr::new_static("icon"), 322 - ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 323 - description: None, 324 - accept: None, 325 - max_size: None, 326 - }), 327 - ); 328 - map.insert( 329 - ::jacquard_common::smol_str::SmolStr::new_static("name"), 330 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 331 - description: None, 332 - format: None, 333 - default: None, 334 - min_length: None, 335 - max_length: Some(1280usize), 336 - min_graphemes: None, 337 - max_graphemes: Some(128usize), 338 - r#enum: None, 339 - r#const: None, 340 - known_values: None, 341 - }), 342 - ); 343 - map.insert( 344 - ::jacquard_common::smol_str::SmolStr::new_static( 345 - "preferences", 346 - ), 347 - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 348 - description: None, 349 - r#ref: ::jacquard_common::CowStr::new_static("#preferences"), 350 - }), 351 - ); 352 - map.insert( 353 - ::jacquard_common::smol_str::SmolStr::new_static("url"), 354 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 355 - description: None, 356 - format: Some( 357 - ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 358 - ), 359 - default: None, 360 - min_length: None, 361 - max_length: None, 362 - min_graphemes: None, 363 - max_graphemes: None, 364 - r#enum: None, 365 - r#const: None, 366 - known_values: None, 367 - }), 368 - ); 369 - map 370 - }, 371 - }), 372 - ); 373 - map.insert( 374 - ::jacquard_common::smol_str::SmolStr::new_static("preferences"), 375 - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 376 - description: None, 377 - required: None, 378 - nullable: None, 379 - properties: { 380 - #[allow(unused_mut)] 381 - let mut map = ::alloc::collections::BTreeMap::new(); 382 - map.insert( 383 - ::jacquard_common::smol_str::SmolStr::new_static( 384 - "showInDiscover", 385 - ), 386 - ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 387 - description: None, 388 - default: None, 389 - r#const: None, 390 - }), 391 - ); 392 - map 393 - }, 394 - }), 395 - ); 396 - map 397 - }, 275 + impl<'a> Publication<'a> { 276 + pub fn uri( 277 + uri: impl Into<jacquard_common::CowStr<'a>>, 278 + ) -> Result< 279 + jacquard_common::types::uri::RecordUri<'a, PublicationRecord>, 280 + jacquard_common::types::uri::UriError, 281 + > { 282 + jacquard_common::types::uri::RecordUri::try_from_uri( 283 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 284 + ) 285 + } 286 + } 287 + 288 + /// Typed wrapper for GetRecord response with this collection's record type. 289 + #[derive( 290 + serde::Serialize, 291 + serde::Deserialize, 292 + Debug, 293 + Clone, 294 + PartialEq, 295 + Eq, 296 + jacquard_derive::IntoStatic 297 + )] 298 + #[serde(rename_all = "camelCase")] 299 + pub struct PublicationGetRecordOutput<'a> { 300 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 301 + #[serde(borrow)] 302 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 303 + #[serde(borrow)] 304 + pub uri: jacquard_common::types::string::AtUri<'a>, 305 + #[serde(borrow)] 306 + pub value: Publication<'a>, 307 + } 308 + 309 + impl From<PublicationGetRecordOutput<'_>> for Publication<'_> { 310 + fn from(output: PublicationGetRecordOutput<'_>) -> Self { 311 + use jacquard_common::IntoStatic; 312 + output.value.into_static() 398 313 } 399 314 } 400 315 316 + impl jacquard_common::types::collection::Collection for Publication<'_> { 317 + const NSID: &'static str = "site.standard.publication"; 318 + type Record = PublicationRecord; 319 + } 320 + 321 + /// Marker type for deserializing records from this collection. 322 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 323 + pub struct PublicationRecord; 324 + impl jacquard_common::xrpc::XrpcResp for PublicationRecord { 325 + const NSID: &'static str = "site.standard.publication"; 326 + const ENCODING: &'static str = "application/json"; 327 + type Output<'de> = PublicationGetRecordOutput<'de>; 328 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 329 + } 330 + 331 + impl jacquard_common::types::collection::Collection for PublicationRecord { 332 + const NSID: &'static str = "site.standard.publication"; 333 + type Record = PublicationRecord; 334 + } 335 + 401 336 impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Publication<'a> { 402 337 fn nsid() -> &'static str { 403 338 "site.standard.publication" ··· 477 412 } 478 413 } 479 414 415 + fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::LexiconDoc< 416 + 'static, 417 + > { 418 + ::jacquard_lexicon::lexicon::LexiconDoc { 419 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 420 + id: ::jacquard_common::CowStr::new_static("site.standard.publication"), 421 + revision: None, 422 + description: None, 423 + defs: { 424 + let mut map = ::alloc::collections::BTreeMap::new(); 425 + map.insert( 426 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 427 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 428 + description: Some( 429 + ::jacquard_common::CowStr::new_static( 430 + "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings.", 431 + ), 432 + ), 433 + key: Some(::jacquard_common::CowStr::new_static("tid")), 434 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 435 + description: None, 436 + required: Some( 437 + vec![ 438 + ::jacquard_common::smol_str::SmolStr::new_static("url"), 439 + ::jacquard_common::smol_str::SmolStr::new_static("name") 440 + ], 441 + ), 442 + nullable: None, 443 + properties: { 444 + #[allow(unused_mut)] 445 + let mut map = ::alloc::collections::BTreeMap::new(); 446 + map.insert( 447 + ::jacquard_common::smol_str::SmolStr::new_static( 448 + "basicTheme", 449 + ), 450 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 451 + description: None, 452 + r#ref: ::jacquard_common::CowStr::new_static( 453 + "site.standard.theme.basic", 454 + ), 455 + }), 456 + ); 457 + map.insert( 458 + ::jacquard_common::smol_str::SmolStr::new_static( 459 + "description", 460 + ), 461 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 462 + description: Some( 463 + ::jacquard_common::CowStr::new_static( 464 + "Brief description of the publication.", 465 + ), 466 + ), 467 + format: None, 468 + default: None, 469 + min_length: None, 470 + max_length: Some(3000usize), 471 + min_graphemes: None, 472 + max_graphemes: Some(300usize), 473 + r#enum: None, 474 + r#const: None, 475 + known_values: None, 476 + }), 477 + ); 478 + map.insert( 479 + ::jacquard_common::smol_str::SmolStr::new_static("icon"), 480 + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 481 + description: None, 482 + accept: None, 483 + max_size: None, 484 + }), 485 + ); 486 + map.insert( 487 + ::jacquard_common::smol_str::SmolStr::new_static("name"), 488 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 489 + description: Some( 490 + ::jacquard_common::CowStr::new_static( 491 + "Name of the publication.", 492 + ), 493 + ), 494 + format: None, 495 + default: None, 496 + min_length: None, 497 + max_length: Some(1280usize), 498 + min_graphemes: None, 499 + max_graphemes: Some(128usize), 500 + r#enum: None, 501 + r#const: None, 502 + known_values: None, 503 + }), 504 + ); 505 + map.insert( 506 + ::jacquard_common::smol_str::SmolStr::new_static( 507 + "preferences", 508 + ), 509 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 510 + description: None, 511 + r#ref: ::jacquard_common::CowStr::new_static("#preferences"), 512 + }), 513 + ); 514 + map.insert( 515 + ::jacquard_common::smol_str::SmolStr::new_static("url"), 516 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 517 + description: Some( 518 + ::jacquard_common::CowStr::new_static( 519 + "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path.", 520 + ), 521 + ), 522 + format: Some( 523 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 524 + ), 525 + default: None, 526 + min_length: None, 527 + max_length: None, 528 + min_graphemes: None, 529 + max_graphemes: None, 530 + r#enum: None, 531 + r#const: None, 532 + known_values: None, 533 + }), 534 + ); 535 + map 536 + }, 537 + }), 538 + }), 539 + ); 540 + map.insert( 541 + ::jacquard_common::smol_str::SmolStr::new_static("preferences"), 542 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 543 + description: Some( 544 + ::jacquard_common::CowStr::new_static( 545 + "Platform-specific preferences for the publication, including discovery and visibility settings.", 546 + ), 547 + ), 548 + required: None, 549 + nullable: None, 550 + properties: { 551 + #[allow(unused_mut)] 552 + let mut map = ::alloc::collections::BTreeMap::new(); 553 + map.insert( 554 + ::jacquard_common::smol_str::SmolStr::new_static( 555 + "showInDiscover", 556 + ), 557 + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 558 + description: None, 559 + default: None, 560 + r#const: None, 561 + }), 562 + ); 563 + map 564 + }, 565 + }), 566 + ); 567 + map 568 + }, 569 + } 570 + } 571 + 572 + /// Platform-specific preferences for the publication, including discovery and visibility settings. 480 573 #[jacquard_derive::lexicon] 481 574 #[derive( 482 575 serde::Serialize, ··· 490 583 )] 491 584 #[serde(rename_all = "camelCase")] 492 585 pub struct Preferences<'a> { 586 + /// Boolean which decides whether the publication should appear in discovery feeds. 493 587 #[serde(skip_serializing_if = "std::option::Option::is_none")] 494 588 pub show_in_discover: std::option::Option<bool>, 495 589 }
+47 -22
crates/weaver-api/src/site_standard/theme/basic.rs
··· 5 5 // This file was automatically generated from Lexicon schemas. 6 6 // Any manual changes will be overwritten on the next regeneration. 7 7 8 + /// A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications. 8 9 #[jacquard_derive::lexicon] 9 10 #[derive( 10 11 serde::Serialize, ··· 17 18 )] 18 19 #[serde(rename_all = "camelCase")] 19 20 pub struct Basic<'a> { 21 + /// Color used for links and button backgrounds. 20 22 #[serde(borrow)] 21 23 pub accent: crate::site_standard::theme::color::Rgb<'a>, 24 + /// Color used for button text. 22 25 #[serde(borrow)] 23 26 pub accent_foreground: crate::site_standard::theme::color::Rgb<'a>, 27 + /// Color used for content background. 24 28 #[serde(borrow)] 25 29 pub background: crate::site_standard::theme::color::Rgb<'a>, 30 + /// Color used for content text. 26 31 #[serde(borrow)] 27 32 pub foreground: crate::site_standard::theme::color::Rgb<'a>, 28 33 } ··· 37 42 } 38 43 /// State trait tracking which required fields have been set 39 44 pub trait State: sealed::Sealed { 40 - type AccentForeground; 41 45 type Accent; 42 46 type Background; 47 + type AccentForeground; 43 48 type Foreground; 44 49 } 45 50 /// Empty state - all required fields are unset 46 51 pub struct Empty(()); 47 52 impl sealed::Sealed for Empty {} 48 53 impl State for Empty { 49 - type AccentForeground = Unset; 50 54 type Accent = Unset; 51 55 type Background = Unset; 56 + type AccentForeground = Unset; 52 57 type Foreground = Unset; 53 - } 54 - ///State transition - sets the `accent_foreground` field to Set 55 - pub struct SetAccentForeground<S: State = Empty>(PhantomData<fn() -> S>); 56 - impl<S: State> sealed::Sealed for SetAccentForeground<S> {} 57 - impl<S: State> State for SetAccentForeground<S> { 58 - type AccentForeground = Set<members::accent_foreground>; 59 - type Accent = S::Accent; 60 - type Background = S::Background; 61 - type Foreground = S::Foreground; 62 58 } 63 59 ///State transition - sets the `accent` field to Set 64 60 pub struct SetAccent<S: State = Empty>(PhantomData<fn() -> S>); 65 61 impl<S: State> sealed::Sealed for SetAccent<S> {} 66 62 impl<S: State> State for SetAccent<S> { 67 - type AccentForeground = S::AccentForeground; 68 63 type Accent = Set<members::accent>; 69 64 type Background = S::Background; 65 + type AccentForeground = S::AccentForeground; 70 66 type Foreground = S::Foreground; 71 67 } 72 68 ///State transition - sets the `background` field to Set 73 69 pub struct SetBackground<S: State = Empty>(PhantomData<fn() -> S>); 74 70 impl<S: State> sealed::Sealed for SetBackground<S> {} 75 71 impl<S: State> State for SetBackground<S> { 72 + type Accent = S::Accent; 73 + type Background = Set<members::background>; 76 74 type AccentForeground = S::AccentForeground; 75 + type Foreground = S::Foreground; 76 + } 77 + ///State transition - sets the `accent_foreground` field to Set 78 + pub struct SetAccentForeground<S: State = Empty>(PhantomData<fn() -> S>); 79 + impl<S: State> sealed::Sealed for SetAccentForeground<S> {} 80 + impl<S: State> State for SetAccentForeground<S> { 77 81 type Accent = S::Accent; 78 - type Background = Set<members::background>; 82 + type Background = S::Background; 83 + type AccentForeground = Set<members::accent_foreground>; 79 84 type Foreground = S::Foreground; 80 85 } 81 86 ///State transition - sets the `foreground` field to Set 82 87 pub struct SetForeground<S: State = Empty>(PhantomData<fn() -> S>); 83 88 impl<S: State> sealed::Sealed for SetForeground<S> {} 84 89 impl<S: State> State for SetForeground<S> { 85 - type AccentForeground = S::AccentForeground; 86 90 type Accent = S::Accent; 87 91 type Background = S::Background; 92 + type AccentForeground = S::AccentForeground; 88 93 type Foreground = Set<members::foreground>; 89 94 } 90 95 /// Marker types for field names 91 96 #[allow(non_camel_case_types)] 92 97 pub mod members { 93 - ///Marker type for the `accent_foreground` field 94 - pub struct accent_foreground(()); 95 98 ///Marker type for the `accent` field 96 99 pub struct accent(()); 97 100 ///Marker type for the `background` field 98 101 pub struct background(()); 102 + ///Marker type for the `accent_foreground` field 103 + pub struct accent_foreground(()); 99 104 ///Marker type for the `foreground` field 100 105 pub struct foreground(()); 101 106 } ··· 210 215 impl<'a, S> BasicBuilder<'a, S> 211 216 where 212 217 S: basic_state::State, 213 - S::AccentForeground: basic_state::IsSet, 214 218 S::Accent: basic_state::IsSet, 215 219 S::Background: basic_state::IsSet, 220 + S::AccentForeground: basic_state::IsSet, 216 221 S::Foreground: basic_state::IsSet, 217 222 { 218 223 /// Build the final struct ··· 256 261 map.insert( 257 262 ::jacquard_common::smol_str::SmolStr::new_static("main"), 258 263 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 259 - description: None, 264 + description: Some( 265 + ::jacquard_common::CowStr::new_static( 266 + "A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications.", 267 + ), 268 + ), 260 269 required: Some( 261 270 vec![ 262 271 ::jacquard_common::smol_str::SmolStr::new_static("background"), ··· 272 281 map.insert( 273 282 ::jacquard_common::smol_str::SmolStr::new_static("accent"), 274 283 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 275 - description: None, 284 + description: Some( 285 + ::jacquard_common::CowStr::new_static( 286 + "Color used for links and button backgrounds.", 287 + ), 288 + ), 276 289 refs: vec![ 277 290 ::jacquard_common::CowStr::new_static("site.standard.theme.color#rgb") 278 291 ], ··· 284 297 "accentForeground", 285 298 ), 286 299 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 287 - description: None, 300 + description: Some( 301 + ::jacquard_common::CowStr::new_static( 302 + "Color used for button text.", 303 + ), 304 + ), 288 305 refs: vec![ 289 306 ::jacquard_common::CowStr::new_static("site.standard.theme.color#rgb") 290 307 ], ··· 296 313 "background", 297 314 ), 298 315 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 299 - description: None, 316 + description: Some( 317 + ::jacquard_common::CowStr::new_static( 318 + "Color used for content background.", 319 + ), 320 + ), 300 321 refs: vec![ 301 322 ::jacquard_common::CowStr::new_static("site.standard.theme.color#rgb") 302 323 ], ··· 308 329 "foreground", 309 330 ), 310 331 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 311 - description: None, 332 + description: Some( 333 + ::jacquard_common::CowStr::new_static( 334 + "Color used for content text.", 335 + ), 336 + ), 312 337 refs: vec![ 313 338 ::jacquard_common::CowStr::new_static("site.standard.theme.color#rgb") 314 339 ],
+32 -32
crates/weaver-api/src/site_standard/theme/color.rs
··· 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 35 type G; 36 - type B; 37 36 type R; 37 + type B; 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 43 type G = Unset; 44 - type B = Unset; 45 44 type R = Unset; 45 + type B = Unset; 46 46 } 47 47 ///State transition - sets the `g` field to Set 48 48 pub struct SetG<S: State = Empty>(PhantomData<fn() -> S>); 49 49 impl<S: State> sealed::Sealed for SetG<S> {} 50 50 impl<S: State> State for SetG<S> { 51 51 type G = Set<members::g>; 52 - type B = S::B; 53 52 type R = S::R; 54 - } 55 - ///State transition - sets the `b` field to Set 56 - pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>); 57 - impl<S: State> sealed::Sealed for SetB<S> {} 58 - impl<S: State> State for SetB<S> { 59 - type G = S::G; 60 - type B = Set<members::b>; 61 - type R = S::R; 53 + type B = S::B; 62 54 } 63 55 ///State transition - sets the `r` field to Set 64 56 pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>); 65 57 impl<S: State> sealed::Sealed for SetR<S> {} 66 58 impl<S: State> State for SetR<S> { 67 59 type G = S::G; 68 - type B = S::B; 69 60 type R = Set<members::r>; 61 + type B = S::B; 62 + } 63 + ///State transition - sets the `b` field to Set 64 + pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetB<S> {} 66 + impl<S: State> State for SetB<S> { 67 + type G = S::G; 68 + type R = S::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 74 ///Marker type for the `g` field 75 75 pub struct g(()); 76 + ///Marker type for the `r` field 77 + pub struct r(()); 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 ··· 161 161 where 162 162 S: rgb_state::State, 163 163 S::G: rgb_state::IsSet, 164 - S::B: rgb_state::IsSet, 165 164 S::R: rgb_state::IsSet, 165 + S::B: 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 G; 442 - type R; 443 442 type A; 444 443 type B; 444 + type R; 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 450 type G = Unset; 451 - type R = Unset; 452 451 type A = Unset; 453 452 type B = Unset; 453 + type R = Unset; 454 454 } 455 455 ///State transition - sets the `g` field to Set 456 456 pub struct SetG<S: State = Empty>(PhantomData<fn() -> S>); 457 457 impl<S: State> sealed::Sealed for SetG<S> {} 458 458 impl<S: State> State for SetG<S> { 459 459 type G = Set<members::g>; 460 - type R = S::R; 461 460 type A = S::A; 462 461 type B = S::B; 463 - } 464 - ///State transition - sets the `r` field to Set 465 - pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>); 466 - impl<S: State> sealed::Sealed for SetR<S> {} 467 - impl<S: State> State for SetR<S> { 468 - type G = S::G; 469 - type R = Set<members::r>; 470 - type A = S::A; 471 - type B = S::B; 462 + type R = S::R; 472 463 } 473 464 ///State transition - sets the `a` field to Set 474 465 pub struct SetA<S: State = Empty>(PhantomData<fn() -> S>); 475 466 impl<S: State> sealed::Sealed for SetA<S> {} 476 467 impl<S: State> State for SetA<S> { 477 468 type G = S::G; 478 - type R = S::R; 479 469 type A = Set<members::a>; 480 470 type B = S::B; 471 + type R = S::R; 481 472 } 482 473 ///State transition - sets the `b` field to Set 483 474 pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>); 484 475 impl<S: State> sealed::Sealed for SetB<S> {} 485 476 impl<S: State> State for SetB<S> { 486 477 type G = S::G; 478 + type A = S::A; 479 + type B = Set<members::b>; 487 480 type R = S::R; 481 + } 482 + ///State transition - sets the `r` field to Set 483 + pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>); 484 + impl<S: State> sealed::Sealed for SetR<S> {} 485 + impl<S: State> State for SetR<S> { 486 + type G = S::G; 488 487 type A = S::A; 489 - type B = Set<members::b>; 488 + type B = S::B; 489 + type R = Set<members::r>; 490 490 } 491 491 /// Marker types for field names 492 492 #[allow(non_camel_case_types)] 493 493 pub mod members { 494 494 ///Marker type for the `g` field 495 495 pub struct g(()); 496 - ///Marker type for the `r` field 497 - pub struct r(()); 498 496 ///Marker type for the `a` field 499 497 pub struct a(()); 500 498 ///Marker type for the `b` field 501 499 pub struct b(()); 500 + ///Marker type for the `r` field 501 + pub struct r(()); 502 502 } 503 503 } 504 504 ··· 600 600 where 601 601 S: rgba_state::State, 602 602 S::G: rgba_state::IsSet, 603 - S::R: rgba_state::IsSet, 604 603 S::A: rgba_state::IsSet, 605 604 S::B: rgba_state::IsSet, 605 + S::R: rgba_state::IsSet, 606 606 { 607 607 /// Build the final struct 608 608 pub fn build(self) -> Rgba<'a> {
+43 -43
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 ContentMarkdown; 59 58 type Disabled; 60 59 type LastUpdatedBy; 60 + type Name; 61 61 type CreatedAt; 62 - type Name; 63 62 type UpdatedAt; 64 63 type Id; 64 + type ContentMarkdown; 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 ContentMarkdown = Unset; 71 70 type Disabled = Unset; 72 71 type LastUpdatedBy = Unset; 72 + type Name = Unset; 73 73 type CreatedAt = Unset; 74 - type Name = Unset; 75 74 type UpdatedAt = Unset; 76 75 type Id = Unset; 77 - } 78 - ///State transition - sets the `content_markdown` field to Set 79 - pub struct SetContentMarkdown<S: State = Empty>(PhantomData<fn() -> S>); 80 - impl<S: State> sealed::Sealed for SetContentMarkdown<S> {} 81 - impl<S: State> State for SetContentMarkdown<S> { 82 - type ContentMarkdown = Set<members::content_markdown>; 83 - type Disabled = S::Disabled; 84 - type LastUpdatedBy = S::LastUpdatedBy; 85 - type CreatedAt = S::CreatedAt; 86 - type Name = S::Name; 87 - type UpdatedAt = S::UpdatedAt; 88 - type Id = S::Id; 76 + type ContentMarkdown = Unset; 89 77 } 90 78 ///State transition - sets the `disabled` field to Set 91 79 pub struct SetDisabled<S: State = Empty>(PhantomData<fn() -> S>); 92 80 impl<S: State> sealed::Sealed for SetDisabled<S> {} 93 81 impl<S: State> State for SetDisabled<S> { 94 - type ContentMarkdown = S::ContentMarkdown; 95 82 type Disabled = Set<members::disabled>; 96 83 type LastUpdatedBy = S::LastUpdatedBy; 97 - type CreatedAt = S::CreatedAt; 98 84 type Name = S::Name; 85 + type CreatedAt = S::CreatedAt; 99 86 type UpdatedAt = S::UpdatedAt; 100 87 type Id = S::Id; 88 + type ContentMarkdown = S::ContentMarkdown; 101 89 } 102 90 ///State transition - sets the `last_updated_by` field to Set 103 91 pub struct SetLastUpdatedBy<S: State = Empty>(PhantomData<fn() -> S>); 104 92 impl<S: State> sealed::Sealed for SetLastUpdatedBy<S> {} 105 93 impl<S: State> State for SetLastUpdatedBy<S> { 106 - type ContentMarkdown = S::ContentMarkdown; 107 94 type Disabled = S::Disabled; 108 95 type LastUpdatedBy = Set<members::last_updated_by>; 109 - type CreatedAt = S::CreatedAt; 110 96 type Name = S::Name; 97 + type CreatedAt = S::CreatedAt; 111 98 type UpdatedAt = S::UpdatedAt; 112 99 type Id = S::Id; 113 - } 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> { 118 100 type ContentMarkdown = S::ContentMarkdown; 119 - type Disabled = S::Disabled; 120 - type LastUpdatedBy = S::LastUpdatedBy; 121 - type CreatedAt = Set<members::created_at>; 122 - type Name = S::Name; 123 - type UpdatedAt = S::UpdatedAt; 124 - type Id = S::Id; 125 101 } 126 102 ///State transition - sets the `name` field to Set 127 103 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 128 104 impl<S: State> sealed::Sealed for SetName<S> {} 129 105 impl<S: State> State for SetName<S> { 130 - type ContentMarkdown = S::ContentMarkdown; 131 106 type Disabled = S::Disabled; 132 107 type LastUpdatedBy = S::LastUpdatedBy; 133 - type CreatedAt = S::CreatedAt; 134 108 type Name = Set<members::name>; 109 + type CreatedAt = S::CreatedAt; 135 110 type UpdatedAt = S::UpdatedAt; 136 111 type Id = S::Id; 112 + type ContentMarkdown = S::ContentMarkdown; 113 + } 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> { 118 + type Disabled = S::Disabled; 119 + type LastUpdatedBy = S::LastUpdatedBy; 120 + type Name = S::Name; 121 + type CreatedAt = Set<members::created_at>; 122 + type UpdatedAt = S::UpdatedAt; 123 + type Id = S::Id; 124 + type ContentMarkdown = S::ContentMarkdown; 137 125 } 138 126 ///State transition - sets the `updated_at` field to Set 139 127 pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 140 128 impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 141 129 impl<S: State> State for SetUpdatedAt<S> { 142 - type ContentMarkdown = S::ContentMarkdown; 143 130 type Disabled = S::Disabled; 144 131 type LastUpdatedBy = S::LastUpdatedBy; 145 - type CreatedAt = S::CreatedAt; 146 132 type Name = S::Name; 133 + type CreatedAt = S::CreatedAt; 147 134 type UpdatedAt = Set<members::updated_at>; 148 135 type Id = S::Id; 136 + type ContentMarkdown = S::ContentMarkdown; 149 137 } 150 138 ///State transition - sets the `id` field to Set 151 139 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 152 140 impl<S: State> sealed::Sealed for SetId<S> {} 153 141 impl<S: State> State for SetId<S> { 142 + type Disabled = S::Disabled; 143 + type LastUpdatedBy = S::LastUpdatedBy; 144 + type Name = S::Name; 145 + type CreatedAt = S::CreatedAt; 146 + type UpdatedAt = S::UpdatedAt; 147 + type Id = Set<members::id>; 154 148 type ContentMarkdown = S::ContentMarkdown; 149 + } 150 + ///State transition - sets the `content_markdown` field to Set 151 + pub struct SetContentMarkdown<S: State = Empty>(PhantomData<fn() -> S>); 152 + impl<S: State> sealed::Sealed for SetContentMarkdown<S> {} 153 + impl<S: State> State for SetContentMarkdown<S> { 155 154 type Disabled = S::Disabled; 156 155 type LastUpdatedBy = S::LastUpdatedBy; 156 + type Name = S::Name; 157 157 type CreatedAt = S::CreatedAt; 158 - type Name = S::Name; 159 158 type UpdatedAt = S::UpdatedAt; 160 - type Id = Set<members::id>; 159 + type Id = S::Id; 160 + type ContentMarkdown = Set<members::content_markdown>; 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 `content_markdown` field 166 - pub struct content_markdown(()); 167 165 ///Marker type for the `disabled` field 168 166 pub struct disabled(()); 169 167 ///Marker type for the `last_updated_by` field 170 168 pub struct last_updated_by(()); 171 - ///Marker type for the `created_at` field 172 - pub struct created_at(()); 173 169 ///Marker type for the `name` field 174 170 pub struct name(()); 171 + ///Marker type for the `created_at` field 172 + pub struct created_at(()); 175 173 ///Marker type for the `updated_at` field 176 174 pub struct updated_at(()); 177 175 ///Marker type for the `id` field 178 176 pub struct id(()); 177 + ///Marker type for the `content_markdown` field 178 + pub struct content_markdown(()); 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::ContentMarkdown: template_view_state::IsSet, 399 398 S::Disabled: template_view_state::IsSet, 400 399 S::LastUpdatedBy: template_view_state::IsSet, 401 - S::CreatedAt: template_view_state::IsSet, 402 400 S::Name: template_view_state::IsSet, 401 + S::CreatedAt: template_view_state::IsSet, 403 402 S::UpdatedAt: template_view_state::IsSet, 404 403 S::Id: template_view_state::IsSet, 404 + S::ContentMarkdown: template_view_state::IsSet, 405 405 { 406 406 /// Build the final struct 407 407 pub fn build(self) -> TemplateView<'a> {
+487 -487
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 CreatedAt; 5311 5310 type Status; 5311 + type CreatedAt; 5312 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 5318 type Status = Unset; 5319 + type CreatedAt = Unset; 5320 5320 type AttemptId = Unset; 5321 5321 } 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 - type Status = S::Status; 5328 - type AttemptId = S::AttemptId; 5329 - } 5330 5322 ///State transition - sets the `status` field to Set 5331 5323 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 5332 5324 impl<S: State> sealed::Sealed for SetStatus<S> {} 5333 5325 impl<S: State> State for SetStatus<S> { 5334 - type CreatedAt = S::CreatedAt; 5335 5326 type Status = Set<members::status>; 5327 + type CreatedAt = S::CreatedAt; 5328 + type AttemptId = S::AttemptId; 5329 + } 5330 + ///State transition - sets the `created_at` field to Set 5331 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 5332 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 5333 + impl<S: State> State for SetCreatedAt<S> { 5334 + type Status = S::Status; 5335 + type CreatedAt = Set<members::created_at>; 5336 5336 type AttemptId = S::AttemptId; 5337 5337 } 5338 5338 ///State transition - sets the `attempt_id` field to Set 5339 5339 pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 5340 5340 impl<S: State> sealed::Sealed for SetAttemptId<S> {} 5341 5341 impl<S: State> State for SetAttemptId<S> { 5342 - type CreatedAt = S::CreatedAt; 5343 5342 type Status = S::Status; 5343 + type CreatedAt = S::CreatedAt; 5344 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 `status` field 5350 + pub struct status(()); 5349 5351 ///Marker type for the `created_at` field 5350 5352 pub struct created_at(()); 5351 - ///Marker type for the `status` field 5352 - pub struct status(()); 5353 5353 ///Marker type for the `attempt_id` field 5354 5354 pub struct attempt_id(()); 5355 5355 } ··· 5589 5589 impl<'a, S> AgeAssuranceEventBuilder<'a, S> 5590 5590 where 5591 5591 S: age_assurance_event_state::State, 5592 - S::CreatedAt: age_assurance_event_state::IsSet, 5593 5592 S::Status: age_assurance_event_state::IsSet, 5593 + S::CreatedAt: age_assurance_event_state::IsSet, 5594 5594 S::AttemptId: age_assurance_event_state::IsSet, 5595 5595 { 5596 5596 /// Build the final struct ··· 5927 5927 /// State trait tracking which required fields have been set 5928 5928 pub trait State: sealed::Sealed { 5929 5929 type Size; 5930 - type MimeType; 5931 5930 type Cid; 5931 + type MimeType; 5932 5932 type CreatedAt; 5933 5933 } 5934 5934 /// Empty state - all required fields are unset ··· 5936 5936 impl sealed::Sealed for Empty {} 5937 5937 impl State for Empty { 5938 5938 type Size = Unset; 5939 - type MimeType = Unset; 5940 5939 type Cid = Unset; 5940 + type MimeType = Unset; 5941 5941 type CreatedAt = Unset; 5942 5942 } 5943 5943 ///State transition - sets the `size` field to Set ··· 5945 5945 impl<S: State> sealed::Sealed for SetSize<S> {} 5946 5946 impl<S: State> State for SetSize<S> { 5947 5947 type Size = Set<members::size>; 5948 - type MimeType = S::MimeType; 5949 5948 type Cid = S::Cid; 5950 - type CreatedAt = S::CreatedAt; 5951 - } 5952 - ///State transition - sets the `mime_type` field to Set 5953 - pub struct SetMimeType<S: State = Empty>(PhantomData<fn() -> S>); 5954 - impl<S: State> sealed::Sealed for SetMimeType<S> {} 5955 - impl<S: State> State for SetMimeType<S> { 5956 - type Size = S::Size; 5957 - type MimeType = Set<members::mime_type>; 5958 - type Cid = S::Cid; 5949 + type MimeType = S::MimeType; 5959 5950 type CreatedAt = S::CreatedAt; 5960 5951 } 5961 5952 ///State transition - sets the `cid` field to Set ··· 5963 5954 impl<S: State> sealed::Sealed for SetCid<S> {} 5964 5955 impl<S: State> State for SetCid<S> { 5965 5956 type Size = S::Size; 5966 - type MimeType = S::MimeType; 5967 5957 type Cid = Set<members::cid>; 5958 + type MimeType = S::MimeType; 5959 + type CreatedAt = S::CreatedAt; 5960 + } 5961 + ///State transition - sets the `mime_type` field to Set 5962 + pub struct SetMimeType<S: State = Empty>(PhantomData<fn() -> S>); 5963 + impl<S: State> sealed::Sealed for SetMimeType<S> {} 5964 + impl<S: State> State for SetMimeType<S> { 5965 + type Size = S::Size; 5966 + type Cid = S::Cid; 5967 + type MimeType = Set<members::mime_type>; 5968 5968 type CreatedAt = S::CreatedAt; 5969 5969 } 5970 5970 ///State transition - sets the `created_at` field to Set ··· 5972 5972 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 5973 5973 impl<S: State> State for SetCreatedAt<S> { 5974 5974 type Size = S::Size; 5975 - type MimeType = S::MimeType; 5976 5975 type Cid = S::Cid; 5976 + type MimeType = S::MimeType; 5977 5977 type CreatedAt = Set<members::created_at>; 5978 5978 } 5979 5979 /// Marker types for field names ··· 5981 5981 pub mod members { 5982 5982 ///Marker type for the `size` field 5983 5983 pub struct size(()); 5984 + ///Marker type for the `cid` field 5985 + pub struct cid(()); 5984 5986 ///Marker type for the `mime_type` field 5985 5987 pub struct mime_type(()); 5986 - ///Marker type for the `cid` field 5987 - pub struct cid(()); 5988 5988 ///Marker type for the `created_at` field 5989 5989 pub struct created_at(()); 5990 5990 } ··· 6134 6134 where 6135 6135 S: blob_view_state::State, 6136 6136 S::Size: blob_view_state::IsSet, 6137 - S::MimeType: blob_view_state::IsSet, 6138 6137 S::Cid: blob_view_state::IsSet, 6138 + S::MimeType: blob_view_state::IsSet, 6139 6139 S::CreatedAt: blob_view_state::IsSet, 6140 6140 { 6141 6141 /// Build the final struct ··· 8132 8132 } 8133 8133 /// State trait tracking which required fields have been set 8134 8134 pub trait State: sealed::Sealed { 8135 - type SubjectBlobCids; 8135 + type Subject; 8136 + type Event; 8136 8137 type CreatedBy; 8137 8138 type CreatedAt; 8138 8139 type Id; 8139 - type Event; 8140 - type Subject; 8140 + type SubjectBlobCids; 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 SubjectBlobCids = Unset; 8146 + type Subject = Unset; 8147 + type Event = Unset; 8147 8148 type CreatedBy = Unset; 8148 8149 type CreatedAt = Unset; 8149 8150 type Id = Unset; 8150 - type Event = Unset; 8151 - type Subject = Unset; 8151 + type SubjectBlobCids = Unset; 8152 8152 } 8153 - ///State transition - sets the `subject_blob_cids` field to Set 8154 - pub struct SetSubjectBlobCids<S: State = Empty>(PhantomData<fn() -> S>); 8155 - impl<S: State> sealed::Sealed for SetSubjectBlobCids<S> {} 8156 - impl<S: State> State for SetSubjectBlobCids<S> { 8157 - type SubjectBlobCids = Set<members::subject_blob_cids>; 8153 + ///State transition - sets the `subject` field to Set 8154 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 8155 + impl<S: State> sealed::Sealed for SetSubject<S> {} 8156 + impl<S: State> State for SetSubject<S> { 8157 + type Subject = Set<members::subject>; 8158 + type Event = S::Event; 8158 8159 type CreatedBy = S::CreatedBy; 8159 8160 type CreatedAt = S::CreatedAt; 8160 8161 type Id = S::Id; 8161 - type Event = S::Event; 8162 + type SubjectBlobCids = S::SubjectBlobCids; 8163 + } 8164 + ///State transition - sets the `event` field to Set 8165 + pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 8166 + impl<S: State> sealed::Sealed for SetEvent<S> {} 8167 + impl<S: State> State for SetEvent<S> { 8162 8168 type Subject = S::Subject; 8169 + type Event = Set<members::event>; 8170 + type CreatedBy = S::CreatedBy; 8171 + type CreatedAt = S::CreatedAt; 8172 + type Id = S::Id; 8173 + type SubjectBlobCids = S::SubjectBlobCids; 8163 8174 } 8164 8175 ///State transition - sets the `created_by` field to Set 8165 8176 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 8166 8177 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 8167 8178 impl<S: State> State for SetCreatedBy<S> { 8168 - type SubjectBlobCids = S::SubjectBlobCids; 8179 + type Subject = S::Subject; 8180 + type Event = S::Event; 8169 8181 type CreatedBy = Set<members::created_by>; 8170 8182 type CreatedAt = S::CreatedAt; 8171 8183 type Id = S::Id; 8172 - type Event = S::Event; 8173 - type Subject = S::Subject; 8184 + type SubjectBlobCids = S::SubjectBlobCids; 8174 8185 } 8175 8186 ///State transition - sets the `created_at` field to Set 8176 8187 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 8177 8188 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 8178 8189 impl<S: State> State for SetCreatedAt<S> { 8179 - type SubjectBlobCids = S::SubjectBlobCids; 8190 + type Subject = S::Subject; 8191 + type Event = S::Event; 8180 8192 type CreatedBy = S::CreatedBy; 8181 8193 type CreatedAt = Set<members::created_at>; 8182 8194 type Id = S::Id; 8183 - type Event = S::Event; 8184 - type Subject = S::Subject; 8195 + type SubjectBlobCids = S::SubjectBlobCids; 8185 8196 } 8186 8197 ///State transition - sets the `id` field to Set 8187 8198 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 8188 8199 impl<S: State> sealed::Sealed for SetId<S> {} 8189 8200 impl<S: State> State for SetId<S> { 8190 - type SubjectBlobCids = S::SubjectBlobCids; 8201 + type Subject = S::Subject; 8202 + type Event = S::Event; 8191 8203 type CreatedBy = S::CreatedBy; 8192 8204 type CreatedAt = S::CreatedAt; 8193 8205 type Id = Set<members::id>; 8194 - type Event = S::Event; 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> { 8201 8206 type SubjectBlobCids = S::SubjectBlobCids; 8202 - type CreatedBy = S::CreatedBy; 8203 - type CreatedAt = S::CreatedAt; 8204 - type Id = S::Id; 8205 - type Event = Set<members::event>; 8206 - type Subject = S::Subject; 8207 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; 8208 + ///State transition - sets the `subject_blob_cids` field to Set 8209 + pub struct SetSubjectBlobCids<S: State = Empty>(PhantomData<fn() -> S>); 8210 + impl<S: State> sealed::Sealed for SetSubjectBlobCids<S> {} 8211 + impl<S: State> State for SetSubjectBlobCids<S> { 8212 + type Subject = S::Subject; 8213 + type Event = S::Event; 8213 8214 type CreatedBy = S::CreatedBy; 8214 8215 type CreatedAt = S::CreatedAt; 8215 8216 type Id = S::Id; 8216 - type Event = S::Event; 8217 - type Subject = Set<members::subject>; 8217 + type SubjectBlobCids = Set<members::subject_blob_cids>; 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 `subject_blob_cids` field 8223 - pub struct subject_blob_cids(()); 8222 + ///Marker type for the `subject` field 8223 + pub struct subject(()); 8224 + ///Marker type for the `event` field 8225 + pub struct event(()); 8224 8226 ///Marker type for the `created_by` field 8225 8227 pub struct created_by(()); 8226 8228 ///Marker type for the `created_at` field 8227 8229 pub struct created_at(()); 8228 8230 ///Marker type for the `id` field 8229 8231 pub struct id(()); 8230 - ///Marker type for the `event` field 8231 - pub struct event(()); 8232 - ///Marker type for the `subject` field 8233 - pub struct subject(()); 8232 + ///Marker type for the `subject_blob_cids` field 8233 + pub struct subject_blob_cids(()); 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::SubjectBlobCids: mod_event_view_state::IsSet, 8456 + S::Subject: mod_event_view_state::IsSet, 8457 + S::Event: mod_event_view_state::IsSet, 8457 8458 S::CreatedBy: mod_event_view_state::IsSet, 8458 8459 S::CreatedAt: mod_event_view_state::IsSet, 8459 8460 S::Id: mod_event_view_state::IsSet, 8460 - S::Event: mod_event_view_state::IsSet, 8461 - S::Subject: mod_event_view_state::IsSet, 8461 + S::SubjectBlobCids: 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 Id; 8656 + type SubjectBlobs; 8655 8657 type CreatedBy; 8656 8658 type CreatedAt; 8657 - type Id; 8658 - type Subject; 8659 8659 type Event; 8660 - type SubjectBlobs; 8660 + type Subject; 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 Id = Unset; 8667 + type SubjectBlobs = Unset; 8666 8668 type CreatedBy = Unset; 8667 8669 type CreatedAt = Unset; 8668 - type Id = Unset; 8670 + type Event = Unset; 8669 8671 type Subject = Unset; 8670 - type Event = Unset; 8671 - type SubjectBlobs = Unset; 8672 + } 8673 + ///State transition - sets the `id` field to Set 8674 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 8675 + impl<S: State> sealed::Sealed for SetId<S> {} 8676 + impl<S: State> State for SetId<S> { 8677 + type Id = Set<members::id>; 8678 + type SubjectBlobs = S::SubjectBlobs; 8679 + type CreatedBy = S::CreatedBy; 8680 + type CreatedAt = S::CreatedAt; 8681 + type Event = S::Event; 8682 + type Subject = S::Subject; 8683 + } 8684 + ///State transition - sets the `subject_blobs` field to Set 8685 + pub struct SetSubjectBlobs<S: State = Empty>(PhantomData<fn() -> S>); 8686 + impl<S: State> sealed::Sealed for SetSubjectBlobs<S> {} 8687 + impl<S: State> State for SetSubjectBlobs<S> { 8688 + type Id = S::Id; 8689 + type SubjectBlobs = Set<members::subject_blobs>; 8690 + type CreatedBy = S::CreatedBy; 8691 + type CreatedAt = S::CreatedAt; 8692 + type Event = S::Event; 8693 + type Subject = S::Subject; 8672 8694 } 8673 8695 ///State transition - sets the `created_by` field to Set 8674 8696 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 8675 8697 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 8676 8698 impl<S: State> State for SetCreatedBy<S> { 8699 + type Id = S::Id; 8700 + type SubjectBlobs = S::SubjectBlobs; 8677 8701 type CreatedBy = Set<members::created_by>; 8678 8702 type CreatedAt = S::CreatedAt; 8679 - type Id = S::Id; 8680 - type Subject = S::Subject; 8681 8703 type Event = S::Event; 8682 - type SubjectBlobs = S::SubjectBlobs; 8704 + type Subject = S::Subject; 8683 8705 } 8684 8706 ///State transition - sets the `created_at` field to Set 8685 8707 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 8686 8708 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 8687 8709 impl<S: State> State for SetCreatedAt<S> { 8710 + type Id = S::Id; 8711 + type SubjectBlobs = S::SubjectBlobs; 8688 8712 type CreatedBy = S::CreatedBy; 8689 8713 type CreatedAt = Set<members::created_at>; 8690 - type Id = S::Id; 8691 - type Subject = S::Subject; 8692 8714 type Event = S::Event; 8693 - type SubjectBlobs = S::SubjectBlobs; 8715 + type Subject = S::Subject; 8694 8716 } 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> { 8717 + ///State transition - sets the `event` field to Set 8718 + pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 8719 + impl<S: State> sealed::Sealed for SetEvent<S> {} 8720 + impl<S: State> State for SetEvent<S> { 8721 + type Id = S::Id; 8722 + type SubjectBlobs = S::SubjectBlobs; 8699 8723 type CreatedBy = S::CreatedBy; 8700 8724 type CreatedAt = S::CreatedAt; 8701 - type Id = Set<members::id>; 8725 + type Event = Set<members::event>; 8702 8726 type Subject = S::Subject; 8703 - type Event = S::Event; 8704 - type SubjectBlobs = S::SubjectBlobs; 8705 8727 } 8706 8728 ///State transition - sets the `subject` field to Set 8707 8729 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 8708 8730 impl<S: State> sealed::Sealed for SetSubject<S> {} 8709 8731 impl<S: State> State for SetSubject<S> { 8710 - type CreatedBy = S::CreatedBy; 8711 - type CreatedAt = S::CreatedAt; 8712 8732 type Id = S::Id; 8713 - type Subject = Set<members::subject>; 8714 - type Event = S::Event; 8715 8733 type SubjectBlobs = S::SubjectBlobs; 8716 - } 8717 - ///State transition - sets the `event` field to Set 8718 - pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 8719 - impl<S: State> sealed::Sealed for SetEvent<S> {} 8720 - impl<S: State> State for SetEvent<S> { 8721 8734 type CreatedBy = S::CreatedBy; 8722 8735 type CreatedAt = S::CreatedAt; 8723 - type Id = S::Id; 8724 - type Subject = S::Subject; 8725 - type Event = Set<members::event>; 8726 - type SubjectBlobs = S::SubjectBlobs; 8727 - } 8728 - ///State transition - sets the `subject_blobs` field to Set 8729 - pub struct SetSubjectBlobs<S: State = Empty>(PhantomData<fn() -> S>); 8730 - impl<S: State> sealed::Sealed for SetSubjectBlobs<S> {} 8731 - impl<S: State> State for SetSubjectBlobs<S> { 8732 - type CreatedBy = S::CreatedBy; 8733 - type CreatedAt = S::CreatedAt; 8734 - type Id = S::Id; 8735 - type Subject = S::Subject; 8736 8736 type Event = S::Event; 8737 - type SubjectBlobs = Set<members::subject_blobs>; 8737 + type Subject = Set<members::subject>; 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 `id` field 8743 + pub struct id(()); 8744 + ///Marker type for the `subject_blobs` field 8745 + pub struct subject_blobs(()); 8742 8746 ///Marker type for the `created_by` field 8743 8747 pub struct created_by(()); 8744 8748 ///Marker type for the `created_at` field 8745 8749 pub struct created_at(()); 8746 - ///Marker type for the `id` field 8747 - pub struct id(()); 8748 - ///Marker type for the `subject` field 8749 - pub struct subject(()); 8750 8750 ///Marker type for the `event` field 8751 8751 pub struct event(()); 8752 - ///Marker type for the `subject_blobs` field 8753 - pub struct subject_blobs(()); 8752 + ///Marker type for the `subject` field 8753 + pub struct subject(()); 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::Id: mod_event_view_detail_state::IsSet, 8927 + S::SubjectBlobs: mod_event_view_detail_state::IsSet, 8926 8928 S::CreatedBy: mod_event_view_detail_state::IsSet, 8927 8929 S::CreatedAt: mod_event_view_detail_state::IsSet, 8928 - S::Id: mod_event_view_detail_state::IsSet, 8929 - S::Subject: mod_event_view_detail_state::IsSet, 8930 8930 S::Event: mod_event_view_detail_state::IsSet, 8931 - S::SubjectBlobs: mod_event_view_detail_state::IsSet, 8931 + S::Subject: mod_event_view_detail_state::IsSet, 8932 8932 { 8933 8933 /// Build the final struct 8934 8934 pub fn build(self) -> ModEventViewDetail<'a> { ··· 9231 9231 } 9232 9232 /// State trait tracking which required fields have been set 9233 9233 pub trait State: sealed::Sealed { 9234 - type Op; 9235 9234 type Timestamp; 9235 + type Op; 9236 9236 } 9237 9237 /// Empty state - all required fields are unset 9238 9238 pub struct Empty(()); 9239 9239 impl sealed::Sealed for Empty {} 9240 9240 impl State for Empty { 9241 + type Timestamp = Unset; 9241 9242 type Op = Unset; 9242 - type Timestamp = Unset; 9243 + } 9244 + ///State transition - sets the `timestamp` field to Set 9245 + pub struct SetTimestamp<S: State = Empty>(PhantomData<fn() -> S>); 9246 + impl<S: State> sealed::Sealed for SetTimestamp<S> {} 9247 + impl<S: State> State for SetTimestamp<S> { 9248 + type Timestamp = Set<members::timestamp>; 9249 + type Op = S::Op; 9243 9250 } 9244 9251 ///State transition - sets the `op` field to Set 9245 9252 pub struct SetOp<S: State = Empty>(PhantomData<fn() -> S>); 9246 9253 impl<S: State> sealed::Sealed for SetOp<S> {} 9247 9254 impl<S: State> State for SetOp<S> { 9255 + type Timestamp = S::Timestamp; 9248 9256 type Op = Set<members::op>; 9249 - type Timestamp = S::Timestamp; 9250 - } 9251 - ///State transition - sets the `timestamp` field to Set 9252 - pub struct SetTimestamp<S: State = Empty>(PhantomData<fn() -> S>); 9253 - impl<S: State> sealed::Sealed for SetTimestamp<S> {} 9254 - impl<S: State> State for SetTimestamp<S> { 9255 - type Op = S::Op; 9256 - type Timestamp = Set<members::timestamp>; 9257 9257 } 9258 9258 /// Marker types for field names 9259 9259 #[allow(non_camel_case_types)] 9260 9260 pub mod members { 9261 + ///Marker type for the `timestamp` field 9262 + pub struct timestamp(()); 9261 9263 ///Marker type for the `op` field 9262 9264 pub struct op(()); 9263 - ///Marker type for the `timestamp` field 9264 - pub struct timestamp(()); 9265 9265 } 9266 9266 } 9267 9267 ··· 9371 9371 impl<'a, S> RecordEventBuilder<'a, S> 9372 9372 where 9373 9373 S: record_event_state::State, 9374 - S::Op: record_event_state::IsSet, 9375 9374 S::Timestamp: record_event_state::IsSet, 9375 + S::Op: record_event_state::IsSet, 9376 9376 { 9377 9377 /// Build the final struct 9378 9378 pub fn build(self) -> RecordEvent<'a> { ··· 9677 9677 } 9678 9678 /// State trait tracking which required fields have been set 9679 9679 pub trait State: sealed::Sealed { 9680 + type Moderation; 9680 9681 type Repo; 9681 - type Uri; 9682 - type Moderation; 9683 9682 type IndexedAt; 9684 - type Cid; 9685 9683 type BlobCids; 9684 + type Cid; 9686 9685 type Value; 9686 + type Uri; 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 Repo = Unset; 9693 - type Uri = Unset; 9694 9692 type Moderation = Unset; 9693 + type Repo = Unset; 9695 9694 type IndexedAt = Unset; 9695 + type BlobCids = Unset; 9696 9696 type Cid = Unset; 9697 - type BlobCids = Unset; 9698 9697 type Value = Unset; 9698 + type Uri = Unset; 9699 + } 9700 + ///State transition - sets the `moderation` field to Set 9701 + pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 9702 + impl<S: State> sealed::Sealed for SetModeration<S> {} 9703 + impl<S: State> State for SetModeration<S> { 9704 + type Moderation = Set<members::moderation>; 9705 + type Repo = S::Repo; 9706 + type IndexedAt = S::IndexedAt; 9707 + type BlobCids = S::BlobCids; 9708 + type Cid = S::Cid; 9709 + type Value = S::Value; 9710 + type Uri = S::Uri; 9699 9711 } 9700 9712 ///State transition - sets the `repo` field to Set 9701 9713 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 9702 9714 impl<S: State> sealed::Sealed for SetRepo<S> {} 9703 9715 impl<S: State> State for SetRepo<S> { 9716 + type Moderation = S::Moderation; 9704 9717 type Repo = Set<members::repo>; 9705 - type Uri = S::Uri; 9706 - type Moderation = S::Moderation; 9707 9718 type IndexedAt = S::IndexedAt; 9708 - type Cid = S::Cid; 9709 9719 type BlobCids = S::BlobCids; 9710 - type Value = S::Value; 9711 - } 9712 - ///State transition - sets the `uri` field to Set 9713 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 9714 - impl<S: State> sealed::Sealed for SetUri<S> {} 9715 - impl<S: State> State for SetUri<S> { 9716 - type Repo = S::Repo; 9717 - type Uri = Set<members::uri>; 9718 - type Moderation = S::Moderation; 9719 - type IndexedAt = S::IndexedAt; 9720 9720 type Cid = S::Cid; 9721 - type BlobCids = S::BlobCids; 9722 9721 type Value = S::Value; 9723 - } 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> { 9728 - type Repo = S::Repo; 9729 9722 type Uri = S::Uri; 9730 - type Moderation = Set<members::moderation>; 9731 - type IndexedAt = S::IndexedAt; 9732 - type Cid = S::Cid; 9733 - type BlobCids = S::BlobCids; 9734 - type Value = S::Value; 9735 9723 } 9736 9724 ///State transition - sets the `indexed_at` field to Set 9737 9725 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 9738 9726 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 9739 9727 impl<S: State> State for SetIndexedAt<S> { 9728 + type Moderation = S::Moderation; 9740 9729 type Repo = S::Repo; 9730 + type IndexedAt = Set<members::indexed_at>; 9731 + type BlobCids = S::BlobCids; 9732 + type Cid = S::Cid; 9733 + type Value = S::Value; 9741 9734 type Uri = S::Uri; 9735 + } 9736 + ///State transition - sets the `blob_cids` field to Set 9737 + pub struct SetBlobCids<S: State = Empty>(PhantomData<fn() -> S>); 9738 + impl<S: State> sealed::Sealed for SetBlobCids<S> {} 9739 + impl<S: State> State for SetBlobCids<S> { 9742 9740 type Moderation = S::Moderation; 9743 - type IndexedAt = Set<members::indexed_at>; 9741 + type Repo = S::Repo; 9742 + type IndexedAt = S::IndexedAt; 9743 + type BlobCids = Set<members::blob_cids>; 9744 9744 type Cid = S::Cid; 9745 - type BlobCids = S::BlobCids; 9746 9745 type Value = S::Value; 9746 + type Uri = S::Uri; 9747 9747 } 9748 9748 ///State transition - sets the `cid` field to Set 9749 9749 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 9750 9750 impl<S: State> sealed::Sealed for SetCid<S> {} 9751 9751 impl<S: State> State for SetCid<S> { 9752 + type Moderation = S::Moderation; 9752 9753 type Repo = S::Repo; 9753 - type Uri = S::Uri; 9754 - type Moderation = S::Moderation; 9755 9754 type IndexedAt = S::IndexedAt; 9756 - type Cid = Set<members::cid>; 9757 9755 type BlobCids = S::BlobCids; 9756 + type Cid = Set<members::cid>; 9758 9757 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> { 9764 - type Repo = S::Repo; 9765 9758 type Uri = S::Uri; 9766 - type Moderation = S::Moderation; 9767 - type IndexedAt = S::IndexedAt; 9768 - type Cid = S::Cid; 9769 - type BlobCids = Set<members::blob_cids>; 9770 - type Value = S::Value; 9771 9759 } 9772 9760 ///State transition - sets the `value` field to Set 9773 9761 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 9774 9762 impl<S: State> sealed::Sealed for SetValue<S> {} 9775 9763 impl<S: State> State for SetValue<S> { 9764 + type Moderation = S::Moderation; 9776 9765 type Repo = S::Repo; 9766 + type IndexedAt = S::IndexedAt; 9767 + type BlobCids = S::BlobCids; 9768 + type Cid = S::Cid; 9769 + type Value = Set<members::value>; 9777 9770 type Uri = S::Uri; 9771 + } 9772 + ///State transition - sets the `uri` field to Set 9773 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 9774 + impl<S: State> sealed::Sealed for SetUri<S> {} 9775 + impl<S: State> State for SetUri<S> { 9778 9776 type Moderation = S::Moderation; 9777 + type Repo = S::Repo; 9779 9778 type IndexedAt = S::IndexedAt; 9780 - type Cid = S::Cid; 9781 9779 type BlobCids = S::BlobCids; 9782 - type Value = Set<members::value>; 9780 + type Cid = S::Cid; 9781 + type Value = S::Value; 9782 + type Uri = Set<members::uri>; 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 `moderation` field 9788 + pub struct moderation(()); 9787 9789 ///Marker type for the `repo` field 9788 9790 pub struct repo(()); 9789 - ///Marker type for the `uri` field 9790 - pub struct uri(()); 9791 - ///Marker type for the `moderation` field 9792 - pub struct moderation(()); 9793 9791 ///Marker type for the `indexed_at` field 9794 9792 pub struct indexed_at(()); 9793 + ///Marker type for the `blob_cids` field 9794 + pub struct blob_cids(()); 9795 9795 ///Marker type for the `cid` field 9796 9796 pub struct cid(()); 9797 - ///Marker type for the `blob_cids` field 9798 - pub struct blob_cids(()); 9799 9797 ///Marker type for the `value` field 9800 9798 pub struct value(()); 9799 + ///Marker type for the `uri` field 9800 + pub struct uri(()); 9801 9801 } 9802 9802 } 9803 9803 ··· 9970 9970 impl<'a, S> RecordViewBuilder<'a, S> 9971 9971 where 9972 9972 S: record_view_state::State, 9973 + S::Moderation: record_view_state::IsSet, 9973 9974 S::Repo: record_view_state::IsSet, 9974 - S::Uri: record_view_state::IsSet, 9975 - S::Moderation: record_view_state::IsSet, 9976 9975 S::IndexedAt: record_view_state::IsSet, 9976 + S::BlobCids: record_view_state::IsSet, 9977 9977 S::Cid: record_view_state::IsSet, 9978 - S::BlobCids: record_view_state::IsSet, 9979 9978 S::Value: record_view_state::IsSet, 9979 + S::Uri: record_view_state::IsSet, 9980 9980 { 9981 9981 /// Build the final struct 9982 9982 pub fn build(self) -> RecordView<'a> { ··· 10070 10070 /// State trait tracking which required fields have been set 10071 10071 pub trait State: sealed::Sealed { 10072 10072 type Blobs; 10073 + type Value; 10073 10074 type IndexedAt; 10074 10075 type Repo; 10075 - type Value; 10076 + type Cid; 10076 10077 type Moderation; 10077 10078 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 10084 type Blobs = Unset; 10085 + type Value = Unset; 10085 10086 type IndexedAt = Unset; 10086 10087 type Repo = Unset; 10087 - type Value = Unset; 10088 + type Cid = Unset; 10088 10089 type Moderation = Unset; 10089 10090 type Uri = Unset; 10090 - type Cid = Unset; 10091 10091 } 10092 10092 ///State transition - sets the `blobs` field to Set 10093 10093 pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>); 10094 10094 impl<S: State> sealed::Sealed for SetBlobs<S> {} 10095 10095 impl<S: State> State for SetBlobs<S> { 10096 10096 type Blobs = Set<members::blobs>; 10097 + type Value = S::Value; 10097 10098 type IndexedAt = S::IndexedAt; 10098 10099 type Repo = S::Repo; 10099 - type Value = S::Value; 10100 + type Cid = S::Cid; 10100 10101 type Moderation = S::Moderation; 10101 10102 type Uri = S::Uri; 10103 + } 10104 + ///State transition - sets the `value` field to Set 10105 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 10106 + impl<S: State> sealed::Sealed for SetValue<S> {} 10107 + impl<S: State> State for SetValue<S> { 10108 + type Blobs = S::Blobs; 10109 + type Value = Set<members::value>; 10110 + type IndexedAt = S::IndexedAt; 10111 + type Repo = S::Repo; 10102 10112 type Cid = S::Cid; 10113 + type Moderation = S::Moderation; 10114 + type Uri = S::Uri; 10103 10115 } 10104 10116 ///State transition - sets the `indexed_at` field to Set 10105 10117 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 10106 10118 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 10107 10119 impl<S: State> State for SetIndexedAt<S> { 10108 10120 type Blobs = S::Blobs; 10121 + type Value = S::Value; 10109 10122 type IndexedAt = Set<members::indexed_at>; 10110 10123 type Repo = S::Repo; 10111 - type Value = S::Value; 10124 + type Cid = S::Cid; 10112 10125 type Moderation = S::Moderation; 10113 10126 type Uri = S::Uri; 10114 - type Cid = S::Cid; 10115 10127 } 10116 10128 ///State transition - sets the `repo` field to Set 10117 10129 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 10118 10130 impl<S: State> sealed::Sealed for SetRepo<S> {} 10119 10131 impl<S: State> State for SetRepo<S> { 10120 10132 type Blobs = S::Blobs; 10133 + type Value = S::Value; 10121 10134 type IndexedAt = S::IndexedAt; 10122 10135 type Repo = Set<members::repo>; 10123 - type Value = S::Value; 10136 + type Cid = S::Cid; 10124 10137 type Moderation = S::Moderation; 10125 10138 type Uri = S::Uri; 10126 - type Cid = S::Cid; 10127 10139 } 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> { 10140 + ///State transition - sets the `cid` field to Set 10141 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 10142 + impl<S: State> sealed::Sealed for SetCid<S> {} 10143 + impl<S: State> State for SetCid<S> { 10132 10144 type Blobs = S::Blobs; 10145 + type Value = S::Value; 10133 10146 type IndexedAt = S::IndexedAt; 10134 10147 type Repo = S::Repo; 10135 - type Value = Set<members::value>; 10148 + type Cid = Set<members::cid>; 10136 10149 type Moderation = S::Moderation; 10137 10150 type Uri = S::Uri; 10138 - type Cid = S::Cid; 10139 10151 } 10140 10152 ///State transition - sets the `moderation` field to Set 10141 10153 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 10142 10154 impl<S: State> sealed::Sealed for SetModeration<S> {} 10143 10155 impl<S: State> State for SetModeration<S> { 10144 10156 type Blobs = S::Blobs; 10157 + type Value = S::Value; 10145 10158 type IndexedAt = S::IndexedAt; 10146 10159 type Repo = S::Repo; 10147 - type Value = S::Value; 10160 + type Cid = S::Cid; 10148 10161 type Moderation = Set<members::moderation>; 10149 10162 type Uri = S::Uri; 10150 - type Cid = S::Cid; 10151 10163 } 10152 10164 ///State transition - sets the `uri` field to Set 10153 10165 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 10154 10166 impl<S: State> sealed::Sealed for SetUri<S> {} 10155 10167 impl<S: State> State for SetUri<S> { 10156 10168 type Blobs = S::Blobs; 10169 + type Value = S::Value; 10157 10170 type IndexedAt = S::IndexedAt; 10158 10171 type Repo = S::Repo; 10159 - type Value = S::Value; 10172 + type Cid = S::Cid; 10160 10173 type Moderation = S::Moderation; 10161 10174 type Uri = Set<members::uri>; 10162 - type Cid = S::Cid; 10163 - } 10164 - ///State transition - sets the `cid` field to Set 10165 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 10166 - impl<S: State> sealed::Sealed for SetCid<S> {} 10167 - impl<S: State> State for SetCid<S> { 10168 - type Blobs = S::Blobs; 10169 - type IndexedAt = S::IndexedAt; 10170 - type Repo = S::Repo; 10171 - type Value = S::Value; 10172 - type Moderation = S::Moderation; 10173 - type Uri = S::Uri; 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 10179 ///Marker type for the `blobs` field 10180 10180 pub struct blobs(()); 10181 + ///Marker type for the `value` field 10182 + pub struct value(()); 10181 10183 ///Marker type for the `indexed_at` field 10182 10184 pub struct indexed_at(()); 10183 10185 ///Marker type for the `repo` field 10184 10186 pub struct repo(()); 10185 - ///Marker type for the `value` field 10186 - pub struct value(()); 10187 + ///Marker type for the `cid` field 10188 + pub struct cid(()); 10187 10189 ///Marker type for the `moderation` field 10188 10190 pub struct moderation(()); 10189 10191 ///Marker type for the `uri` field 10190 10192 pub struct uri(()); 10191 - ///Marker type for the `cid` field 10192 - pub struct cid(()); 10193 10193 } 10194 10194 } 10195 10195 ··· 10383 10383 where 10384 10384 S: record_view_detail_state::State, 10385 10385 S::Blobs: record_view_detail_state::IsSet, 10386 + S::Value: record_view_detail_state::IsSet, 10386 10387 S::IndexedAt: record_view_detail_state::IsSet, 10387 10388 S::Repo: record_view_detail_state::IsSet, 10388 - S::Value: record_view_detail_state::IsSet, 10389 + S::Cid: record_view_detail_state::IsSet, 10389 10390 S::Moderation: record_view_detail_state::IsSet, 10390 10391 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 IndexedAt; 10692 10693 type RelatedRecords; 10693 - type Handle; 10694 - type IndexedAt; 10695 10694 type Moderation; 10696 10695 type Did; 10696 + type Handle; 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 IndexedAt = Unset; 10702 10703 type RelatedRecords = Unset; 10703 - type Handle = Unset; 10704 - type IndexedAt = Unset; 10705 10704 type Moderation = Unset; 10706 10705 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; 10717 - } 10718 - ///State transition - sets the `handle` field to Set 10719 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 10720 - impl<S: State> sealed::Sealed for SetHandle<S> {} 10721 - impl<S: State> State for SetHandle<S> { 10722 - type RelatedRecords = S::RelatedRecords; 10723 - type Handle = Set<members::handle>; 10724 - type IndexedAt = S::IndexedAt; 10725 - type Moderation = S::Moderation; 10726 - type Did = S::Did; 10706 + type Handle = Unset; 10727 10707 } 10728 10708 ///State transition - sets the `indexed_at` field to Set 10729 10709 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 10730 10710 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 10731 10711 impl<S: State> State for SetIndexedAt<S> { 10712 + type IndexedAt = Set<members::indexed_at>; 10732 10713 type RelatedRecords = S::RelatedRecords; 10714 + type Moderation = S::Moderation; 10715 + type Did = S::Did; 10733 10716 type Handle = S::Handle; 10734 - type IndexedAt = Set<members::indexed_at>; 10717 + } 10718 + ///State transition - sets the `related_records` field to Set 10719 + pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>); 10720 + impl<S: State> sealed::Sealed for SetRelatedRecords<S> {} 10721 + impl<S: State> State for SetRelatedRecords<S> { 10722 + type IndexedAt = S::IndexedAt; 10723 + type RelatedRecords = Set<members::related_records>; 10735 10724 type Moderation = S::Moderation; 10736 10725 type Did = S::Did; 10726 + type Handle = S::Handle; 10737 10727 } 10738 10728 ///State transition - sets the `moderation` field to Set 10739 10729 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 10740 10730 impl<S: State> sealed::Sealed for SetModeration<S> {} 10741 10731 impl<S: State> State for SetModeration<S> { 10732 + type IndexedAt = S::IndexedAt; 10742 10733 type RelatedRecords = S::RelatedRecords; 10743 - type Handle = S::Handle; 10744 - type IndexedAt = S::IndexedAt; 10745 10734 type Moderation = Set<members::moderation>; 10746 10735 type Did = S::Did; 10736 + type Handle = S::Handle; 10747 10737 } 10748 10738 ///State transition - sets the `did` field to Set 10749 10739 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 10750 10740 impl<S: State> sealed::Sealed for SetDid<S> {} 10751 10741 impl<S: State> State for SetDid<S> { 10742 + type IndexedAt = S::IndexedAt; 10752 10743 type RelatedRecords = S::RelatedRecords; 10744 + type Moderation = S::Moderation; 10745 + type Did = Set<members::did>; 10753 10746 type Handle = S::Handle; 10747 + } 10748 + ///State transition - sets the `handle` field to Set 10749 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 10750 + impl<S: State> sealed::Sealed for SetHandle<S> {} 10751 + impl<S: State> State for SetHandle<S> { 10754 10752 type IndexedAt = S::IndexedAt; 10753 + type RelatedRecords = S::RelatedRecords; 10755 10754 type Moderation = S::Moderation; 10756 - type Did = Set<members::did>; 10755 + type Did = S::Did; 10756 + type Handle = Set<members::handle>; 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 `indexed_at` field 10762 + pub struct indexed_at(()); 10761 10763 ///Marker type for the `related_records` field 10762 10764 pub struct related_records(()); 10763 - ///Marker type for the `handle` field 10764 - pub struct handle(()); 10765 - ///Marker type for the `indexed_at` field 10766 - pub struct indexed_at(()); 10767 10765 ///Marker type for the `moderation` field 10768 10766 pub struct moderation(()); 10769 10767 ///Marker type for the `did` field 10770 10768 pub struct did(()); 10769 + ///Marker type for the `handle` field 10770 + pub struct handle(()); 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, 11027 - S::Handle: repo_view_state::IsSet, 11028 11026 S::IndexedAt: repo_view_state::IsSet, 11027 + S::RelatedRecords: repo_view_state::IsSet, 11029 11028 S::Moderation: repo_view_state::IsSet, 11030 11029 S::Did: repo_view_state::IsSet, 11030 + S::Handle: 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 Handle; 11152 11153 type IndexedAt; 11153 - type RelatedRecords; 11154 11154 type Moderation; 11155 11155 type Did; 11156 - type Handle; 11156 + type RelatedRecords; 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 Handle = Unset; 11162 11163 type IndexedAt = Unset; 11163 - type RelatedRecords = Unset; 11164 11164 type Moderation = Unset; 11165 11165 type Did = Unset; 11166 - type Handle = Unset; 11166 + type RelatedRecords = Unset; 11167 + } 11168 + ///State transition - sets the `handle` field to Set 11169 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 11170 + impl<S: State> sealed::Sealed for SetHandle<S> {} 11171 + impl<S: State> State for SetHandle<S> { 11172 + type Handle = Set<members::handle>; 11173 + type IndexedAt = S::IndexedAt; 11174 + type Moderation = S::Moderation; 11175 + type Did = S::Did; 11176 + type RelatedRecords = S::RelatedRecords; 11167 11177 } 11168 11178 ///State transition - sets the `indexed_at` field to Set 11169 11179 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 11170 11180 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 11171 11181 impl<S: State> State for SetIndexedAt<S> { 11182 + type Handle = S::Handle; 11172 11183 type IndexedAt = Set<members::indexed_at>; 11173 - type RelatedRecords = S::RelatedRecords; 11174 11184 type Moderation = S::Moderation; 11175 11185 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>; 11184 - type Moderation = S::Moderation; 11185 - type Did = S::Did; 11186 - type Handle = S::Handle; 11186 + type RelatedRecords = S::RelatedRecords; 11187 11187 } 11188 11188 ///State transition - sets the `moderation` field to Set 11189 11189 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 11190 11190 impl<S: State> sealed::Sealed for SetModeration<S> {} 11191 11191 impl<S: State> State for SetModeration<S> { 11192 + type Handle = S::Handle; 11192 11193 type IndexedAt = S::IndexedAt; 11193 - type RelatedRecords = S::RelatedRecords; 11194 11194 type Moderation = Set<members::moderation>; 11195 11195 type Did = S::Did; 11196 - type Handle = S::Handle; 11196 + type RelatedRecords = S::RelatedRecords; 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 Handle = S::Handle; 11202 11203 type IndexedAt = S::IndexedAt; 11203 - type RelatedRecords = S::RelatedRecords; 11204 11204 type Moderation = S::Moderation; 11205 11205 type Did = Set<members::did>; 11206 + type RelatedRecords = S::RelatedRecords; 11207 + } 11208 + ///State transition - sets the `related_records` field to Set 11209 + pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>); 11210 + impl<S: State> sealed::Sealed for SetRelatedRecords<S> {} 11211 + impl<S: State> State for SetRelatedRecords<S> { 11206 11212 type Handle = S::Handle; 11207 - } 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> { 11212 11213 type IndexedAt = S::IndexedAt; 11213 - type RelatedRecords = S::RelatedRecords; 11214 11214 type Moderation = S::Moderation; 11215 11215 type Did = S::Did; 11216 - type Handle = Set<members::handle>; 11216 + type RelatedRecords = Set<members::related_records>; 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 `handle` field 11222 + pub struct handle(()); 11221 11223 ///Marker type for the `indexed_at` field 11222 11224 pub struct indexed_at(()); 11223 - ///Marker type for the `related_records` field 11224 - pub struct related_records(()); 11225 11225 ///Marker type for the `moderation` field 11226 11226 pub struct moderation(()); 11227 11227 ///Marker type for the `did` field 11228 11228 pub struct did(()); 11229 - ///Marker type for the `handle` field 11230 - pub struct handle(()); 11229 + ///Marker type for the `related_records` field 11230 + pub struct related_records(()); 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::Handle: repo_view_detail_state::IsSet, 11549 11550 S::IndexedAt: repo_view_detail_state::IsSet, 11550 - S::RelatedRecords: repo_view_detail_state::IsSet, 11551 11551 S::Moderation: repo_view_detail_state::IsSet, 11552 11552 S::Did: repo_view_detail_state::IsSet, 11553 - S::Handle: repo_view_detail_state::IsSet, 11553 + S::RelatedRecords: 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 Did; 11801 - type LabeledRecordCount; 11802 11800 type ReportedAccountCount; 11801 + type LabeledRecordCount; 11802 + type TakendownRecordCount; 11803 11803 type RecordReportCount; 11804 - type ReportedRecordCount; 11805 - type LabeledAccountCount; 11806 11804 type AccountReportCount; 11807 - type TakendownRecordCount; 11808 11805 type TakendownAccountCount; 11806 + type ReportedRecordCount; 11807 + type LabeledAccountCount; 11808 + type Did; 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 Did = Unset; 11814 + type ReportedAccountCount = Unset; 11815 11815 type LabeledRecordCount = Unset; 11816 - type ReportedAccountCount = Unset; 11816 + type TakendownRecordCount = Unset; 11817 11817 type RecordReportCount = Unset; 11818 + type AccountReportCount = Unset; 11819 + type TakendownAccountCount = Unset; 11818 11820 type ReportedRecordCount = Unset; 11819 11821 type LabeledAccountCount = Unset; 11820 - type AccountReportCount = Unset; 11821 - type TakendownRecordCount = Unset; 11822 - type TakendownAccountCount = Unset; 11822 + type Did = Unset; 11823 11823 } 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>; 11824 + ///State transition - sets the `reported_account_count` field to Set 11825 + pub struct SetReportedAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11826 + impl<S: State> sealed::Sealed for SetReportedAccountCount<S> {} 11827 + impl<S: State> State for SetReportedAccountCount<S> { 11828 + type ReportedAccountCount = Set<members::reported_account_count>; 11829 11829 type LabeledRecordCount = S::LabeledRecordCount; 11830 - type ReportedAccountCount = S::ReportedAccountCount; 11830 + type TakendownRecordCount = S::TakendownRecordCount; 11831 11831 type RecordReportCount = S::RecordReportCount; 11832 - type ReportedRecordCount = S::ReportedRecordCount; 11833 - type LabeledAccountCount = S::LabeledAccountCount; 11834 11832 type AccountReportCount = S::AccountReportCount; 11835 - type TakendownRecordCount = S::TakendownRecordCount; 11836 11833 type TakendownAccountCount = S::TakendownAccountCount; 11834 + type ReportedRecordCount = S::ReportedRecordCount; 11835 + type LabeledAccountCount = S::LabeledAccountCount; 11836 + type Did = S::Did; 11837 11837 } 11838 11838 ///State transition - sets the `labeled_record_count` field to Set 11839 11839 pub struct SetLabeledRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11840 11840 impl<S: State> sealed::Sealed for SetLabeledRecordCount<S> {} 11841 11841 impl<S: State> State for SetLabeledRecordCount<S> { 11842 - type Did = S::Did; 11842 + type ReportedAccountCount = S::ReportedAccountCount; 11843 11843 type LabeledRecordCount = Set<members::labeled_record_count>; 11844 - type ReportedAccountCount = S::ReportedAccountCount; 11844 + type TakendownRecordCount = S::TakendownRecordCount; 11845 11845 type RecordReportCount = S::RecordReportCount; 11846 - type ReportedRecordCount = S::ReportedRecordCount; 11847 - type LabeledAccountCount = S::LabeledAccountCount; 11848 11846 type AccountReportCount = S::AccountReportCount; 11849 - type TakendownRecordCount = S::TakendownRecordCount; 11850 11847 type TakendownAccountCount = S::TakendownAccountCount; 11851 - } 11852 - ///State transition - sets the `reported_account_count` field to Set 11853 - pub struct SetReportedAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11854 - impl<S: State> sealed::Sealed for SetReportedAccountCount<S> {} 11855 - impl<S: State> State for SetReportedAccountCount<S> { 11848 + type ReportedRecordCount = S::ReportedRecordCount; 11849 + type LabeledAccountCount = S::LabeledAccountCount; 11856 11850 type Did = S::Did; 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> { 11856 + type ReportedAccountCount = S::ReportedAccountCount; 11857 11857 type LabeledRecordCount = S::LabeledRecordCount; 11858 - type ReportedAccountCount = Set<members::reported_account_count>; 11858 + type TakendownRecordCount = Set<members::takendown_record_count>; 11859 11859 type RecordReportCount = S::RecordReportCount; 11860 - type ReportedRecordCount = S::ReportedRecordCount; 11861 - type LabeledAccountCount = S::LabeledAccountCount; 11862 11860 type AccountReportCount = S::AccountReportCount; 11863 - type TakendownRecordCount = S::TakendownRecordCount; 11864 11861 type TakendownAccountCount = S::TakendownAccountCount; 11862 + type ReportedRecordCount = S::ReportedRecordCount; 11863 + type LabeledAccountCount = S::LabeledAccountCount; 11864 + type Did = S::Did; 11865 11865 } 11866 11866 ///State transition - sets the `record_report_count` field to Set 11867 11867 pub struct SetRecordReportCount<S: State = Empty>(PhantomData<fn() -> S>); 11868 11868 impl<S: State> sealed::Sealed for SetRecordReportCount<S> {} 11869 11869 impl<S: State> State for SetRecordReportCount<S> { 11870 - type Did = S::Did; 11871 - type LabeledRecordCount = S::LabeledRecordCount; 11872 11870 type ReportedAccountCount = S::ReportedAccountCount; 11871 + type LabeledRecordCount = S::LabeledRecordCount; 11872 + type TakendownRecordCount = S::TakendownRecordCount; 11873 11873 type RecordReportCount = Set<members::record_report_count>; 11874 + type AccountReportCount = S::AccountReportCount; 11875 + type TakendownAccountCount = S::TakendownAccountCount; 11874 11876 type ReportedRecordCount = S::ReportedRecordCount; 11875 11877 type LabeledAccountCount = S::LabeledAccountCount; 11876 - type AccountReportCount = S::AccountReportCount; 11878 + type Did = S::Did; 11879 + } 11880 + ///State transition - sets the `account_report_count` field to Set 11881 + pub struct SetAccountReportCount<S: State = Empty>(PhantomData<fn() -> S>); 11882 + impl<S: State> sealed::Sealed for SetAccountReportCount<S> {} 11883 + impl<S: State> State for SetAccountReportCount<S> { 11884 + type ReportedAccountCount = S::ReportedAccountCount; 11885 + type LabeledRecordCount = S::LabeledRecordCount; 11877 11886 type TakendownRecordCount = S::TakendownRecordCount; 11887 + type RecordReportCount = S::RecordReportCount; 11888 + type AccountReportCount = Set<members::account_report_count>; 11878 11889 type TakendownAccountCount = S::TakendownAccountCount; 11890 + type ReportedRecordCount = S::ReportedRecordCount; 11891 + type LabeledAccountCount = S::LabeledAccountCount; 11892 + type Did = S::Did; 11893 + } 11894 + ///State transition - sets the `takendown_account_count` field to Set 11895 + pub struct SetTakendownAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11896 + impl<S: State> sealed::Sealed for SetTakendownAccountCount<S> {} 11897 + impl<S: State> State for SetTakendownAccountCount<S> { 11898 + type ReportedAccountCount = S::ReportedAccountCount; 11899 + type LabeledRecordCount = S::LabeledRecordCount; 11900 + type TakendownRecordCount = S::TakendownRecordCount; 11901 + type RecordReportCount = S::RecordReportCount; 11902 + type AccountReportCount = S::AccountReportCount; 11903 + type TakendownAccountCount = Set<members::takendown_account_count>; 11904 + type ReportedRecordCount = S::ReportedRecordCount; 11905 + type LabeledAccountCount = S::LabeledAccountCount; 11906 + type Did = S::Did; 11879 11907 } 11880 11908 ///State transition - sets the `reported_record_count` field to Set 11881 11909 pub struct SetReportedRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11882 11910 impl<S: State> sealed::Sealed for SetReportedRecordCount<S> {} 11883 11911 impl<S: State> State for SetReportedRecordCount<S> { 11884 - type Did = S::Did; 11912 + type ReportedAccountCount = S::ReportedAccountCount; 11885 11913 type LabeledRecordCount = S::LabeledRecordCount; 11886 - type ReportedAccountCount = S::ReportedAccountCount; 11914 + type TakendownRecordCount = S::TakendownRecordCount; 11887 11915 type RecordReportCount = S::RecordReportCount; 11888 - type ReportedRecordCount = Set<members::reported_record_count>; 11889 - type LabeledAccountCount = S::LabeledAccountCount; 11890 11916 type AccountReportCount = S::AccountReportCount; 11891 - type TakendownRecordCount = S::TakendownRecordCount; 11892 11917 type TakendownAccountCount = S::TakendownAccountCount; 11918 + type ReportedRecordCount = Set<members::reported_record_count>; 11919 + type LabeledAccountCount = S::LabeledAccountCount; 11920 + type Did = S::Did; 11893 11921 } 11894 11922 ///State transition - sets the `labeled_account_count` field to Set 11895 11923 pub struct SetLabeledAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11896 11924 impl<S: State> sealed::Sealed for SetLabeledAccountCount<S> {} 11897 11925 impl<S: State> State for SetLabeledAccountCount<S> { 11898 - type Did = S::Did; 11899 - type LabeledRecordCount = S::LabeledRecordCount; 11900 11926 type ReportedAccountCount = S::ReportedAccountCount; 11927 + type LabeledRecordCount = S::LabeledRecordCount; 11928 + type TakendownRecordCount = S::TakendownRecordCount; 11901 11929 type RecordReportCount = S::RecordReportCount; 11930 + type AccountReportCount = S::AccountReportCount; 11931 + type TakendownAccountCount = S::TakendownAccountCount; 11902 11932 type ReportedRecordCount = S::ReportedRecordCount; 11903 11933 type LabeledAccountCount = Set<members::labeled_account_count>; 11904 - type AccountReportCount = S::AccountReportCount; 11905 - type TakendownRecordCount = S::TakendownRecordCount; 11906 - type TakendownAccountCount = S::TakendownAccountCount; 11934 + type Did = S::Did; 11907 11935 } 11908 - ///State transition - sets the `account_report_count` field to Set 11909 - pub struct SetAccountReportCount<S: State = Empty>(PhantomData<fn() -> S>); 11910 - impl<S: State> sealed::Sealed for SetAccountReportCount<S> {} 11911 - impl<S: State> State for SetAccountReportCount<S> { 11912 - type Did = S::Did; 11913 - type LabeledRecordCount = S::LabeledRecordCount; 11936 + ///State transition - sets the `did` field to Set 11937 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 11938 + impl<S: State> sealed::Sealed for SetDid<S> {} 11939 + impl<S: State> State for SetDid<S> { 11914 11940 type ReportedAccountCount = S::ReportedAccountCount; 11915 - type RecordReportCount = S::RecordReportCount; 11916 - type ReportedRecordCount = S::ReportedRecordCount; 11917 - type LabeledAccountCount = S::LabeledAccountCount; 11918 - type AccountReportCount = Set<members::account_report_count>; 11941 + type LabeledRecordCount = S::LabeledRecordCount; 11919 11942 type TakendownRecordCount = S::TakendownRecordCount; 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; 11928 - type ReportedAccountCount = S::ReportedAccountCount; 11929 11943 type RecordReportCount = S::RecordReportCount; 11930 - type ReportedRecordCount = S::ReportedRecordCount; 11931 - type LabeledAccountCount = S::LabeledAccountCount; 11932 11944 type AccountReportCount = S::AccountReportCount; 11933 - type TakendownRecordCount = Set<members::takendown_record_count>; 11934 11945 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> { 11940 - type Did = S::Did; 11941 - type LabeledRecordCount = S::LabeledRecordCount; 11942 - type ReportedAccountCount = S::ReportedAccountCount; 11943 - type RecordReportCount = S::RecordReportCount; 11944 11946 type ReportedRecordCount = S::ReportedRecordCount; 11945 11947 type LabeledAccountCount = S::LabeledAccountCount; 11946 - type AccountReportCount = S::AccountReportCount; 11947 - type TakendownRecordCount = S::TakendownRecordCount; 11948 - type TakendownAccountCount = Set<members::takendown_account_count>; 11948 + type Did = Set<members::did>; 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 `did` field 11954 - pub struct did(()); 11953 + ///Marker type for the `reported_account_count` field 11954 + pub struct reported_account_count(()); 11955 11955 ///Marker type for the `labeled_record_count` field 11956 11956 pub struct labeled_record_count(()); 11957 - ///Marker type for the `reported_account_count` field 11958 - pub struct reported_account_count(()); 11957 + ///Marker type for the `takendown_record_count` field 11958 + pub struct takendown_record_count(()); 11959 11959 ///Marker type for the `record_report_count` field 11960 11960 pub struct record_report_count(()); 11961 - ///Marker type for the `reported_record_count` field 11962 - pub struct reported_record_count(()); 11963 - ///Marker type for the `labeled_account_count` field 11964 - pub struct labeled_account_count(()); 11965 11961 ///Marker type for the `account_report_count` field 11966 11962 pub struct account_report_count(()); 11967 - ///Marker type for the `takendown_record_count` field 11968 - pub struct takendown_record_count(()); 11969 11963 ///Marker type for the `takendown_account_count` field 11970 11964 pub struct takendown_account_count(()); 11965 + ///Marker type for the `reported_record_count` field 11966 + pub struct reported_record_count(()); 11967 + ///Marker type for the `labeled_account_count` field 11968 + pub struct labeled_account_count(()); 11969 + ///Marker type for the `did` field 11970 + pub struct did(()); 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::Did: reporter_stats_state::IsSet, 12194 - S::LabeledRecordCount: reporter_stats_state::IsSet, 12195 12193 S::ReportedAccountCount: reporter_stats_state::IsSet, 12194 + S::LabeledRecordCount: reporter_stats_state::IsSet, 12195 + S::TakendownRecordCount: reporter_stats_state::IsSet, 12196 12196 S::RecordReportCount: reporter_stats_state::IsSet, 12197 - S::ReportedRecordCount: reporter_stats_state::IsSet, 12198 - S::LabeledAccountCount: reporter_stats_state::IsSet, 12199 12197 S::AccountReportCount: reporter_stats_state::IsSet, 12200 - S::TakendownRecordCount: reporter_stats_state::IsSet, 12201 12198 S::TakendownAccountCount: reporter_stats_state::IsSet, 12199 + S::ReportedRecordCount: reporter_stats_state::IsSet, 12200 + S::LabeledAccountCount: reporter_stats_state::IsSet, 12201 + S::Did: 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 CreatedBy; 12480 12479 type CreatedAt; 12481 12480 type Status; 12482 12481 type Id; 12483 12482 type Did; 12484 12483 type Action; 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 CreatedBy = Unset; 12491 12490 type CreatedAt = Unset; 12492 12491 type Status = Unset; 12493 12492 type Id = Unset; 12494 12493 type Did = Unset; 12495 12494 type Action = Unset; 12496 - } 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 - type CreatedAt = S::CreatedAt; 12503 - type Status = S::Status; 12504 - type Id = S::Id; 12505 - type Did = S::Did; 12506 - type Action = S::Action; 12495 + type CreatedBy = Unset; 12507 12496 } 12508 12497 ///State transition - sets the `created_at` field to Set 12509 12498 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 12510 12499 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 12511 12500 impl<S: State> State for SetCreatedAt<S> { 12512 - type CreatedBy = S::CreatedBy; 12513 12501 type CreatedAt = Set<members::created_at>; 12514 12502 type Status = S::Status; 12515 12503 type Id = S::Id; 12516 12504 type Did = S::Did; 12517 12505 type Action = S::Action; 12506 + type CreatedBy = S::CreatedBy; 12518 12507 } 12519 12508 ///State transition - sets the `status` field to Set 12520 12509 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 12521 12510 impl<S: State> sealed::Sealed for SetStatus<S> {} 12522 12511 impl<S: State> State for SetStatus<S> { 12523 - type CreatedBy = S::CreatedBy; 12524 12512 type CreatedAt = S::CreatedAt; 12525 12513 type Status = Set<members::status>; 12526 12514 type Id = S::Id; 12527 12515 type Did = S::Did; 12528 12516 type Action = S::Action; 12517 + type CreatedBy = S::CreatedBy; 12529 12518 } 12530 12519 ///State transition - sets the `id` field to Set 12531 12520 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 12532 12521 impl<S: State> sealed::Sealed for SetId<S> {} 12533 12522 impl<S: State> State for SetId<S> { 12534 - type CreatedBy = S::CreatedBy; 12535 12523 type CreatedAt = S::CreatedAt; 12536 12524 type Status = S::Status; 12537 12525 type Id = Set<members::id>; 12538 12526 type Did = S::Did; 12539 12527 type Action = S::Action; 12528 + type CreatedBy = S::CreatedBy; 12540 12529 } 12541 12530 ///State transition - sets the `did` field to Set 12542 12531 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 12543 12532 impl<S: State> sealed::Sealed for SetDid<S> {} 12544 12533 impl<S: State> State for SetDid<S> { 12545 - type CreatedBy = S::CreatedBy; 12546 12534 type CreatedAt = S::CreatedAt; 12547 12535 type Status = S::Status; 12548 12536 type Id = S::Id; 12549 12537 type Did = Set<members::did>; 12550 12538 type Action = S::Action; 12539 + type CreatedBy = S::CreatedBy; 12551 12540 } 12552 12541 ///State transition - sets the `action` field to Set 12553 12542 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 12554 12543 impl<S: State> sealed::Sealed for SetAction<S> {} 12555 12544 impl<S: State> State for SetAction<S> { 12545 + type CreatedAt = S::CreatedAt; 12546 + type Status = S::Status; 12547 + type Id = S::Id; 12548 + type Did = S::Did; 12549 + type Action = Set<members::action>; 12556 12550 type CreatedBy = S::CreatedBy; 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> { 12557 12556 type CreatedAt = S::CreatedAt; 12558 12557 type Status = S::Status; 12559 12558 type Id = S::Id; 12560 12559 type Did = S::Did; 12561 - type Action = Set<members::action>; 12560 + type Action = S::Action; 12561 + type CreatedBy = Set<members::created_by>; 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 `created_by` field 12567 - pub struct created_by(()); 12568 12566 ///Marker type for the `created_at` field 12569 12567 pub struct created_at(()); 12570 12568 ///Marker type for the `status` field ··· 12575 12573 pub struct did(()); 12576 12574 ///Marker type for the `action` field 12577 12575 pub struct action(()); 12576 + ///Marker type for the `created_by` field 12577 + pub struct created_by(()); 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::CreatedBy: scheduled_action_view_state::IsSet, 12915 12914 S::CreatedAt: scheduled_action_view_state::IsSet, 12916 12915 S::Status: scheduled_action_view_state::IsSet, 12917 12916 S::Id: scheduled_action_view_state::IsSet, 12918 12917 S::Did: scheduled_action_view_state::IsSet, 12919 12918 S::Action: scheduled_action_view_state::IsSet, 12919 + S::CreatedBy: scheduled_action_view_state::IsSet, 12920 12920 { 12921 12921 /// Build the final struct 12922 12922 pub fn build(self) -> ScheduledActionView<'a> { ··· 13402 13402 /// State trait tracking which required fields have been set 13403 13403 pub trait State: sealed::Sealed { 13404 13404 type Id; 13405 - type Subject; 13406 - type UpdatedAt; 13407 - type ReviewState; 13408 13405 type CreatedAt; 13406 + type ReviewState; 13407 + type UpdatedAt; 13408 + type Subject; 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 13414 type Id = Unset; 13415 + type CreatedAt = Unset; 13416 + type ReviewState = Unset; 13417 + type UpdatedAt = Unset; 13415 13418 type Subject = Unset; 13416 - type UpdatedAt = Unset; 13417 - type ReviewState = Unset; 13418 - type CreatedAt = Unset; 13419 13419 } 13420 13420 ///State transition - sets the `id` field to Set 13421 13421 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 13422 13422 impl<S: State> sealed::Sealed for SetId<S> {} 13423 13423 impl<S: State> State for SetId<S> { 13424 13424 type Id = Set<members::id>; 13425 - type Subject = S::Subject; 13425 + type CreatedAt = S::CreatedAt; 13426 + type ReviewState = S::ReviewState; 13426 13427 type UpdatedAt = S::UpdatedAt; 13428 + type Subject = S::Subject; 13429 + } 13430 + ///State transition - sets the `created_at` field to Set 13431 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 13432 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 13433 + impl<S: State> State for SetCreatedAt<S> { 13434 + type Id = S::Id; 13435 + type CreatedAt = Set<members::created_at>; 13427 13436 type ReviewState = S::ReviewState; 13428 - type CreatedAt = S::CreatedAt; 13437 + type UpdatedAt = S::UpdatedAt; 13438 + type Subject = S::Subject; 13429 13439 } 13430 - ///State transition - sets the `subject` field to Set 13431 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 13432 - impl<S: State> sealed::Sealed for SetSubject<S> {} 13433 - impl<S: State> State for SetSubject<S> { 13440 + ///State transition - sets the `review_state` field to Set 13441 + pub struct SetReviewState<S: State = Empty>(PhantomData<fn() -> S>); 13442 + impl<S: State> sealed::Sealed for SetReviewState<S> {} 13443 + impl<S: State> State for SetReviewState<S> { 13434 13444 type Id = S::Id; 13435 - type Subject = Set<members::subject>; 13445 + type CreatedAt = S::CreatedAt; 13446 + type ReviewState = Set<members::review_state>; 13436 13447 type UpdatedAt = S::UpdatedAt; 13437 - type ReviewState = S::ReviewState; 13438 - type CreatedAt = S::CreatedAt; 13448 + type Subject = S::Subject; 13439 13449 } 13440 13450 ///State transition - sets the `updated_at` field to Set 13441 13451 pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 13442 13452 impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 13443 13453 impl<S: State> State for SetUpdatedAt<S> { 13444 13454 type Id = S::Id; 13445 - type Subject = S::Subject; 13455 + type CreatedAt = S::CreatedAt; 13456 + type ReviewState = S::ReviewState; 13446 13457 type UpdatedAt = Set<members::updated_at>; 13447 - type ReviewState = S::ReviewState; 13448 - type CreatedAt = S::CreatedAt; 13458 + type Subject = S::Subject; 13449 13459 } 13450 - ///State transition - sets the `review_state` field to Set 13451 - pub struct SetReviewState<S: State = Empty>(PhantomData<fn() -> S>); 13452 - impl<S: State> sealed::Sealed for SetReviewState<S> {} 13453 - impl<S: State> State for SetReviewState<S> { 13460 + ///State transition - sets the `subject` field to Set 13461 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 13462 + impl<S: State> sealed::Sealed for SetSubject<S> {} 13463 + impl<S: State> State for SetSubject<S> { 13454 13464 type Id = S::Id; 13455 - type Subject = S::Subject; 13456 - type UpdatedAt = S::UpdatedAt; 13457 - type ReviewState = Set<members::review_state>; 13458 13465 type CreatedAt = S::CreatedAt; 13459 - } 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; 13466 - type UpdatedAt = S::UpdatedAt; 13467 13466 type ReviewState = S::ReviewState; 13468 - type CreatedAt = Set<members::created_at>; 13467 + type UpdatedAt = S::UpdatedAt; 13468 + type Subject = Set<members::subject>; 13469 13469 } 13470 13470 /// Marker types for field names 13471 13471 #[allow(non_camel_case_types)] 13472 13472 pub mod members { 13473 13473 ///Marker type for the `id` field 13474 13474 pub struct id(()); 13475 + ///Marker type for the `created_at` field 13476 + pub struct created_at(()); 13477 + ///Marker type for the `review_state` field 13478 + pub struct review_state(()); 13479 + ///Marker type for the `updated_at` field 13480 + pub struct updated_at(()); 13475 13481 ///Marker type for the `subject` field 13476 13482 pub struct subject(()); 13477 - ///Marker type for the `updated_at` field 13478 - pub struct updated_at(()); 13479 - ///Marker type for the `review_state` field 13480 - pub struct review_state(()); 13481 - ///Marker type for the `created_at` field 13482 - pub struct created_at(()); 13483 13483 } 13484 13484 } 13485 13485 ··· 14015 14015 where 14016 14016 S: subject_status_view_state::State, 14017 14017 S::Id: subject_status_view_state::IsSet, 14018 - S::Subject: subject_status_view_state::IsSet, 14019 - S::UpdatedAt: subject_status_view_state::IsSet, 14020 - S::ReviewState: subject_status_view_state::IsSet, 14021 14018 S::CreatedAt: subject_status_view_state::IsSet, 14019 + S::ReviewState: subject_status_view_state::IsSet, 14020 + S::UpdatedAt: subject_status_view_state::IsSet, 14021 + S::Subject: 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 Length; 14745 - type Width; 14746 14744 type Height; 14745 + type Width; 14746 + type Length; 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 Height = Unset; 14753 + type Width = Unset; 14752 14754 type Length = Unset; 14753 - type Width = Unset; 14754 - type Height = Unset; 14755 14755 } 14756 - ///State transition - sets the `length` field to Set 14757 - pub struct SetLength<S: State = Empty>(PhantomData<fn() -> S>); 14758 - impl<S: State> sealed::Sealed for SetLength<S> {} 14759 - impl<S: State> State for SetLength<S> { 14760 - type Length = Set<members::length>; 14756 + ///State transition - sets the `height` field to Set 14757 + pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 14758 + impl<S: State> sealed::Sealed for SetHeight<S> {} 14759 + impl<S: State> State for SetHeight<S> { 14760 + type Height = Set<members::height>; 14761 14761 type Width = S::Width; 14762 - type Height = S::Height; 14762 + type Length = S::Length; 14763 14763 } 14764 14764 ///State transition - sets the `width` field to Set 14765 14765 pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 14766 14766 impl<S: State> sealed::Sealed for SetWidth<S> {} 14767 14767 impl<S: State> State for SetWidth<S> { 14768 - type Length = S::Length; 14769 - type Width = Set<members::width>; 14770 14768 type Height = S::Height; 14769 + type Width = Set<members::width>; 14770 + type Length = S::Length; 14771 14771 } 14772 - ///State transition - sets the `height` field to Set 14773 - pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 14774 - impl<S: State> sealed::Sealed for SetHeight<S> {} 14775 - impl<S: State> State for SetHeight<S> { 14776 - type Length = S::Length; 14772 + ///State transition - sets the `length` field to Set 14773 + pub struct SetLength<S: State = Empty>(PhantomData<fn() -> S>); 14774 + impl<S: State> sealed::Sealed for SetLength<S> {} 14775 + impl<S: State> State for SetLength<S> { 14776 + type Height = S::Height; 14777 14777 type Width = S::Width; 14778 - type Height = Set<members::height>; 14778 + type Length = Set<members::length>; 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 `height` field 14784 + pub struct height(()); 14785 + ///Marker type for the `width` field 14786 + pub struct width(()); 14783 14787 ///Marker type for the `length` field 14784 14788 pub struct length(()); 14785 - ///Marker type for the `width` field 14786 - pub struct width(()); 14787 - ///Marker type for the `height` field 14788 - pub struct height(()); 14789 14789 } 14790 14790 } 14791 14791 ··· 14878 14878 impl<'a, S> VideoDetailsBuilder<'a, S> 14879 14879 where 14880 14880 S: video_details_state::State, 14881 - S::Length: video_details_state::IsSet, 14882 - S::Width: video_details_state::IsSet, 14883 14881 S::Height: video_details_state::IsSet, 14882 + S::Width: video_details_state::IsSet, 14883 + S::Length: video_details_state::IsSet, 14884 14884 { 14885 14885 /// Build the final struct 14886 14886 pub fn build(self) -> VideoDetails<'a> {
+13 -13
crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 - type Succeeded; 41 40 type Failed; 41 + type Succeeded; 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 Succeeded = Unset; 48 47 type Failed = Unset; 49 - } 50 - ///State transition - sets the `succeeded` field to Set 51 - pub struct SetSucceeded<S: State = Empty>(PhantomData<fn() -> S>); 52 - impl<S: State> sealed::Sealed for SetSucceeded<S> {} 53 - impl<S: State> State for SetSucceeded<S> { 54 - type Succeeded = Set<members::succeeded>; 55 - type Failed = S::Failed; 48 + type Succeeded = Unset; 56 49 } 57 50 ///State transition - sets the `failed` field to Set 58 51 pub struct SetFailed<S: State = Empty>(PhantomData<fn() -> S>); 59 52 impl<S: State> sealed::Sealed for SetFailed<S> {} 60 53 impl<S: State> State for SetFailed<S> { 61 - type Succeeded = S::Succeeded; 62 54 type Failed = Set<members::failed>; 55 + type Succeeded = S::Succeeded; 56 + } 57 + ///State transition - sets the `succeeded` field to Set 58 + pub struct SetSucceeded<S: State = Empty>(PhantomData<fn() -> S>); 59 + impl<S: State> sealed::Sealed for SetSucceeded<S> {} 60 + impl<S: State> State for SetSucceeded<S> { 61 + type Failed = S::Failed; 62 + type Succeeded = Set<members::succeeded>; 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 `succeeded` field 68 - pub struct succeeded(()); 69 67 ///Marker type for the `failed` field 70 68 pub struct failed(()); 69 + ///Marker type for the `succeeded` field 70 + pub struct succeeded(()); 71 71 } 72 72 } 73 73 ··· 152 152 impl<'a, S> CancellationResultsBuilder<'a, S> 153 153 where 154 154 S: cancellation_results_state::State, 155 - S::Succeeded: cancellation_results_state::IsSet, 156 155 S::Failed: cancellation_results_state::IsSet, 156 + S::Succeeded: cancellation_results_state::IsSet, 157 157 { 158 158 /// Build the final struct 159 159 pub fn build(self) -> CancellationResults<'a> {
+24 -24
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; 51 - type Subject; 52 50 type CreatedBy; 51 + type Subject; 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 CreatedBy = Unset; 59 + type Subject = Unset; 58 60 type Event = Unset; 59 - type Subject = Unset; 60 - type CreatedBy = Unset; 61 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>; 62 + ///State transition - sets the `created_by` field to Set 63 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 65 + impl<S: State> State for SetCreatedBy<S> { 66 + type CreatedBy = Set<members::created_by>; 67 67 type Subject = S::Subject; 68 - type CreatedBy = S::CreatedBy; 68 + type Event = S::Event; 69 69 } 70 70 ///State transition - sets the `subject` field to Set 71 71 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 72 72 impl<S: State> sealed::Sealed for SetSubject<S> {} 73 73 impl<S: State> State for SetSubject<S> { 74 - type Event = S::Event; 75 - type Subject = Set<members::subject>; 76 74 type CreatedBy = S::CreatedBy; 75 + type Subject = Set<members::subject>; 76 + type Event = S::Event; 77 77 } 78 - ///State transition - sets the `created_by` field to Set 79 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 80 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 81 - impl<S: State> State for SetCreatedBy<S> { 82 - type Event = S::Event; 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 + type CreatedBy = S::CreatedBy; 83 83 type Subject = S::Subject; 84 - type CreatedBy = Set<members::created_by>; 84 + type Event = Set<members::event>; 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 `created_by` field 90 + pub struct created_by(()); 91 + ///Marker type for the `subject` field 92 + pub struct subject(()); 89 93 ///Marker type for the `event` field 90 94 pub struct event(()); 91 - ///Marker type for the `subject` field 92 - pub struct subject(()); 93 - ///Marker type for the `created_by` field 94 - pub struct created_by(()); 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, 248 - S::Subject: emit_event_state::IsSet, 249 247 S::CreatedBy: emit_event_state::IsSet, 248 + S::Subject: 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 Day; 223 222 type Summary; 223 + type Day; 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 Day = Unset; 230 229 type Summary = Unset; 231 - } 232 - ///State transition - sets the `day` field to Set 233 - pub struct SetDay<S: State = Empty>(PhantomData<fn() -> S>); 234 - impl<S: State> sealed::Sealed for SetDay<S> {} 235 - impl<S: State> State for SetDay<S> { 236 - type Day = Set<members::day>; 237 - type Summary = S::Summary; 230 + type Day = Unset; 238 231 } 239 232 ///State transition - sets the `summary` field to Set 240 233 pub struct SetSummary<S: State = Empty>(PhantomData<fn() -> S>); 241 234 impl<S: State> sealed::Sealed for SetSummary<S> {} 242 235 impl<S: State> State for SetSummary<S> { 243 - type Day = S::Day; 244 236 type Summary = Set<members::summary>; 237 + type Day = S::Day; 238 + } 239 + ///State transition - sets the `day` field to Set 240 + pub struct SetDay<S: State = Empty>(PhantomData<fn() -> S>); 241 + impl<S: State> sealed::Sealed for SetDay<S> {} 242 + impl<S: State> State for SetDay<S> { 243 + type Summary = S::Summary; 244 + type Day = Set<members::day>; 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 `day` field 250 - pub struct day(()); 251 249 ///Marker type for the `summary` field 252 250 pub struct summary(()); 251 + ///Marker type for the `day` field 252 + pub struct day(()); 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::Day: timeline_item_state::IsSet, 338 337 S::Summary: timeline_item_state::IsSet, 338 + S::Day: timeline_item_state::IsSet, 339 339 { 340 340 /// Build the final struct 341 341 pub fn build(self) -> TimelineItem<'a> { ··· 576 576 /// State trait tracking which required fields have been set 577 577 pub trait State: sealed::Sealed { 578 578 type EventSubjectType; 579 - type EventType; 580 579 type Count; 580 + type EventType; 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 586 type EventSubjectType = Unset; 587 - type EventType = Unset; 588 587 type Count = Unset; 588 + type EventType = Unset; 589 589 } 590 590 ///State transition - sets the `event_subject_type` field to Set 591 591 pub struct SetEventSubjectType<S: State = Empty>(PhantomData<fn() -> S>); 592 592 impl<S: State> sealed::Sealed for SetEventSubjectType<S> {} 593 593 impl<S: State> State for SetEventSubjectType<S> { 594 594 type EventSubjectType = Set<members::event_subject_type>; 595 - type EventType = S::EventType; 596 595 type Count = S::Count; 597 - } 598 - ///State transition - sets the `event_type` field to Set 599 - pub struct SetEventType<S: State = Empty>(PhantomData<fn() -> S>); 600 - impl<S: State> sealed::Sealed for SetEventType<S> {} 601 - impl<S: State> State for SetEventType<S> { 602 - type EventSubjectType = S::EventSubjectType; 603 - type EventType = Set<members::event_type>; 604 - type Count = S::Count; 596 + type EventType = S::EventType; 605 597 } 606 598 ///State transition - sets the `count` field to Set 607 599 pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 608 600 impl<S: State> sealed::Sealed for SetCount<S> {} 609 601 impl<S: State> State for SetCount<S> { 610 602 type EventSubjectType = S::EventSubjectType; 611 - type EventType = S::EventType; 612 603 type Count = Set<members::count>; 604 + type EventType = S::EventType; 605 + } 606 + ///State transition - sets the `event_type` field to Set 607 + pub struct SetEventType<S: State = Empty>(PhantomData<fn() -> S>); 608 + impl<S: State> sealed::Sealed for SetEventType<S> {} 609 + impl<S: State> State for SetEventType<S> { 610 + type EventSubjectType = S::EventSubjectType; 611 + type Count = S::Count; 612 + type EventType = Set<members::event_type>; 613 613 } 614 614 /// Marker types for field names 615 615 #[allow(non_camel_case_types)] 616 616 pub mod members { 617 617 ///Marker type for the `event_subject_type` field 618 618 pub struct event_subject_type(()); 619 - ///Marker type for the `event_type` field 620 - pub struct event_type(()); 621 619 ///Marker type for the `count` field 622 620 pub struct count(()); 621 + ///Marker type for the `event_type` field 622 + pub struct event_type(()); 623 623 } 624 624 } 625 625 ··· 716 716 where 717 717 S: timeline_item_summary_state::State, 718 718 S::EventSubjectType: timeline_item_summary_state::IsSet, 719 - S::EventType: timeline_item_summary_state::IsSet, 720 719 S::Count: timeline_item_summary_state::IsSet, 720 + S::EventType: timeline_item_summary_state::IsSet, 721 721 { 722 722 /// Build the final struct 723 723 pub fn build(self) -> TimelineItemSummary<'a> {
+30 -30
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; 764 765 type Action; 765 766 type Scheduling; 766 - type Subjects; 767 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; 773 774 type Action = Unset; 774 775 type Scheduling = Unset; 775 - type Subjects = Unset; 776 776 type CreatedBy = Unset; 777 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 Action = S::Action; 784 + type Scheduling = S::Scheduling; 785 + type CreatedBy = S::CreatedBy; 786 + } 778 787 ///State transition - sets the `action` field to Set 779 788 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 780 789 impl<S: State> sealed::Sealed for SetAction<S> {} 781 790 impl<S: State> State for SetAction<S> { 791 + type Subjects = S::Subjects; 782 792 type Action = Set<members::action>; 783 793 type Scheduling = S::Scheduling; 784 - type Subjects = S::Subjects; 785 794 type CreatedBy = S::CreatedBy; 786 795 } 787 796 ///State transition - sets the `scheduling` field to Set 788 797 pub struct SetScheduling<S: State = Empty>(PhantomData<fn() -> S>); 789 798 impl<S: State> sealed::Sealed for SetScheduling<S> {} 790 799 impl<S: State> State for SetScheduling<S> { 800 + type Subjects = S::Subjects; 791 801 type Action = S::Action; 792 802 type Scheduling = Set<members::scheduling>; 793 - type Subjects = S::Subjects; 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> { 800 - type Action = S::Action; 801 - type Scheduling = S::Scheduling; 802 - type Subjects = Set<members::subjects>; 803 803 type CreatedBy = S::CreatedBy; 804 804 } 805 805 ///State transition - sets the `created_by` field to Set 806 806 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 807 807 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 808 808 impl<S: State> State for SetCreatedBy<S> { 809 + type Subjects = S::Subjects; 809 810 type Action = S::Action; 810 811 type Scheduling = S::Scheduling; 811 - type Subjects = S::Subjects; 812 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(()); 817 819 ///Marker type for the `action` field 818 820 pub struct action(()); 819 821 ///Marker type for the `scheduling` field 820 822 pub struct scheduling(()); 821 - ///Marker type for the `subjects` field 822 - pub struct subjects(()); 823 823 ///Marker type for the `created_by` field 824 824 pub struct created_by(()); 825 825 } ··· 960 960 impl<'a, S> ScheduleActionBuilder<'a, S> 961 961 where 962 962 S: schedule_action_state::State, 963 + S::Subjects: schedule_action_state::IsSet, 963 964 S::Action: schedule_action_state::IsSet, 964 965 S::Scheduling: schedule_action_state::IsSet, 965 - S::Subjects: schedule_action_state::IsSet, 966 966 S::CreatedBy: schedule_action_state::IsSet, 967 967 { 968 968 /// Build the final struct ··· 1072 1072 } 1073 1073 /// State trait tracking which required fields have been set 1074 1074 pub trait State: sealed::Sealed { 1075 - type Failed; 1076 1075 type Succeeded; 1076 + type Failed; 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 Failed = Unset; 1083 1082 type Succeeded = Unset; 1084 - } 1085 - ///State transition - sets the `failed` field to Set 1086 - pub struct SetFailed<S: State = Empty>(PhantomData<fn() -> S>); 1087 - impl<S: State> sealed::Sealed for SetFailed<S> {} 1088 - impl<S: State> State for SetFailed<S> { 1089 - type Failed = Set<members::failed>; 1090 - type Succeeded = S::Succeeded; 1083 + type Failed = Unset; 1091 1084 } 1092 1085 ///State transition - sets the `succeeded` field to Set 1093 1086 pub struct SetSucceeded<S: State = Empty>(PhantomData<fn() -> S>); 1094 1087 impl<S: State> sealed::Sealed for SetSucceeded<S> {} 1095 1088 impl<S: State> State for SetSucceeded<S> { 1089 + type Succeeded = Set<members::succeeded>; 1096 1090 type Failed = S::Failed; 1097 - type Succeeded = Set<members::succeeded>; 1091 + } 1092 + ///State transition - sets the `failed` field to Set 1093 + pub struct SetFailed<S: State = Empty>(PhantomData<fn() -> S>); 1094 + impl<S: State> sealed::Sealed for SetFailed<S> {} 1095 + impl<S: State> State for SetFailed<S> { 1096 + type Succeeded = S::Succeeded; 1097 + type Failed = Set<members::failed>; 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(()); 1104 1102 ///Marker type for the `succeeded` field 1105 1103 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::Failed: scheduled_action_results_state::IsSet, 1192 1191 S::Succeeded: scheduled_action_results_state::IsSet, 1192 + S::Failed: 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 CreatedBy; 147 + type Pattern; 148 + type Url; 148 149 type Action; 149 - type Id; 150 150 type CreatedAt; 151 + type Id; 151 152 type EventType; 152 - type Url; 153 + type CreatedBy; 153 154 type Reason; 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 CreatedBy = Unset; 160 + type Pattern = Unset; 161 + type Url = Unset; 161 162 type Action = Unset; 163 + type CreatedAt = Unset; 162 164 type Id = Unset; 163 - type CreatedAt = Unset; 164 165 type EventType = Unset; 165 - type Url = Unset; 166 + type CreatedBy = Unset; 166 167 type Reason = Unset; 167 - type Pattern = Unset; 168 168 } 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>; 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; 174 175 type Action = S::Action; 176 + type CreatedAt = S::CreatedAt; 175 177 type Id = S::Id; 178 + type EventType = S::EventType; 179 + type CreatedBy = S::CreatedBy; 180 + type Reason = S::Reason; 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 + type Action = S::Action; 176 189 type CreatedAt = S::CreatedAt; 190 + type Id = S::Id; 177 191 type EventType = S::EventType; 178 - type Url = S::Url; 192 + type CreatedBy = S::CreatedBy; 179 193 type Reason = S::Reason; 180 - type Pattern = S::Pattern; 181 194 } 182 195 ///State transition - sets the `action` field to Set 183 196 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 184 197 impl<S: State> sealed::Sealed for SetAction<S> {} 185 198 impl<S: State> State for SetAction<S> { 186 - type CreatedBy = S::CreatedBy; 199 + type Pattern = S::Pattern; 200 + type Url = S::Url; 187 201 type Action = Set<members::action>; 202 + type CreatedAt = S::CreatedAt; 188 203 type Id = S::Id; 189 - type CreatedAt = S::CreatedAt; 190 204 type EventType = S::EventType; 191 - type Url = S::Url; 192 - type Reason = S::Reason; 193 - type Pattern = S::Pattern; 194 - } 195 - ///State transition - sets the `id` field to Set 196 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 197 - impl<S: State> sealed::Sealed for SetId<S> {} 198 - impl<S: State> State for SetId<S> { 199 205 type CreatedBy = S::CreatedBy; 200 - type Action = S::Action; 201 - type Id = Set<members::id>; 202 - type CreatedAt = S::CreatedAt; 203 - type EventType = S::EventType; 204 - type Url = S::Url; 205 206 type Reason = S::Reason; 206 - type Pattern = S::Pattern; 207 207 } 208 208 ///State transition - sets the `created_at` field to Set 209 209 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 210 210 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 211 211 impl<S: State> State for SetCreatedAt<S> { 212 - type CreatedBy = S::CreatedBy; 212 + type Pattern = S::Pattern; 213 + type Url = S::Url; 213 214 type Action = S::Action; 214 - type Id = S::Id; 215 215 type CreatedAt = Set<members::created_at>; 216 + type Id = S::Id; 216 217 type EventType = S::EventType; 217 - type Url = S::Url; 218 + type CreatedBy = S::CreatedBy; 218 219 type Reason = S::Reason; 220 + } 221 + ///State transition - sets the `id` field to Set 222 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 223 + impl<S: State> sealed::Sealed for SetId<S> {} 224 + impl<S: State> State for SetId<S> { 219 225 type Pattern = S::Pattern; 226 + type Url = S::Url; 227 + type Action = S::Action; 228 + type CreatedAt = S::CreatedAt; 229 + type Id = Set<members::id>; 230 + type EventType = S::EventType; 231 + type CreatedBy = S::CreatedBy; 232 + type Reason = S::Reason; 220 233 } 221 234 ///State transition - sets the `event_type` field to Set 222 235 pub struct SetEventType<S: State = Empty>(PhantomData<fn() -> S>); 223 236 impl<S: State> sealed::Sealed for SetEventType<S> {} 224 237 impl<S: State> State for SetEventType<S> { 225 - type CreatedBy = S::CreatedBy; 238 + type Pattern = S::Pattern; 239 + type Url = S::Url; 226 240 type Action = S::Action; 241 + type CreatedAt = S::CreatedAt; 227 242 type Id = S::Id; 228 - type CreatedAt = S::CreatedAt; 229 243 type EventType = Set<members::event_type>; 230 - type Url = S::Url; 244 + type CreatedBy = S::CreatedBy; 231 245 type Reason = S::Reason; 232 - type Pattern = S::Pattern; 233 246 } 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> { 238 - type CreatedBy = S::CreatedBy; 247 + ///State transition - sets the `created_by` field to Set 248 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 249 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 250 + impl<S: State> State for SetCreatedBy<S> { 251 + type Pattern = S::Pattern; 252 + type Url = S::Url; 239 253 type Action = S::Action; 254 + type CreatedAt = S::CreatedAt; 240 255 type Id = S::Id; 241 - type CreatedAt = S::CreatedAt; 242 256 type EventType = S::EventType; 243 - type Url = Set<members::url>; 257 + type CreatedBy = Set<members::created_by>; 244 258 type Reason = S::Reason; 245 - type Pattern = S::Pattern; 246 259 } 247 260 ///State transition - sets the `reason` field to Set 248 261 pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 249 262 impl<S: State> sealed::Sealed for SetReason<S> {} 250 263 impl<S: State> State for SetReason<S> { 251 - type CreatedBy = S::CreatedBy; 264 + type Pattern = S::Pattern; 265 + type Url = S::Url; 252 266 type Action = S::Action; 267 + type CreatedAt = S::CreatedAt; 253 268 type Id = S::Id; 254 - type CreatedAt = S::CreatedAt; 255 269 type EventType = S::EventType; 256 - type Url = S::Url; 270 + type CreatedBy = S::CreatedBy; 257 271 type Reason = Set<members::reason>; 258 - type Pattern = S::Pattern; 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; 265 - type Action = S::Action; 266 - type Id = S::Id; 267 - type CreatedAt = S::CreatedAt; 268 - type EventType = S::EventType; 269 - type Url = S::Url; 270 - type Reason = S::Reason; 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 `created_by` field 277 - pub struct created_by(()); 276 + ///Marker type for the `pattern` field 277 + pub struct pattern(()); 278 + ///Marker type for the `url` field 279 + pub struct url(()); 278 280 ///Marker type for the `action` field 279 281 pub struct action(()); 282 + ///Marker type for the `created_at` field 283 + pub struct created_at(()); 280 284 ///Marker type for the `id` field 281 285 pub struct id(()); 282 - ///Marker type for the `created_at` field 283 - pub struct created_at(()); 284 286 ///Marker type for the `event_type` field 285 287 pub struct event_type(()); 286 - ///Marker type for the `url` field 287 - pub struct url(()); 288 + ///Marker type for the `created_by` field 289 + pub struct created_by(()); 288 290 ///Marker type for the `reason` field 289 291 pub struct reason(()); 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::CreatedBy: event_state::IsSet, 511 + S::Pattern: event_state::IsSet, 512 + S::Url: event_state::IsSet, 512 513 S::Action: event_state::IsSet, 513 - S::Id: event_state::IsSet, 514 514 S::CreatedAt: event_state::IsSet, 515 + S::Id: event_state::IsSet, 515 516 S::EventType: event_state::IsSet, 516 - S::Url: event_state::IsSet, 517 + S::CreatedBy: event_state::IsSet, 517 518 S::Reason: 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 Reason; 1261 - type CreatedBy; 1262 - type UpdatedAt; 1263 1260 type CreatedAt; 1261 + type UpdatedAt; 1264 1262 type Url; 1265 - type Action; 1266 1263 type Pattern; 1264 + type Reason; 1265 + type Action; 1266 + type CreatedBy; 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 Reason = Unset; 1273 - type CreatedBy = Unset; 1274 - type UpdatedAt = Unset; 1275 1272 type CreatedAt = Unset; 1273 + type UpdatedAt = Unset; 1276 1274 type Url = Unset; 1277 - type Action = Unset; 1278 1275 type Pattern = Unset; 1276 + type Reason = Unset; 1277 + type Action = Unset; 1278 + type CreatedBy = Unset; 1279 1279 } 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 - type CreatedBy = S::CreatedBy; 1280 + ///State transition - sets the `created_at` field to Set 1281 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1282 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1283 + impl<S: State> State for SetCreatedAt<S> { 1284 + type CreatedAt = Set<members::created_at>; 1286 1285 type UpdatedAt = S::UpdatedAt; 1287 - type CreatedAt = S::CreatedAt; 1288 1286 type Url = S::Url; 1289 - type Action = S::Action; 1290 1287 type Pattern = S::Pattern; 1291 - } 1292 - ///State transition - sets the `created_by` field to Set 1293 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 1294 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 1295 - impl<S: State> State for SetCreatedBy<S> { 1296 1288 type Reason = S::Reason; 1297 - type CreatedBy = Set<members::created_by>; 1298 - type UpdatedAt = S::UpdatedAt; 1299 - type CreatedAt = S::CreatedAt; 1300 - type Url = S::Url; 1301 1289 type Action = S::Action; 1302 - type Pattern = S::Pattern; 1290 + type CreatedBy = S::CreatedBy; 1303 1291 } 1304 1292 ///State transition - sets the `updated_at` field to Set 1305 1293 pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1306 1294 impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 1307 1295 impl<S: State> State for SetUpdatedAt<S> { 1308 - type Reason = S::Reason; 1309 - type CreatedBy = S::CreatedBy; 1296 + type CreatedAt = S::CreatedAt; 1310 1297 type UpdatedAt = Set<members::updated_at>; 1311 - type CreatedAt = S::CreatedAt; 1312 1298 type Url = S::Url; 1313 - type Action = S::Action; 1314 1299 type Pattern = S::Pattern; 1315 - } 1316 - ///State transition - sets the `created_at` field to Set 1317 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1318 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1319 - impl<S: State> State for SetCreatedAt<S> { 1320 1300 type Reason = S::Reason; 1301 + type Action = S::Action; 1321 1302 type CreatedBy = S::CreatedBy; 1322 - type UpdatedAt = S::UpdatedAt; 1323 - type CreatedAt = Set<members::created_at>; 1324 - type Url = S::Url; 1325 - type Action = S::Action; 1326 - type Pattern = S::Pattern; 1327 1303 } 1328 1304 ///State transition - sets the `url` field to Set 1329 1305 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 1330 1306 impl<S: State> sealed::Sealed for SetUrl<S> {} 1331 1307 impl<S: State> State for SetUrl<S> { 1308 + type CreatedAt = S::CreatedAt; 1309 + type UpdatedAt = S::UpdatedAt; 1310 + type Url = Set<members::url>; 1311 + type Pattern = S::Pattern; 1332 1312 type Reason = S::Reason; 1313 + type Action = S::Action; 1333 1314 type CreatedBy = S::CreatedBy; 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 CreatedAt = S::CreatedAt; 1334 1321 type UpdatedAt = S::UpdatedAt; 1322 + type Url = S::Url; 1323 + type Pattern = Set<members::pattern>; 1324 + type Reason = S::Reason; 1325 + type Action = S::Action; 1326 + type CreatedBy = S::CreatedBy; 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> { 1335 1332 type CreatedAt = S::CreatedAt; 1336 - type Url = Set<members::url>; 1337 - type Action = S::Action; 1333 + type UpdatedAt = S::UpdatedAt; 1334 + type Url = S::Url; 1338 1335 type Pattern = S::Pattern; 1336 + type Reason = Set<members::reason>; 1337 + type Action = S::Action; 1338 + type CreatedBy = S::CreatedBy; 1339 1339 } 1340 1340 ///State transition - sets the `action` field to Set 1341 1341 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 1342 1342 impl<S: State> sealed::Sealed for SetAction<S> {} 1343 1343 impl<S: State> State for SetAction<S> { 1344 - type Reason = S::Reason; 1345 - type CreatedBy = S::CreatedBy; 1344 + type CreatedAt = S::CreatedAt; 1346 1345 type UpdatedAt = S::UpdatedAt; 1347 - type CreatedAt = S::CreatedAt; 1348 1346 type Url = S::Url; 1349 - type Action = Set<members::action>; 1350 1347 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> { 1356 1348 type Reason = S::Reason; 1349 + type Action = Set<members::action>; 1357 1350 type CreatedBy = S::CreatedBy; 1358 - type UpdatedAt = S::UpdatedAt; 1351 + } 1352 + ///State transition - sets the `created_by` field to Set 1353 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 1354 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 1355 + impl<S: State> State for SetCreatedBy<S> { 1359 1356 type CreatedAt = S::CreatedAt; 1357 + type UpdatedAt = S::UpdatedAt; 1360 1358 type Url = S::Url; 1359 + type Pattern = S::Pattern; 1360 + type Reason = S::Reason; 1361 1361 type Action = S::Action; 1362 - type Pattern = Set<members::pattern>; 1362 + type CreatedBy = Set<members::created_by>; 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 `reason` field 1368 - pub struct reason(()); 1369 - ///Marker type for the `created_by` field 1370 - pub struct created_by(()); 1371 - ///Marker type for the `updated_at` field 1372 - pub struct updated_at(()); 1373 1367 ///Marker type for the `created_at` field 1374 1368 pub struct created_at(()); 1369 + ///Marker type for the `updated_at` field 1370 + pub struct updated_at(()); 1375 1371 ///Marker type for the `url` field 1376 1372 pub struct url(()); 1373 + ///Marker type for the `pattern` field 1374 + pub struct pattern(()); 1375 + ///Marker type for the `reason` field 1376 + pub struct reason(()); 1377 1377 ///Marker type for the `action` field 1378 1378 pub struct action(()); 1379 - ///Marker type for the `pattern` field 1380 - pub struct pattern(()); 1379 + ///Marker type for the `created_by` field 1380 + pub struct created_by(()); 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::Reason: url_rule_state::IsSet, 1571 - S::CreatedBy: url_rule_state::IsSet, 1572 - S::UpdatedAt: url_rule_state::IsSet, 1573 1570 S::CreatedAt: url_rule_state::IsSet, 1571 + S::UpdatedAt: url_rule_state::IsSet, 1574 1572 S::Url: url_rule_state::IsSet, 1575 - S::Action: url_rule_state::IsSet, 1576 1573 S::Pattern: url_rule_state::IsSet, 1574 + S::Reason: url_rule_state::IsSet, 1575 + S::Action: url_rule_state::IsSet, 1576 + S::CreatedBy: url_rule_state::IsSet, 1577 1577 { 1578 1578 /// Build the final struct 1579 1579 pub fn build(self) -> UrlRule<'a> {
+17 -17
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 Reason; 50 49 type Url; 51 50 type Action; 51 + type Reason; 52 52 type Pattern; 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 58 type Url = Unset; 60 59 type Action = Unset; 60 + type Reason = Unset; 61 61 type Pattern = Unset; 62 62 } 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 - type Url = S::Url; 69 - type Action = S::Action; 70 - type Pattern = S::Pattern; 71 - } 72 63 ///State transition - sets the `url` field to Set 73 64 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 74 65 impl<S: State> sealed::Sealed for SetUrl<S> {} 75 66 impl<S: State> State for SetUrl<S> { 76 - type Reason = S::Reason; 77 67 type Url = Set<members::url>; 78 68 type Action = S::Action; 69 + type Reason = S::Reason; 79 70 type Pattern = S::Pattern; 80 71 } 81 72 ///State transition - sets the `action` field to Set 82 73 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 83 74 impl<S: State> sealed::Sealed for SetAction<S> {} 84 75 impl<S: State> State for SetAction<S> { 85 - type Reason = S::Reason; 86 76 type Url = S::Url; 87 77 type Action = Set<members::action>; 78 + type Reason = S::Reason; 79 + type Pattern = S::Pattern; 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 Url = S::Url; 86 + type Action = S::Action; 87 + type Reason = Set<members::reason>; 88 88 type Pattern = S::Pattern; 89 89 } 90 90 ///State transition - sets the `pattern` field to Set 91 91 pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 92 92 impl<S: State> sealed::Sealed for SetPattern<S> {} 93 93 impl<S: State> State for SetPattern<S> { 94 - type Reason = S::Reason; 95 94 type Url = S::Url; 96 95 type Action = S::Action; 96 + type Reason = S::Reason; 97 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 `reason` field 103 - pub struct reason(()); 104 102 ///Marker type for the `url` field 105 103 pub struct url(()); 106 104 ///Marker type for the `action` field 107 105 pub struct action(()); 106 + ///Marker type for the `reason` field 107 + pub struct reason(()); 108 108 ///Marker type for the `pattern` field 109 109 pub struct pattern(()); 110 110 } ··· 256 256 impl<'a, S> AddRuleBuilder<'a, S> 257 257 where 258 258 S: add_rule_state::State, 259 - S::Reason: add_rule_state::IsSet, 260 259 S::Url: add_rule_state::IsSet, 261 260 S::Action: add_rule_state::IsSet, 261 + S::Reason: add_rule_state::IsSet, 262 262 S::Pattern: add_rule_state::IsSet, 263 263 { 264 264 /// Build the final struct
+13 -13
crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs
··· 42 42 } 43 43 /// State trait tracking which required fields have been set 44 44 pub trait State: sealed::Sealed { 45 - type Pattern; 46 45 type Url; 46 + type Pattern; 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 Pattern = Unset; 53 52 type Url = Unset; 54 - } 55 - ///State transition - sets the `pattern` field to Set 56 - pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 57 - impl<S: State> sealed::Sealed for SetPattern<S> {} 58 - impl<S: State> State for SetPattern<S> { 59 - type Pattern = Set<members::pattern>; 60 - type Url = S::Url; 53 + type Pattern = Unset; 61 54 } 62 55 ///State transition - sets the `url` field to Set 63 56 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 64 57 impl<S: State> sealed::Sealed for SetUrl<S> {} 65 58 impl<S: State> State for SetUrl<S> { 66 - type Pattern = S::Pattern; 67 59 type Url = Set<members::url>; 60 + type Pattern = S::Pattern; 61 + } 62 + ///State transition - sets the `pattern` field to Set 63 + pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetPattern<S> {} 65 + impl<S: State> State for SetPattern<S> { 66 + type Url = S::Url; 67 + type Pattern = Set<members::pattern>; 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 `pattern` field 73 - pub struct pattern(()); 74 72 ///Marker type for the `url` field 75 73 pub struct url(()); 74 + ///Marker type for the `pattern` field 75 + pub struct pattern(()); 76 76 } 77 77 } 78 78 ··· 182 182 impl<'a, S> RemoveRuleBuilder<'a, S> 183 183 where 184 184 S: remove_rule_state::State, 185 - S::Pattern: remove_rule_state::IsSet, 186 185 S::Url: remove_rule_state::IsSet, 186 + S::Pattern: remove_rule_state::IsSet, 187 187 { 188 188 /// Build the final struct 189 189 pub fn build(self) -> RemoveRule<'a> {
+26 -26
crates/weaver-api/src/tools_ozone/safelink/update_rule.rs
··· 47 47 /// State trait tracking which required fields have been set 48 48 pub trait State: sealed::Sealed { 49 49 type Action; 50 - type Pattern; 51 - type Url; 52 50 type Reason; 51 + type Url; 52 + type Pattern; 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 58 type Action = Unset; 59 - type Pattern = Unset; 60 - type Url = Unset; 61 59 type Reason = Unset; 60 + type Url = Unset; 61 + type Pattern = Unset; 62 62 } 63 63 ///State transition - sets the `action` field to Set 64 64 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 65 65 impl<S: State> sealed::Sealed for SetAction<S> {} 66 66 impl<S: State> State for SetAction<S> { 67 67 type Action = Set<members::action>; 68 - type Pattern = S::Pattern; 69 - type Url = S::Url; 70 68 type Reason = S::Reason; 69 + type Url = S::Url; 70 + type Pattern = S::Pattern; 71 71 } 72 - ///State transition - sets the `pattern` field to Set 73 - pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 74 - impl<S: State> sealed::Sealed for SetPattern<S> {} 75 - impl<S: State> State for SetPattern<S> { 72 + ///State transition - sets the `reason` field to Set 73 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 74 + impl<S: State> sealed::Sealed for SetReason<S> {} 75 + impl<S: State> State for SetReason<S> { 76 76 type Action = S::Action; 77 - type Pattern = Set<members::pattern>; 77 + type Reason = Set<members::reason>; 78 78 type Url = S::Url; 79 - type Reason = S::Reason; 79 + type Pattern = S::Pattern; 80 80 } 81 81 ///State transition - sets the `url` field to Set 82 82 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 83 83 impl<S: State> sealed::Sealed for SetUrl<S> {} 84 84 impl<S: State> State for SetUrl<S> { 85 85 type Action = S::Action; 86 - type Pattern = S::Pattern; 86 + type Reason = S::Reason; 87 87 type Url = Set<members::url>; 88 - type Reason = S::Reason; 88 + type Pattern = S::Pattern; 89 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> { 90 + ///State transition - sets the `pattern` field to Set 91 + pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 92 + impl<S: State> sealed::Sealed for SetPattern<S> {} 93 + impl<S: State> State for SetPattern<S> { 94 94 type Action = S::Action; 95 - type Pattern = S::Pattern; 95 + type Reason = S::Reason; 96 96 type Url = S::Url; 97 - type Reason = Set<members::reason>; 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 102 ///Marker type for the `action` field 103 103 pub struct action(()); 104 - ///Marker type for the `pattern` field 105 - pub struct pattern(()); 106 - ///Marker type for the `url` field 107 - pub struct url(()); 108 104 ///Marker type for the `reason` field 109 105 pub struct reason(()); 106 + ///Marker type for the `url` field 107 + pub struct url(()); 108 + ///Marker type for the `pattern` field 109 + pub struct pattern(()); 110 110 } 111 111 } 112 112 ··· 257 257 where 258 258 S: update_rule_state::State, 259 259 S::Action: update_rule_state::IsSet, 260 - S::Pattern: update_rule_state::IsSet, 261 - S::Url: update_rule_state::IsSet, 262 260 S::Reason: update_rule_state::IsSet, 261 + S::Url: update_rule_state::IsSet, 262 + S::Pattern: update_rule_state::IsSet, 263 263 { 264 264 /// Build the final struct 265 265 pub fn build(self) -> UpdateRule<'a> {
+26 -26
crates/weaver-api/src/tools_ozone/set.rs
··· 301 301 /// State trait tracking which required fields have been set 302 302 pub trait State: sealed::Sealed { 303 303 type Name; 304 - type SetSize; 305 - type CreatedAt; 306 304 type UpdatedAt; 305 + type CreatedAt; 306 + type SetSize; 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 312 type Name = Unset; 313 - type SetSize = Unset; 314 - type CreatedAt = Unset; 315 313 type UpdatedAt = Unset; 314 + type CreatedAt = Unset; 315 + type SetSize = Unset; 316 316 } 317 317 ///State transition - sets the `name` field to Set 318 318 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 319 319 impl<S: State> sealed::Sealed for SetName<S> {} 320 320 impl<S: State> State for SetName<S> { 321 321 type Name = Set<members::name>; 322 - type SetSize = S::SetSize; 323 - type CreatedAt = S::CreatedAt; 324 322 type UpdatedAt = S::UpdatedAt; 323 + type CreatedAt = S::CreatedAt; 324 + type SetSize = S::SetSize; 325 325 } 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> { 326 + ///State transition - sets the `updated_at` field to Set 327 + pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 328 + impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 329 + impl<S: State> State for SetUpdatedAt<S> { 330 330 type Name = S::Name; 331 - type SetSize = Set<members::set_size>; 331 + type UpdatedAt = Set<members::updated_at>; 332 332 type CreatedAt = S::CreatedAt; 333 - type UpdatedAt = S::UpdatedAt; 333 + type SetSize = S::SetSize; 334 334 } 335 335 ///State transition - sets the `created_at` field to Set 336 336 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 337 337 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 338 338 impl<S: State> State for SetCreatedAt<S> { 339 339 type Name = S::Name; 340 - type SetSize = S::SetSize; 340 + type UpdatedAt = S::UpdatedAt; 341 341 type CreatedAt = Set<members::created_at>; 342 - type UpdatedAt = S::UpdatedAt; 342 + type SetSize = S::SetSize; 343 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> { 344 + ///State transition - sets the `set_size` field to Set 345 + pub struct SetSetSize<S: State = Empty>(PhantomData<fn() -> S>); 346 + impl<S: State> sealed::Sealed for SetSetSize<S> {} 347 + impl<S: State> State for SetSetSize<S> { 348 348 type Name = S::Name; 349 - type SetSize = S::SetSize; 349 + type UpdatedAt = S::UpdatedAt; 350 350 type CreatedAt = S::CreatedAt; 351 - type UpdatedAt = Set<members::updated_at>; 351 + type SetSize = Set<members::set_size>; 352 352 } 353 353 /// Marker types for field names 354 354 #[allow(non_camel_case_types)] 355 355 pub mod members { 356 356 ///Marker type for the `name` field 357 357 pub struct name(()); 358 - ///Marker type for the `set_size` field 359 - pub struct set_size(()); 360 - ///Marker type for the `created_at` field 361 - pub struct created_at(()); 362 358 ///Marker type for the `updated_at` field 363 359 pub struct updated_at(()); 360 + ///Marker type for the `created_at` field 361 + pub struct created_at(()); 362 + ///Marker type for the `set_size` field 363 + pub struct set_size(()); 364 364 } 365 365 } 366 366 ··· 494 494 where 495 495 S: set_view_state::State, 496 496 S::Name: set_view_state::IsSet, 497 - S::SetSize: set_view_state::IsSet, 498 - S::CreatedAt: set_view_state::IsSet, 499 497 S::UpdatedAt: set_view_state::IsSet, 498 + S::CreatedAt: set_view_state::IsSet, 499 + S::SetSize: 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/delete_values.rs
··· 35 35 } 36 36 /// State trait tracking which required fields have been set 37 37 pub trait State: sealed::Sealed { 38 - type Values; 39 38 type Name; 39 + type Values; 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 Values = Unset; 46 45 type Name = Unset; 47 - } 48 - ///State transition - sets the `values` field to Set 49 - pub struct SetValues<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetValues<S> {} 51 - impl<S: State> State for SetValues<S> { 52 - type Values = Set<members::values>; 53 - type Name = S::Name; 46 + type Values = Unset; 54 47 } 55 48 ///State transition - sets the `name` field to Set 56 49 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 57 50 impl<S: State> sealed::Sealed for SetName<S> {} 58 51 impl<S: State> State for SetName<S> { 59 - type Values = S::Values; 60 52 type Name = Set<members::name>; 53 + type Values = S::Values; 54 + } 55 + ///State transition - sets the `values` field to Set 56 + pub struct SetValues<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetValues<S> {} 58 + impl<S: State> State for SetValues<S> { 59 + type Name = S::Name; 60 + type Values = Set<members::values>; 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 `values` field 66 - pub struct values(()); 67 65 ///Marker type for the `name` field 68 66 pub struct name(()); 67 + ///Marker type for the `values` field 68 + pub struct values(()); 69 69 } 70 70 } 71 71 ··· 138 138 impl<'a, S> DeleteValuesBuilder<'a, S> 139 139 where 140 140 S: delete_values_state::State, 141 - S::Values: delete_values_state::IsSet, 142 141 S::Name: delete_values_state::IsSet, 142 + S::Values: delete_values_state::IsSet, 143 143 { 144 144 /// Build the final struct 145 145 pub fn build(self) -> DeleteValues<'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 LastUpdatedBy; 59 - type Key; 58 + type Scope; 60 59 type Value; 61 60 type Did; 62 - type Scope; 61 + type Key; 63 62 type CreatedBy; 63 + type LastUpdatedBy; 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 LastUpdatedBy = Unset; 70 - type Key = Unset; 69 + type Scope = Unset; 71 70 type Value = Unset; 72 71 type Did = Unset; 73 - type Scope = Unset; 72 + type Key = Unset; 74 73 type CreatedBy = Unset; 74 + type LastUpdatedBy = Unset; 75 75 } 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 - type Key = S::Key; 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>; 82 81 type Value = S::Value; 83 82 type Did = S::Did; 84 - type Scope = S::Scope; 83 + type Key = S::Key; 85 84 type CreatedBy = S::CreatedBy; 86 - } 87 - ///State transition - sets the `key` field to Set 88 - pub struct SetKey<S: State = Empty>(PhantomData<fn() -> S>); 89 - impl<S: State> sealed::Sealed for SetKey<S> {} 90 - impl<S: State> State for SetKey<S> { 91 85 type LastUpdatedBy = S::LastUpdatedBy; 92 - type Key = Set<members::key>; 93 - type Value = S::Value; 94 - type Did = S::Did; 95 - type Scope = S::Scope; 96 - type CreatedBy = S::CreatedBy; 97 86 } 98 87 ///State transition - sets the `value` field to Set 99 88 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 100 89 impl<S: State> sealed::Sealed for SetValue<S> {} 101 90 impl<S: State> State for SetValue<S> { 102 - type LastUpdatedBy = S::LastUpdatedBy; 103 - type Key = S::Key; 91 + type Scope = S::Scope; 104 92 type Value = Set<members::value>; 105 93 type Did = S::Did; 106 - type Scope = S::Scope; 94 + type Key = S::Key; 107 95 type CreatedBy = S::CreatedBy; 96 + type LastUpdatedBy = S::LastUpdatedBy; 108 97 } 109 98 ///State transition - sets the `did` field to Set 110 99 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 111 100 impl<S: State> sealed::Sealed for SetDid<S> {} 112 101 impl<S: State> State for SetDid<S> { 113 - type LastUpdatedBy = S::LastUpdatedBy; 114 - type Key = S::Key; 102 + type Scope = S::Scope; 115 103 type Value = S::Value; 116 104 type Did = Set<members::did>; 117 - type Scope = S::Scope; 105 + type Key = S::Key; 118 106 type CreatedBy = S::CreatedBy; 119 - } 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 107 type LastUpdatedBy = S::LastUpdatedBy; 125 - type Key = S::Key; 108 + } 109 + ///State transition - sets the `key` field to Set 110 + pub struct SetKey<S: State = Empty>(PhantomData<fn() -> S>); 111 + impl<S: State> sealed::Sealed for SetKey<S> {} 112 + impl<S: State> State for SetKey<S> { 113 + type Scope = S::Scope; 126 114 type Value = S::Value; 127 115 type Did = S::Did; 128 - type Scope = Set<members::scope>; 116 + type Key = Set<members::key>; 129 117 type CreatedBy = S::CreatedBy; 118 + type LastUpdatedBy = S::LastUpdatedBy; 130 119 } 131 120 ///State transition - sets the `created_by` field to Set 132 121 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 133 122 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 134 123 impl<S: State> State for SetCreatedBy<S> { 124 + type Scope = S::Scope; 125 + type Value = S::Value; 126 + type Did = S::Did; 127 + type Key = S::Key; 128 + type CreatedBy = Set<members::created_by>; 135 129 type LastUpdatedBy = S::LastUpdatedBy; 136 - type Key = S::Key; 130 + } 131 + ///State transition - sets the `last_updated_by` field to Set 132 + pub struct SetLastUpdatedBy<S: State = Empty>(PhantomData<fn() -> S>); 133 + impl<S: State> sealed::Sealed for SetLastUpdatedBy<S> {} 134 + impl<S: State> State for SetLastUpdatedBy<S> { 135 + type Scope = S::Scope; 137 136 type Value = S::Value; 138 137 type Did = S::Did; 139 - type Scope = S::Scope; 140 - type CreatedBy = Set<members::created_by>; 138 + type Key = S::Key; 139 + type CreatedBy = S::CreatedBy; 140 + type LastUpdatedBy = Set<members::last_updated_by>; 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 `last_updated_by` field 146 - pub struct last_updated_by(()); 147 - ///Marker type for the `key` field 148 - pub struct key(()); 145 + ///Marker type for the `scope` field 146 + pub struct scope(()); 149 147 ///Marker type for the `value` field 150 148 pub struct value(()); 151 149 ///Marker type for the `did` field 152 150 pub struct did(()); 153 - ///Marker type for the `scope` field 154 - pub struct scope(()); 151 + ///Marker type for the `key` field 152 + pub struct key(()); 155 153 ///Marker type for the `created_by` field 156 154 pub struct created_by(()); 155 + ///Marker type for the `last_updated_by` field 156 + pub struct last_updated_by(()); 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::LastUpdatedBy: defs_option_state::IsSet, 401 - S::Key: defs_option_state::IsSet, 400 + S::Scope: defs_option_state::IsSet, 402 401 S::Value: defs_option_state::IsSet, 403 402 S::Did: defs_option_state::IsSet, 404 - S::Scope: defs_option_state::IsSet, 403 + S::Key: defs_option_state::IsSet, 405 404 S::CreatedBy: defs_option_state::IsSet, 405 + S::LastUpdatedBy: 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 Scope; 44 45 type Value; 45 46 type Key; 46 - type Scope; 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 Scope = Unset; 52 53 type Value = Unset; 53 54 type Key = Unset; 54 - type Scope = Unset; 55 + } 56 + ///State transition - sets the `scope` field to Set 57 + pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetScope<S> {} 59 + impl<S: State> State for SetScope<S> { 60 + type Scope = Set<members::scope>; 61 + type Value = S::Value; 62 + type Key = S::Key; 55 63 } 56 64 ///State transition - sets the `value` field to Set 57 65 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 58 66 impl<S: State> sealed::Sealed for SetValue<S> {} 59 67 impl<S: State> State for SetValue<S> { 68 + type Scope = S::Scope; 60 69 type Value = Set<members::value>; 61 70 type Key = S::Key; 62 - type Scope = S::Scope; 63 71 } 64 72 ///State transition - sets the `key` field to Set 65 73 pub struct SetKey<S: State = Empty>(PhantomData<fn() -> S>); 66 74 impl<S: State> sealed::Sealed for SetKey<S> {} 67 75 impl<S: State> State for SetKey<S> { 68 - type Value = S::Value; 69 - type Key = Set<members::key>; 70 76 type Scope = S::Scope; 71 - } 72 - ///State transition - sets the `scope` field to Set 73 - pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 74 - impl<S: State> sealed::Sealed for SetScope<S> {} 75 - impl<S: State> State for SetScope<S> { 76 77 type Value = S::Value; 77 - type Key = S::Key; 78 - type Scope = Set<members::scope>; 78 + type Key = Set<members::key>; 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 `scope` field 84 + pub struct scope(()); 83 85 ///Marker type for the `value` field 84 86 pub struct value(()); 85 87 ///Marker type for the `key` field 86 88 pub struct key(()); 87 - ///Marker type for the `scope` field 88 - pub struct scope(()); 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::Scope: upsert_option_state::IsSet, 221 222 S::Value: upsert_option_state::IsSet, 222 223 S::Key: upsert_option_state::IsSet, 223 - S::Scope: 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 Role; 37 36 type Did; 37 + type Role; 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 Role = Unset; 44 43 type Did = Unset; 45 - } 46 - ///State transition - sets the `role` field to Set 47 - pub struct SetRole<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetRole<S> {} 49 - impl<S: State> State for SetRole<S> { 50 - type Role = Set<members::role>; 51 - type Did = S::Did; 44 + type Role = Unset; 52 45 } 53 46 ///State transition - sets the `did` field to Set 54 47 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetDid<S> {} 56 49 impl<S: State> State for SetDid<S> { 57 - type Role = S::Role; 58 50 type Did = Set<members::did>; 51 + type Role = S::Role; 52 + } 53 + ///State transition - sets the `role` field to Set 54 + pub struct SetRole<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetRole<S> {} 56 + impl<S: State> State for SetRole<S> { 57 + type Did = S::Did; 58 + type Role = Set<members::role>; 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 `role` field 64 - pub struct role(()); 65 63 ///Marker type for the `did` field 66 64 pub struct did(()); 65 + ///Marker type for the `role` field 66 + pub struct role(()); 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::Role: add_member_state::IsSet, 140 139 S::Did: add_member_state::IsSet, 140 + S::Role: add_member_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> AddMember<'a> {
+38 -38
crates/weaver-api/src/tools_ozone/verification.rs
··· 75 75 /// State trait tracking which required fields have been set 76 76 pub trait State: sealed::Sealed { 77 77 type Issuer; 78 + type Uri; 79 + type Handle; 78 80 type Subject; 79 81 type DisplayName; 80 - type Uri; 81 - type Handle; 82 82 type CreatedAt; 83 83 } 84 84 /// Empty state - all required fields are unset ··· 86 86 impl sealed::Sealed for Empty {} 87 87 impl State for Empty { 88 88 type Issuer = Unset; 89 + type Uri = Unset; 90 + type Handle = Unset; 89 91 type Subject = Unset; 90 92 type DisplayName = Unset; 91 - type Uri = Unset; 92 - type Handle = Unset; 93 93 type CreatedAt = Unset; 94 94 } 95 95 ///State transition - sets the `issuer` field to Set ··· 97 97 impl<S: State> sealed::Sealed for SetIssuer<S> {} 98 98 impl<S: State> State for SetIssuer<S> { 99 99 type Issuer = Set<members::issuer>; 100 - type Subject = S::Subject; 101 - type DisplayName = S::DisplayName; 102 100 type Uri = S::Uri; 103 101 type Handle = S::Handle; 104 - type CreatedAt = S::CreatedAt; 105 - } 106 - ///State transition - sets the `subject` field to Set 107 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 108 - impl<S: State> sealed::Sealed for SetSubject<S> {} 109 - impl<S: State> State for SetSubject<S> { 110 - type Issuer = S::Issuer; 111 - type Subject = Set<members::subject>; 112 - type DisplayName = S::DisplayName; 113 - type Uri = S::Uri; 114 - type Handle = S::Handle; 115 - type CreatedAt = S::CreatedAt; 116 - } 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; 122 102 type Subject = S::Subject; 123 - type DisplayName = Set<members::display_name>; 124 - type Uri = S::Uri; 125 - type Handle = S::Handle; 103 + type DisplayName = S::DisplayName; 126 104 type CreatedAt = S::CreatedAt; 127 105 } 128 106 ///State transition - sets the `uri` field to Set ··· 130 108 impl<S: State> sealed::Sealed for SetUri<S> {} 131 109 impl<S: State> State for SetUri<S> { 132 110 type Issuer = S::Issuer; 111 + type Uri = Set<members::uri>; 112 + type Handle = S::Handle; 133 113 type Subject = S::Subject; 134 114 type DisplayName = S::DisplayName; 135 - type Uri = Set<members::uri>; 136 - type Handle = S::Handle; 137 115 type CreatedAt = S::CreatedAt; 138 116 } 139 117 ///State transition - sets the `handle` field to Set ··· 141 119 impl<S: State> sealed::Sealed for SetHandle<S> {} 142 120 impl<S: State> State for SetHandle<S> { 143 121 type Issuer = S::Issuer; 122 + type Uri = S::Uri; 123 + type Handle = Set<members::handle>; 144 124 type Subject = S::Subject; 145 125 type DisplayName = S::DisplayName; 126 + type CreatedAt = S::CreatedAt; 127 + } 128 + ///State transition - sets the `subject` field to Set 129 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 130 + impl<S: State> sealed::Sealed for SetSubject<S> {} 131 + impl<S: State> State for SetSubject<S> { 132 + type Issuer = S::Issuer; 146 133 type Uri = S::Uri; 147 - type Handle = Set<members::handle>; 134 + type Handle = S::Handle; 135 + type Subject = Set<members::subject>; 136 + type DisplayName = S::DisplayName; 137 + type CreatedAt = S::CreatedAt; 138 + } 139 + ///State transition - sets the `display_name` field to Set 140 + pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 141 + impl<S: State> sealed::Sealed for SetDisplayName<S> {} 142 + impl<S: State> State for SetDisplayName<S> { 143 + type Issuer = S::Issuer; 144 + type Uri = S::Uri; 145 + type Handle = S::Handle; 146 + type Subject = S::Subject; 147 + type DisplayName = Set<members::display_name>; 148 148 type CreatedAt = S::CreatedAt; 149 149 } 150 150 ///State transition - sets the `created_at` field to Set ··· 152 152 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 153 153 impl<S: State> State for SetCreatedAt<S> { 154 154 type Issuer = S::Issuer; 155 - type Subject = S::Subject; 156 - type DisplayName = S::DisplayName; 157 155 type Uri = S::Uri; 158 156 type Handle = S::Handle; 157 + type Subject = S::Subject; 158 + type DisplayName = S::DisplayName; 159 159 type CreatedAt = Set<members::created_at>; 160 160 } 161 161 /// Marker types for field names ··· 163 163 pub mod members { 164 164 ///Marker type for the `issuer` field 165 165 pub struct issuer(()); 166 + ///Marker type for the `uri` field 167 + pub struct uri(()); 168 + ///Marker type for the `handle` field 169 + pub struct handle(()); 166 170 ///Marker type for the `subject` field 167 171 pub struct subject(()); 168 172 ///Marker type for the `display_name` field 169 173 pub struct display_name(()); 170 - ///Marker type for the `uri` field 171 - pub struct uri(()); 172 - ///Marker type for the `handle` field 173 - pub struct handle(()); 174 174 ///Marker type for the `created_at` field 175 175 pub struct created_at(()); 176 176 } ··· 480 480 where 481 481 S: verification_view_state::State, 482 482 S::Issuer: verification_view_state::IsSet, 483 + S::Uri: verification_view_state::IsSet, 484 + S::Handle: verification_view_state::IsSet, 483 485 S::Subject: verification_view_state::IsSet, 484 486 S::DisplayName: 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 Subject; 40 39 type Error; 40 + type Subject; 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 Subject = Unset; 47 46 type Error = Unset; 48 - } 49 - ///State transition - sets the `subject` field to Set 50 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 51 - impl<S: State> sealed::Sealed for SetSubject<S> {} 52 - impl<S: State> State for SetSubject<S> { 53 - type Subject = Set<members::subject>; 54 - type Error = S::Error; 47 + type Subject = Unset; 55 48 } 56 49 ///State transition - sets the `error` field to Set 57 50 pub struct SetError<S: State = Empty>(PhantomData<fn() -> S>); 58 51 impl<S: State> sealed::Sealed for SetError<S> {} 59 52 impl<S: State> State for SetError<S> { 60 - type Subject = S::Subject; 61 53 type Error = Set<members::error>; 54 + type Subject = S::Subject; 55 + } 56 + ///State transition - sets the `subject` field to Set 57 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetSubject<S> {} 59 + impl<S: State> State for SetSubject<S> { 60 + type Error = S::Error; 61 + type Subject = Set<members::subject>; 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 `subject` field 67 - pub struct subject(()); 68 66 ///Marker type for the `error` field 69 67 pub struct error(()); 68 + ///Marker type for the `subject` field 69 + pub struct subject(()); 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::Subject: grant_error_state::IsSet, 143 142 S::Error: grant_error_state::IsSet, 143 + S::Subject: 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 Handle; 644 - type DisplayName; 645 643 type Subject; 644 + type DisplayName; 645 + type Handle; 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 Subject = Unset; 652 + type DisplayName = Unset; 651 653 type Handle = Unset; 652 - type DisplayName = Unset; 653 - type Subject = Unset; 654 654 } 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>; 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>; 660 660 type DisplayName = S::DisplayName; 661 - type Subject = S::Subject; 661 + type Handle = S::Handle; 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 Handle = S::Handle; 668 - type DisplayName = Set<members::display_name>; 669 667 type Subject = S::Subject; 668 + type DisplayName = Set<members::display_name>; 669 + type Handle = S::Handle; 670 670 } 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; 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; 676 676 type DisplayName = S::DisplayName; 677 - type Subject = Set<members::subject>; 677 + type Handle = Set<members::handle>; 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 `subject` field 683 + pub struct subject(()); 684 + ///Marker type for the `display_name` field 685 + pub struct display_name(()); 682 686 ///Marker type for the `handle` field 683 687 pub struct handle(()); 684 - ///Marker type for the `display_name` field 685 - pub struct display_name(()); 686 - ///Marker type for the `subject` field 687 - pub struct subject(()); 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::Handle: verification_input_state::IsSet, 801 - S::DisplayName: verification_input_state::IsSet, 802 800 S::Subject: verification_input_state::IsSet, 801 + S::DisplayName: verification_input_state::IsSet, 802 + S::Handle: 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 Uri; 240 239 type Error; 240 + type Uri; 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 Uri = Unset; 247 246 type Error = Unset; 248 - } 249 - ///State transition - sets the `uri` field to Set 250 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 251 - impl<S: State> sealed::Sealed for SetUri<S> {} 252 - impl<S: State> State for SetUri<S> { 253 - type Uri = Set<members::uri>; 254 - type Error = S::Error; 247 + type Uri = Unset; 255 248 } 256 249 ///State transition - sets the `error` field to Set 257 250 pub struct SetError<S: State = Empty>(PhantomData<fn() -> S>); 258 251 impl<S: State> sealed::Sealed for SetError<S> {} 259 252 impl<S: State> State for SetError<S> { 260 - type Uri = S::Uri; 261 253 type Error = Set<members::error>; 254 + type Uri = S::Uri; 255 + } 256 + ///State transition - sets the `uri` field to Set 257 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 258 + impl<S: State> sealed::Sealed for SetUri<S> {} 259 + impl<S: State> State for SetUri<S> { 260 + type Error = S::Error; 261 + type Uri = Set<members::uri>; 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 `uri` field 267 - pub struct uri(()); 268 266 ///Marker type for the `error` field 269 267 pub struct error(()); 268 + ///Marker type for the `uri` field 269 + pub struct uri(()); 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::Uri: revoke_error_state::IsSet, 343 342 S::Error: revoke_error_state::IsSet, 343 + S::Uri: revoke_error_state::IsSet, 344 344 { 345 345 /// Build the final struct 346 346 pub fn build(self) -> RevokeError<'a> {
+1 -1
crates/weaver-app/Cargo.toml
··· 23 23 required-features = ["web"] 24 24 25 25 [features] 26 - default = ["web", "fullstack-server", "use-index"] 26 + default = ["web", "fullstack-server", "use-index", "pckt"] 27 27 # Fullstack mode with SSR and server functions 28 28 fullstack-server = ["dioxus/fullstack"] 29 29 # Enable pckt/site.standard document rendering
+73 -1
crates/weaver-app/src/components/app_link.rs
··· 7 7 8 8 use crate::env::WEAVER_APP_HOST; 9 9 use crate::host_mode::LinkMode; 10 - use crate::{Route, SubdomainRoute}; 10 + use crate::{CustomDomainRoute, Route, SubdomainRoute}; 11 11 use dioxus::prelude::*; 12 12 use jacquard::smol_str::SmolStr; 13 13 use jacquard::types::string::AtIdentifier; ··· 160 160 } 161 161 } 162 162 // These go to main domain in subdomain mode 163 + AppLinkTarget::StandaloneEntry { ident, rkey } => { 164 + let href = format!("{}/{}/e/{}", WEAVER_APP_HOST, ident, rkey); 165 + rsx! { 166 + a { href: "{href}", class: "{class}", {props.children} } 167 + } 168 + } 169 + AppLinkTarget::StandaloneEntryEdit { ident, rkey } => { 170 + let href = format!("{}/{}/e/{}/edit", WEAVER_APP_HOST, ident, rkey); 171 + rsx! { 172 + a { href: "{href}", class: "{class}", {props.children} } 173 + } 174 + } 175 + AppLinkTarget::NewDraft { ident, notebook } => { 176 + let href = match notebook { 177 + Some(nb) => format!("{}/{}/new?notebook={}", WEAVER_APP_HOST, ident, nb), 178 + None => format!("{}/{}/new", WEAVER_APP_HOST, ident), 179 + }; 180 + rsx! { 181 + a { href: "{href}", class: "{class}", {props.children} } 182 + } 183 + } 184 + AppLinkTarget::Drafts { ident } => { 185 + let href = format!("{}/{}/drafts", WEAVER_APP_HOST, ident); 186 + rsx! { 187 + a { href: "{href}", class: "{class}", {props.children} } 188 + } 189 + } 190 + AppLinkTarget::Invites { ident } => { 191 + let href = format!("{}/{}/invites", WEAVER_APP_HOST, ident); 192 + rsx! { 193 + a { href: "{href}", class: "{class}", {props.children} } 194 + } 195 + } 196 + } 197 + } 198 + LinkMode::CustomDomain => { 199 + // Custom domain mode - uses CustomDomainRoute for path-based routing 200 + match props.to.clone() { 201 + AppLinkTarget::Entry { entry_path, .. } => { 202 + // Entry by title maps to path page 203 + let route = CustomDomainRoute::PathPage { 204 + segments: vec![entry_path.to_string()], 205 + }; 206 + rsx! { 207 + Link { to: route, class: "{class}", {props.children} } 208 + } 209 + } 210 + AppLinkTarget::EntryByRkey { rkey, .. } => { 211 + let route = CustomDomainRoute::EntryByRkey { rkey }; 212 + rsx! { 213 + Link { to: route, class: "{class}", {props.children} } 214 + } 215 + } 216 + AppLinkTarget::EntryEdit { rkey, .. } => { 217 + let route = CustomDomainRoute::EntryEdit { rkey }; 218 + rsx! { 219 + Link { to: route, class: "{class}", {props.children} } 220 + } 221 + } 222 + AppLinkTarget::Notebook { .. } => { 223 + let route = CustomDomainRoute::Root {}; 224 + rsx! { 225 + Link { to: route, class: "{class}", {props.children} } 226 + } 227 + } 228 + AppLinkTarget::Profile { ident } => { 229 + let route = CustomDomainRoute::Profile { ident }; 230 + rsx! { 231 + Link { to: route, class: "{class}", {props.children} } 232 + } 233 + } 234 + // These go to main domain in custom domain mode 163 235 AppLinkTarget::StandaloneEntry { ident, rkey } => { 164 236 let href = format!("{}/{}/e/{}", WEAVER_APP_HOST, ident, rkey); 165 237 rsx! {
+150
crates/weaver-app/src/custom_domain_app.rs
··· 1 + //! Custom domain Dioxus application. 2 + //! 3 + //! Separate router for custom domain hosting (e.g., myblog.com). 4 + //! Uses site.standard.publication documents with path-based routing. 5 + 6 + use dioxus::prelude::*; 7 + use jacquard::smol_str::SmolStr; 8 + use jacquard::types::string::AtIdentifier; 9 + 10 + use crate::components::identity::RepositoryIndex; 11 + use crate::host_mode::CustomDomainContext; 12 + 13 + /// Custom domain route enum - path-based routing for publications. 14 + #[derive(Debug, Clone, Routable, PartialEq)] 15 + #[rustfmt::skip] 16 + pub enum CustomDomainRoute { 17 + #[layout(CustomDomainLayout)] 18 + /// Root/landing page. 19 + #[route("/")] 20 + Root {}, 21 + /// Explicit index page. 22 + #[route("/index")] 23 + Index {}, 24 + /// Entry by rkey (direct lookup). 25 + #[route("/e/:rkey")] 26 + EntryByRkey { rkey: SmolStr }, 27 + /// Entry edit by rkey. 28 + #[route("/e/:rkey/edit")] 29 + EntryEdit { rkey: SmolStr }, 30 + /// Profile/repository view. 31 + #[route("/u/:ident")] 32 + Profile { ident: AtIdentifier<'static> }, 33 + /// Path-based document (catch-all, must be last). 34 + #[route("/*segments")] 35 + PathPage { segments: Vec<String> }, 36 + } 37 + 38 + /// Root component for custom domain app. 39 + #[component] 40 + pub fn CustomDomainApp() -> Element { 41 + rsx! { 42 + document::Link { rel: "icon", href: crate::FAVICON } 43 + document::Link { rel: "preconnect", href: "https://fonts.googleapis.com" } 44 + document::Link { rel: "preconnect", href: "https://fonts.gstatic.com" } 45 + document::Link { rel: "stylesheet", href: crate::THEME_DEFAULTS_CSS } 46 + 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" } 47 + document::Link { rel: "stylesheet", href: crate::MAIN_CSS } 48 + crate::components::toast::ToastProvider { 49 + Router::<CustomDomainRoute> {} 50 + } 51 + } 52 + } 53 + 54 + #[component] 55 + fn CustomDomainLayout() -> Element { 56 + let ctx = use_context::<CustomDomainContext>(); 57 + rsx! { 58 + nav { class: "custom-domain-nav", 59 + a { href: "/", "{ctx.publication_name}" } 60 + } 61 + main { Outlet::<CustomDomainRoute> {} } 62 + } 63 + } 64 + 65 + #[component] 66 + fn Root() -> Element { 67 + rsx! { Index {} } 68 + } 69 + 70 + #[component] 71 + fn Index() -> Element { 72 + let ctx = use_context::<CustomDomainContext>(); 73 + 74 + rsx! { 75 + crate::views::NotebookIndex { 76 + ident: ctx.owner.clone(), 77 + book_title: ctx.publication_name.clone(), 78 + } 79 + } 80 + } 81 + 82 + #[component] 83 + fn EntryByRkey(rkey: ReadOnlySignal<SmolStr>) -> Element { 84 + let ctx = use_context::<CustomDomainContext>(); 85 + 86 + rsx! { 87 + crate::views::NotebookEntryByRkey { 88 + ident: ctx.owner.clone(), 89 + book_title: ctx.publication_name.clone(), 90 + rkey: rkey, 91 + } 92 + } 93 + } 94 + 95 + #[component] 96 + fn EntryEdit(rkey: ReadOnlySignal<SmolStr>) -> Element { 97 + let ctx = use_context::<CustomDomainContext>(); 98 + 99 + rsx! { 100 + crate::views::NotebookEntryEdit { 101 + ident: ctx.owner.clone(), 102 + book_title: ctx.publication_name.clone(), 103 + rkey: rkey, 104 + } 105 + } 106 + } 107 + 108 + #[component] 109 + fn Profile(ident: AtIdentifier<'static>) -> Element { 110 + rsx! { 111 + RepositoryIndex { ident } 112 + } 113 + } 114 + 115 + #[component] 116 + fn PathPage(segments: ReadOnlySignal<Vec<String>>) -> Element { 117 + let ctx = use_context::<CustomDomainContext>(); 118 + 119 + let ident = use_memo(move || ctx.owner.clone()); 120 + let rkey = use_memo(move || ctx.publication_rkey.clone()); 121 + let path = use_memo(move || format!("/{}", segments().join("/"))); 122 + 123 + let (doc_res, doc_data) = 124 + crate::data::use_custom_domain_document_data(ident.into(), rkey.into(), path.into()); 125 + 126 + #[cfg(feature = "fullstack-server")] 127 + let _doc_res = doc_res?; 128 + 129 + #[cfg(not(feature = "fullstack-server"))] 130 + let _ = doc_res; 131 + 132 + match &*doc_data.read() { 133 + Some(data) => { 134 + let title = data.document.title.as_ref(); 135 + 136 + rsx! { 137 + article { class: "document-content", 138 + h1 { "{title}" } 139 + div { 140 + class: "rendered-content", 141 + dangerous_inner_html: "{data.rendered_html}" 142 + } 143 + } 144 + } 145 + } 146 + None => rsx! { 147 + div { class: "loading", "Loading..." } 148 + }, 149 + } 150 + }
+182 -12
crates/weaver-app/src/data.rs
··· 1851 1851 use jacquard::prelude::IdentityResolver; 1852 1852 use weaver_api::site_standard::document::Document as SiteStandardDocument; 1853 1853 use weaver_api::site_standard::publication::Publication; 1854 - use weaver_renderer::pckt::{PcktRenderContext, render_content_blocks}; 1854 + use weaver_renderer::pckt::{PcktRenderContext, render_document_content}; 1855 1855 1856 1856 let ident = ident(); 1857 1857 let rkey = rkey(); ··· 1886 1886 }; 1887 1887 1888 1888 // Fetch publication to get base URL 1889 - let publication_url = 1890 - if let Ok(pub_record) = fetcher.fetch_record_slingshot(&doc.publication).await { 1889 + use jacquard::types::string::Uri; 1890 + let publication_url = if let Uri::At(site_uri) = &doc.site { 1891 + if let Ok(pub_record) = fetcher.fetch_record_slingshot(site_uri).await { 1891 1892 jacquard::from_data::<Publication>(&pub_record.value) 1892 1893 .ok() 1893 1894 .map(|p| p.url.as_ref().to_string()) 1894 1895 } else { 1895 1896 None 1896 - }; 1897 + } 1898 + } else { 1899 + // Site is an HTTPS URL, use it directly 1900 + Some(doc.site.as_str().to_string()) 1901 + }; 1897 1902 1898 1903 // Render HTML 1899 1904 let rendered_html = { ··· 1902 1907 AtIdentifier::Handle(h) => fetcher.resolve_handle(h).await.ok()?.into_static(), 1903 1908 }; 1904 1909 let ctx = PcktRenderContext::new(author_did); 1905 - if let Some(blocks) = &doc.content { 1906 - Some(render_content_blocks(blocks, &ctx, &fetcher).await) 1910 + if let Some(content) = &doc.content { 1911 + Some(render_document_content(content, &ctx, &fetcher).await) 1907 1912 } else { 1908 1913 Some(String::from("<p>No content</p>")) 1909 1914 } ··· 1956 1961 use jacquard::prelude::IdentityResolver; 1957 1962 use weaver_api::site_standard::document::Document as SiteStandardDocument; 1958 1963 use weaver_api::site_standard::publication::Publication; 1959 - use weaver_renderer::pckt::{PcktRenderContext, render_content_blocks}; 1964 + use weaver_renderer::pckt::{PcktRenderContext, render_document_content}; 1960 1965 1961 1966 let fetcher = use_context::<crate::fetch::Fetcher>(); 1962 1967 ··· 1996 2001 }; 1997 2002 1998 2003 // Fetch publication to get base URL 1999 - let publication_url = 2000 - if let Ok(pub_record) = fetcher.fetch_record_slingshot(&doc.publication).await { 2004 + use jacquard::types::string::Uri; 2005 + let publication_url = if let Uri::At(site_uri) = &doc.site { 2006 + if let Ok(pub_record) = fetcher.fetch_record_slingshot(site_uri).await { 2001 2007 jacquard::from_data::<Publication>(&pub_record.value) 2002 2008 .ok() 2003 2009 .map(|p| p.url.as_ref().to_string()) 2004 2010 } else { 2005 2011 None 2006 - }; 2012 + } 2013 + } else { 2014 + // Site is an HTTPS URL, use it directly 2015 + Some(doc.site.as_str().to_string()) 2016 + }; 2007 2017 2008 2018 // Render HTML 2009 2019 let rendered_html = { ··· 2012 2022 AtIdentifier::Handle(h) => fetcher.resolve_handle(h).await.ok()?.into_static(), 2013 2023 }; 2014 2024 let ctx = PcktRenderContext::new(author_did); 2015 - if let Some(blocks) = &doc.content { 2016 - Some(render_content_blocks(blocks, &ctx, &fetcher).await) 2025 + if let Some(content) = &doc.content { 2026 + Some(render_document_content(content, &ctx, &fetcher).await) 2017 2027 } else { 2018 2028 Some(String::from("<p>No content</p>")) 2019 2029 } ··· 2061 2071 cache.insert_bytes(cid, body, cache_key); 2062 2072 Ok(()) 2063 2073 } 2074 + 2075 + // ============================================================================ 2076 + // Custom Domain Document Resolution 2077 + // ============================================================================ 2078 + 2079 + use weaver_api::sh_weaver::domain::DocumentView; 2080 + 2081 + /// Typed data returned from custom domain document resolution. 2082 + #[derive(Clone, Debug, PartialEq)] 2083 + pub struct CustomDomainDocumentData { 2084 + pub document: DocumentView<'static>, 2085 + pub rendered_html: String, 2086 + } 2087 + 2088 + #[cfg(feature = "fullstack-server")] 2089 + pub fn use_custom_domain_document_data( 2090 + ident: ReadSignal<AtIdentifier<'static>>, 2091 + publication_rkey: ReadSignal<SmolStr>, 2092 + path: ReadSignal<String>, 2093 + ) -> ( 2094 + Result<Resource<Option<(serde_json::Value, String)>>, RenderError>, 2095 + Memo<Option<CustomDomainDocumentData>>, 2096 + ) { 2097 + let fetcher = use_context::<crate::fetch::Fetcher>(); 2098 + let fetcher = fetcher.clone(); 2099 + 2100 + let res = use_server_future(use_reactive!(|(ident, publication_rkey, path)| { 2101 + let fetcher = fetcher.clone(); 2102 + async move { 2103 + use jacquard::prelude::XrpcClient; 2104 + use jacquard::smol_str::format_smolstr; 2105 + use jacquard::types::aturi::AtUri; 2106 + use weaver_api::sh_weaver::domain::resolve_document::ResolveDocument; 2107 + use weaver_api::site_standard::document::Document; 2108 + use weaver_renderer::pckt::{PcktRenderContext, render_document_content}; 2109 + 2110 + let ident_val = ident(); 2111 + let rkey = publication_rkey(); 2112 + let path_val = path(); 2113 + 2114 + let author_did = match &ident_val { 2115 + AtIdentifier::Did(d) => d.clone().into_static(), 2116 + AtIdentifier::Handle(h) => fetcher.resolve_handle(h).await.ok()?.into_static(), 2117 + }; 2118 + 2119 + let pub_uri_str = 2120 + format_smolstr!("at://{}/site.standard.publication/{}", author_did, rkey); 2121 + let pub_uri = AtUri::new(&pub_uri_str).ok()?; 2122 + 2123 + let output = fetcher 2124 + .send( 2125 + ResolveDocument::new() 2126 + .publication(pub_uri) 2127 + .path(&path_val) 2128 + .build(), 2129 + ) 2130 + .await 2131 + .ok()? 2132 + .into_output() 2133 + .ok()?; 2134 + 2135 + let doc_view = output.document; 2136 + let document = jacquard::from_data::<Document>(&doc_view.record).ok()?; 2137 + 2138 + let rendered_html = if let Some(content) = &document.content { 2139 + let ctx = PcktRenderContext::new(author_did); 2140 + render_document_content(content, &ctx, &*fetcher.get_client()).await 2141 + } else { 2142 + String::new() 2143 + }; 2144 + 2145 + Some((serde_json::to_value(&doc_view).ok()?, rendered_html)) 2146 + } 2147 + })); 2148 + 2149 + let memo = use_memo(use_reactive!(|res| { 2150 + let res = res.as_ref().ok()?; 2151 + if let Some(Some((doc_json, html))) = &*res.read() { 2152 + let document = jacquard::from_json_value::<DocumentView>(doc_json.clone()).ok()?; 2153 + Some(CustomDomainDocumentData { 2154 + document, 2155 + rendered_html: html.clone(), 2156 + }) 2157 + } else { 2158 + None 2159 + } 2160 + })); 2161 + 2162 + (res, memo) 2163 + } 2164 + 2165 + #[cfg(not(feature = "fullstack-server"))] 2166 + pub fn use_custom_domain_document_data( 2167 + ident: ReadSignal<AtIdentifier<'static>>, 2168 + publication_rkey: ReadSignal<SmolStr>, 2169 + path: ReadSignal<String>, 2170 + ) -> ( 2171 + Resource<Option<CustomDomainDocumentData>>, 2172 + Memo<Option<CustomDomainDocumentData>>, 2173 + ) { 2174 + let fetcher = use_context::<crate::fetch::Fetcher>(); 2175 + let fetcher = fetcher.clone(); 2176 + 2177 + let res = use_resource(move || { 2178 + let fetcher = fetcher.clone(); 2179 + async move { 2180 + use jacquard::IntoStatic; 2181 + use jacquard::prelude::XrpcClient; 2182 + use jacquard::smol_str::format_smolstr; 2183 + use jacquard::types::aturi::AtUri; 2184 + use weaver_api::sh_weaver::domain::resolve_document::ResolveDocument; 2185 + use weaver_api::site_standard::document::Document; 2186 + use weaver_renderer::pckt::{PcktRenderContext, render_document_content}; 2187 + 2188 + let ident_val = ident(); 2189 + let rkey = publication_rkey(); 2190 + let path_val = path(); 2191 + 2192 + let author_did = match &ident_val { 2193 + AtIdentifier::Did(d) => d.clone().into_static(), 2194 + AtIdentifier::Handle(h) => fetcher.resolve_handle(h).await.ok()?.into_static(), 2195 + }; 2196 + 2197 + let pub_uri_str = 2198 + format_smolstr!("at://{}/site.standard.publication/{}", author_did, rkey); 2199 + let pub_uri = AtUri::new(&pub_uri_str).ok()?; 2200 + 2201 + let output = fetcher 2202 + .send( 2203 + ResolveDocument::new() 2204 + .publication(pub_uri) 2205 + .path(&path_val) 2206 + .build(), 2207 + ) 2208 + .await 2209 + .ok()? 2210 + .into_output() 2211 + .ok()?; 2212 + 2213 + let doc_view = output.document.into_static(); 2214 + let document = jacquard::from_data::<Document>(&doc_view.record).ok()?; 2215 + 2216 + let rendered_html = if let Some(content) = &document.content { 2217 + let ctx = PcktRenderContext::new(author_did); 2218 + render_document_content(content, &ctx, &*fetcher.get_client()).await 2219 + } else { 2220 + String::new() 2221 + }; 2222 + 2223 + Some(CustomDomainDocumentData { 2224 + document: doc_view.clone(), 2225 + rendered_html, 2226 + }) 2227 + } 2228 + }); 2229 + 2230 + let memo = use_memo(move || res.cloned().flatten()); 2231 + 2232 + (res, memo) 2233 + }
+76 -12
crates/weaver-app/src/host_mode.rs
··· 5 5 use jacquard::types::string::AtIdentifier; 6 6 use serde::{Deserialize, Serialize}; 7 7 8 + /// Unified host context resolved by middleware. 9 + /// 10 + /// This is inserted into request extensions by the host resolution middleware 11 + /// and read by the Dioxus app to determine which router to use. 12 + #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] 13 + pub enum HostContext { 14 + /// Main weaver.sh domain - use full Route enum. 15 + MainDomain, 16 + /// Subdomain hosting (notebook.weaver.sh) - use SubdomainRoute. 17 + Subdomain(SubdomainContext), 18 + /// Custom domain (myblog.com) - use CustomDomainRoute. 19 + CustomDomain(CustomDomainContext), 20 + } 21 + 22 + impl HostContext { 23 + /// Get the link mode for this host context. 24 + pub fn link_mode(&self) -> LinkMode { 25 + match self { 26 + HostContext::MainDomain => LinkMode::MainDomain, 27 + HostContext::Subdomain(_) => LinkMode::Subdomain, 28 + HostContext::CustomDomain(_) => LinkMode::CustomDomain, 29 + } 30 + } 31 + } 32 + 8 33 /// Context for subdomain routing - identifies the notebook being served. 9 34 #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] 10 35 #[serde(bound(deserialize = ""))] ··· 37 62 } 38 63 } 39 64 65 + /// Context for custom domain routing - identifies the publication being served. 66 + #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] 67 + #[serde(bound(deserialize = ""))] 68 + pub struct CustomDomainContext { 69 + /// Custom domain (e.g., "myblog.com"). 70 + pub domain: SmolStr, 71 + /// DID of the publication owner. 72 + #[serde(deserialize_with = "deserialize_static_ident")] 73 + pub owner: AtIdentifier<'static>, 74 + /// Publication rkey. 75 + pub publication_rkey: SmolStr, 76 + /// Publication name. 77 + pub publication_name: SmolStr, 78 + /// For weaver-backed publications, the backing notebook URI. 79 + pub notebook_uri: Option<SmolStr>, 80 + } 81 + 40 82 /// Link mode for generating appropriate URLs based on host context. 41 83 /// 42 84 /// Components use this context to generate links that work on both ··· 48 90 MainDomain, 49 91 /// Subdomain - simplified paths like /:entry 50 92 Subdomain, 93 + /// Custom domain - paths like /:path for publications 94 + CustomDomain, 51 95 } 52 96 53 97 impl LinkMode { ··· 56 100 matches!(self, LinkMode::Subdomain) 57 101 } 58 102 103 + /// Check if we're in a hosted mode (subdomain or custom domain). 104 + pub fn is_hosted(&self) -> bool { 105 + matches!(self, LinkMode::Subdomain | LinkMode::CustomDomain) 106 + } 107 + 59 108 /// Generate link to a notebook entry by title. 60 109 pub fn entry_link( 61 110 &self, ··· 65 114 ) -> SmolStr { 66 115 match self { 67 116 LinkMode::MainDomain => format_smolstr!("/{}/{}/{}", ident, book_title, entry_title), 68 - LinkMode::Subdomain => format_smolstr!("/{}", entry_title), 117 + LinkMode::Subdomain | LinkMode::CustomDomain => format_smolstr!("/{}", entry_title), 69 118 } 70 119 } 71 120 ··· 78 127 ) -> SmolStr { 79 128 match self { 80 129 LinkMode::MainDomain => format_smolstr!("/{}/{}/e/{}", ident, book_title, rkey), 81 - LinkMode::Subdomain => format_smolstr!("/e/{}", rkey), 130 + LinkMode::Subdomain | LinkMode::CustomDomain => format_smolstr!("/e/{}", rkey), 82 131 } 83 132 } 84 133 ··· 91 140 ) -> SmolStr { 92 141 match self { 93 142 LinkMode::MainDomain => format_smolstr!("/{}/{}/e/{}/edit", ident, book_title, rkey), 94 - LinkMode::Subdomain => format_smolstr!("/e/{}/edit", rkey), 143 + LinkMode::Subdomain | LinkMode::CustomDomain => format_smolstr!("/e/{}/edit", rkey), 95 144 } 96 145 } 97 146 ··· 99 148 pub fn notebook_link(&self, ident: &AtIdentifier<'_>, book_title: &str) -> SmolStr { 100 149 match self { 101 150 LinkMode::MainDomain => format_smolstr!("/{}/{}", ident, book_title), 102 - LinkMode::Subdomain => SmolStr::new_static("/"), 151 + LinkMode::Subdomain | LinkMode::CustomDomain => SmolStr::new_static("/"), 103 152 } 104 153 } 105 154 ··· 107 156 pub fn profile_link(&self, ident: &AtIdentifier<'_>) -> SmolStr { 108 157 match self { 109 158 LinkMode::MainDomain => format_smolstr!("/{}", ident), 110 - LinkMode::Subdomain => format_smolstr!("/u/{}", ident), 159 + LinkMode::Subdomain | LinkMode::CustomDomain => format_smolstr!("/u/{}", ident), 111 160 } 112 161 } 113 162 ··· 115 164 pub fn standalone_entry_link(&self, ident: &AtIdentifier<'_>, rkey: &str) -> SmolStr { 116 165 match self { 117 166 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), 167 + // Standalone entries don't exist in hosted mode - link to main domain 168 + LinkMode::Subdomain | LinkMode::CustomDomain => { 169 + format_smolstr!("{}/{}/e/{}", WEAVER_APP_HOST, ident, rkey) 170 + } 120 171 } 121 172 } 122 173 ··· 125 176 match self { 126 177 LinkMode::MainDomain => format_smolstr!("/{}/e/{}/edit", ident, rkey), 127 178 // Edit on main domain 128 - LinkMode::Subdomain => format_smolstr!("{}/{}/e/{}/edit", WEAVER_APP_HOST, ident, rkey), 179 + LinkMode::Subdomain | LinkMode::CustomDomain => { 180 + format_smolstr!("{}/{}/e/{}/edit", WEAVER_APP_HOST, ident, rkey) 181 + } 129 182 } 130 183 } 131 184 ··· 135 188 (LinkMode::MainDomain, Some(nb)) => format_smolstr!("/{}/new?notebook={}", ident, nb), 136 189 (LinkMode::MainDomain, None) => format_smolstr!("/{}/new", ident), 137 190 // Drafts are on main domain 138 - (LinkMode::Subdomain, Some(nb)) => { 191 + (LinkMode::Subdomain | LinkMode::CustomDomain, Some(nb)) => { 139 192 format_smolstr!("{}/{}/new?notebook={}", WEAVER_APP_HOST, ident, nb) 140 193 } 141 - (LinkMode::Subdomain, None) => format_smolstr!("{}/{}/new", WEAVER_APP_HOST, ident), 194 + (LinkMode::Subdomain | LinkMode::CustomDomain, None) => { 195 + format_smolstr!("{}/{}/new", WEAVER_APP_HOST, ident) 196 + } 142 197 } 143 198 } 144 199 ··· 146 201 pub fn drafts_link(&self, ident: &AtIdentifier<'_>) -> SmolStr { 147 202 match self { 148 203 LinkMode::MainDomain => format_smolstr!("/{}/drafts", ident), 149 - LinkMode::Subdomain => format_smolstr!("{}/{}/drafts", WEAVER_APP_HOST, ident), 204 + LinkMode::Subdomain | LinkMode::CustomDomain => { 205 + format_smolstr!("{}/{}/drafts", WEAVER_APP_HOST, ident) 206 + } 150 207 } 151 208 } 152 209 ··· 154 211 pub fn invites_link(&self, ident: &AtIdentifier<'_>) -> SmolStr { 155 212 match self { 156 213 LinkMode::MainDomain => format_smolstr!("/{}/invites", ident), 157 - LinkMode::Subdomain => format_smolstr!("{}/{}/invites", WEAVER_APP_HOST, ident), 214 + LinkMode::Subdomain | LinkMode::CustomDomain => { 215 + format_smolstr!("{}/{}/invites", WEAVER_APP_HOST, ident) 216 + } 158 217 } 218 + } 219 + 220 + /// Generate link to a document by path (for custom domain publications). 221 + pub fn document_link(&self, path: &str) -> SmolStr { 222 + format_smolstr!("/{}", path.trim_start_matches('/')) 159 223 } 160 224 }
+36 -86
crates/weaver-app/src/lib.rs
··· 29 29 pub mod record_utils; 30 30 pub mod service_worker; 31 31 32 + pub mod custom_domain_app; 33 + #[cfg(feature = "server")] 34 + pub mod middleware; 32 35 pub mod subdomain_app; 33 36 pub mod views; 37 + #[cfg(feature = "server")] 38 + pub mod well_known; 34 39 35 - pub use host_mode::{LinkMode, SubdomainContext}; 36 - pub use subdomain_app::SubdomainApp; 37 - pub use subdomain_app::SubdomainRoute; 40 + pub use custom_domain_app::{CustomDomainApp, CustomDomainRoute}; 41 + pub use host_mode::{CustomDomainContext, HostContext, LinkMode, SubdomainContext}; 42 + pub use subdomain_app::{SubdomainApp, SubdomainRoute}; 38 43 39 44 use auth::{AuthState, AuthStore}; 40 45 use components::{EntryPage, Repository, RepositoryIndex}; ··· 47 52 RecordIndex, RecordPage, StandaloneEntry, StandaloneEntryEdit, StandaloneEntryNsid, TermsPage, 48 53 WhiteWindEntry, WhiteWindEntryNsid, 49 54 }; 50 - 51 - use crate::{ 52 - env::WEAVER_APP_DOMAIN, 53 - subdomain_app::{extract_subdomain, lookup_subdomain_context}, 54 - }; 55 - 56 - /// Reserved subdomains that should not be used for notebooks. 57 - const RESERVED_SUBDOMAINS: &[&str] = &[ 58 - "www", "api", "admin", "app", "auth", "cdn", "alpha", "beta", "staging", "index", 59 - ]; 60 55 61 56 #[derive(Debug, Clone, Routable, PartialEq)] 62 57 #[rustfmt::skip] ··· 150 145 )) 151 146 }); 152 147 148 + // Read host context from request extensions (set by middleware). 153 149 #[cfg(feature = "fullstack-server")] 154 - let ctx_resource = use_server_future({ 155 - let fetcher = fetcher.clone(); 156 - move || { 157 - let fetcher = fetcher.clone(); 158 - async move { 159 - use dioxus::fullstack::FullstackContext; 160 - use http::header::HOST; 161 - 162 - // Get host header from request 163 - let Some(ctx) = FullstackContext::current() else { 164 - tracing::warn!("No FullstackContext available"); 165 - return None; 166 - }; 167 - let parts = ctx.parts_mut(); 168 - 169 - let Some(host_header) = parts.headers.get(HOST) else { 170 - tracing::warn!("No Host header in request"); 171 - return None; 172 - }; 173 - let Ok(host) = host_header.to_str() else { 174 - tracing::warn!("Host header not valid UTF-8"); 175 - return None; 176 - }; 177 - 178 - let host_str = host.split(':').next().unwrap_or(host); 179 - let Some(subdomain) = extract_subdomain(host_str, WEAVER_APP_DOMAIN) else { 180 - tracing::info!( 181 - host_str, 182 - domain = WEAVER_APP_DOMAIN, 183 - "Not a subdomain request" 184 - ); 185 - return None; 186 - }; 187 - 188 - // Check if subdomain is reserved 189 - if RESERVED_SUBDOMAINS.contains(&subdomain.as_str()) { 190 - tracing::info!(subdomain, "Reserved subdomain, skipping notebook lookup"); 191 - return None; 192 - } 150 + let host_ctx = { 151 + use_server_cached(|| { 152 + use dioxus::fullstack::FullstackContext; 193 153 194 - // Look up notebook by global path 195 - let result = lookup_subdomain_context(&fetcher, &subdomain).await; 196 - if result.is_none() { 197 - tracing::warn!(subdomain, "Notebook lookup failed for subdomain"); 198 - } 199 - result 200 - } 201 - } 202 - })?; 203 - 204 - #[cfg(feature = "fullstack-server")] 205 - let ctx = match &*ctx_resource.read() { 206 - Some(ctx) => ctx.clone(), 207 - None => { 208 - return rsx! { div { "Loading..." } }; 209 - } 154 + let ctx = FullstackContext::current(); 155 + ctx.and_then(|c| { 156 + let parts = c.parts_mut(); 157 + parts.extensions.get::<HostContext>().cloned() 158 + }) 159 + .unwrap_or(HostContext::MainDomain) 160 + }) 210 161 }; 211 162 212 163 #[cfg(not(feature = "fullstack-server"))] 213 - let ctx = { None::<SubdomainContext> }; 164 + let host_ctx = HostContext::MainDomain; 214 165 215 166 let auth_state = use_signal(|| AuthState::default()); 216 167 #[allow(unused)] 217 168 let auth_state = use_context_provider(|| auth_state); 218 169 219 - // Provide link mode for router-agnostic link generation (subdomain mode) 220 - let sub = use_context_provider(|| { 221 - if ctx.is_some() { 222 - LinkMode::Subdomain 223 - } else { 224 - LinkMode::MainDomain 225 - } 226 - }); 170 + // Provide link mode for router-agnostic link generation. 171 + let _link_mode = use_context_provider(|| host_ctx.link_mode()); 227 172 228 173 #[cfg(all(target_family = "wasm", target_os = "unknown"))] 229 174 let restore_result = { ··· 251 196 252 197 use_context_provider(|| restore_result); 253 198 254 - if sub == LinkMode::Subdomain { 255 - tracing::info!("App: rendering SubdomainApp"); 256 - use_context_provider(|| ctx.unwrap()); 257 - rsx! { 258 - SubdomainApp {} 199 + // Dispatch to appropriate app based on host context. 200 + match host_ctx { 201 + HostContext::Subdomain(ctx) => { 202 + tracing::info!("App: rendering SubdomainApp"); 203 + use_context_provider(|| ctx); 204 + rsx! { SubdomainApp {} } 205 + } 206 + HostContext::CustomDomain(ctx) => { 207 + tracing::info!("App: rendering CustomDomainApp"); 208 + use_context_provider(|| ctx); 209 + rsx! { CustomDomainApp {} } 259 210 } 260 - } else { 261 - tracing::info!("App: rendering MainDomainApp"); 262 - rsx! { 263 - MainDomainApp {} 211 + HostContext::MainDomain => { 212 + tracing::info!("App: rendering MainDomainApp"); 213 + rsx! { MainDomainApp {} } 264 214 } 265 215 } 266 216 }
+12 -10
crates/weaver-app/src/main.rs
··· 15 15 static ALLOCATOR: LockedAllocator<FreeListAllocator> = 16 16 LockedAllocator::new(FreeListAllocator::new()); 17 17 18 - /// Base domain for subdomain extraction. 19 - #[cfg(feature = "server")] 20 - const BASE_DOMAIN: &str = weaver_app::env::WEAVER_APP_DOMAIN; 21 - 22 - /// Reserved subdomains that should not be used for notebooks. 23 - #[cfg(feature = "server")] 24 - const RESERVED_SUBDOMAINS: &[&str] = &[ 25 - "www", "api", "admin", "app", "auth", "cdn", "alpha", "beta", "staging", "index", 26 - ]; 27 - 28 18 fn main() { 29 19 // Set up better panic messages for wasm 30 20 #[cfg(target_arch = "wasm32")] ··· 98 88 axum::Router::new() 99 89 .route("/favicon.ico", get(weaver_app::favicon)) 100 90 .serve_dioxus_application(ServeConfig::builder(), App) 91 + // Host context resolution. 92 + .layer(middleware::from_fn({ 93 + let fetcher = fetcher.clone(); 94 + move |req: Request, next: Next| { 95 + let fetcher = fetcher.clone(); 96 + async move { 97 + weaver_app::middleware::host_context_middleware(req, next, fetcher) 98 + .await 99 + } 100 + } 101 + })) 102 + // Insert fetcher and blob cache into extensions. 101 103 .layer(middleware::from_fn({ 102 104 let blob_cache = blob_cache.clone(); 103 105 let fetcher = fetcher.clone();
+182
crates/weaver-app/src/middleware.rs
··· 1 + //! Axum middleware for host-based routing. 2 + 3 + use std::sync::Arc; 4 + 5 + use axum::{ 6 + extract::Request, 7 + http::header::HOST, 8 + middleware::Next, 9 + response::{IntoResponse, Redirect, Response}, 10 + }; 11 + use jacquard::IntoStatic; 12 + use jacquard::client::AgentSessionExt; 13 + use jacquard::smol_str::SmolStr; 14 + use jacquard::smol_str::ToSmolStr; 15 + 16 + use crate::{ 17 + env::WEAVER_APP_DOMAIN, 18 + fetch::Fetcher, 19 + host_mode::{CustomDomainContext, HostContext, SubdomainContext}, 20 + subdomain_app::{extract_subdomain, lookup_subdomain_context}, 21 + }; 22 + 23 + /// Reserved subdomains that should not be used for notebooks. 24 + const RESERVED_SUBDOMAINS: &[&str] = &[ 25 + "www", "api", "admin", "app", "auth", "cdn", "alpha", "beta", "staging", "index", 26 + ]; 27 + 28 + /// Prefix for encoded publication hostnames (nb-{encoded}.weaver.sh). 29 + const ENCODED_PUBLICATION_PREFIX: &str = "nb-"; 30 + 31 + /// Middleware that resolves host context and inserts it into request extensions. 32 + /// 33 + /// This handles: 34 + /// - Encoded publication hostnames (nb-xxx.pub.weaver.sh) → redirect to real domain 35 + /// - Subdomain routing (notebook.weaver.sh) → SubdomainContext 36 + /// - Custom domain routing (myblog.com) → CustomDomainContext 37 + /// - Main domain (weaver.sh) → MainDomain 38 + pub async fn host_context_middleware( 39 + mut req: Request, 40 + next: Next, 41 + fetcher: Arc<Fetcher>, 42 + ) -> Response { 43 + // Extract everything we need from the request BEFORE any async calls. 44 + // The body type isn't Sync, so we can't hold &req across await points. 45 + let host = extract_host(&req); 46 + let path = req.uri().path().to_string(); 47 + let query = req 48 + .uri() 49 + .query() 50 + .map(|q| format!("?{}", q)) 51 + .unwrap_or_default(); 52 + 53 + let Some(host) = host else { 54 + tracing::warn!("No Host header in request"); 55 + req.extensions_mut().insert(HostContext::MainDomain); 56 + return next.run(req).await; 57 + }; 58 + 59 + // Strip port if present. 60 + let host_str = host.split(':').next().unwrap_or(&host).to_string(); 61 + 62 + // Check if this is a weaver domain subdomain. 63 + if let Some(subdomain) = extract_subdomain(&host_str, WEAVER_APP_DOMAIN) { 64 + // Check for encoded publication hostname (nb-xxx.pub.weaver.sh). 65 + if let Some(redirect_url) = 66 + handle_encoded_publication(&subdomain, &path, &query, fetcher.clone()).await 67 + { 68 + return Redirect::permanent(&redirect_url).into_response(); 69 + } 70 + 71 + // Check for reserved subdomains. 72 + if RESERVED_SUBDOMAINS.contains(&subdomain.as_str()) { 73 + tracing::debug!(subdomain, "Reserved subdomain, using main domain"); 74 + req.extensions_mut().insert(HostContext::MainDomain); 75 + return next.run(req).await; 76 + } 77 + 78 + // Try to look up notebook for this subdomain. 79 + if let Some(ctx) = lookup_subdomain_context(&fetcher, &subdomain).await { 80 + tracing::debug!(subdomain, "Resolved subdomain context"); 81 + req.extensions_mut().insert(HostContext::Subdomain(ctx)); 82 + return next.run(req).await; 83 + } 84 + 85 + // Subdomain not found, fall through to main domain. 86 + tracing::warn!(subdomain, "Subdomain not found, using main domain"); 87 + req.extensions_mut().insert(HostContext::MainDomain); 88 + return next.run(req).await; 89 + } 90 + 91 + // Not a weaver subdomain - check for custom domain. 92 + if let Some(ctx) = lookup_custom_domain(fetcher.clone(), &host_str).await { 93 + tracing::debug!(domain = host_str, "Resolved custom domain context"); 94 + req.extensions_mut().insert(HostContext::CustomDomain(ctx)); 95 + return next.run(req).await; 96 + } 97 + 98 + // Unknown domain, use main domain routing. 99 + tracing::debug!(host = host_str, "Unknown host, using main domain"); 100 + req.extensions_mut().insert(HostContext::MainDomain); 101 + next.run(req).await 102 + } 103 + 104 + /// Extract the Host header from the request. 105 + fn extract_host(req: &Request) -> Option<String> { 106 + req.headers() 107 + .get(HOST)? 108 + .to_str() 109 + .ok() 110 + .map(|s| s.to_string()) 111 + } 112 + 113 + /// Handle encoded publication hostname (nb-{encoded}.weaver.sh). 114 + /// 115 + /// Returns Some(redirect_url) if this is an encoded hostname that should redirect. 116 + async fn handle_encoded_publication( 117 + subdomain: &str, 118 + path: &str, 119 + query: &str, 120 + fetcher: Arc<Fetcher>, 121 + ) -> Option<String> { 122 + // Check if subdomain matches pattern: nb-{encoded} 123 + if !subdomain.starts_with(ENCODED_PUBLICATION_PREFIX) { 124 + return None; 125 + } 126 + 127 + // Decode the publication subdomain. 128 + let Some((did, rkey)) = weaver_common::domain_encoding::decode_publication_subdomain(subdomain) 129 + else { 130 + tracing::warn!(subdomain, "Failed to decode publication subdomain"); 131 + return None; 132 + }; 133 + 134 + // Look up the publication to get the real domain. 135 + let domain = lookup_publication_domain(fetcher, did.as_str(), rkey.as_str()).await?; 136 + 137 + Some(format!("https://{}{}{}", domain, path, query)) 138 + } 139 + 140 + /// Look up publication domain by DID and rkey. 141 + async fn lookup_publication_domain(fetcher: Arc<Fetcher>, did: &str, rkey: &str) -> Option<String> { 142 + use jacquard::types::string::Uri; 143 + use weaver_api::site_standard::publication::Publication; 144 + 145 + let uri_str = format!("at://{}/site.standard.publication/{}", did, rkey); 146 + let uri = Publication::uri(&uri_str).ok()?; 147 + 148 + let record = fetcher.fetch_record(&uri).await.ok()?; 149 + 150 + // Extract domain from the already-parsed publication URL. 151 + match &record.value.url { 152 + Uri::Https(url) | Uri::Wss(url) => url.host_str().map(|h| h.to_string()), 153 + _ => None, 154 + } 155 + } 156 + 157 + /// Look up custom domain context. 158 + async fn lookup_custom_domain(fetcher: Arc<Fetcher>, domain: &str) -> Option<CustomDomainContext> { 159 + use jacquard::prelude::XrpcClient; 160 + use weaver_api::sh_weaver::domain::resolve_by_domain::ResolveByDomain; 161 + 162 + let output = fetcher 163 + .send(ResolveByDomain::new().domain(domain).build()) 164 + .await 165 + .ok()? 166 + .into_output() 167 + .ok()?; 168 + 169 + let pub_view = output.publication; 170 + 171 + Some(CustomDomainContext { 172 + domain: SmolStr::new(domain), 173 + owner: jacquard::types::string::AtIdentifier::Did( 174 + jacquard::types::string::Did::new(&pub_view.did) 175 + .ok()? 176 + .into_static(), 177 + ), 178 + publication_rkey: pub_view.rkey.to_smolstr(), 179 + publication_name: pub_view.name.to_smolstr(), 180 + notebook_uri: pub_view.notebook_uri.map(|u| u.to_smolstr()), 181 + }) 182 + }
+3
crates/weaver-app/src/subdomain_app.rs
··· 100 100 /// Root component for subdomain app. 101 101 #[component] 102 102 pub fn SubdomainApp() -> Element { 103 + tracing::info!("SubdomainApp: rendering root"); 103 104 rsx! { 104 105 document::Link { rel: "icon", href: crate::FAVICON } 105 106 document::Link { rel: "preconnect", href: "https://fonts.googleapis.com" } ··· 118 119 /// Landing page - check for custom "/" entry, else show notebook index. 119 120 #[component] 120 121 fn SubdomainLanding() -> Element { 122 + tracing::info!("SubdomainLanding: start"); 121 123 let ctx = use_context::<SubdomainContext>(); 124 + tracing::info!("SubdomainLanding: got context, rendering"); 122 125 123 126 // TODO: Check for entry with custom path "/" for this notebook. 124 127 // For now, just render the notebook index.
+6 -3
crates/weaver-app/src/views/notebook.rs
··· 69 69 ident: ReadSignal<AtIdentifier<'static>>, 70 70 book_title: ReadSignal<SmolStr>, 71 71 ) -> Element { 72 - tracing::debug!( 73 - "NotebookIndex component rendering for ident: {:?}, book: {}", 72 + tracing::info!( 73 + "NotebookIndex: start, ident={:?}, book={}", 74 74 ident(), 75 75 book_title() 76 76 ); 77 77 // Fetch full notebook metadata with SSR support 78 78 // IMPORTANT: Call ALL hooks before any ? early returns to maintain hook order 79 79 let (notebook_result, notebook_data) = data::use_notebook(ident, book_title); 80 + tracing::info!("NotebookIndex: use_notebook returned"); 80 81 let (entries_result, entries_resource) = data::use_notebook_entries(ident, book_title); 81 - tracing::debug!("NotebookIndex got notebook data and entries"); 82 + tracing::info!("NotebookIndex: use_notebook_entries returned"); 82 83 83 84 #[cfg(feature = "fullstack-server")] 84 85 notebook_result?; 86 + tracing::info!("NotebookIndex: past notebook_result?"); 85 87 86 88 #[cfg(feature = "fullstack-server")] 87 89 entries_result?; 90 + tracing::info!("NotebookIndex: past entries_result?"); 88 91 89 92 // Check ownership for "Add Entry" button 90 93 let auth_state = use_context::<Signal<AuthState>>();
+5
crates/weaver-app/src/views/subdomain_navbar.rs
··· 26 26 27 27 #[component] 28 28 pub fn SubdomainNavbar() -> Element { 29 + tracing::info!("SubdomainNavbar: start"); 29 30 let ctx = use_context::<SubdomainContext>(); 30 31 let route = use_route::<SubdomainRoute>(); 31 32 let auth_state = use_context::<Signal<AuthState>>(); 33 + tracing::info!("SubdomainNavbar: got context"); 32 34 33 35 #[allow(unused)] 34 36 let fetcher = use_context::<Fetcher>(); ··· 180 182 181 183 #[component] 182 184 fn AuthorProfileLink(ident: ReadSignal<AtIdentifier<'static>>) -> Element { 185 + tracing::info!("AuthorProfileLink: start, ident={:?}", ident()); 183 186 let (handle_res, handle) = use_handle(ident); 187 + tracing::info!("AuthorProfileLink: use_handle returned"); 184 188 185 189 #[cfg(feature = "fullstack-server")] 186 190 handle_res?; 191 + tracing::info!("AuthorProfileLink: past handle_res check"); 187 192 188 193 rsx! { 189 194 Link {
+37
crates/weaver-app/src/well_known.rs
··· 1 + //! Well-known endpoints for site.standard compatibility. 2 + 3 + use crate::host_mode::CustomDomainContext; 4 + use axum::{Json, http::StatusCode}; 5 + use jacquard::smol_str::{SmolStr, format_smolstr}; 6 + use serde::Serialize; 7 + 8 + /// Well-known publication response per site.standard spec. 9 + #[derive(Debug, Clone, Serialize)] 10 + #[serde(rename_all = "camelCase")] 11 + pub struct WellKnownPublication { 12 + pub publication_uri: SmolStr, 13 + pub name: SmolStr, 14 + pub url: SmolStr, 15 + } 16 + 17 + /// Handle /.well-known/site.standard.publication 18 + /// 19 + /// Returns publication info for the current custom domain. 20 + /// This handler expects CustomDomainContext to be set by middleware. 21 + pub async fn well_known_publication( 22 + ctx: Option<axum::Extension<CustomDomainContext>>, 23 + ) -> Result<Json<WellKnownPublication>, StatusCode> { 24 + let ctx = ctx.ok_or(StatusCode::NOT_FOUND)?; 25 + 26 + let publication_uri = format_smolstr!( 27 + "at://{}/site.standard.publication/{}", 28 + ctx.owner, 29 + ctx.publication_rkey 30 + ); 31 + 32 + Ok(Json(WellKnownPublication { 33 + publication_uri, 34 + name: ctx.publication_name.clone(), 35 + url: format_smolstr!("https://{}", ctx.domain), 36 + })) 37 + }
+112
crates/weaver-common/src/domain_encoding.rs
··· 1 + //! DNS-safe encoding for publication AT-URIs. 2 + //! 3 + //! Custom domains use self-describing CNAME records pointing to 4 + //! `nb-{encoded-did}-{rkey}.weaver.sh`. This module handles 5 + //! encoding and decoding the subdomain portion. 6 + 7 + use jacquard::IntoStatic; 8 + use jacquard::types::string::{Did, Tid}; 9 + 10 + const PREFIX: &str = "nb-"; 11 + 12 + /// Encode a Publication AT-URI into a DNS-safe subdomain. 13 + /// 14 + /// Encoding rules: 15 + /// - DID `:` separators become `-` 16 + /// - `did:web` dots become `_` (underscores are invalid in domain names, so unambiguous) 17 + /// - rkey is appended as last segment (TIDs never contain hyphens) 18 + /// 19 + /// Examples: 20 + /// - `did:plc:z72i7hdynmk6r22` + `3jui7kd2y2e2b` → `nb-plc-z72i7hdynmk6r22-3jui7kd2y2e2b` 21 + /// - `did:web:example.com` + `3jui7kd2y2e2b` → `nb-web-example_com-3jui7kd2y2e2b` 22 + pub fn encode_publication_subdomain(did: &Did, rkey: &Tid) -> String { 23 + let did_str = did.as_str(); 24 + 25 + // did:plc:abc123 -> plc-abc123 26 + // did:web:example.com -> web-example_com 27 + let encoded_did = did_str 28 + .strip_prefix("did:") 29 + .expect("valid DID") 30 + .replace(':', "-") 31 + .replace('.', "_"); 32 + 33 + format!("{}{}-{}", PREFIX, encoded_did, rkey.as_str()) 34 + } 35 + 36 + /// Decode a publication subdomain back to DID and rkey. 37 + /// 38 + /// Parsing strategy: work from both ends since rkeys (TIDs) never contain hyphens. 39 + pub fn decode_publication_subdomain(subdomain: &str) -> Option<(Did<'static>, Tid)> { 40 + let inner = subdomain.strip_prefix(PREFIX)?; 41 + 42 + // Split at the LAST hyphen - rkey is on the right (TIDs have no hyphens) 43 + let (did_part, rkey_str) = inner.rsplit_once('-')?; 44 + 45 + // Parse rkey as TID 46 + let rkey = Tid::from(rkey_str.to_owned()); 47 + 48 + // Reconstruct DID from encoded form 49 + // plc-abc123 -> did:plc:abc123 50 + // web-example_com -> did:web:example.com 51 + let (method, identifier) = did_part.split_once('-')?; 52 + let decoded_identifier = identifier.replace('_', "."); 53 + let did_str = format!("did:{}:{}", method, decoded_identifier); 54 + let did = Did::new(&did_str).ok()?; 55 + 56 + Some((did.into_static(), rkey)) 57 + } 58 + 59 + #[cfg(test)] 60 + mod tests { 61 + use super::*; 62 + use jacquard::IntoStatic; 63 + 64 + #[test] 65 + fn roundtrip_did_plc() { 66 + let did = Did::new("did:plc:z72i7hdynmk6r22").unwrap(); 67 + let rkey = Tid::from("3jui7kd2y2e2b".to_owned()); 68 + 69 + let encoded = encode_publication_subdomain(&did, &rkey); 70 + assert_eq!(encoded, "nb-plc-z72i7hdynmk6r22-3jui7kd2y2e2b"); 71 + 72 + let (decoded_did, decoded_rkey) = decode_publication_subdomain(&encoded).unwrap(); 73 + assert_eq!(decoded_did, did.into_static()); 74 + assert_eq!(decoded_rkey, rkey); 75 + } 76 + 77 + #[test] 78 + fn roundtrip_did_web() { 79 + let did = Did::new("did:web:example.com").unwrap(); 80 + let rkey = Tid::from("3jui7kd2y2e2b".to_owned()); 81 + 82 + let encoded = encode_publication_subdomain(&did, &rkey); 83 + assert_eq!(encoded, "nb-web-example_com-3jui7kd2y2e2b"); 84 + 85 + let (decoded_did, decoded_rkey) = decode_publication_subdomain(&encoded).unwrap(); 86 + assert_eq!(decoded_did, did.into_static()); 87 + assert_eq!(decoded_rkey, rkey); 88 + } 89 + 90 + #[test] 91 + fn roundtrip_did_web_with_hyphens() { 92 + let did = Did::new("did:web:my-cool-site.example.com").unwrap(); 93 + let rkey = Tid::from("3jui7kd2y2e2b".to_owned()); 94 + 95 + let encoded = encode_publication_subdomain(&did, &rkey); 96 + assert_eq!(encoded, "nb-web-my-cool-site_example_com-3jui7kd2y2e2b"); 97 + 98 + let (decoded_did, decoded_rkey) = decode_publication_subdomain(&encoded).unwrap(); 99 + assert_eq!(decoded_did, did.into_static()); 100 + assert_eq!(decoded_rkey, rkey); 101 + } 102 + 103 + #[test] 104 + fn decode_invalid_prefix() { 105 + assert!(decode_publication_subdomain("foo-plc-abc123-rkey").is_none()); 106 + } 107 + 108 + #[test] 109 + fn decode_missing_method() { 110 + assert!(decode_publication_subdomain("nb-abc123").is_none()); 111 + } 112 + }
+2
crates/weaver-common/src/lib.rs
··· 4 4 #[cfg(feature = "cache")] 5 5 pub mod cache; 6 6 pub mod constellation; 7 + pub mod domain_encoding; 7 8 pub mod error; 8 9 #[cfg(feature = "perf")] 9 10 pub mod perf; ··· 15 16 16 17 // Re-export jacquard for convenience 17 18 pub use agent::{SessionPeer, WeaverExt}; 19 + pub use domain_encoding::{decode_publication_subdomain, encode_publication_subdomain}; 18 20 pub use error::WeaverError; 19 21 20 22 // Re-export blake3 for topic hashing
+45
crates/weaver-index/migrations/clickhouse/041_publications.sql
··· 1 + -- site.standard.publication records 2 + -- Source of truth for custom domain claims 3 + 4 + CREATE TABLE IF NOT EXISTS publications ( 5 + -- Identity 6 + did String, 7 + rkey String, 8 + cid String, 9 + 10 + -- Materialized URI for convenience 11 + uri String MATERIALIZED concat('at://', did, '/site.standard.publication/', rkey), 12 + 13 + -- Queryable fields from record 14 + name String DEFAULT '', 15 + description String DEFAULT '', 16 + url String DEFAULT '', -- Canonical URL (e.g., https://myblog.com) 17 + 18 + -- Extracted domain from url for fast lookup 19 + domain String DEFAULT '', -- e.g., myblog.com 20 + 21 + -- Weaver-specific: notebook AT-URI if this publication is backed by a notebook 22 + notebook_uri String DEFAULT '', 23 + 24 + -- Encoded CNAME target for reverse lookup 25 + cname_target String MATERIALIZED concat('nb-', 26 + replaceAll(replaceAll(substring(did, 5), ':', '-'), '.', '_'), 27 + '-', rkey, '.pub.weaver.sh'), 28 + 29 + -- Timestamps 30 + created_at DateTime64(3) DEFAULT toDateTime64(0, 3), 31 + event_time DateTime64(3), 32 + indexed_at DateTime64(3) DEFAULT now64(3), 33 + 34 + -- Soft delete 35 + deleted_at DateTime64(3) DEFAULT toDateTime64(0, 3), 36 + record JSON DEFAULT '{}' 37 + ) 38 + ENGINE = ReplacingMergeTree(indexed_at) 39 + ORDER BY (did, rkey); 40 + 41 + -- Index for domain lookup 42 + ALTER TABLE publications ADD INDEX idx_domain domain TYPE bloom_filter GRANULARITY 4; 43 + 44 + -- Index for CNAME target lookup 45 + ALTER TABLE publications ADD INDEX idx_cname_target cname_target TYPE bloom_filter GRANULARITY 4;
+34
crates/weaver-index/migrations/clickhouse/042_publications_mv.sql
··· 1 + -- Materialized view to populate publications from raw_records 2 + 3 + CREATE MATERIALIZED VIEW IF NOT EXISTS publications_mv TO publications AS 4 + SELECT 5 + did, 6 + rkey, 7 + cid, 8 + 9 + -- Extract fields from record 10 + coalesce(record.name, '') AS name, 11 + coalesce(record.description, '') AS description, 12 + coalesce(record.url, '') AS url, 13 + 14 + -- Extract domain from URL (strip protocol and path) 15 + -- https://myblog.com/path -> myblog.com 16 + replaceRegexpOne( 17 + replaceRegexpOne( 18 + replaceRegexpOne(toString(record.url), '^https://', ''), 19 + '^http://', '' 20 + ), 21 + '/.*$', '' 22 + ) AS domain, 23 + 24 + -- Extract notebookUri from record (weaver-specific) 25 + coalesce(record.notebookUri, '') AS notebook_uri, 26 + 27 + event_time, 28 + indexed_at, 29 + 30 + -- Soft delete: if operation is delete, set deleted_at 31 + if(operation = 'delete', event_time, toDateTime64(0, 3)) as deleted_at, 32 + record 33 + FROM raw_records 34 + WHERE collection = 'site.standard.publication'
+44
crates/weaver-index/migrations/clickhouse/043_documents.sql
··· 1 + -- site.standard.document records 2 + -- Documents within a publication, with custom path routing support 3 + 4 + CREATE TABLE IF NOT EXISTS documents ( 5 + -- Identity 6 + did String, 7 + rkey String, 8 + cid String, 9 + 10 + -- Materialized URI 11 + uri String MATERIALIZED concat('at://', did, '/site.standard.document/', rkey), 12 + 13 + -- Parent publication reference 14 + publication_uri String DEFAULT '', -- at://did/site.standard.publication/rkey 15 + publication_did String DEFAULT '', 16 + publication_rkey String DEFAULT '', 17 + 18 + -- Queryable fields 19 + title String DEFAULT '', 20 + description String DEFAULT '', 21 + path String DEFAULT '', -- Custom URL path (e.g., /posts/my-first-post) 22 + 23 + -- Weaver-specific: entry reference if content contains BookEntryView 24 + entry_uri String DEFAULT '', -- AT-URI of the backing sh.weaver.notebook.entry 25 + entry_index Int64 DEFAULT -1, -- Index within the notebook (-1 if not weaver content) 26 + 27 + -- Normalized path for lookup (lowercase, no trailing slash) 28 + path_normalized String MATERIALIZED lower(trimRight(path, '/')), 29 + 30 + -- Timestamps 31 + published_at DateTime64(3) DEFAULT toDateTime64(0, 3), 32 + updated_at DateTime64(3) DEFAULT toDateTime64(0, 3), 33 + event_time DateTime64(3), 34 + indexed_at DateTime64(3) DEFAULT now64(3), 35 + 36 + -- Soft delete 37 + deleted_at DateTime64(3) DEFAULT toDateTime64(0, 3), 38 + record JSON DEFAULT '{}' 39 + ) 40 + ENGINE = ReplacingMergeTree(indexed_at) 41 + ORDER BY (publication_did, publication_rkey, path_normalized, rkey); 42 + 43 + -- Index for path lookup within a publication 44 + ALTER TABLE documents ADD INDEX idx_path path_normalized TYPE bloom_filter GRANULARITY 4;
+53
crates/weaver-index/migrations/clickhouse/044_documents_mv.sql
··· 1 + -- Materialized view to populate documents from raw_records 2 + 3 + CREATE MATERIALIZED VIEW IF NOT EXISTS documents_mv TO documents AS 4 + SELECT 5 + did, 6 + rkey, 7 + cid, 8 + 9 + -- Extract site reference (renamed from publication in lexicon) 10 + coalesce(record.site, '') AS publication_uri, 11 + 12 + -- Parse publication DID from at://did/collection/rkey (only if it's an AT-URI) 13 + if( 14 + startsWith(toString(record.site), 'at://'), 15 + extractAll(toString(record.site), 'at://([^/]+)/')[1], 16 + '' 17 + ) AS publication_did, 18 + 19 + -- Parse publication rkey 20 + if( 21 + startsWith(toString(record.site), 'at://'), 22 + extractAll(toString(record.site), '/([^/]+)$')[1], 23 + '' 24 + ) AS publication_rkey, 25 + 26 + -- Extract fields from record 27 + coalesce(record.title, '') AS title, 28 + coalesce(record.description, '') AS description, 29 + coalesce(record.path, '') AS path, 30 + 31 + -- Extract weaver entry info from content if it's a BookEntryView 32 + if( 33 + toString(record.content.`$type`) = 'sh.weaver.notebook.defs#bookEntryView', 34 + coalesce(record.content.entry.uri, ''), 35 + '' 36 + ) AS entry_uri, 37 + if( 38 + toString(record.content.`$type`) = 'sh.weaver.notebook.defs#bookEntryView', 39 + toInt64OrZero(toString(record.content.`index`)), 40 + -1 41 + ) AS entry_index, 42 + 43 + -- Timestamps 44 + parseDateTime64BestEffortOrZero(toString(record.publishedAt), 3) AS published_at, 45 + parseDateTime64BestEffortOrZero(toString(record.updatedAt), 3) AS updated_at, 46 + event_time, 47 + indexed_at, 48 + 49 + -- Soft delete 50 + if(operation = 'delete', event_time, toDateTime64(0, 3)) as deleted_at, 51 + record 52 + FROM raw_records 53 + WHERE collection = 'site.standard.document'
+38
crates/weaver-index/migrations/clickhouse/045_custom_domains.sql
··· 1 + -- Denormalized view for fast custom domain to publication lookup 2 + -- This is the main lookup table for routing custom domain requests 3 + 4 + CREATE TABLE IF NOT EXISTS custom_domains ( 5 + -- Domain being claimed 6 + domain String, 7 + 8 + -- Publication details 9 + publication_did String, 10 + publication_rkey String, 11 + publication_name String, 12 + publication_url String, 13 + cname_target String, 14 + 15 + -- For conflict resolution: first claim wins 16 + created_at DateTime64(3), 17 + indexed_at DateTime64(3) DEFAULT now64(3), 18 + 19 + -- Soft delete when publication is deleted or URL changes 20 + deleted_at DateTime64(3) DEFAULT toDateTime64(0, 3) 21 + ) 22 + ENGINE = ReplacingMergeTree(indexed_at) 23 + ORDER BY (domain); 24 + 25 + -- MV to populate from publications 26 + CREATE MATERIALIZED VIEW IF NOT EXISTS custom_domains_mv TO custom_domains AS 27 + SELECT 28 + domain, 29 + did AS publication_did, 30 + rkey AS publication_rkey, 31 + name AS publication_name, 32 + url AS publication_url, 33 + cname_target, 34 + event_time AS created_at, 35 + indexed_at, 36 + deleted_at 37 + FROM publications 38 + WHERE domain != '' AND deleted_at = toDateTime64(0, 3);
+3 -2
crates/weaver-index/src/clickhouse.rs
··· 7 7 pub use client::{Client, TableSize}; 8 8 pub use migrations::{DbObject, MigrationResult, Migrator, ObjectType}; 9 9 pub use queries::{ 10 - CollaboratorRow, EditChainNode, EditHeadRow, EditNodeRow, EntryRow, HandleMappingRow, 11 - NotebookRow, ProfileCountsRow, ProfileRow, ProfileWithCounts, StaleDraftRow, 10 + CollaboratorRow, CustomDomainRow, DocumentRow, EditChainNode, EditHeadRow, EditNodeRow, 11 + EntryRow, HandleMappingRow, NotebookRow, ProfileCountsRow, ProfileRow, ProfileWithCounts, 12 + PublicationRow, StaleDraftRow, 12 13 }; 13 14 pub use resilient_inserter::{InserterConfig, ResilientRecordInserter}; 14 15 pub use schema::{
+2
crates/weaver-index/src/clickhouse/queries.rs
··· 9 9 mod identity; 10 10 mod notebooks; 11 11 mod profiles; 12 + mod publications; 12 13 13 14 pub use collab::PermissionRow; 14 15 pub use collab_state::{CollaboratorRow, EditHeadRow}; ··· 16 17 pub use identity::HandleMappingRow; 17 18 pub use notebooks::{EntryRow, NotebookRow}; 18 19 pub use profiles::{ProfileCountsRow, ProfileRow, ProfileWithCounts}; 20 + pub use publications::{CustomDomainRow, DocumentRow, PublicationRow};
+65 -66
crates/weaver-index/src/clickhouse/queries/notebooks.rs
··· 138 138 /// List entries for a specific notebook, ordered by position in the notebook. 139 139 /// 140 140 /// Uses notebook_entries table to get entries that belong to this notebook. 141 - /// Deduplicates entries by rkey, keeping the most recently updated version. 141 + /// Query is structured to avoid expensive double-FINAL joins by: 142 + /// 1. First filtering notebook_entries in a subquery with argMax for dedup 143 + /// 2. Then joining only those specific entries 142 144 pub async fn list_notebook_entries( 143 145 &self, 144 146 notebook_did: &str, ··· 146 148 limit: u32, 147 149 cursor: Option<u32>, 148 150 ) -> Result<Vec<EntryRow>, IndexError> { 149 - use std::collections::HashMap; 150 - 151 + // Two-phase query to avoid memory-expensive FINAL on large tables: 152 + // 1. Get entry refs from notebook_entries using argMax dedup (no FINAL) 153 + // 2. Join only those specific entries (targeted lookup, not full table FINAL) 151 154 let query = r#" 155 + WITH entry_refs AS ( 156 + SELECT 157 + entry_did, 158 + entry_rkey, 159 + argMax(position, indexed_at) AS position 160 + FROM notebook_entries 161 + WHERE notebook_did = ? 162 + AND notebook_rkey = ? 163 + GROUP BY entry_did, entry_rkey 164 + HAVING position > ? 165 + ORDER BY position ASC 166 + LIMIT ? 167 + ) 152 168 SELECT 153 169 e.did AS did, 154 170 e.rkey AS rkey, 155 - e.cid AS cid, 156 - e.uri AS uri, 157 - e.title AS title, 158 - e.path AS path, 159 - e.tags AS tags, 160 - e.author_dids AS author_dids, 161 - e.created_at AS created_at, 162 - e.updated_at AS updated_at, 163 - e.indexed_at AS indexed_at, 164 - e.record AS record 165 - FROM notebook_entries ne FINAL 166 - INNER JOIN entries e FINAL ON 167 - e.did = ne.entry_did 168 - AND e.rkey = ne.entry_rkey 169 - AND e.deleted_at = toDateTime64(0, 3) 170 - WHERE ne.notebook_did = ? 171 - AND ne.notebook_rkey = ? 172 - AND ne.position > ? 173 - ORDER BY ne.position ASC 174 - LIMIT ? 171 + argMax(e.cid, e.indexed_at) AS cid, 172 + argMax(e.uri, e.indexed_at) AS uri, 173 + argMax(e.title, e.indexed_at) AS title, 174 + argMax(e.path, e.indexed_at) AS path, 175 + argMax(e.tags, e.indexed_at) AS tags, 176 + argMax(e.author_dids, e.indexed_at) AS author_dids, 177 + argMax(e.created_at, e.indexed_at) AS created_at, 178 + argMax(e.updated_at, e.indexed_at) AS updated_at, 179 + max(e.indexed_at) AS indexed_at, 180 + argMax(e.record, e.indexed_at) AS record 181 + FROM entries e 182 + INNER JOIN entry_refs er ON e.did = er.entry_did AND e.rkey = er.entry_rkey 183 + WHERE e.deleted_at = toDateTime64(0, 3) 184 + GROUP BY e.did, e.rkey 185 + ORDER BY any(er.position) ASC 175 186 "#; 176 187 177 188 let cursor_val = cursor.unwrap_or(0); ··· 182 193 .bind(notebook_did) 183 194 .bind(notebook_rkey) 184 195 .bind(cursor_val) 185 - // Fetch extra to account for duplicates we'll filter out 186 - .bind(limit * 2) 196 + .bind(limit) 187 197 .fetch_all::<EntryRow>() 188 198 .await 189 199 .map_err(|e| ClickHouseError::Query { ··· 191 201 source: e, 192 202 })?; 193 203 194 - // Dedupe by rkey, keeping the most recently updated version 195 - let mut seen: HashMap<SmolStr, usize> = HashMap::new(); 196 - let mut deduped: Vec<EntryRow> = Vec::with_capacity(rows.len()); 197 - 198 - for row in rows { 199 - if let Some(&existing_idx) = seen.get(&row.rkey) { 200 - // Keep the one with the more recent updated_at 201 - if row.updated_at > deduped[existing_idx].updated_at { 202 - deduped[existing_idx] = row; 203 - } 204 - } else { 205 - seen.insert(row.rkey.clone(), deduped.len()); 206 - deduped.push(row); 207 - } 208 - 209 - // Stop once we have enough unique entries 210 - if deduped.len() >= limit as usize { 211 - break; 212 - } 213 - } 214 - 215 - Ok(deduped) 204 + Ok(rows) 216 205 } 217 206 218 207 /// Get an entry by rkey, picking the most recent version across collaborators. ··· 716 705 let offset = if index > 0 { index - 1 } else { 0 }; 717 706 let fetch_count = if index > 0 { 3u32 } else { 2u32 }; 718 707 708 + // Same pattern as list_notebook_entries - avoid double FINAL by using 709 + // argMax aggregation for dedup instead 719 710 let query = r#" 711 + WITH entry_refs AS ( 712 + SELECT 713 + entry_did, 714 + entry_rkey, 715 + argMax(position, indexed_at) AS position 716 + FROM notebook_entries 717 + WHERE notebook_did = ? 718 + AND notebook_rkey = ? 719 + GROUP BY entry_did, entry_rkey 720 + ORDER BY position ASC 721 + LIMIT ? OFFSET ? 722 + ) 720 723 SELECT 721 724 e.did AS did, 722 725 e.rkey AS rkey, 723 - e.cid AS cid, 724 - e.uri AS uri, 725 - e.title AS title, 726 - e.path AS path, 727 - e.tags AS tags, 728 - e.author_dids AS author_dids, 729 - e.created_at AS created_at, 730 - e.updated_at AS updated_at, 731 - e.indexed_at AS indexed_at, 732 - e.record AS record 733 - FROM notebook_entries ne FINAL 734 - INNER JOIN entries e FINAL ON 735 - e.did = ne.entry_did 736 - AND e.rkey = ne.entry_rkey 737 - AND e.deleted_at = toDateTime64(0, 3) 738 - WHERE ne.notebook_did = ? 739 - AND ne.notebook_rkey = ? 740 - ORDER BY ne.position ASC 741 - LIMIT ? OFFSET ? 726 + argMax(e.cid, e.indexed_at) AS cid, 727 + argMax(e.uri, e.indexed_at) AS uri, 728 + argMax(e.title, e.indexed_at) AS title, 729 + argMax(e.path, e.indexed_at) AS path, 730 + argMax(e.tags, e.indexed_at) AS tags, 731 + argMax(e.author_dids, e.indexed_at) AS author_dids, 732 + argMax(e.created_at, e.indexed_at) AS created_at, 733 + argMax(e.updated_at, e.indexed_at) AS updated_at, 734 + max(e.indexed_at) AS indexed_at, 735 + argMax(e.record, e.indexed_at) AS record 736 + FROM entries e 737 + INNER JOIN entry_refs er ON e.did = er.entry_did AND e.rkey = er.entry_rkey 738 + WHERE e.deleted_at = toDateTime64(0, 3) 739 + GROUP BY e.did, e.rkey 740 + ORDER BY any(er.position) ASC 742 741 "#; 743 742 744 743 let rows: Vec<EntryRow> = self
+223
crates/weaver-index/src/clickhouse/queries/publications.rs
··· 1 + //! Publication and document queries for site.standard.* types 2 + 3 + use clickhouse::Row; 4 + use serde::Deserialize; 5 + use smol_str::SmolStr; 6 + 7 + use crate::clickhouse::Client; 8 + use crate::error::{ClickHouseError, IndexError}; 9 + 10 + /// Publication row from the publications table. 11 + #[derive(Debug, Clone, Row, Deserialize)] 12 + pub struct PublicationRow { 13 + pub did: SmolStr, 14 + pub rkey: SmolStr, 15 + pub cid: SmolStr, 16 + pub name: SmolStr, 17 + pub description: SmolStr, 18 + pub url: SmolStr, 19 + pub domain: SmolStr, 20 + pub notebook_uri: SmolStr, 21 + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] 22 + pub event_time: chrono::DateTime<chrono::Utc>, 23 + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] 24 + pub indexed_at: chrono::DateTime<chrono::Utc>, 25 + pub record: SmolStr, 26 + } 27 + 28 + /// Custom domain lookup row from custom_domains table. 29 + #[derive(Debug, Clone, Row, Deserialize)] 30 + pub struct CustomDomainRow { 31 + pub domain: SmolStr, 32 + pub publication_did: SmolStr, 33 + pub publication_rkey: SmolStr, 34 + pub publication_name: SmolStr, 35 + pub publication_url: SmolStr, 36 + pub cname_target: SmolStr, 37 + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] 38 + pub created_at: chrono::DateTime<chrono::Utc>, 39 + } 40 + 41 + /// Document row from the documents table. 42 + #[derive(Debug, Clone, Row, Deserialize)] 43 + pub struct DocumentRow { 44 + pub did: SmolStr, 45 + pub rkey: SmolStr, 46 + pub cid: SmolStr, 47 + pub publication_did: SmolStr, 48 + pub publication_rkey: SmolStr, 49 + pub title: SmolStr, 50 + pub description: SmolStr, 51 + pub path: SmolStr, 52 + pub entry_uri: SmolStr, 53 + pub entry_index: i64, 54 + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] 55 + pub published_at: chrono::DateTime<chrono::Utc>, 56 + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] 57 + pub indexed_at: chrono::DateTime<chrono::Utc>, 58 + pub record: SmolStr, 59 + } 60 + 61 + impl Client { 62 + /// Lookup publication by domain (for custom domain routing). 63 + pub async fn get_publication_by_domain( 64 + &self, 65 + domain: &str, 66 + ) -> Result<Option<CustomDomainRow>, IndexError> { 67 + let query = r#" 68 + SELECT domain, publication_did, publication_rkey, publication_name, 69 + publication_url, cname_target, created_at 70 + FROM custom_domains FINAL 71 + WHERE domain = ? AND deleted_at = toDateTime64(0, 3) 72 + LIMIT 1 73 + "#; 74 + self.inner() 75 + .query(query) 76 + .bind(domain) 77 + .fetch_optional::<CustomDomainRow>() 78 + .await 79 + .map_err(|e| ClickHouseError::Query { 80 + message: "failed to get publication by domain".into(), 81 + source: e, 82 + }) 83 + .map_err(IndexError::from) 84 + } 85 + 86 + /// Get publication by DID and rkey. 87 + pub async fn get_publication( 88 + &self, 89 + did: &str, 90 + rkey: &str, 91 + ) -> Result<Option<PublicationRow>, IndexError> { 92 + let query = r#" 93 + SELECT did, rkey, cid, name, description, url, domain, notebook_uri, 94 + event_time, indexed_at, record 95 + FROM publications FINAL 96 + WHERE did = ? AND rkey = ? AND deleted_at = toDateTime64(0, 3) 97 + LIMIT 1 98 + "#; 99 + self.inner() 100 + .query(query) 101 + .bind(did) 102 + .bind(rkey) 103 + .fetch_optional::<PublicationRow>() 104 + .await 105 + .map_err(|e| ClickHouseError::Query { 106 + message: "failed to get publication".into(), 107 + source: e, 108 + }) 109 + .map_err(IndexError::from) 110 + } 111 + 112 + /// Resolve document by path within a publication. 113 + pub async fn resolve_document_by_path( 114 + &self, 115 + publication_did: &str, 116 + publication_rkey: &str, 117 + path: &str, 118 + ) -> Result<Option<DocumentRow>, IndexError> { 119 + let normalized = path.to_lowercase().trim_end_matches('/').to_string(); 120 + let query = r#" 121 + SELECT did, rkey, cid, publication_did, publication_rkey, 122 + title, description, path, entry_uri, entry_index, 123 + published_at, indexed_at, record 124 + FROM documents FINAL 125 + WHERE publication_did = ? AND publication_rkey = ? 126 + AND path_normalized = ? AND deleted_at = toDateTime64(0, 3) 127 + ORDER BY indexed_at DESC 128 + LIMIT 1 129 + "#; 130 + self.inner() 131 + .query(query) 132 + .bind(publication_did) 133 + .bind(publication_rkey) 134 + .bind(&normalized) 135 + .fetch_optional::<DocumentRow>() 136 + .await 137 + .map_err(|e| ClickHouseError::Query { 138 + message: "failed to resolve document by path".into(), 139 + source: e, 140 + }) 141 + .map_err(IndexError::from) 142 + } 143 + 144 + /// List documents in a publication. 145 + pub async fn list_publication_documents( 146 + &self, 147 + publication_did: &str, 148 + publication_rkey: &str, 149 + limit: u32, 150 + cursor: Option<i64>, 151 + ) -> Result<Vec<DocumentRow>, IndexError> { 152 + let query = if cursor.is_some() { 153 + r#" 154 + SELECT did, rkey, cid, publication_did, publication_rkey, 155 + title, description, path, entry_uri, entry_index, 156 + published_at, indexed_at, record 157 + FROM documents FINAL 158 + WHERE publication_did = ? AND publication_rkey = ? 159 + AND deleted_at = toDateTime64(0, 3) 160 + AND toUnixTimestamp64Milli(published_at) < ? 161 + ORDER BY published_at DESC 162 + LIMIT ? 163 + "# 164 + } else { 165 + r#" 166 + SELECT did, rkey, cid, publication_did, publication_rkey, 167 + title, description, path, entry_uri, entry_index, 168 + published_at, indexed_at, record 169 + FROM documents FINAL 170 + WHERE publication_did = ? AND publication_rkey = ? 171 + AND deleted_at = toDateTime64(0, 3) 172 + ORDER BY published_at DESC 173 + LIMIT ? 174 + "# 175 + }; 176 + 177 + let mut q = self 178 + .inner() 179 + .query(query) 180 + .bind(publication_did) 181 + .bind(publication_rkey); 182 + 183 + if let Some(c) = cursor { 184 + q = q.bind(c); 185 + } 186 + 187 + q.bind(limit) 188 + .fetch_all::<DocumentRow>() 189 + .await 190 + .map_err(|e| ClickHouseError::Query { 191 + message: "failed to list publication documents".into(), 192 + source: e, 193 + }) 194 + .map_err(IndexError::from) 195 + } 196 + 197 + /// Get document by DID and rkey. 198 + pub async fn get_document( 199 + &self, 200 + did: &str, 201 + rkey: &str, 202 + ) -> Result<Option<DocumentRow>, IndexError> { 203 + let query = r#" 204 + SELECT did, rkey, cid, publication_did, publication_rkey, 205 + title, description, path, entry_uri, entry_index, 206 + published_at, indexed_at, record 207 + FROM documents FINAL 208 + WHERE did = ? AND rkey = ? AND deleted_at = toDateTime64(0, 3) 209 + LIMIT 1 210 + "#; 211 + self.inner() 212 + .query(query) 213 + .bind(did) 214 + .bind(rkey) 215 + .fetch_optional::<DocumentRow>() 216 + .await 217 + .map_err(|e| ClickHouseError::Query { 218 + message: "failed to get document".into(), 219 + source: e, 220 + }) 221 + .map_err(IndexError::from) 222 + } 223 + }
+255
crates/weaver-index/src/endpoints/domain.rs
··· 1 + //! sh.weaver.domain.* endpoint handlers 2 + 3 + use axum::{Json, extract::State}; 4 + use jacquard::IntoStatic; 5 + use serde::{Deserialize, Serialize}; 6 + use jacquard::cowstr::ToCowStr; 7 + use jacquard::types::string::{AtUri, Cid, Did}; 8 + use jacquard_axum::ExtractXrpc; 9 + use weaver_api::sh_weaver::domain::{ 10 + DocumentView, PublicationView, 11 + resolve_by_domain::{ResolveByDomainOutput, ResolveByDomainRequest}, 12 + resolve_document::{ResolveDocumentOutput, ResolveDocumentRequest}, 13 + }; 14 + 15 + use crate::clickhouse::{DocumentRow, PublicationRow}; 16 + use crate::endpoints::notebook::parse_record_json; 17 + use crate::endpoints::repo::XrpcErrorResponse; 18 + use crate::server::AppState; 19 + 20 + /// Handle sh.weaver.domain.resolveByDomain 21 + /// 22 + /// Resolves a publication by its custom domain. 23 + pub async fn resolve_by_domain( 24 + State(state): State<AppState>, 25 + ExtractXrpc(args): ExtractXrpc<ResolveByDomainRequest>, 26 + ) -> Result<Json<ResolveByDomainOutput<'static>>, XrpcErrorResponse> { 27 + let domain = args.domain.as_ref(); 28 + 29 + let custom_domain = state 30 + .clickhouse 31 + .get_publication_by_domain(domain) 32 + .await 33 + .map_err(|e| { 34 + tracing::error!("Failed to lookup domain: {}", e); 35 + XrpcErrorResponse::internal_error("Database query failed") 36 + })? 37 + .ok_or_else(|| XrpcErrorResponse::not_found("Domain not found"))?; 38 + 39 + // Fetch full publication record 40 + let pub_row = state 41 + .clickhouse 42 + .get_publication( 43 + &custom_domain.publication_did, 44 + &custom_domain.publication_rkey, 45 + ) 46 + .await 47 + .map_err(|e| { 48 + tracing::error!("Failed to get publication: {}", e); 49 + XrpcErrorResponse::internal_error("Database query failed") 50 + })? 51 + .ok_or_else(|| XrpcErrorResponse::not_found("Publication not found"))?; 52 + 53 + let publication = build_publication_view(&pub_row)?; 54 + 55 + Ok(Json( 56 + ResolveByDomainOutput { 57 + publication, 58 + extra_data: None, 59 + } 60 + .into_static(), 61 + )) 62 + } 63 + 64 + /// Handle sh.weaver.domain.resolveDocument 65 + /// 66 + /// Resolves a document by path within a publication. 67 + pub async fn resolve_document( 68 + State(state): State<AppState>, 69 + ExtractXrpc(args): ExtractXrpc<ResolveDocumentRequest>, 70 + ) -> Result<Json<ResolveDocumentOutput<'static>>, XrpcErrorResponse> { 71 + // Parse publication URI 72 + let pub_uri = &args.publication; 73 + let pub_authority = pub_uri.authority(); 74 + let pub_rkey = pub_uri 75 + .rkey() 76 + .ok_or_else(|| XrpcErrorResponse::invalid_request("Publication URI must include rkey"))?; 77 + 78 + // Resolve authority to DID 79 + let pub_did = crate::endpoints::actor::resolve_actor(&state, pub_authority).await?; 80 + let pub_did_str = pub_did.as_str(); 81 + let pub_rkey_str = pub_rkey.as_ref(); 82 + 83 + // Verify publication exists 84 + let _pub_row = state 85 + .clickhouse 86 + .get_publication(pub_did_str, pub_rkey_str) 87 + .await 88 + .map_err(|e| { 89 + tracing::error!("Failed to get publication: {}", e); 90 + XrpcErrorResponse::internal_error("Database query failed") 91 + })? 92 + .ok_or_else(|| XrpcErrorResponse::not_found("Publication not found"))?; 93 + 94 + // Resolve document by path 95 + let path = args.path.as_ref(); 96 + let doc_row = state 97 + .clickhouse 98 + .resolve_document_by_path(pub_did_str, pub_rkey_str, path) 99 + .await 100 + .map_err(|e| { 101 + tracing::error!("Failed to resolve document: {}", e); 102 + XrpcErrorResponse::internal_error("Database query failed") 103 + })? 104 + .ok_or_else(|| XrpcErrorResponse::not_found("Document not found"))?; 105 + 106 + let document = build_document_view(&doc_row)?; 107 + 108 + Ok(Json( 109 + ResolveDocumentOutput { 110 + document, 111 + extra_data: None, 112 + } 113 + .into_static(), 114 + )) 115 + } 116 + 117 + /// Build a PublicationView from a PublicationRow. 118 + fn build_publication_view( 119 + row: &PublicationRow, 120 + ) -> Result<PublicationView<'static>, XrpcErrorResponse> { 121 + let uri_str = format!("at://{}/site.standard.publication/{}", row.did, row.rkey); 122 + let uri = AtUri::new(&uri_str).map_err(|e| { 123 + tracing::error!("Invalid publication URI: {}", e); 124 + XrpcErrorResponse::internal_error("Invalid URI") 125 + })?; 126 + 127 + let cid = Cid::new(row.cid.as_bytes()).map_err(|e| { 128 + tracing::error!("Invalid publication CID: {}", e); 129 + XrpcErrorResponse::internal_error("Invalid CID") 130 + })?; 131 + 132 + let did = Did::new(&row.did).map_err(|e| { 133 + tracing::error!("Invalid publication DID: {}", e); 134 + XrpcErrorResponse::internal_error("Invalid DID") 135 + })?; 136 + 137 + let record = parse_record_json(&row.record)?; 138 + 139 + let notebook_uri = if row.notebook_uri.is_empty() { 140 + None 141 + } else { 142 + AtUri::new(&row.notebook_uri).ok() 143 + }; 144 + 145 + Ok(PublicationView::new() 146 + .uri(uri.into_static()) 147 + .cid(cid.into_static()) 148 + .did(did.into_static()) 149 + .rkey(row.rkey.to_cowstr().into_static()) 150 + .name(row.name.to_cowstr().into_static()) 151 + .domain(row.domain.to_cowstr().into_static()) 152 + .record(record) 153 + .indexed_at(row.indexed_at.fixed_offset()) 154 + .maybe_notebook_uri(notebook_uri.map(|u| u.into_static())) 155 + .build()) 156 + } 157 + 158 + /// Build a DocumentView from a DocumentRow. 159 + fn build_document_view(row: &DocumentRow) -> Result<DocumentView<'static>, XrpcErrorResponse> { 160 + let uri_str = format!("at://{}/site.standard.document/{}", row.did, row.rkey); 161 + let uri = AtUri::new(&uri_str).map_err(|e| { 162 + tracing::error!("Invalid document URI: {}", e); 163 + XrpcErrorResponse::internal_error("Invalid URI") 164 + })?; 165 + 166 + let cid = Cid::new(row.cid.as_bytes()).map_err(|e| { 167 + tracing::error!("Invalid document CID: {}", e); 168 + XrpcErrorResponse::internal_error("Invalid CID") 169 + })?; 170 + 171 + let did = Did::new(&row.did).map_err(|e| { 172 + tracing::error!("Invalid document DID: {}", e); 173 + XrpcErrorResponse::internal_error("Invalid DID") 174 + })?; 175 + 176 + let record = parse_record_json(&row.record)?; 177 + 178 + let entry_uri = if row.entry_uri.is_empty() { 179 + None 180 + } else { 181 + AtUri::new(&row.entry_uri).ok() 182 + }; 183 + 184 + let entry_index = if row.entry_index >= 0 { 185 + Some(row.entry_index) 186 + } else { 187 + None 188 + }; 189 + 190 + Ok(DocumentView::new() 191 + .uri(uri.into_static()) 192 + .cid(cid.into_static()) 193 + .did(did.into_static()) 194 + .rkey(row.rkey.to_cowstr().into_static()) 195 + .title(row.title.to_cowstr().into_static()) 196 + .path(row.path.to_cowstr().into_static()) 197 + .record(record) 198 + .indexed_at(row.indexed_at.fixed_offset()) 199 + .maybe_entry_uri(entry_uri.map(|u| u.into_static())) 200 + .maybe_entry_index(entry_index) 201 + .build()) 202 + } 203 + 204 + // === Internal Caddy Verification Endpoint === 205 + 206 + #[derive(Debug, Deserialize)] 207 + pub struct VerifyDomainQuery { 208 + pub domain: String, 209 + } 210 + 211 + #[derive(Debug, Serialize)] 212 + #[serde(rename_all = "camelCase")] 213 + pub struct VerifyDomainResponse { 214 + pub valid: bool, 215 + pub publication_uri: Option<String>, 216 + } 217 + 218 + /// Internal endpoint for Caddy on-demand TLS verification. 219 + pub async fn verify_domain( 220 + State(state): State<AppState>, 221 + axum::extract::Query(params): axum::extract::Query<VerifyDomainQuery>, 222 + ) -> Result<Json<VerifyDomainResponse>, XrpcErrorResponse> { 223 + let domain = &params.domain; 224 + tracing::info!(%domain, "Verifying custom domain for TLS"); 225 + 226 + let row = state 227 + .clickhouse 228 + .get_publication_by_domain(domain) 229 + .await 230 + .map_err(|e| { 231 + tracing::error!(%domain, error = %e, "Database error"); 232 + XrpcErrorResponse::internal_error("Database query failed") 233 + })?; 234 + 235 + match row { 236 + Some(r) => { 237 + let uri = format!( 238 + "at://{}/site.standard.publication/{}", 239 + r.publication_did, r.publication_rkey 240 + ); 241 + tracing::info!(%domain, %uri, "Domain verified"); 242 + Ok(Json(VerifyDomainResponse { 243 + valid: true, 244 + publication_uri: Some(uri), 245 + })) 246 + } 247 + None => { 248 + tracing::info!(%domain, "Domain not found"); 249 + Ok(Json(VerifyDomainResponse { 250 + valid: false, 251 + publication_uri: None, 252 + })) 253 + } 254 + } 255 + }
+1
crates/weaver-index/src/endpoints/mod.rs
··· 14 14 pub mod actor; 15 15 pub mod bsky; 16 16 pub mod collab; 17 + pub mod domain; 17 18 pub mod edit; 18 19 pub mod identity; 19 20 pub mod notebook;
+34 -34
crates/weaver-index/src/endpoints/notebook.rs
··· 192 192 // Build BookEntryViews with prev/next navigation 193 193 let mut entries: Vec<BookEntryView<'static>> = Vec::with_capacity(entry_views.len()); 194 194 for (idx, entry_view) in entry_views.iter().enumerate() { 195 - let prev = (idx > 0) 196 - .then(|| BookEntryRef::new().entry(entry_views[idx - 1].clone()).build()); 195 + let prev = (idx > 0).then(|| { 196 + BookEntryRef::new() 197 + .entry(entry_views[idx - 1].clone()) 198 + .build() 199 + }); 197 200 let next = entry_views 198 201 .get(idx + 1) 199 202 .map(|e| BookEntryRef::new().entry(e.clone()).build()); ··· 362 365 let did_str = did.as_str(); 363 366 364 367 // Fetch entry and contributors in parallel 365 - let (entry_result, contributors_result) = tokio::try_join!( 366 - async { 367 - state 368 - .clickhouse 369 - .get_entry_exact(did_str, rkey_str) 370 - .await 371 - .map_err(|e| { 372 - tracing::error!("Failed to get entry: {}", e); 373 - XrpcErrorResponse::internal_error("Database query failed") 374 - }) 375 - }, 376 - async { 377 - state 378 - .clickhouse 379 - .get_entry_contributors(did_str, rkey_str) 380 - .await 381 - .map_err(|e| { 382 - tracing::error!("Failed to get contributors: {}", e); 383 - XrpcErrorResponse::internal_error("Database query failed") 384 - }) 385 - } 386 - )?; 387 - 388 - let entry_row = entry_result.ok_or_else(|| XrpcErrorResponse::not_found("Entry not found"))?; 389 - 368 + let contributors_result = state 369 + .clickhouse 370 + .get_entry_contributors(did_str, rkey_str) 371 + .await 372 + .map_err(|e| { 373 + tracing::error!("Failed to get contributors: {}", e); 374 + XrpcErrorResponse::internal_error("Database query failed") 375 + })?; 390 376 // Merge contributors with author_dids from record (dedupe) 391 377 let mut all_author_dids: HashSet<&str> = 392 378 contributors_result.iter().map(|s| s.as_str()).collect(); 379 + 380 + let entry_result = state 381 + .clickhouse 382 + .get_entry( 383 + rkey_str, 384 + &all_author_dids.iter().cloned().collect::<Vec<_>>(), 385 + ) 386 + .await 387 + .map_err(|e| { 388 + tracing::error!("Failed to get entry: {}", e); 389 + XrpcErrorResponse::internal_error("Database query failed") 390 + })?; 391 + let entry_row = entry_result.ok_or_else(|| XrpcErrorResponse::not_found("Entry not found"))?; 392 + 393 393 for did in &entry_row.author_dids { 394 394 all_author_dids.insert(did.as_str()); 395 395 } ··· 532 532 } 533 533 534 534 /// Build an EntryView from an EntryRow with explicit author list (evidence-based contributors) 535 - fn build_entry_view_with_authors( 535 + pub fn build_entry_view_with_authors( 536 536 entry_row: &crate::clickhouse::EntryRow, 537 537 author_dids: &[SmolStr], 538 538 profile_map: &HashMap<&str, &ProfileRow>, ··· 564 564 } 565 565 566 566 /// Convert SmolStr to Option<CowStr> if non-empty 567 - fn non_empty_cowstr(s: &smol_str::SmolStr) -> Option<jacquard::CowStr<'static>> { 567 + pub fn non_empty_cowstr(s: &smol_str::SmolStr) -> Option<jacquard::CowStr<'static>> { 568 568 if s.is_empty() { 569 569 None 570 570 } else { ··· 573 573 } 574 574 575 575 /// Parse record JSON string into owned Data 576 - fn parse_record_json(json: &str) -> Result<Data<'static>, XrpcErrorResponse> { 576 + pub fn parse_record_json(json: &str) -> Result<Data<'static>, XrpcErrorResponse> { 577 577 let data: Data<'_> = serde_json::from_str(json).map_err(|e| { 578 578 tracing::error!("Failed to parse record JSON: {}", e); 579 579 XrpcErrorResponse::internal_error("Invalid record JSON stored") ··· 582 582 } 583 583 584 584 /// Hydrate author list from DIDs using profile map 585 - fn hydrate_authors( 585 + pub fn hydrate_authors( 586 586 author_dids: &[SmolStr], 587 587 profile_map: &HashMap<&str, &ProfileRow>, 588 588 ) -> Result<Vec<AuthorListView<'static>>, XrpcErrorResponse> { ··· 623 623 } 624 624 625 625 /// Convert ProfileRow to ProfileDataView 626 - fn profile_to_data_view( 626 + pub fn profile_to_data_view( 627 627 profile: &ProfileRow, 628 628 ) -> Result<ProfileDataView<'static>, XrpcErrorResponse> { 629 629 let did = Did::new(&profile.did).map_err(|e| { ··· 680 680 } 681 681 682 682 /// Parse cursor string to i64 timestamp millis 683 - fn parse_cursor(cursor: Option<&str>) -> Result<Option<i64>, XrpcErrorResponse> { 683 + pub fn parse_cursor(cursor: Option<&str>) -> Result<Option<i64>, XrpcErrorResponse> { 684 684 cursor 685 685 .map(|c| { 686 686 c.parse::<i64>() ··· 1011 1011 } 1012 1012 1013 1013 /// Build an EntryView from an EntryRow 1014 - fn build_entry_view( 1014 + pub fn build_entry_view( 1015 1015 entry_row: &EntryRow, 1016 1016 profile_map: &HashMap<&str, &ProfileRow>, 1017 1017 ) -> Result<EntryView<'static>, XrpcErrorResponse> {
+1 -1
crates/weaver-index/src/landing.html
··· 116 116 <p>This is an AT Protocol record index serving the Weaver writing platform.</p> 117 117 <p>Most API endpoints are available under <code>/xrpc/</code>.</p> 118 118 <ul> 119 - <li>Web App (alpha): <a href="https://alpha.weaver.sh">alpha.weaver.sh</a></li> 119 + <li>Web App: <a href="https://weaver.sh">weaver.sh</a></li> 120 120 <li> 121 121 Source Code: 122 122 <a href="https://tangled.org/@nonbinary.computer/weaver">tangled.org/@nonbinary.computer/weaver</a>
+13 -1
crates/weaver-index/src/server.rs
··· 35 35 use weaver_api::sh_weaver::edit::get_contributors::GetContributorsRequest; 36 36 use weaver_api::sh_weaver::edit::get_edit_history::GetEditHistoryRequest; 37 37 use weaver_api::sh_weaver::edit::list_drafts::ListDraftsRequest; 38 + use weaver_api::sh_weaver::domain::{ 39 + resolve_by_domain::ResolveByDomainRequest, resolve_document::ResolveDocumentRequest, 40 + }; 38 41 use weaver_api::sh_weaver::notebook::{ 39 42 get_book_entry::GetBookEntryRequest, get_entry::GetEntryRequest, 40 43 get_entry_feed::GetEntryFeedRequest, get_entry_notebooks::GetEntryNotebooksRequest, ··· 45 48 46 49 use crate::clickhouse::Client; 47 50 use crate::config::ShardConfig; 48 - use crate::endpoints::{actor, bsky, collab, edit, identity, notebook, repo}; 51 + use crate::endpoints::{actor, bsky, collab, domain, edit, identity, notebook, repo}; 49 52 use crate::error::{IndexError, ServerError}; 50 53 use crate::sqlite::ShardRouter; 51 54 ··· 139 142 )) 140 143 .merge(ResolveGlobalNotebookRequest::into_router( 141 144 notebook::resolve_global_notebook, 145 + )) 146 + // Internal endpoint for Caddy on-demand TLS verification 147 + .route("/internal/verify-domain", get(domain::verify_domain)) 148 + // sh.weaver.domain.* endpoints 149 + .merge(ResolveByDomainRequest::into_router( 150 + domain::resolve_by_domain, 151 + )) 152 + .merge(ResolveDocumentRequest::into_router( 153 + domain::resolve_document, 142 154 )) 143 155 // sh.weaver.collab.* endpoints 144 156 .merge(GetResourceParticipantsRequest::into_router(
+1 -1
crates/weaver-renderer/Cargo.toml
··· 6 6 publish = false 7 7 8 8 [features] 9 - default = ["syntax-highlighting", "syntax-css"] 9 + default = ["syntax-highlighting", "syntax-css", "pckt"] 10 10 pckt = [] 11 11 # Basic syntax highlighting (code_pretty.rs) - works in WASM 12 12 syntax-highlighting = ["dep:syntect"]
+32 -17
crates/weaver-renderer/src/atproto/embed_renderer.rs
··· 468 468 469 469 // Fetch publication to get base URL for external link 470 470 use weaver_api::site_standard::publication::Publication; 471 - let publication_url: Option<String> = agent 472 - .fetch_record_slingshot(&doc.publication) 473 - .await 474 - .ok() 475 - .and_then(|rec| { 476 - jacquard::from_data::<Publication>(&rec.value) 477 - .ok() 478 - .map(|pub_rec| pub_rec.url.as_ref().to_string()) 479 - }); 471 + let Uri::At(uri) = &doc.site else { 472 + return Err(AtProtoPreprocessError::FetchFailed( 473 + "Invalid site URI".to_string(), 474 + )); 475 + }; 476 + let publication_url: Option<String> = 477 + agent 478 + .fetch_record_slingshot(uri) 479 + .await 480 + .ok() 481 + .and_then(|rec| { 482 + jacquard::from_data::<Publication>(&rec.value) 483 + .ok() 484 + .map(|pub_rec| pub_rec.url.as_ref().to_string()) 485 + }); 480 486 481 487 // Get author DID and handle from URI authority 482 - use jacquard::types::string::{Did, Handle}; 488 + use jacquard::types::{ 489 + string::{Did, Handle}, 490 + uri::Uri, 491 + }; 483 492 let (author_did, author_handle): (Did<'static>, Option<Handle<'static>>) = match uri.authority() 484 493 { 485 494 jacquard::types::ident::AtIdentifier::Did(d) => { ··· 557 566 558 567 // Render content blocks if present 559 568 if let Some(content) = &doc.content { 560 - html.push_str(&render_content_blocks(content, &ctx, agent).await); 569 + html.push_str(&render_content_blocks(vec![content.clone()].as_slice(), &ctx, agent).await); 561 570 } else if let Some(text_content) = &doc.text_content { 562 571 // Fallback to text_content if no structured content 563 572 html.push_str("<p>"); ··· 1270 1279 .map(|d| d.into_static()) 1271 1280 }); 1272 1281 1273 - let ctx = author_did.map(PcktRenderContext::new).unwrap_or_else(|| { 1274 - PcktRenderContext::new(jacquard::types::string::Did::unchecked( 1275 - "did:plc:unknown".into(), 1276 - )) 1277 - }); 1282 + let ctx = author_did 1283 + .map(PcktRenderContext::new) 1284 + .unwrap_or_else(|| unsafe { 1285 + PcktRenderContext::new(jacquard::types::string::Did::unchecked( 1286 + "did:plc:unknown".into(), 1287 + )) 1288 + }); 1278 1289 1279 1290 let rkey = uri.rkey().map(|r| r.as_ref()).unwrap_or("unknown"); 1280 1291 let toggle_id = format!("pckt-toggle-{}", rkey); ··· 1309 1320 html.push_str("<div class=\"embed-entry-content\">"); 1310 1321 if let Some(content) = &doc.content { 1311 1322 // Render actual content blocks using the sync renderer. 1312 - html.push_str(&render_content_blocks_sync(content, &ctx, resolved_content)); 1323 + html.push_str(&render_content_blocks_sync( 1324 + vec![content.clone()].as_slice(), 1325 + &ctx, 1326 + resolved_content, 1327 + )); 1313 1328 } else if let Some(text_content) = &doc.text_content { 1314 1329 // Fallback to text_content if no structured blocks. 1315 1330 html.push_str("<p>");
+242 -1
crates/weaver-renderer/src/pckt/block_renderer.rs
··· 8 8 image::Image, list_item::ListItemContentItem, ordered_list::OrderedList, text::Text, 9 9 website::Website, 10 10 }; 11 + use weaver_api::blog_pckt::content::Content as PcktContent; 12 + use weaver_api::sh_weaver::notebook::{BookEntryView, entry::Entry}; 11 13 12 14 use crate::facet::{NormalizedFacet, render_faceted_html}; 13 15 ··· 445 447 if let Some(rest) = uri_str.strip_prefix("at://") { 446 448 if let Some((did, path)) = rest.split_once('/') { 447 449 if let Some(rkey) = path.strip_prefix("app.bsky.feed.post/") { 448 - html.push_str("<iframe class=\"bsky-embed-iframe\" src=\"https://embed.bsky.app/embed/"); 450 + html.push_str( 451 + "<iframe class=\"bsky-embed-iframe\" src=\"https://embed.bsky.app/embed/", 452 + ); 449 453 let _ = escape_html(&mut *html, did); 450 454 html.push_str("/post/"); 451 455 let _ = escape_html(&mut *html, rkey); ··· 471 475 472 476 html.push_str("\" target=\"_blank\" rel=\"noopener\">View post on Bluesky</a></div>\n"); 473 477 } 478 + 479 + /// Render document content by dispatching on $type. 480 + /// This is the main entry point for site.standard.document.content rendering. 481 + pub async fn render_document_content<A: AgentSessionExt>( 482 + content: &Data<'_>, 483 + ctx: &PcktRenderContext, 484 + agent: &A, 485 + ) -> String { 486 + let Some(type_tag) = content.type_discriminator() else { 487 + return String::from("<p>Unknown content type</p>"); 488 + }; 489 + 490 + match type_tag { 491 + "blog.pckt.content" => { 492 + if let Ok(pckt_content) = jacquard::from_data::<PcktContent>(content) { 493 + render_content_blocks(&pckt_content.items, ctx, agent).await 494 + } else { 495 + String::from("<p>Failed to parse pckt content</p>") 496 + } 497 + } 498 + "sh.weaver.notebook.defs#bookEntryView" => { 499 + if let Ok(book_entry) = jacquard::from_data::<BookEntryView>(content) { 500 + render_book_entry_view_async(&book_entry, ctx, agent).await 501 + } else { 502 + String::from("<p>Failed to parse book entry</p>") 503 + } 504 + } 505 + "sh.weaver.notebook.entry" => { 506 + if let Ok(entry) = jacquard::from_data::<Entry>(content) { 507 + render_entry_async(&entry, ctx, agent).await 508 + } else { 509 + String::from("<p>Failed to parse entry</p>") 510 + } 511 + } 512 + _ => { 513 + tracing::debug!("Unknown document content type: {}", type_tag); 514 + String::from("<p>Unsupported content type</p>") 515 + } 516 + } 517 + } 518 + 519 + /// Sync version of render_document_content. 520 + pub fn render_document_content_sync( 521 + content: &Data<'_>, 522 + ctx: &PcktRenderContext, 523 + resolved_content: Option<&weaver_common::ResolvedContent>, 524 + ) -> String { 525 + let Some(type_tag) = content.type_discriminator() else { 526 + return String::from("<p>Unknown content type</p>"); 527 + }; 528 + 529 + match type_tag { 530 + "blog.pckt.content" => { 531 + if let Ok(pckt_content) = jacquard::from_data::<PcktContent>(content) { 532 + render_content_blocks_sync(&pckt_content.items, ctx, resolved_content) 533 + } else { 534 + String::from("<p>Failed to parse pckt content</p>") 535 + } 536 + } 537 + "sh.weaver.notebook.defs#bookEntryView" => { 538 + if let Ok(book_entry) = jacquard::from_data::<BookEntryView>(content) { 539 + render_book_entry_view_sync(&book_entry, ctx, resolved_content) 540 + } else { 541 + String::from("<p>Failed to parse book entry</p>") 542 + } 543 + } 544 + "sh.weaver.notebook.entry" => { 545 + if let Ok(entry) = jacquard::from_data::<Entry>(content) { 546 + render_entry_sync(&entry, ctx, resolved_content) 547 + } else { 548 + String::from("<p>Failed to parse entry</p>") 549 + } 550 + } 551 + _ => { 552 + tracing::debug!("Unknown document content type: {}", type_tag); 553 + String::from("<p>Unsupported content type</p>") 554 + } 555 + } 556 + } 557 + 558 + /// Async render for BookEntryView - fetches embeds on demand. 559 + /// Uses ctx.author_did for blob URLs and identity context. 560 + async fn render_book_entry_view_async<A: AgentSessionExt>( 561 + book_entry: &BookEntryView<'_>, 562 + ctx: &PcktRenderContext, 563 + agent: &A, 564 + ) -> String { 565 + use crate::atproto::{ClientContext, ClientWriter}; 566 + use crate::{ContextIterator, NotebookProcessor}; 567 + use markdown_weaver::Parser; 568 + use n0_future::stream::StreamExt; 569 + 570 + let Ok(entry) = jacquard::from_data::<Entry>(&book_entry.entry.record) else { 571 + return String::from("<p>Failed to parse entry</p>"); 572 + }; 573 + 574 + let resolved_content = prefetch_entry_embeds(&entry, agent).await; 575 + 576 + let client_ctx = ClientContext::<()>::new(entry.clone(), ctx.author_did.clone()); 577 + let parser = Parser::new_ext(&entry.content, crate::default_md_options()).into_offset_iter(); 578 + let iter = ContextIterator::default(parser); 579 + let processor = NotebookProcessor::new(client_ctx, iter); 580 + let events: Vec<_> = StreamExt::collect(processor).await; 581 + 582 + let mut html = String::new(); 583 + ClientWriter::new(events.into_iter(), &mut html, &entry.content) 584 + .with_embed_provider(resolved_content) 585 + .run() 586 + .ok(); 587 + html 588 + } 589 + 590 + /// Sync render - uses pre-resolved content, no async processing. 591 + fn render_book_entry_view_sync( 592 + book_entry: &BookEntryView<'_>, 593 + _ctx: &PcktRenderContext, 594 + resolved_content: Option<&weaver_common::ResolvedContent>, 595 + ) -> String { 596 + use crate::atproto::ClientWriter; 597 + use markdown_weaver::Parser; 598 + 599 + let Ok(entry) = jacquard::from_data::<Entry>(&book_entry.entry.record) else { 600 + return String::from("<p>Failed to parse entry</p>"); 601 + }; 602 + 603 + let parser = Parser::new_ext(&entry.content, crate::default_md_options()).into_offset_iter(); 604 + let mut html = String::new(); 605 + if let Some(resolved) = resolved_content { 606 + ClientWriter::new(parser, &mut html, &entry.content) 607 + .with_embed_provider(resolved.clone()) 608 + .run() 609 + .ok(); 610 + } else { 611 + ClientWriter::<_, _, ()>::new(parser, &mut html, &entry.content) 612 + .run() 613 + .ok(); 614 + } 615 + html 616 + } 617 + 618 + /// Async render for direct Entry (not wrapped in BookEntryView). 619 + /// Uses ctx.author_did for identity context. 620 + async fn render_entry_async<A: AgentSessionExt>( 621 + entry: &Entry<'_>, 622 + ctx: &PcktRenderContext, 623 + agent: &A, 624 + ) -> String { 625 + use crate::atproto::{ClientContext, ClientWriter}; 626 + use crate::{ContextIterator, NotebookProcessor}; 627 + use jacquard::IntoStatic; 628 + use markdown_weaver::Parser; 629 + use n0_future::stream::StreamExt; 630 + 631 + let resolved_content = prefetch_entry_embeds(entry, agent).await; 632 + 633 + let client_ctx = ClientContext::<()>::new(entry.clone().into_static(), ctx.author_did.clone()); 634 + let parser = Parser::new_ext(&entry.content, crate::default_md_options()).into_offset_iter(); 635 + let iter = ContextIterator::default(parser); 636 + let processor = NotebookProcessor::new(client_ctx, iter); 637 + let events: Vec<_> = StreamExt::collect(processor).await; 638 + 639 + let mut html = String::new(); 640 + ClientWriter::new(events.into_iter(), &mut html, &entry.content) 641 + .with_embed_provider(resolved_content) 642 + .run() 643 + .ok(); 644 + html 645 + } 646 + 647 + /// Sync render for direct Entry. 648 + fn render_entry_sync( 649 + entry: &Entry<'_>, 650 + _ctx: &PcktRenderContext, 651 + resolved_content: Option<&weaver_common::ResolvedContent>, 652 + ) -> String { 653 + use crate::atproto::ClientWriter; 654 + use markdown_weaver::Parser; 655 + 656 + let parser = Parser::new_ext(&entry.content, crate::default_md_options()).into_offset_iter(); 657 + let mut html = String::new(); 658 + if let Some(resolved) = resolved_content { 659 + ClientWriter::new(parser, &mut html, &entry.content) 660 + .with_embed_provider(resolved.clone()) 661 + .run() 662 + .ok(); 663 + } else { 664 + ClientWriter::<_, _, ()>::new(parser, &mut html, &entry.content) 665 + .run() 666 + .ok(); 667 + } 668 + html 669 + } 670 + 671 + /// Extract and pre-fetch embeds from a weaver entry. 672 + async fn prefetch_entry_embeds<A: AgentSessionExt>( 673 + entry: &Entry<'_>, 674 + agent: &A, 675 + ) -> weaver_common::ResolvedContent { 676 + use crate::atproto::fetch_and_render; 677 + use jacquard::IntoStatic; 678 + 679 + let mut resolved = weaver_common::ResolvedContent::new(); 680 + 681 + // Try stored embeds first. 682 + if let Some(ref embeds) = entry.embeds { 683 + if let Some(ref records) = embeds.records { 684 + for record in &records.records { 685 + let uri = record.record.uri.clone().into_static(); 686 + if let Ok(html) = fetch_and_render(&uri, agent).await { 687 + resolved.add_embed(uri, html, None); 688 + } 689 + } 690 + return resolved; 691 + } 692 + } 693 + 694 + // Fall back to parsing markdown for at:// URIs. 695 + #[cfg(not(all(target_family = "wasm", target_os = "unknown")))] 696 + use regex::Regex; 697 + #[cfg(all(target_family = "wasm", target_os = "unknown"))] 698 + use regex_lite::Regex; 699 + use std::sync::LazyLock; 700 + static AT_URI_REGEX: LazyLock<Regex> = 701 + LazyLock::new(|| Regex::new(r"at://[^\s\)\]]+").unwrap()); 702 + 703 + for m in AT_URI_REGEX.find_iter(&entry.content) { 704 + let uri_str: &str = m.as_str(); 705 + if let Ok(uri) = jacquard::types::aturi::AtUri::new(uri_str) { 706 + let uri = uri.into_static(); 707 + if let Ok(html) = fetch_and_render(&uri, agent).await { 708 + resolved.add_embed(uri, html, None); 709 + } 710 + } 711 + } 712 + 713 + resolved 714 + }
+1 -1
crates/weaver-renderer/src/pckt/mod.rs
··· 2 2 3 3 pub use block_renderer::{ 4 4 render_block, render_block_sync, render_content_blocks, render_content_blocks_sync, 5 - PcktRenderContext, 5 + render_document_content, render_document_content_sync, PcktRenderContext, 6 6 };
+21
docker-compose.yml
··· 1 1 services: 2 + # Caddy - reverse proxy with automatic TLS 3 + caddy: 4 + image: ${REGISTRY_HOST:-localhost}:5000/weaver-caddy:latest 5 + container_name: weaver-caddy 6 + ports: 7 + - "80:80" 8 + - "443:443" 9 + volumes: 10 + - ./infra/caddy/Caddyfile:/etc/caddy/Caddyfile:ro 11 + - caddy_data:/data 12 + - caddy_config:/config 13 + environment: 14 + CLOUDFLARE_API_TOKEN: ${CLOUDFLARE_API_TOKEN} 15 + ACME_EMAIL: ${ACME_EMAIL:-admin@weaver.sh} 16 + depends_on: 17 + - weaver-app 18 + - index 19 + restart: unless-stopped 20 + 2 21 # ClickHouse - analytics database (internal only, no host ports exposed) 3 22 clickhouse: 4 23 image: clickhouse/clickhouse-server:25.11 ··· 115 134 registry_data: 116 135 tap_data: 117 136 index_data: 137 + caddy_data: 138 + caddy_config:
+32
infra/caddy/Caddyfile
··· 1 + { 2 + email {$ACME_EMAIL:contact@weaver.sh} 3 + 4 + on_demand_tls { 5 + ask http://index:3000/internal/verify-domain 6 + } 7 + } 8 + 9 + # Index service 10 + index.weaver.sh { 11 + reverse_proxy index:3000 12 + } 13 + 14 + 15 + # Custom domains - on-demand TLS 16 + :443 { 17 + tls { 18 + on_demand 19 + } 20 + 21 + @www header_regexp host Host ^www\.(.+)$ 22 + handle @www { 23 + redir https://{re.host.1}{uri} permanent 24 + } 25 + 26 + reverse_proxy weaver-app:8080 27 + } 28 + 29 + 30 + :80 { 31 + respond /health 200 32 + }
+8
infra/caddy/Dockerfile
··· 1 + FROM caddy:2-builder AS builder 2 + 3 + RUN xcaddy build \ 4 + --with github.com/caddy-dns/cloudflare 5 + 6 + FROM caddy:2-alpine 7 + 8 + COPY --from=builder /usr/bin/caddy /usr/bin/caddy