diff --git a/Cargo.lock b/Cargo.lock index 4297903..474461b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,6 +165,15 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac436601d6bdde674a0d7fb593e829ffe7b3387c351b356dd20e2d40f5bf3ee5" +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + [[package]] name = "ar_archive_writer" version = "0.2.0" @@ -896,6 +905,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + [[package]] name = "bytecheck" version = "0.6.12" @@ -1755,6 +1770,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "csscolorparser" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda6aace1fbef3aa217b27f4c8d7d071ef2a70a5ca51050b1f17d40299d3f16" +dependencies = [ + "phf 0.11.3", +] + [[package]] name = "cssparser" version = "0.29.6" @@ -3599,6 +3623,12 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "fast-srgb8" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" + [[package]] name = "fastrand" version = "2.3.0" @@ -7766,6 +7796,30 @@ dependencies = [ "primeorder", ] +[[package]] +name = "palette" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" +dependencies = [ + "approx", + "fast-srgb8", + "palette_derive", + "phf 0.11.3", +] + +[[package]] +name = "palette_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" +dependencies = [ + "by_address", + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "pango" version = "0.18.3" @@ -12292,6 +12346,7 @@ name = "weaver-renderer" version = "0.1.0" dependencies = [ "bitflags 2.10.0", + "csscolorparser", "dashmap 6.1.0", "http", "ignore", @@ -12302,6 +12357,7 @@ dependencies = [ "miette 7.6.0", "mime-sniffer", "n0-future 0.1.3", + "palette", "pin-project", "pin-utils", "pulldown-latex", diff --git a/crates/weaver-api/lexicons/sh_weaver_domain_generateDocument.json b/crates/weaver-api/lexicons/sh_weaver_domain_generateDocument.json index 6dd06a5..2e1ed72 100644 --- a/crates/weaver-api/lexicons/sh_weaver_domain_generateDocument.json +++ b/crates/weaver-api/lexicons/sh_weaver_domain_generateDocument.json @@ -18,6 +18,10 @@ "description": "AT-URI of the sh.weaver.notebook.entry to convert.", "format": "at-uri" }, + "entryRecord": { + "type": "unknown", + "description": "The entry record data to use (avoids staleness from index cache)." + }, "path": { "type": "string", "description": "URL path for the document." diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_book.json b/crates/weaver-api/lexicons/sh_weaver_notebook_book.json index f9fb7df..4dc6c79 100644 --- a/crates/weaver-api/lexicons/sh_weaver_notebook_book.json +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_book.json @@ -42,7 +42,7 @@ }, "publishGlobal": { "type": "boolean", - "description": "Notebook opts into accessiblity by path only without identity scoping. Path must be globally unique." + "description": "Notebook opts into accessiblity by path only without identity scoping. Path must be globally unique and a valid subdomain." }, "rating": { "type": "ref", diff --git a/crates/weaver-api/src/app_bsky/actor.rs b/crates/weaver-api/src/app_bsky/actor.rs index 93acf72..1d3d675 100644 --- a/crates/weaver-api/src/app_bsky/actor.rs +++ b/crates/weaver-api/src/app_bsky/actor.rs @@ -3137,37 +3137,37 @@ pub mod known_followers_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Count; type Followers; + type Count; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Count = Unset; type Followers = Unset; - } - ///State transition - sets the `count` field to Set - pub struct SetCount(PhantomData S>); - impl sealed::Sealed for SetCount {} - impl State for SetCount { - type Count = Set; - type Followers = S::Followers; + type Count = Unset; } ///State transition - sets the `followers` field to Set pub struct SetFollowers(PhantomData S>); impl sealed::Sealed for SetFollowers {} impl State for SetFollowers { - type Count = S::Count; type Followers = Set; + type Count = S::Count; + } + ///State transition - sets the `count` field to Set + pub struct SetCount(PhantomData S>); + impl sealed::Sealed for SetCount {} + impl State for SetCount { + type Followers = S::Followers; + type Count = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `count` field - pub struct count(()); ///Marker type for the `followers` field pub struct followers(()); + ///Marker type for the `count` field + pub struct count(()); } } @@ -3240,8 +3240,8 @@ where impl<'a, S> KnownFollowersBuilder<'a, S> where S: known_followers_state::State, - S::Count: known_followers_state::IsSet, S::Followers: known_followers_state::IsSet, + S::Count: known_followers_state::IsSet, { /// Build the final struct pub fn build(self) -> KnownFollowers<'a> { @@ -5548,37 +5548,37 @@ pub mod profile_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Handle; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Handle = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Handle = S::Handle; + type Did = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Did = S::Did; type Handle = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = S::Handle; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -5861,8 +5861,8 @@ impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { impl<'a, S> ProfileViewBasicBuilder<'a, S> where S: profile_view_basic_state::State, - S::Did: profile_view_basic_state::IsSet, S::Handle: profile_view_basic_state::IsSet, + S::Did: profile_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> ProfileViewBasic<'a> { @@ -7884,49 +7884,49 @@ pub mod verification_state_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type VerifiedStatus; type Verifications; + type VerifiedStatus; type TrustedVerifierStatus; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type VerifiedStatus = Unset; type Verifications = Unset; + type VerifiedStatus = Unset; type TrustedVerifierStatus = Unset; } - ///State transition - sets the `verified_status` field to Set - pub struct SetVerifiedStatus(PhantomData S>); - impl sealed::Sealed for SetVerifiedStatus {} - impl State for SetVerifiedStatus { - type VerifiedStatus = Set; - type Verifications = S::Verifications; - type TrustedVerifierStatus = S::TrustedVerifierStatus; - } ///State transition - sets the `verifications` field to Set pub struct SetVerifications(PhantomData S>); impl sealed::Sealed for SetVerifications {} impl State for SetVerifications { - type VerifiedStatus = S::VerifiedStatus; type Verifications = Set; + type VerifiedStatus = S::VerifiedStatus; + type TrustedVerifierStatus = S::TrustedVerifierStatus; + } + ///State transition - sets the `verified_status` field to Set + pub struct SetVerifiedStatus(PhantomData S>); + impl sealed::Sealed for SetVerifiedStatus {} + impl State for SetVerifiedStatus { + type Verifications = S::Verifications; + type VerifiedStatus = Set; type TrustedVerifierStatus = S::TrustedVerifierStatus; } ///State transition - sets the `trusted_verifier_status` field to Set pub struct SetTrustedVerifierStatus(PhantomData S>); impl sealed::Sealed for SetTrustedVerifierStatus {} impl State for SetTrustedVerifierStatus { - type VerifiedStatus = S::VerifiedStatus; type Verifications = S::Verifications; + type VerifiedStatus = S::VerifiedStatus; type TrustedVerifierStatus = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `verified_status` field - pub struct verified_status(()); ///Marker type for the `verifications` field pub struct verifications(()); + ///Marker type for the `verified_status` field + pub struct verified_status(()); ///Marker type for the `trusted_verifier_status` field pub struct trusted_verifier_status(()); } @@ -8024,8 +8024,8 @@ where impl<'a, S> VerificationStateBuilder<'a, S> where S: verification_state_state::State, - S::VerifiedStatus: verification_state_state::IsSet, S::Verifications: verification_state_state::IsSet, + S::VerifiedStatus: verification_state_state::IsSet, S::TrustedVerifierStatus: verification_state_state::IsSet, { /// Build the final struct @@ -8310,67 +8310,67 @@ pub mod verification_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type IsValid; + type Uri; type CreatedAt; + type IsValid; type Issuer; - type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type IsValid = Unset; + type Uri = Unset; type CreatedAt = Unset; + type IsValid = Unset; type Issuer = Unset; - type Uri = Unset; } - ///State transition - sets the `is_valid` field to Set - pub struct SetIsValid(PhantomData S>); - impl sealed::Sealed for SetIsValid {} - impl State for SetIsValid { - type IsValid = Set; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type CreatedAt = S::CreatedAt; + type IsValid = S::IsValid; type Issuer = S::Issuer; - type Uri = S::Uri; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type IsValid = S::IsValid; + type Uri = S::Uri; type CreatedAt = Set; + type IsValid = S::IsValid; type Issuer = S::Issuer; + } + ///State transition - sets the `is_valid` field to Set + pub struct SetIsValid(PhantomData S>); + impl sealed::Sealed for SetIsValid {} + impl State for SetIsValid { type Uri = S::Uri; + type CreatedAt = S::CreatedAt; + type IsValid = Set; + type Issuer = S::Issuer; } ///State transition - sets the `issuer` field to Set pub struct SetIssuer(PhantomData S>); impl sealed::Sealed for SetIssuer {} impl State for SetIssuer { - type IsValid = S::IsValid; - type CreatedAt = S::CreatedAt; - type Issuer = Set; type Uri = S::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type IsValid = S::IsValid; type CreatedAt = S::CreatedAt; - type Issuer = S::Issuer; - type Uri = Set; + type IsValid = S::IsValid; + type Issuer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `is_valid` field - pub struct is_valid(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `is_valid` field + pub struct is_valid(()); ///Marker type for the `issuer` field pub struct issuer(()); - ///Marker type for the `uri` field - pub struct uri(()); } } @@ -8483,10 +8483,10 @@ where impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, - S::IsValid: verification_view_state::IsSet, + S::Uri: verification_view_state::IsSet, S::CreatedAt: verification_view_state::IsSet, + S::IsValid: verification_view_state::IsSet, S::Issuer: verification_view_state::IsSet, - S::Uri: verification_view_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationView<'a> { diff --git a/crates/weaver-api/src/app_bsky/ageassurance.rs b/crates/weaver-api/src/app_bsky/ageassurance.rs index 0b2d95f..e4b5e27 100644 --- a/crates/weaver-api/src/app_bsky/ageassurance.rs +++ b/crates/weaver-api/src/app_bsky/ageassurance.rs @@ -1117,37 +1117,37 @@ pub mod config_region_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rules; type CountryCode; + type Rules; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rules = Unset; type CountryCode = Unset; - } - ///State transition - sets the `rules` field to Set - pub struct SetRules(PhantomData S>); - impl sealed::Sealed for SetRules {} - impl State for SetRules { - type Rules = Set; - type CountryCode = S::CountryCode; + type Rules = Unset; } ///State transition - sets the `country_code` field to Set pub struct SetCountryCode(PhantomData S>); impl sealed::Sealed for SetCountryCode {} impl State for SetCountryCode { - type Rules = S::Rules; type CountryCode = Set; + type Rules = S::Rules; + } + ///State transition - sets the `rules` field to Set + pub struct SetRules(PhantomData S>); + impl sealed::Sealed for SetRules {} + impl State for SetRules { + type CountryCode = S::CountryCode; + type Rules = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rules` field - pub struct rules(()); ///Marker type for the `country_code` field pub struct country_code(()); + ///Marker type for the `rules` field + pub struct rules(()); } } @@ -1240,8 +1240,8 @@ where impl<'a, S> ConfigRegionBuilder<'a, S> where S: config_region_state::State, - S::Rules: config_region_state::IsSet, S::CountryCode: config_region_state::IsSet, + S::Rules: config_region_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegion<'a> { @@ -1506,37 +1506,37 @@ pub mod config_region_rule_if_account_newer_than_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Date; type Access; + type Date; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Date = Unset; type Access = Unset; - } - ///State transition - sets the `date` field to Set - pub struct SetDate(PhantomData S>); - impl sealed::Sealed for SetDate {} - impl State for SetDate { - type Date = Set; - type Access = S::Access; + type Date = Unset; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type Date = S::Date; type Access = Set; + type Date = S::Date; + } + ///State transition - sets the `date` field to Set + pub struct SetDate(PhantomData S>); + impl sealed::Sealed for SetDate {} + impl State for SetDate { + type Access = S::Access; + type Date = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `date` field - pub struct date(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `date` field + pub struct date(()); } } @@ -1626,8 +1626,8 @@ where impl<'a, S> ConfigRegionRuleIfAccountNewerThanBuilder<'a, S> where S: config_region_rule_if_account_newer_than_state::State, - S::Date: config_region_rule_if_account_newer_than_state::IsSet, S::Access: config_region_rule_if_account_newer_than_state::IsSet, + S::Date: config_region_rule_if_account_newer_than_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfAccountNewerThan<'a> { @@ -2476,37 +2476,37 @@ pub mod config_region_rule_if_declared_under_age_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Access; type Age; + type Access; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Access = Unset; type Age = Unset; - } - ///State transition - sets the `access` field to Set - pub struct SetAccess(PhantomData S>); - impl sealed::Sealed for SetAccess {} - impl State for SetAccess { - type Access = Set; - type Age = S::Age; + type Access = Unset; } ///State transition - sets the `age` field to Set pub struct SetAge(PhantomData S>); impl sealed::Sealed for SetAge {} impl State for SetAge { - type Access = S::Access; type Age = Set; + type Access = S::Access; + } + ///State transition - sets the `access` field to Set + pub struct SetAccess(PhantomData S>); + impl sealed::Sealed for SetAccess {} + impl State for SetAccess { + type Age = S::Age; + type Access = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `access` field - pub struct access(()); ///Marker type for the `age` field pub struct age(()); + ///Marker type for the `access` field + pub struct access(()); } } @@ -2596,8 +2596,8 @@ where impl<'a, S> ConfigRegionRuleIfDeclaredUnderAgeBuilder<'a, S> where S: config_region_rule_if_declared_under_age_state::State, - S::Access: config_region_rule_if_declared_under_age_state::IsSet, S::Age: config_region_rule_if_declared_under_age_state::IsSet, + S::Access: config_region_rule_if_declared_under_age_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfDeclaredUnderAge<'a> { @@ -2704,85 +2704,85 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CountryCode; - type AttemptId; type Access; - type CreatedAt; + type AttemptId; type Status; + type CreatedAt; + type CountryCode; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CountryCode = Unset; - type AttemptId = Unset; type Access = Unset; - type CreatedAt = Unset; + type AttemptId = Unset; type Status = Unset; + type CreatedAt = Unset; + type CountryCode = Unset; } - ///State transition - sets the `country_code` field to Set - pub struct SetCountryCode(PhantomData S>); - impl sealed::Sealed for SetCountryCode {} - impl State for SetCountryCode { - type CountryCode = Set; + ///State transition - sets the `access` field to Set + pub struct SetAccess(PhantomData S>); + impl sealed::Sealed for SetAccess {} + impl State for SetAccess { + type Access = Set; type AttemptId = S::AttemptId; - type Access = S::Access; - type CreatedAt = S::CreatedAt; type Status = S::Status; + type CreatedAt = S::CreatedAt; + type CountryCode = S::CountryCode; } ///State transition - sets the `attempt_id` field to Set pub struct SetAttemptId(PhantomData S>); impl sealed::Sealed for SetAttemptId {} impl State for SetAttemptId { - type CountryCode = S::CountryCode; - type AttemptId = Set; type Access = S::Access; - type CreatedAt = S::CreatedAt; + type AttemptId = Set; type Status = S::Status; - } - ///State transition - sets the `access` field to Set - pub struct SetAccess(PhantomData S>); - impl sealed::Sealed for SetAccess {} - impl State for SetAccess { + type CreatedAt = S::CreatedAt; type CountryCode = S::CountryCode; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type Access = S::Access; type AttemptId = S::AttemptId; - type Access = Set; + type Status = Set; type CreatedAt = S::CreatedAt; - type Status = S::Status; + type CountryCode = S::CountryCode; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type CountryCode = S::CountryCode; - type AttemptId = S::AttemptId; type Access = S::Access; - type CreatedAt = Set; + type AttemptId = S::AttemptId; type Status = S::Status; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { + type CreatedAt = Set; type CountryCode = S::CountryCode; - type AttemptId = S::AttemptId; + } + ///State transition - sets the `country_code` field to Set + pub struct SetCountryCode(PhantomData S>); + impl sealed::Sealed for SetCountryCode {} + impl State for SetCountryCode { type Access = S::Access; + type AttemptId = S::AttemptId; + type Status = S::Status; type CreatedAt = S::CreatedAt; - type Status = Set; + type CountryCode = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `country_code` field - pub struct country_code(()); - ///Marker type for the `attempt_id` field - pub struct attempt_id(()); ///Marker type for the `access` field pub struct access(()); - ///Marker type for the `created_at` field - pub struct created_at(()); + ///Marker type for the `attempt_id` field + pub struct attempt_id(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `country_code` field + pub struct country_code(()); } } @@ -3038,11 +3038,11 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, - S::CountryCode: event_state::IsSet, - S::AttemptId: event_state::IsSet, S::Access: event_state::IsSet, - S::CreatedAt: event_state::IsSet, + S::AttemptId: event_state::IsSet, S::Status: event_state::IsSet, + S::CreatedAt: event_state::IsSet, + S::CountryCode: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { diff --git a/crates/weaver-api/src/app_bsky/bookmark.rs b/crates/weaver-api/src/app_bsky/bookmark.rs index ac81a96..300946d 100644 --- a/crates/weaver-api/src/app_bsky/bookmark.rs +++ b/crates/weaver-api/src/app_bsky/bookmark.rs @@ -281,37 +281,37 @@ pub mod bookmark_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Item; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type Item = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type Item = S::Item; + type Subject = Unset; } ///State transition - sets the `item` field to Set pub struct SetItem(PhantomData S>); impl sealed::Sealed for SetItem {} impl State for SetItem { - type Subject = S::Subject; type Item = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Item = S::Item; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `item` field pub struct item(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -404,8 +404,8 @@ where impl<'a, S> BookmarkViewBuilder<'a, S> where S: bookmark_view_state::State, - S::Subject: bookmark_view_state::IsSet, S::Item: bookmark_view_state::IsSet, + S::Subject: bookmark_view_state::IsSet, { /// Build the final struct pub fn build(self) -> BookmarkView<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed.rs b/crates/weaver-api/src/app_bsky/embed.rs index 803afd8..89519f1 100644 --- a/crates/weaver-api/src/app_bsky/embed.rs +++ b/crates/weaver-api/src/app_bsky/embed.rs @@ -38,37 +38,37 @@ pub mod aspect_ratio_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Width; type Height; + type Width; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Width = Unset; type Height = Unset; - } - ///State transition - sets the `width` field to Set - pub struct SetWidth(PhantomData S>); - impl sealed::Sealed for SetWidth {} - impl State for SetWidth { - type Width = Set; - type Height = S::Height; + type Width = Unset; } ///State transition - sets the `height` field to Set pub struct SetHeight(PhantomData S>); impl sealed::Sealed for SetHeight {} impl State for SetHeight { - type Width = S::Width; type Height = Set; + type Width = S::Width; + } + ///State transition - sets the `width` field to Set + pub struct SetWidth(PhantomData S>); + impl sealed::Sealed for SetWidth {} + impl State for SetWidth { + type Height = S::Height; + type Width = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `width` field - pub struct width(()); ///Marker type for the `height` field pub struct height(()); + ///Marker type for the `width` field + pub struct width(()); } } @@ -138,8 +138,8 @@ where impl<'a, S> AspectRatioBuilder<'a, S> where S: aspect_ratio_state::State, - S::Width: aspect_ratio_state::IsSet, S::Height: aspect_ratio_state::IsSet, + S::Width: aspect_ratio_state::IsSet, { /// Build the final struct pub fn build(self) -> AspectRatio<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/external.rs b/crates/weaver-api/src/app_bsky/embed/external.rs index cc0be95..f4f4e41 100644 --- a/crates/weaver-api/src/app_bsky/embed/external.rs +++ b/crates/weaver-api/src/app_bsky/embed/external.rs @@ -38,51 +38,51 @@ pub mod external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; - type Uri; type Description; + type Uri; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; - type Uri = Unset; type Description = Unset; + type Uri = Unset; + type Title = Unset; } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; + ///State transition - sets the `description` field to Set + pub struct SetDescription(PhantomData S>); + impl sealed::Sealed for SetDescription {} + impl State for SetDescription { + type Description = Set; type Uri = S::Uri; - type Description = S::Description; + type Title = S::Title; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Title = S::Title; - type Uri = Set; type Description = S::Description; - } - ///State transition - sets the `description` field to Set - pub struct SetDescription(PhantomData S>); - impl sealed::Sealed for SetDescription {} - impl State for SetDescription { + type Uri = Set; type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Description = S::Description; type Uri = S::Uri; - type Description = Set; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `description` field pub struct description(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -195,9 +195,9 @@ where impl<'a, S> ExternalBuilder<'a, S> where S: external_state::State, - S::Title: external_state::IsSet, - S::Uri: external_state::IsSet, S::Description: external_state::IsSet, + S::Uri: external_state::IsSet, + S::Title: external_state::IsSet, { /// Build the final struct pub fn build(self) -> External<'a> { @@ -784,51 +784,51 @@ pub mod view_external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Description; type Uri; type Title; - type Description; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Description = Unset; type Uri = Unset; type Title = Unset; - type Description = Unset; + } + ///State transition - sets the `description` field to Set + pub struct SetDescription(PhantomData S>); + impl sealed::Sealed for SetDescription {} + impl State for SetDescription { + type Description = Set; + type Uri = S::Uri; + type Title = S::Title; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { + type Description = S::Description; type Uri = Set; type Title = S::Title; - type Description = S::Description; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { - type Uri = S::Uri; - type Title = Set; type Description = S::Description; - } - ///State transition - sets the `description` field to Set - pub struct SetDescription(PhantomData S>); - impl sealed::Sealed for SetDescription {} - impl State for SetDescription { type Uri = S::Uri; - type Title = S::Title; - type Description = Set; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `description` field + pub struct description(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `title` field pub struct title(()); - ///Marker type for the `description` field - pub struct description(()); } } @@ -941,9 +941,9 @@ where impl<'a, S> ViewExternalBuilder<'a, S> where S: view_external_state::State, + S::Description: view_external_state::IsSet, S::Uri: view_external_state::IsSet, S::Title: view_external_state::IsSet, - S::Description: view_external_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewExternal<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/images.rs b/crates/weaver-api/src/app_bsky/embed/images.rs index fc4af35..609cd26 100644 --- a/crates/weaver-api/src/app_bsky/embed/images.rs +++ b/crates/weaver-api/src/app_bsky/embed/images.rs @@ -760,49 +760,49 @@ pub mod view_image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Thumb; type Fullsize; + type Thumb; type Alt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Thumb = Unset; type Fullsize = Unset; + type Thumb = Unset; type Alt = Unset; } - ///State transition - sets the `thumb` field to Set - pub struct SetThumb(PhantomData S>); - impl sealed::Sealed for SetThumb {} - impl State for SetThumb { - type Thumb = Set; - type Fullsize = S::Fullsize; - type Alt = S::Alt; - } ///State transition - sets the `fullsize` field to Set pub struct SetFullsize(PhantomData S>); impl sealed::Sealed for SetFullsize {} impl State for SetFullsize { - type Thumb = S::Thumb; type Fullsize = Set; + type Thumb = S::Thumb; + type Alt = S::Alt; + } + ///State transition - sets the `thumb` field to Set + pub struct SetThumb(PhantomData S>); + impl sealed::Sealed for SetThumb {} + impl State for SetThumb { + type Fullsize = S::Fullsize; + type Thumb = Set; type Alt = S::Alt; } ///State transition - sets the `alt` field to Set pub struct SetAlt(PhantomData S>); impl sealed::Sealed for SetAlt {} impl State for SetAlt { - type Thumb = S::Thumb; type Fullsize = S::Fullsize; + type Thumb = S::Thumb; type Alt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `thumb` field - pub struct thumb(()); ///Marker type for the `fullsize` field pub struct fullsize(()); + ///Marker type for the `thumb` field + pub struct thumb(()); ///Marker type for the `alt` field pub struct alt(()); } @@ -917,8 +917,8 @@ where impl<'a, S> ViewImageBuilder<'a, S> where S: view_image_state::State, - S::Thumb: view_image_state::IsSet, S::Fullsize: view_image_state::IsSet, + S::Thumb: view_image_state::IsSet, S::Alt: view_image_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/embed/record.rs b/crates/weaver-api/src/app_bsky/embed/record.rs index 8a755aa..72d98c2 100644 --- a/crates/weaver-api/src/app_bsky/embed/record.rs +++ b/crates/weaver-api/src/app_bsky/embed/record.rs @@ -723,49 +723,49 @@ pub mod view_blocked_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Author; type Uri; + type Author; type Blocked; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Author = Unset; type Uri = Unset; + type Author = Unset; type Blocked = Unset; } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { - type Author = Set; - type Uri = S::Uri; - type Blocked = S::Blocked; - } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Author = S::Author; type Uri = Set; + type Author = S::Author; + type Blocked = S::Blocked; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type Uri = S::Uri; + type Author = Set; type Blocked = S::Blocked; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Author = S::Author; type Uri = S::Uri; + type Author = S::Author; type Blocked = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `author` field - pub struct author(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `author` field + pub struct author(()); ///Marker type for the `blocked` field pub struct blocked(()); } @@ -860,8 +860,8 @@ where impl<'a, S> ViewBlockedBuilder<'a, S> where S: view_blocked_state::State, - S::Author: view_blocked_state::IsSet, S::Uri: view_blocked_state::IsSet, + S::Author: view_blocked_state::IsSet, S::Blocked: view_blocked_state::IsSet, { /// Build the final struct @@ -934,37 +934,37 @@ pub mod view_detached_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Detached; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Detached = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Detached = S::Detached; + type Uri = Unset; } ///State transition - sets the `detached` field to Set pub struct SetDetached(PhantomData S>); impl sealed::Sealed for SetDetached {} impl State for SetDetached { - type Uri = S::Uri; type Detached = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Detached = S::Detached; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `detached` field pub struct detached(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1037,8 +1037,8 @@ where impl<'a, S> ViewDetachedBuilder<'a, S> where S: view_detached_state::State, - S::Uri: view_detached_state::IsSet, S::Detached: view_detached_state::IsSet, + S::Uri: view_detached_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewDetached<'a> { @@ -1303,85 +1303,85 @@ pub mod view_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Value; type Uri; - type Author; type IndexedAt; + type Author; type Cid; - type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Value = Unset; type Uri = Unset; - type Author = Unset; type IndexedAt = Unset; + type Author = Unset; type Cid = Unset; - type Value = Unset; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Value = Set; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Author = S::Author; + type Cid = S::Cid; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Uri = Set; - type Author = S::Author; - type IndexedAt = S::IndexedAt; - type Cid = S::Cid; type Value = S::Value; - } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { - type Uri = S::Uri; - type Author = Set; + type Uri = Set; type IndexedAt = S::IndexedAt; + type Author = S::Author; type Cid = S::Cid; - type Value = S::Value; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { + type Value = S::Value; type Uri = S::Uri; - type Author = S::Author; type IndexedAt = Set; + type Author = S::Author; type Cid = S::Cid; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { type Value = S::Value; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Author = Set; + type Cid = S::Cid; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; - type Author = S::Author; - type IndexedAt = S::IndexedAt; - type Cid = Set; type Value = S::Value; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { type Uri = S::Uri; - type Author = S::Author; type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type Value = Set; + type Author = S::Author; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `author` field - pub struct author(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `author` field + pub struct author(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `value` field - pub struct value(()); } } @@ -1619,11 +1619,11 @@ where impl<'a, S> ViewRecordBuilder<'a, S> where S: view_record_state::State, + S::Value: view_record_state::IsSet, S::Uri: view_record_state::IsSet, - S::Author: view_record_state::IsSet, S::IndexedAt: view_record_state::IsSet, + S::Author: view_record_state::IsSet, S::Cid: view_record_state::IsSet, - S::Value: view_record_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewRecord<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/record_with_media.rs b/crates/weaver-api/src/app_bsky/embed/record_with_media.rs index 8e4fcac..e530d9e 100644 --- a/crates/weaver-api/src/app_bsky/embed/record_with_media.rs +++ b/crates/weaver-api/src/app_bsky/embed/record_with_media.rs @@ -33,37 +33,37 @@ pub mod record_with_media_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Media; type Record; + type Media; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Media = Unset; type Record = Unset; - } - ///State transition - sets the `media` field to Set - pub struct SetMedia(PhantomData S>); - impl sealed::Sealed for SetMedia {} - impl State for SetMedia { - type Media = Set; - type Record = S::Record; + type Media = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Media = S::Media; type Record = Set; + type Media = S::Media; + } + ///State transition - sets the `media` field to Set + pub struct SetMedia(PhantomData S>); + impl sealed::Sealed for SetMedia {} + impl State for SetMedia { + type Record = S::Record; + type Media = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `media` field - pub struct media(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> RecordWithMediaBuilder<'a, S> where S: record_with_media_state::State, - S::Media: record_with_media_state::IsSet, S::Record: record_with_media_state::IsSet, + S::Media: record_with_media_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordWithMedia<'a> { @@ -322,37 +322,37 @@ pub mod view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Media; type Record; + type Media; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Media = Unset; type Record = Unset; - } - ///State transition - sets the `media` field to Set - pub struct SetMedia(PhantomData S>); - impl sealed::Sealed for SetMedia {} - impl State for SetMedia { - type Media = Set; - type Record = S::Record; + type Media = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Media = S::Media; type Record = Set; + type Media = S::Media; + } + ///State transition - sets the `media` field to Set + pub struct SetMedia(PhantomData S>); + impl sealed::Sealed for SetMedia {} + impl State for SetMedia { + type Record = S::Record; + type Media = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `media` field - pub struct media(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); } } @@ -425,8 +425,8 @@ where impl<'a, S> ViewBuilder<'a, S> where S: view_state::State, - S::Media: view_state::IsSet, S::Record: view_state::IsSet, + S::Media: view_state::IsSet, { /// Build the final struct pub fn build(self) -> View<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/video.rs b/crates/weaver-api/src/app_bsky/embed/video.rs index 03e866e..d214654 100644 --- a/crates/weaver-api/src/app_bsky/embed/video.rs +++ b/crates/weaver-api/src/app_bsky/embed/video.rs @@ -32,37 +32,37 @@ pub mod caption_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type File; type Lang; + type File; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type File = Unset; type Lang = Unset; - } - ///State transition - sets the `file` field to Set - pub struct SetFile(PhantomData S>); - impl sealed::Sealed for SetFile {} - impl State for SetFile { - type File = Set; - type Lang = S::Lang; + type File = Unset; } ///State transition - sets the `lang` field to Set pub struct SetLang(PhantomData S>); impl sealed::Sealed for SetLang {} impl State for SetLang { - type File = S::File; type Lang = Set; + type File = S::File; + } + ///State transition - sets the `file` field to Set + pub struct SetFile(PhantomData S>); + impl sealed::Sealed for SetFile {} + impl State for SetFile { + type Lang = S::Lang; + type File = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `file` field - pub struct file(()); ///Marker type for the `lang` field pub struct lang(()); + ///Marker type for the `file` field + pub struct file(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> CaptionBuilder<'a, S> where S: caption_state::State, - S::File: caption_state::IsSet, S::Lang: caption_state::IsSet, + S::File: caption_state::IsSet, { /// Build the final struct pub fn build(self) -> Caption<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed.rs b/crates/weaver-api/src/app_bsky/feed.rs index a48c379..1e650df 100644 --- a/crates/weaver-api/src/app_bsky/feed.rs +++ b/crates/weaver-api/src/app_bsky/feed.rs @@ -1609,51 +1609,51 @@ pub mod blocked_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Blocked; - type Uri; type Author; + type Uri; + type Blocked; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Blocked = Unset; - type Uri = Unset; type Author = Unset; + type Uri = Unset; + type Blocked = Unset; } - ///State transition - sets the `blocked` field to Set - pub struct SetBlocked(PhantomData S>); - impl sealed::Sealed for SetBlocked {} - impl State for SetBlocked { - type Blocked = Set; + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type Author = Set; type Uri = S::Uri; - type Author = S::Author; + type Blocked = S::Blocked; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Blocked = S::Blocked; - type Uri = Set; type Author = S::Author; - } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { + type Uri = Set; type Blocked = S::Blocked; + } + ///State transition - sets the `blocked` field to Set + pub struct SetBlocked(PhantomData S>); + impl sealed::Sealed for SetBlocked {} + impl State for SetBlocked { + type Author = S::Author; type Uri = S::Uri; - type Author = Set; + type Blocked = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `blocked` field - pub struct blocked(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `blocked` field + pub struct blocked(()); } } @@ -1746,9 +1746,9 @@ where impl<'a, S> BlockedPostBuilder<'a, S> where S: blocked_post_state::State, - S::Blocked: blocked_post_state::IsSet, - S::Uri: blocked_post_state::IsSet, S::Author: blocked_post_state::IsSet, + S::Uri: blocked_post_state::IsSet, + S::Blocked: blocked_post_state::IsSet, { /// Build the final struct pub fn build(self) -> BlockedPost<'a> { @@ -2234,105 +2234,105 @@ pub mod generator_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Uri; type Creator; type DisplayName; type Cid; - type Did; type IndexedAt; - type Uri; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Uri = Unset; type Creator = Unset; type DisplayName = Unset; type Cid = Unset; - type Did = Unset; type IndexedAt = Unset; - type Uri = Unset; + type Did = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Creator = S::Creator; + type DisplayName = S::DisplayName; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Did = S::Did; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { + type Uri = S::Uri; type Creator = Set; type DisplayName = S::DisplayName; type Cid = S::Cid; - type Did = S::Did; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; + type Did = S::Did; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { + type Uri = S::Uri; type Creator = S::Creator; type DisplayName = Set; type Cid = S::Cid; - type Did = S::Did; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; + type Did = S::Did; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Creator = S::Creator; - type DisplayName = S::DisplayName; - type Cid = Set; - type Did = S::Did; - type IndexedAt = S::IndexedAt; type Uri = S::Uri; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { type Creator = S::Creator; type DisplayName = S::DisplayName; - type Cid = S::Cid; - type Did = Set; + type Cid = Set; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; + type Did = S::Did; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { + type Uri = S::Uri; type Creator = S::Creator; type DisplayName = S::DisplayName; type Cid = S::Cid; - type Did = S::Did; type IndexedAt = Set; - type Uri = S::Uri; + type Did = S::Did; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Uri = S::Uri; type Creator = S::Creator; type DisplayName = S::DisplayName; type Cid = S::Cid; - type Did = S::Did; type IndexedAt = S::IndexedAt; - type Uri = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `creator` field pub struct creator(()); ///Marker type for the `display_name` field pub struct display_name(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -2648,12 +2648,12 @@ impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { impl<'a, S> GeneratorViewBuilder<'a, S> where S: generator_view_state::State, + S::Uri: generator_view_state::IsSet, S::Creator: generator_view_state::IsSet, S::DisplayName: generator_view_state::IsSet, S::Cid: generator_view_state::IsSet, - S::Did: generator_view_state::IsSet, S::IndexedAt: generator_view_state::IsSet, - S::Uri: generator_view_state::IsSet, + S::Did: generator_view_state::IsSet, { /// Build the final struct pub fn build(self) -> GeneratorView<'a> { @@ -3235,37 +3235,37 @@ pub mod not_found_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type NotFound; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type NotFound = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type NotFound = S::NotFound; + type Uri = Unset; } ///State transition - sets the `not_found` field to Set pub struct SetNotFound(PhantomData S>); impl sealed::Sealed for SetNotFound {} impl State for SetNotFound { - type Uri = S::Uri; type NotFound = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type NotFound = S::NotFound; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `not_found` field pub struct not_found(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -3338,8 +3338,8 @@ where impl<'a, S> NotFoundPostBuilder<'a, S> where S: not_found_post_state::State, - S::Uri: not_found_post_state::IsSet, S::NotFound: not_found_post_state::IsSet, + S::Uri: not_found_post_state::IsSet, { /// Build the final struct pub fn build(self) -> NotFoundPost<'a> { @@ -3441,85 +3441,85 @@ pub mod post_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; - type Cid; type Uri; - type Author; + type Record; type IndexedAt; + type Author; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; - type Cid = Unset; type Uri = Unset; - type Author = Unset; + type Record = Unset; type IndexedAt = Unset; + type Author = Unset; + type Cid = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Record = S::Record; + type IndexedAt = S::IndexedAt; + type Author = S::Author; + type Cid = S::Cid; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Record = Set; - type Cid = S::Cid; type Uri = S::Uri; - type Author = S::Author; + type Record = Set; type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Record = S::Record; - type Cid = Set; - type Uri = S::Uri; type Author = S::Author; - type IndexedAt = S::IndexedAt; + type Cid = S::Cid; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Uri = S::Uri; type Record = S::Record; - type Cid = S::Cid; - type Uri = Set; + type IndexedAt = Set; type Author = S::Author; - type IndexedAt = S::IndexedAt; + type Cid = S::Cid; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Record = S::Record; - type Cid = S::Cid; type Uri = S::Uri; - type Author = Set; - type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type Record = S::Record; + type IndexedAt = S::IndexedAt; + type Author = Set; type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Uri = S::Uri; + type Record = S::Record; + type IndexedAt = S::IndexedAt; type Author = S::Author; - type IndexedAt = Set; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `author` field - pub struct author(()); + ///Marker type for the `record` field + pub struct record(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -3832,11 +3832,11 @@ impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { impl<'a, S> PostViewBuilder<'a, S> where S: post_view_state::State, - S::Record: post_view_state::IsSet, - S::Cid: post_view_state::IsSet, S::Uri: post_view_state::IsSet, - S::Author: post_view_state::IsSet, + S::Record: post_view_state::IsSet, S::IndexedAt: post_view_state::IsSet, + S::Author: post_view_state::IsSet, + S::Cid: post_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PostView<'a> { @@ -3993,37 +3993,37 @@ pub mod reason_repost_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type By; type IndexedAt; + type By; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type By = Unset; type IndexedAt = Unset; - } - ///State transition - sets the `by` field to Set - pub struct SetBy(PhantomData S>); - impl sealed::Sealed for SetBy {} - impl State for SetBy { - type By = Set; - type IndexedAt = S::IndexedAt; + type By = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type By = S::By; type IndexedAt = Set; + type By = S::By; + } + ///State transition - sets the `by` field to Set + pub struct SetBy(PhantomData S>); + impl sealed::Sealed for SetBy {} + impl State for SetBy { + type IndexedAt = S::IndexedAt; + type By = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `by` field - pub struct by(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `by` field + pub struct by(()); } } @@ -4136,8 +4136,8 @@ impl<'a, S: reason_repost_state::State> ReasonRepostBuilder<'a, S> { impl<'a, S> ReasonRepostBuilder<'a, S> where S: reason_repost_state::State, - S::By: reason_repost_state::IsSet, S::IndexedAt: reason_repost_state::IsSet, + S::By: reason_repost_state::IsSet, { /// Build the final struct pub fn build(self) -> ReasonRepost<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/generator.rs b/crates/weaver-api/src/app_bsky/feed/generator.rs index b8927e3..ff24181 100644 --- a/crates/weaver-api/src/app_bsky/feed/generator.rs +++ b/crates/weaver-api/src/app_bsky/feed/generator.rs @@ -56,51 +56,51 @@ pub mod generator_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; - type DisplayName; type CreatedAt; + type DisplayName; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; - type DisplayName = Unset; type CreatedAt = Unset; + type DisplayName = Unset; + type Did = Unset; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; type DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; + type Did = S::Did; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Did = S::Did; - type DisplayName = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + type DisplayName = Set; type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type CreatedAt = S::CreatedAt; type DisplayName = S::DisplayName; - type CreatedAt = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `display_name` field - pub struct display_name(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `display_name` field + pub struct display_name(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -317,9 +317,9 @@ impl<'a, S: generator_state::State> GeneratorBuilder<'a, S> { impl<'a, S> GeneratorBuilder<'a, S> where S: generator_state::State, - S::Did: generator_state::IsSet, - S::DisplayName: generator_state::IsSet, S::CreatedAt: generator_state::IsSet, + S::DisplayName: generator_state::IsSet, + S::Did: generator_state::IsSet, { /// Build the final struct pub fn build(self) -> Generator<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/get_likes.rs b/crates/weaver-api/src/app_bsky/feed/get_likes.rs index 19b72bf..eaa643f 100644 --- a/crates/weaver-api/src/app_bsky/feed/get_likes.rs +++ b/crates/weaver-api/src/app_bsky/feed/get_likes.rs @@ -33,51 +33,51 @@ pub mod like_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedAt; type Actor; type IndexedAt; - type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type CreatedAt = Unset; type Actor = Unset; type IndexedAt = Unset; - type CreatedAt = Unset; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Actor = S::Actor; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData S>); impl sealed::Sealed for SetActor {} impl State for SetActor { + type CreatedAt = S::CreatedAt; type Actor = Set; type IndexedAt = S::IndexedAt; - type CreatedAt = S::CreatedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Actor = S::Actor; - type IndexedAt = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type Actor = S::Actor; - type IndexedAt = S::IndexedAt; - type CreatedAt = Set; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `actor` field pub struct actor(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `created_at` field - pub struct created_at(()); } } @@ -170,9 +170,9 @@ where impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, + S::CreatedAt: like_state::IsSet, S::Actor: like_state::IsSet, S::IndexedAt: like_state::IsSet, - S::CreatedAt: like_state::IsSet, { /// Build the final struct pub fn build(self) -> Like<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/like.rs b/crates/weaver-api/src/app_bsky/feed/like.rs index 0f43928..a326a4b 100644 --- a/crates/weaver-api/src/app_bsky/feed/like.rs +++ b/crates/weaver-api/src/app_bsky/feed/like.rs @@ -36,37 +36,37 @@ pub mod like_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = S::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = S::CreatedAt; type Subject = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -159,8 +159,8 @@ impl<'a, S: like_state::State> LikeBuilder<'a, S> { impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, - S::CreatedAt: like_state::IsSet, S::Subject: like_state::IsSet, + S::CreatedAt: like_state::IsSet, { /// Build the final struct pub fn build(self) -> Like<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/post.rs b/crates/weaver-api/src/app_bsky/feed/post.rs index 87de036..1b535e7 100644 --- a/crates/weaver-api/src/app_bsky/feed/post.rs +++ b/crates/weaver-api/src/app_bsky/feed/post.rs @@ -1097,37 +1097,37 @@ pub mod reply_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Parent; type Root; + type Parent; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Parent = Unset; type Root = Unset; - } - ///State transition - sets the `parent` field to Set - pub struct SetParent(PhantomData S>); - impl sealed::Sealed for SetParent {} - impl State for SetParent { - type Parent = Set; - type Root = S::Root; + type Parent = Unset; } ///State transition - sets the `root` field to Set pub struct SetRoot(PhantomData S>); impl sealed::Sealed for SetRoot {} impl State for SetRoot { - type Parent = S::Parent; type Root = Set; + type Parent = S::Parent; + } + ///State transition - sets the `parent` field to Set + pub struct SetParent(PhantomData S>); + impl sealed::Sealed for SetParent {} + impl State for SetParent { + type Root = S::Root; + type Parent = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `parent` field - pub struct parent(()); ///Marker type for the `root` field pub struct root(()); + ///Marker type for the `parent` field + pub struct parent(()); } } @@ -1200,8 +1200,8 @@ where impl<'a, S> ReplyRefBuilder<'a, S> where S: reply_ref_state::State, - S::Parent: reply_ref_state::IsSet, S::Root: reply_ref_state::IsSet, + S::Parent: reply_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> ReplyRef<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/postgate.rs b/crates/weaver-api/src/app_bsky/feed/postgate.rs index 8516296..3d1d3c7 100644 --- a/crates/weaver-api/src/app_bsky/feed/postgate.rs +++ b/crates/weaver-api/src/app_bsky/feed/postgate.rs @@ -224,37 +224,37 @@ pub mod postgate_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Post; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Post = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Post = S::Post; + type CreatedAt = Unset; } ///State transition - sets the `post` field to Set pub struct SetPost(PhantomData S>); impl sealed::Sealed for SetPost {} impl State for SetPost { - type CreatedAt = S::CreatedAt; type Post = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Post = S::Post; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `post` field pub struct post(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -367,8 +367,8 @@ where impl<'a, S> PostgateBuilder<'a, S> where S: postgate_state::State, - S::CreatedAt: postgate_state::IsSet, S::Post: postgate_state::IsSet, + S::CreatedAt: postgate_state::IsSet, { /// Build the final struct pub fn build(self) -> Postgate<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph.rs b/crates/weaver-api/src/app_bsky/graph.rs index 16183c3..6d2133d 100644 --- a/crates/weaver-api/src/app_bsky/graph.rs +++ b/crates/weaver-api/src/app_bsky/graph.rs @@ -82,37 +82,37 @@ pub mod list_item_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Uri; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type Uri = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type Uri = S::Uri; + type Subject = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Subject = S::Subject; type Uri = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Uri = S::Uri; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -185,8 +185,8 @@ where impl<'a, S> ListItemViewBuilder<'a, S> where S: list_item_view_state::State, - S::Subject: list_item_view_state::IsSet, S::Uri: list_item_view_state::IsSet, + S::Subject: list_item_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListItemView<'a> { @@ -1284,104 +1284,104 @@ pub mod list_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type IndexedAt; type Creator; - type Cid; - type Purpose; type Name; + type Purpose; + type IndexedAt; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; - type IndexedAt = Unset; type Creator = Unset; - type Cid = Unset; - type Purpose = Unset; type Name = Unset; + type Purpose = Unset; + type IndexedAt = Unset; + type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; - type IndexedAt = S::IndexedAt; type Creator = S::Creator; - type Cid = S::Cid; - type Purpose = S::Purpose; type Name = S::Name; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Uri = S::Uri; - type IndexedAt = Set; - type Creator = S::Creator; - type Cid = S::Cid; type Purpose = S::Purpose; - type Name = S::Name; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { type Uri = S::Uri; - type IndexedAt = S::IndexedAt; type Creator = Set; - type Cid = S::Cid; - type Purpose = S::Purpose; type Name = S::Name; + type Purpose = S::Purpose; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { type Uri = S::Uri; - type IndexedAt = S::IndexedAt; type Creator = S::Creator; - type Cid = Set; + type Name = Set; type Purpose = S::Purpose; - type Name = S::Name; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; } ///State transition - sets the `purpose` field to Set pub struct SetPurpose(PhantomData S>); impl sealed::Sealed for SetPurpose {} impl State for SetPurpose { type Uri = S::Uri; - type IndexedAt = S::IndexedAt; type Creator = S::Creator; - type Cid = S::Cid; - type Purpose = Set; type Name = S::Name; + type Purpose = Set; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { type Uri = S::Uri; - type IndexedAt = S::IndexedAt; type Creator = S::Creator; + type Name = S::Name; + type Purpose = S::Purpose; + type IndexedAt = Set; type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = S::Uri; + type Creator = S::Creator; + type Name = S::Name; type Purpose = S::Purpose; - type Name = Set; + type IndexedAt = S::IndexedAt; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `purpose` field - pub struct purpose(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `purpose` field + pub struct purpose(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1662,11 +1662,11 @@ impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::Uri: list_view_state::IsSet, - S::IndexedAt: list_view_state::IsSet, S::Creator: list_view_state::IsSet, - S::Cid: list_view_state::IsSet, - S::Purpose: list_view_state::IsSet, S::Name: list_view_state::IsSet, + S::Purpose: list_view_state::IsSet, + S::IndexedAt: list_view_state::IsSet, + S::Cid: list_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListView<'a> { @@ -1841,67 +1841,67 @@ pub mod list_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; + type Purpose; type Name; type Uri; - type Purpose; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; + type Purpose = Unset; type Name = Unset; type Uri = Unset; - type Purpose = Unset; + type Cid = Unset; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Purpose = Set; type Name = S::Name; type Uri = S::Uri; - type Purpose = S::Purpose; + type Cid = S::Cid; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Cid = S::Cid; + type Purpose = S::Purpose; type Name = Set; type Uri = S::Uri; - type Purpose = S::Purpose; + type Cid = S::Cid; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; + type Purpose = S::Purpose; type Name = S::Name; type Uri = Set; - type Purpose = S::Purpose; - } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData S>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Purpose = S::Purpose; type Name = S::Name; type Uri = S::Uri; - type Purpose = Set; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `purpose` field + pub struct purpose(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `purpose` field - pub struct purpose(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -2118,10 +2118,10 @@ impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> { impl<'a, S> ListViewBasicBuilder<'a, S> where S: list_view_basic_state::State, - S::Cid: list_view_basic_state::IsSet, + S::Purpose: list_view_basic_state::IsSet, S::Name: list_view_basic_state::IsSet, S::Uri: list_view_basic_state::IsSet, - S::Purpose: list_view_basic_state::IsSet, + S::Cid: list_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> ListViewBasic<'a> { @@ -2298,37 +2298,37 @@ pub mod not_found_actor_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type NotFound; type Actor; + type NotFound; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type NotFound = Unset; type Actor = Unset; - } - ///State transition - sets the `not_found` field to Set - pub struct SetNotFound(PhantomData S>); - impl sealed::Sealed for SetNotFound {} - impl State for SetNotFound { - type NotFound = Set; - type Actor = S::Actor; + type NotFound = Unset; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData S>); impl sealed::Sealed for SetActor {} impl State for SetActor { - type NotFound = S::NotFound; type Actor = Set; + type NotFound = S::NotFound; + } + ///State transition - sets the `not_found` field to Set + pub struct SetNotFound(PhantomData S>); + impl sealed::Sealed for SetNotFound {} + impl State for SetNotFound { + type Actor = S::Actor; + type NotFound = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `not_found` field - pub struct not_found(()); ///Marker type for the `actor` field pub struct actor(()); + ///Marker type for the `not_found` field + pub struct not_found(()); } } @@ -2401,8 +2401,8 @@ where impl<'a, S> NotFoundActorBuilder<'a, S> where S: not_found_actor_state::State, - S::NotFound: not_found_actor_state::IsSet, S::Actor: not_found_actor_state::IsSet, + S::NotFound: not_found_actor_state::IsSet, { /// Build the final struct pub fn build(self) -> NotFoundActor<'a> { @@ -2706,9 +2706,9 @@ pub mod starter_pack_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Creator; + type Cid; type IndexedAt; type Uri; - type Cid; type Record; } /// Empty state - all required fields are unset @@ -2716,9 +2716,9 @@ pub mod starter_pack_view_state { impl sealed::Sealed for Empty {} impl State for Empty { type Creator = Unset; + type Cid = Unset; type IndexedAt = Unset; type Uri = Unset; - type Cid = Unset; type Record = Unset; } ///State transition - sets the `creator` field to Set @@ -2726,9 +2726,19 @@ pub mod starter_pack_view_state { impl sealed::Sealed for SetCreator {} impl State for SetCreator { type Creator = Set; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Record = S::Record; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Creator = S::Creator; + type Cid = Set; type IndexedAt = S::IndexedAt; type Uri = S::Uri; - type Cid = S::Cid; type Record = S::Record; } ///State transition - sets the `indexed_at` field to Set @@ -2736,9 +2746,9 @@ pub mod starter_pack_view_state { impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Creator = S::Creator; + type Cid = S::Cid; type IndexedAt = Set; type Uri = S::Uri; - type Cid = S::Cid; type Record = S::Record; } ///State transition - sets the `uri` field to Set @@ -2746,19 +2756,9 @@ pub mod starter_pack_view_state { impl sealed::Sealed for SetUri {} impl State for SetUri { type Creator = S::Creator; - type IndexedAt = S::IndexedAt; - type Uri = Set; type Cid = S::Cid; - type Record = S::Record; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Creator = S::Creator; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - type Cid = Set; + type Uri = Set; type Record = S::Record; } ///State transition - sets the `record` field to Set @@ -2766,9 +2766,9 @@ pub mod starter_pack_view_state { impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Creator = S::Creator; + type Cid = S::Cid; type IndexedAt = S::IndexedAt; type Uri = S::Uri; - type Cid = S::Cid; type Record = Set; } /// Marker types for field names @@ -2776,12 +2776,12 @@ pub mod starter_pack_view_state { pub mod members { ///Marker type for the `creator` field pub struct creator(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `record` field pub struct record(()); } @@ -3037,9 +3037,9 @@ impl<'a, S> StarterPackViewBuilder<'a, S> where S: starter_pack_view_state::State, S::Creator: starter_pack_view_state::IsSet, + S::Cid: starter_pack_view_state::IsSet, S::IndexedAt: starter_pack_view_state::IsSet, S::Uri: starter_pack_view_state::IsSet, - S::Cid: starter_pack_view_state::IsSet, S::Record: starter_pack_view_state::IsSet, { /// Build the final struct @@ -3190,84 +3190,84 @@ pub mod starter_pack_view_basic_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Creator; - type IndexedAt; type Record; type Uri; type Cid; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Creator = Unset; - type IndexedAt = Unset; type Record = Unset; type Uri = Unset; type Cid = Unset; + type IndexedAt = Unset; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { type Creator = Set; - type IndexedAt = S::IndexedAt; - type Record = S::Record; - type Uri = S::Uri; - type Cid = S::Cid; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Creator = S::Creator; - type IndexedAt = Set; type Record = S::Record; type Uri = S::Uri; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Creator = S::Creator; - type IndexedAt = S::IndexedAt; type Record = Set; type Uri = S::Uri; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Creator = S::Creator; - type IndexedAt = S::IndexedAt; type Record = S::Record; type Uri = Set; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Creator = S::Creator; - type IndexedAt = S::IndexedAt; type Record = S::Record; type Uri = S::Uri; type Cid = Set; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Creator = S::Creator; + type Record = S::Record; + type Uri = S::Uri; + type Cid = S::Cid; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `record` field pub struct record(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -3479,10 +3479,10 @@ impl<'a, S> StarterPackViewBasicBuilder<'a, S> where S: starter_pack_view_basic_state::State, S::Creator: starter_pack_view_basic_state::IsSet, - S::IndexedAt: starter_pack_view_basic_state::IsSet, S::Record: starter_pack_view_basic_state::IsSet, S::Uri: starter_pack_view_basic_state::IsSet, S::Cid: starter_pack_view_basic_state::IsSet, + S::IndexedAt: starter_pack_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> StarterPackViewBasic<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/follow.rs b/crates/weaver-api/src/app_bsky/graph/follow.rs index c145fac..648570c 100644 --- a/crates/weaver-api/src/app_bsky/graph/follow.rs +++ b/crates/weaver-api/src/app_bsky/graph/follow.rs @@ -36,37 +36,37 @@ pub mod follow_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = S::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = S::CreatedAt; type Subject = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -159,8 +159,8 @@ impl<'a, S: follow_state::State> FollowBuilder<'a, S> { impl<'a, S> FollowBuilder<'a, S> where S: follow_state::State, - S::CreatedAt: follow_state::IsSet, S::Subject: follow_state::IsSet, + S::CreatedAt: follow_state::IsSet, { /// Build the final struct pub fn build(self) -> Follow<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/list.rs b/crates/weaver-api/src/app_bsky/graph/list.rs index 53f4a3a..1c7816d 100644 --- a/crates/weaver-api/src/app_bsky/graph/list.rs +++ b/crates/weaver-api/src/app_bsky/graph/list.rs @@ -51,51 +51,51 @@ pub mod list_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Name; type Purpose; type CreatedAt; - type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Name = Unset; type Purpose = Unset; type CreatedAt = Unset; - type Name = Unset; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Name = Set; + type Purpose = S::Purpose; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `purpose` field to Set pub struct SetPurpose(PhantomData S>); impl sealed::Sealed for SetPurpose {} impl State for SetPurpose { + type Name = S::Name; type Purpose = Set; type CreatedAt = S::CreatedAt; - type Name = S::Name; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Purpose = S::Purpose; - type CreatedAt = Set; type Name = S::Name; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { type Purpose = S::Purpose; - type CreatedAt = S::CreatedAt; - type Name = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `name` field + pub struct name(()); ///Marker type for the `purpose` field pub struct purpose(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `name` field - pub struct name(()); } } @@ -268,9 +268,9 @@ where impl<'a, S> ListBuilder<'a, S> where S: list_state::State, + S::Name: list_state::IsSet, S::Purpose: list_state::IsSet, S::CreatedAt: list_state::IsSet, - S::Name: list_state::IsSet, { /// Build the final struct pub fn build(self) -> List<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/listblock.rs b/crates/weaver-api/src/app_bsky/graph/listblock.rs index 84dfe12..1faa447 100644 --- a/crates/weaver-api/src/app_bsky/graph/listblock.rs +++ b/crates/weaver-api/src/app_bsky/graph/listblock.rs @@ -34,37 +34,37 @@ pub mod listblock_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type CreatedAt; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type CreatedAt = S::CreatedAt; + type Subject = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Subject = S::Subject; type CreatedAt = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type CreatedAt = S::CreatedAt; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> ListblockBuilder<'a, S> where S: listblock_state::State, - S::Subject: listblock_state::IsSet, S::CreatedAt: listblock_state::IsSet, + S::Subject: listblock_state::IsSet, { /// Build the final struct pub fn build(self) -> Listblock<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/listitem.rs b/crates/weaver-api/src/app_bsky/graph/listitem.rs index b54c6f8..861afa5 100644 --- a/crates/weaver-api/src/app_bsky/graph/listitem.rs +++ b/crates/weaver-api/src/app_bsky/graph/listitem.rs @@ -37,51 +37,51 @@ pub mod listitem_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Subject; type CreatedAt; type List; - type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Subject = Unset; type CreatedAt = Unset; type List = Unset; - type Subject = Unset; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Subject = Set; + type CreatedAt = S::CreatedAt; + type List = S::List; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { + type Subject = S::Subject; type CreatedAt = Set; type List = S::List; - type Subject = S::Subject; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData S>); impl sealed::Sealed for SetList {} impl State for SetList { - type CreatedAt = S::CreatedAt; - type List = Set; type Subject = S::Subject; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { type CreatedAt = S::CreatedAt; - type List = S::List; - type Subject = Set; + type List = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `subject` field + pub struct subject(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `list` field pub struct list(()); - ///Marker type for the `subject` field - pub struct subject(()); } } @@ -174,9 +174,9 @@ where impl<'a, S> ListitemBuilder<'a, S> where S: listitem_state::State, + S::Subject: listitem_state::IsSet, S::CreatedAt: listitem_state::IsSet, S::List: listitem_state::IsSet, - S::Subject: listitem_state::IsSet, { /// Build the final struct pub fn build(self) -> Listitem<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/starterpack.rs b/crates/weaver-api/src/app_bsky/graph/starterpack.rs index 5052ac7..04266cf 100644 --- a/crates/weaver-api/src/app_bsky/graph/starterpack.rs +++ b/crates/weaver-api/src/app_bsky/graph/starterpack.rs @@ -366,51 +366,51 @@ pub mod starterpack_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; - type CreatedAt; type List; + type CreatedAt; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Name = Unset; - type CreatedAt = Unset; type List = Unset; + type CreatedAt = Unset; + type Name = Unset; } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Name = Set; + ///State transition - sets the `list` field to Set + pub struct SetList(PhantomData S>); + impl sealed::Sealed for SetList {} + impl State for SetList { + type List = Set; type CreatedAt = S::CreatedAt; - type List = S::List; + type Name = S::Name; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Name = S::Name; - type CreatedAt = Set; type List = S::List; - } - ///State transition - sets the `list` field to Set - pub struct SetList(PhantomData S>); - impl sealed::Sealed for SetList {} - impl State for SetList { + type CreatedAt = Set; type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type List = S::List; type CreatedAt = S::CreatedAt; - type List = Set; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `name` field - pub struct name(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `list` field pub struct list(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -563,9 +563,9 @@ where impl<'a, S> StarterpackBuilder<'a, S> where S: starterpack_state::State, - S::Name: starterpack_state::IsSet, - S::CreatedAt: starterpack_state::IsSet, S::List: starterpack_state::IsSet, + S::CreatedAt: starterpack_state::IsSet, + S::Name: starterpack_state::IsSet, { /// Build the final struct pub fn build(self) -> Starterpack<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/verification.rs b/crates/weaver-api/src/app_bsky/graph/verification.rs index c6bf270..e77972d 100644 --- a/crates/weaver-api/src/app_bsky/graph/verification.rs +++ b/crates/weaver-api/src/app_bsky/graph/verification.rs @@ -41,67 +41,67 @@ pub mod verification_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Subject; + type CreatedAt; type Handle; type DisplayName; - type CreatedAt; - type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Subject = Unset; + type CreatedAt = Unset; type Handle = Unset; type DisplayName = Unset; - type CreatedAt = Unset; - type Subject = Unset; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Subject = Set; + type CreatedAt = S::CreatedAt; + type Handle = S::Handle; + type DisplayName = S::DisplayName; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; + type Handle = S::Handle; + type DisplayName = S::DisplayName; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { + type Subject = S::Subject; + type CreatedAt = S::CreatedAt; type Handle = Set; type DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; - type Subject = S::Subject; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Handle = S::Handle; - type DisplayName = Set; - type CreatedAt = S::CreatedAt; - type Subject = S::Subject; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Handle = S::Handle; - type DisplayName = S::DisplayName; - type CreatedAt = Set; type Subject = S::Subject; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Handle = S::Handle; - type DisplayName = S::DisplayName; type CreatedAt = S::CreatedAt; - type Subject = Set; + type Handle = S::Handle; + type DisplayName = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `handle` field pub struct handle(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `subject` field - pub struct subject(()); } } @@ -214,10 +214,10 @@ where impl<'a, S> VerificationBuilder<'a, S> where S: verification_state::State, + S::Subject: verification_state::IsSet, + S::CreatedAt: verification_state::IsSet, S::Handle: verification_state::IsSet, S::DisplayName: verification_state::IsSet, - S::CreatedAt: verification_state::IsSet, - S::Subject: verification_state::IsSet, { /// Build the final struct pub fn build(self) -> Verification<'a> { diff --git a/crates/weaver-api/src/app_bsky/labeler.rs b/crates/weaver-api/src/app_bsky/labeler.rs index 11f00a4..83459aa 100644 --- a/crates/weaver-api/src/app_bsky/labeler.rs +++ b/crates/weaver-api/src/app_bsky/labeler.rs @@ -632,67 +632,67 @@ pub mod labeler_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type IndexedAt; - type Creator; type Uri; type Cid; + type IndexedAt; + type Creator; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type IndexedAt = Unset; - type Creator = Unset; type Uri = Unset; type Cid = Unset; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type IndexedAt = Set; - type Creator = S::Creator; - type Uri = S::Uri; - type Cid = S::Cid; - } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData S>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { - type IndexedAt = S::IndexedAt; - type Creator = Set; - type Uri = S::Uri; - type Cid = S::Cid; + type IndexedAt = Unset; + type Creator = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type IndexedAt = S::IndexedAt; - type Creator = S::Creator; type Uri = Set; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Creator = S::Creator; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { + type Uri = S::Uri; + type Cid = Set; type IndexedAt = S::IndexedAt; type Creator = S::Creator; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { type Uri = S::Uri; - type Cid = Set; + type Cid = S::Cid; + type IndexedAt = Set; + type Creator = S::Creator; + } + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Uri = S::Uri; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Creator = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `creator` field - pub struct creator(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `creator` field + pub struct creator(()); } } @@ -859,10 +859,10 @@ impl<'a, S: labeler_view_state::State> LabelerViewBuilder<'a, S> { impl<'a, S> LabelerViewBuilder<'a, S> where S: labeler_view_state::State, - S::IndexedAt: labeler_view_state::IsSet, - S::Creator: labeler_view_state::IsSet, S::Uri: labeler_view_state::IsSet, S::Cid: labeler_view_state::IsSet, + S::IndexedAt: labeler_view_state::IsSet, + S::Creator: labeler_view_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerView<'a> { @@ -985,85 +985,85 @@ pub mod labeler_view_detailed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; + type Creator; type Policies; type IndexedAt; + type Uri; type Cid; - type Creator; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; + type Creator = Unset; type Policies = Unset; type IndexedAt = Unset; + type Uri = Unset; type Cid = Unset; - type Creator = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Creator = Set; type Policies = S::Policies; type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Cid = S::Cid; - type Creator = S::Creator; } ///State transition - sets the `policies` field to Set pub struct SetPolicies(PhantomData S>); impl sealed::Sealed for SetPolicies {} impl State for SetPolicies { - type Uri = S::Uri; + type Creator = S::Creator; type Policies = Set; type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Cid = S::Cid; - type Creator = S::Creator; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Uri = S::Uri; + type Creator = S::Creator; type Policies = S::Policies; type IndexedAt = Set; + type Uri = S::Uri; type Cid = S::Cid; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Creator = S::Creator; + type Policies = S::Policies; + type IndexedAt = S::IndexedAt; + type Uri = Set; + type Cid = S::Cid; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; - type Policies = S::Policies; - type IndexedAt = S::IndexedAt; - type Cid = Set; type Creator = S::Creator; - } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData S>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { - type Uri = S::Uri; type Policies = S::Policies; type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type Creator = Set; + type Uri = S::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `creator` field + pub struct creator(()); ///Marker type for the `policies` field pub struct policies(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `creator` field - pub struct creator(()); } } @@ -1322,11 +1322,11 @@ impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, - S::Uri: labeler_view_detailed_state::IsSet, + S::Creator: labeler_view_detailed_state::IsSet, S::Policies: labeler_view_detailed_state::IsSet, S::IndexedAt: labeler_view_detailed_state::IsSet, + S::Uri: labeler_view_detailed_state::IsSet, S::Cid: labeler_view_detailed_state::IsSet, - S::Creator: labeler_view_detailed_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerViewDetailed<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification.rs b/crates/weaver-api/src/app_bsky/notification.rs index d48aed4..8b4ac46 100644 --- a/crates/weaver-api/src/app_bsky/notification.rs +++ b/crates/weaver-api/src/app_bsky/notification.rs @@ -43,37 +43,37 @@ pub mod activity_subscription_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Post; type Reply; + type Post; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Post = Unset; type Reply = Unset; - } - ///State transition - sets the `post` field to Set - pub struct SetPost(PhantomData S>); - impl sealed::Sealed for SetPost {} - impl State for SetPost { - type Post = Set; - type Reply = S::Reply; + type Post = Unset; } ///State transition - sets the `reply` field to Set pub struct SetReply(PhantomData S>); impl sealed::Sealed for SetReply {} impl State for SetReply { - type Post = S::Post; type Reply = Set; + type Post = S::Post; + } + ///State transition - sets the `post` field to Set + pub struct SetPost(PhantomData S>); + impl sealed::Sealed for SetPost {} + impl State for SetPost { + type Reply = S::Reply; + type Post = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `post` field - pub struct post(()); ///Marker type for the `reply` field pub struct reply(()); + ///Marker type for the `post` field + pub struct post(()); } } @@ -143,8 +143,8 @@ where impl<'a, S> ActivitySubscriptionBuilder<'a, S> where S: activity_subscription_state::State, - S::Post: activity_subscription_state::IsSet, S::Reply: activity_subscription_state::IsSet, + S::Post: activity_subscription_state::IsSet, { /// Build the final struct pub fn build(self) -> ActivitySubscription<'a> { @@ -601,37 +601,37 @@ pub mod chat_preference_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Include; type Push; + type Include; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Include = Unset; type Push = Unset; - } - ///State transition - sets the `include` field to Set - pub struct SetInclude(PhantomData S>); - impl sealed::Sealed for SetInclude {} - impl State for SetInclude { - type Include = Set; - type Push = S::Push; + type Include = Unset; } ///State transition - sets the `push` field to Set pub struct SetPush(PhantomData S>); impl sealed::Sealed for SetPush {} impl State for SetPush { - type Include = S::Include; type Push = Set; + type Include = S::Include; + } + ///State transition - sets the `include` field to Set + pub struct SetInclude(PhantomData S>); + impl sealed::Sealed for SetInclude {} + impl State for SetInclude { + type Push = S::Push; + type Include = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `include` field - pub struct include(()); ///Marker type for the `push` field pub struct push(()); + ///Marker type for the `include` field + pub struct include(()); } } @@ -704,8 +704,8 @@ where impl<'a, S> ChatPreferenceBuilder<'a, S> where S: chat_preference_state::State, - S::Include: chat_preference_state::IsSet, S::Push: chat_preference_state::IsSet, + S::Include: chat_preference_state::IsSet, { /// Build the final struct pub fn build(self) -> ChatPreference<'a> { @@ -867,50 +867,50 @@ pub mod filterable_preference_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Push; - type Include; type List; + type Include; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Push = Unset; - type Include = Unset; type List = Unset; + type Include = Unset; } ///State transition - sets the `push` field to Set pub struct SetPush(PhantomData S>); impl sealed::Sealed for SetPush {} impl State for SetPush { type Push = Set; - type Include = S::Include; - type List = S::List; - } - ///State transition - sets the `include` field to Set - pub struct SetInclude(PhantomData S>); - impl sealed::Sealed for SetInclude {} - impl State for SetInclude { - type Push = S::Push; - type Include = Set; type List = S::List; + type Include = S::Include; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData S>); impl sealed::Sealed for SetList {} impl State for SetList { type Push = S::Push; - type Include = S::Include; type List = Set; + type Include = S::Include; + } + ///State transition - sets the `include` field to Set + pub struct SetInclude(PhantomData S>); + impl sealed::Sealed for SetInclude {} + impl State for SetInclude { + type Push = S::Push; + type List = S::List; + type Include = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `push` field pub struct push(()); - ///Marker type for the `include` field - pub struct include(()); ///Marker type for the `list` field pub struct list(()); + ///Marker type for the `include` field + pub struct include(()); } } @@ -1004,8 +1004,8 @@ impl<'a, S> FilterablePreferenceBuilder<'a, S> where S: filterable_preference_state::State, S::Push: filterable_preference_state::IsSet, - S::Include: filterable_preference_state::IsSet, S::List: filterable_preference_state::IsSet, + S::Include: filterable_preference_state::IsSet, { /// Build the final struct pub fn build(self) -> FilterablePreference<'a> { @@ -1166,37 +1166,37 @@ pub mod preference_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type List; type Push; + type List; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type List = Unset; type Push = Unset; - } - ///State transition - sets the `list` field to Set - pub struct SetList(PhantomData S>); - impl sealed::Sealed for SetList {} - impl State for SetList { - type List = Set; - type Push = S::Push; + type List = Unset; } ///State transition - sets the `push` field to Set pub struct SetPush(PhantomData S>); impl sealed::Sealed for SetPush {} impl State for SetPush { - type List = S::List; type Push = Set; + type List = S::List; + } + ///State transition - sets the `list` field to Set + pub struct SetList(PhantomData S>); + impl sealed::Sealed for SetList {} + impl State for SetList { + type Push = S::Push; + type List = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `list` field - pub struct list(()); ///Marker type for the `push` field pub struct push(()); + ///Marker type for the `list` field + pub struct list(()); } } @@ -1266,8 +1266,8 @@ where impl<'a, S> PreferenceBuilder<'a, S> where S: preference_state::State, - S::List: preference_state::IsSet, S::Push: preference_state::IsSet, + S::List: preference_state::IsSet, { /// Build the final struct pub fn build(self) -> Preference<'a> { @@ -1360,301 +1360,301 @@ pub mod preferences_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type StarterpackJoined; - type RepostViaRepost; - type SubscribedPost; type Unverified; + type Mention; type Follow; + type Repost; type Verified; + type Reply; + type Chat; + type RepostViaRepost; + type SubscribedPost; + type LikeViaRepost; type Quote; type Like; - type LikeViaRepost; - type Chat; - type Mention; - type Reply; - type Repost; + type StarterpackJoined; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type StarterpackJoined = Unset; - type RepostViaRepost = Unset; - type SubscribedPost = Unset; type Unverified = Unset; + type Mention = Unset; type Follow = Unset; + type Repost = Unset; type Verified = Unset; + type Reply = Unset; + type Chat = Unset; + type RepostViaRepost = Unset; + type SubscribedPost = Unset; + type LikeViaRepost = Unset; type Quote = Unset; type Like = Unset; - type LikeViaRepost = Unset; - type Chat = Unset; - type Mention = Unset; - type Reply = Unset; - type Repost = Unset; + type StarterpackJoined = Unset; } - ///State transition - sets the `starterpack_joined` field to Set - pub struct SetStarterpackJoined(PhantomData S>); - impl sealed::Sealed for SetStarterpackJoined {} - impl State for SetStarterpackJoined { - type StarterpackJoined = Set; - type RepostViaRepost = S::RepostViaRepost; - type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; + ///State transition - sets the `unverified` field to Set + pub struct SetUnverified(PhantomData S>); + impl sealed::Sealed for SetUnverified {} + impl State for SetUnverified { + type Unverified = Set; + type Mention = S::Mention; type Follow = S::Follow; + type Repost = S::Repost; type Verified = S::Verified; - type Quote = S::Quote; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = S::Chat; - type Mention = S::Mention; type Reply = S::Reply; - type Repost = S::Repost; - } - ///State transition - sets the `repost_via_repost` field to Set - pub struct SetRepostViaRepost(PhantomData S>); - impl sealed::Sealed for SetRepostViaRepost {} - impl State for SetRepostViaRepost { - type StarterpackJoined = S::StarterpackJoined; - type RepostViaRepost = Set; + type Chat = S::Chat; + type RepostViaRepost = S::RepostViaRepost; type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; - type Follow = S::Follow; - type Verified = S::Verified; + type LikeViaRepost = S::LikeViaRepost; type Quote = S::Quote; type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = S::Chat; - type Mention = S::Mention; - type Reply = S::Reply; - type Repost = S::Repost; - } - ///State transition - sets the `subscribed_post` field to Set - pub struct SetSubscribedPost(PhantomData S>); - impl sealed::Sealed for SetSubscribedPost {} - impl State for SetSubscribedPost { type StarterpackJoined = S::StarterpackJoined; - type RepostViaRepost = S::RepostViaRepost; - type SubscribedPost = Set; + } + ///State transition - sets the `mention` field to Set + pub struct SetMention(PhantomData S>); + impl sealed::Sealed for SetMention {} + impl State for SetMention { type Unverified = S::Unverified; + type Mention = Set; type Follow = S::Follow; + type Repost = S::Repost; type Verified = S::Verified; - type Quote = S::Quote; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = S::Chat; - type Mention = S::Mention; type Reply = S::Reply; - type Repost = S::Repost; - } - ///State transition - sets the `unverified` field to Set - pub struct SetUnverified(PhantomData S>); - impl sealed::Sealed for SetUnverified {} - impl State for SetUnverified { - type StarterpackJoined = S::StarterpackJoined; + type Chat = S::Chat; type RepostViaRepost = S::RepostViaRepost; type SubscribedPost = S::SubscribedPost; - type Unverified = Set; - type Follow = S::Follow; - type Verified = S::Verified; + type LikeViaRepost = S::LikeViaRepost; type Quote = S::Quote; type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = S::Chat; - type Mention = S::Mention; - type Reply = S::Reply; - type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; } ///State transition - sets the `follow` field to Set pub struct SetFollow(PhantomData S>); impl sealed::Sealed for SetFollow {} impl State for SetFollow { - type StarterpackJoined = S::StarterpackJoined; - type RepostViaRepost = S::RepostViaRepost; - type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Mention = S::Mention; type Follow = Set; + type Repost = S::Repost; type Verified = S::Verified; + type Reply = S::Reply; + type Chat = S::Chat; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type LikeViaRepost = S::LikeViaRepost; type Quote = S::Quote; type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = S::Chat; + type StarterpackJoined = S::StarterpackJoined; + } + ///State transition - sets the `repost` field to Set + pub struct SetRepost(PhantomData S>); + impl sealed::Sealed for SetRepost {} + impl State for SetRepost { + type Unverified = S::Unverified; type Mention = S::Mention; + type Follow = S::Follow; + type Repost = Set; + type Verified = S::Verified; type Reply = S::Reply; - type Repost = S::Repost; + type Chat = S::Chat; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type LikeViaRepost = S::LikeViaRepost; + type Quote = S::Quote; + type Like = S::Like; + type StarterpackJoined = S::StarterpackJoined; } ///State transition - sets the `verified` field to Set pub struct SetVerified(PhantomData S>); impl sealed::Sealed for SetVerified {} impl State for SetVerified { - type StarterpackJoined = S::StarterpackJoined; - type RepostViaRepost = S::RepostViaRepost; - type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Mention = S::Mention; type Follow = S::Follow; + type Repost = S::Repost; type Verified = Set; + type Reply = S::Reply; + type Chat = S::Chat; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type LikeViaRepost = S::LikeViaRepost; type Quote = S::Quote; type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = S::Chat; + type StarterpackJoined = S::StarterpackJoined; + } + ///State transition - sets the `reply` field to Set + pub struct SetReply(PhantomData S>); + impl sealed::Sealed for SetReply {} + impl State for SetReply { + type Unverified = S::Unverified; type Mention = S::Mention; - type Reply = S::Reply; + type Follow = S::Follow; type Repost = S::Repost; - } - ///State transition - sets the `quote` field to Set - pub struct SetQuote(PhantomData S>); - impl sealed::Sealed for SetQuote {} - impl State for SetQuote { - type StarterpackJoined = S::StarterpackJoined; + type Verified = S::Verified; + type Reply = Set; + type Chat = S::Chat; type RepostViaRepost = S::RepostViaRepost; type SubscribedPost = S::SubscribedPost; + type LikeViaRepost = S::LikeViaRepost; + type Quote = S::Quote; + type Like = S::Like; + type StarterpackJoined = S::StarterpackJoined; + } + ///State transition - sets the `chat` field to Set + pub struct SetChat(PhantomData S>); + impl sealed::Sealed for SetChat {} + impl State for SetChat { type Unverified = S::Unverified; + type Mention = S::Mention; type Follow = S::Follow; + type Repost = S::Repost; type Verified = S::Verified; - type Quote = Set; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = S::Chat; - type Mention = S::Mention; type Reply = S::Reply; - type Repost = S::Repost; - } - ///State transition - sets the `like` field to Set - pub struct SetLike(PhantomData S>); - impl sealed::Sealed for SetLike {} - impl State for SetLike { - type StarterpackJoined = S::StarterpackJoined; + type Chat = Set; type RepostViaRepost = S::RepostViaRepost; type SubscribedPost = S::SubscribedPost; + type LikeViaRepost = S::LikeViaRepost; + type Quote = S::Quote; + type Like = S::Like; + type StarterpackJoined = S::StarterpackJoined; + } + ///State transition - sets the `repost_via_repost` field to Set + pub struct SetRepostViaRepost(PhantomData S>); + impl sealed::Sealed for SetRepostViaRepost {} + impl State for SetRepostViaRepost { type Unverified = S::Unverified; + type Mention = S::Mention; type Follow = S::Follow; + type Repost = S::Repost; type Verified = S::Verified; - type Quote = S::Quote; - type Like = Set; - type LikeViaRepost = S::LikeViaRepost; + type Reply = S::Reply; type Chat = S::Chat; + type RepostViaRepost = Set; + type SubscribedPost = S::SubscribedPost; + type LikeViaRepost = S::LikeViaRepost; + type Quote = S::Quote; + type Like = S::Like; + type StarterpackJoined = S::StarterpackJoined; + } + ///State transition - sets the `subscribed_post` field to Set + pub struct SetSubscribedPost(PhantomData S>); + impl sealed::Sealed for SetSubscribedPost {} + impl State for SetSubscribedPost { + type Unverified = S::Unverified; type Mention = S::Mention; - type Reply = S::Reply; + type Follow = S::Follow; type Repost = S::Repost; + type Verified = S::Verified; + type Reply = S::Reply; + type Chat = S::Chat; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = Set; + type LikeViaRepost = S::LikeViaRepost; + type Quote = S::Quote; + type Like = S::Like; + type StarterpackJoined = S::StarterpackJoined; } ///State transition - sets the `like_via_repost` field to Set pub struct SetLikeViaRepost(PhantomData S>); impl sealed::Sealed for SetLikeViaRepost {} impl State for SetLikeViaRepost { - type StarterpackJoined = S::StarterpackJoined; - type RepostViaRepost = S::RepostViaRepost; - type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Mention = S::Mention; type Follow = S::Follow; + type Repost = S::Repost; type Verified = S::Verified; - type Quote = S::Quote; - type Like = S::Like; - type LikeViaRepost = Set; - type Chat = S::Chat; - type Mention = S::Mention; type Reply = S::Reply; - type Repost = S::Repost; - } - ///State transition - sets the `chat` field to Set - pub struct SetChat(PhantomData S>); - impl sealed::Sealed for SetChat {} - impl State for SetChat { - type StarterpackJoined = S::StarterpackJoined; + type Chat = S::Chat; type RepostViaRepost = S::RepostViaRepost; type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; - type Follow = S::Follow; - type Verified = S::Verified; + type LikeViaRepost = Set; type Quote = S::Quote; type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = Set; - type Mention = S::Mention; - type Reply = S::Reply; - type Repost = S::Repost; - } - ///State transition - sets the `mention` field to Set - pub struct SetMention(PhantomData S>); - impl sealed::Sealed for SetMention {} - impl State for SetMention { type StarterpackJoined = S::StarterpackJoined; - type RepostViaRepost = S::RepostViaRepost; - type SubscribedPost = S::SubscribedPost; + } + ///State transition - sets the `quote` field to Set + pub struct SetQuote(PhantomData S>); + impl sealed::Sealed for SetQuote {} + impl State for SetQuote { type Unverified = S::Unverified; + type Mention = S::Mention; type Follow = S::Follow; + type Repost = S::Repost; type Verified = S::Verified; - type Quote = S::Quote; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = S::Chat; - type Mention = Set; type Reply = S::Reply; - type Repost = S::Repost; - } - ///State transition - sets the `reply` field to Set - pub struct SetReply(PhantomData S>); - impl sealed::Sealed for SetReply {} - impl State for SetReply { - type StarterpackJoined = S::StarterpackJoined; + type Chat = S::Chat; type RepostViaRepost = S::RepostViaRepost; type SubscribedPost = S::SubscribedPost; + type LikeViaRepost = S::LikeViaRepost; + type Quote = Set; + type Like = S::Like; + type StarterpackJoined = S::StarterpackJoined; + } + ///State transition - sets the `like` field to Set + pub struct SetLike(PhantomData S>); + impl sealed::Sealed for SetLike {} + impl State for SetLike { type Unverified = S::Unverified; + type Mention = S::Mention; type Follow = S::Follow; + type Repost = S::Repost; type Verified = S::Verified; - type Quote = S::Quote; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; + type Reply = S::Reply; type Chat = S::Chat; - type Mention = S::Mention; - type Reply = Set; - type Repost = S::Repost; - } - ///State transition - sets the `repost` field to Set - pub struct SetRepost(PhantomData S>); - impl sealed::Sealed for SetRepost {} - impl State for SetRepost { - type StarterpackJoined = S::StarterpackJoined; type RepostViaRepost = S::RepostViaRepost; type SubscribedPost = S::SubscribedPost; + type LikeViaRepost = S::LikeViaRepost; + type Quote = S::Quote; + type Like = Set; + type StarterpackJoined = S::StarterpackJoined; + } + ///State transition - sets the `starterpack_joined` field to Set + pub struct SetStarterpackJoined(PhantomData S>); + impl sealed::Sealed for SetStarterpackJoined {} + impl State for SetStarterpackJoined { type Unverified = S::Unverified; + type Mention = S::Mention; type Follow = S::Follow; + type Repost = S::Repost; type Verified = S::Verified; + type Reply = S::Reply; + type Chat = S::Chat; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type LikeViaRepost = S::LikeViaRepost; type Quote = S::Quote; type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Chat = S::Chat; - type Mention = S::Mention; - type Reply = S::Reply; - type Repost = Set; + type StarterpackJoined = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `starterpack_joined` field - pub struct starterpack_joined(()); - ///Marker type for the `repost_via_repost` field - pub struct repost_via_repost(()); - ///Marker type for the `subscribed_post` field - pub struct subscribed_post(()); ///Marker type for the `unverified` field pub struct unverified(()); + ///Marker type for the `mention` field + pub struct mention(()); ///Marker type for the `follow` field pub struct follow(()); + ///Marker type for the `repost` field + pub struct repost(()); ///Marker type for the `verified` field pub struct verified(()); + ///Marker type for the `reply` field + pub struct reply(()); + ///Marker type for the `chat` field + pub struct chat(()); + ///Marker type for the `repost_via_repost` field + pub struct repost_via_repost(()); + ///Marker type for the `subscribed_post` field + pub struct subscribed_post(()); + ///Marker type for the `like_via_repost` field + pub struct like_via_repost(()); ///Marker type for the `quote` field pub struct quote(()); ///Marker type for the `like` field pub struct like(()); - ///Marker type for the `like_via_repost` field - pub struct like_via_repost(()); - ///Marker type for the `chat` field - pub struct chat(()); - ///Marker type for the `mention` field - pub struct mention(()); - ///Marker type for the `reply` field - pub struct reply(()); - ///Marker type for the `repost` field - pub struct repost(()); + ///Marker type for the `starterpack_joined` field + pub struct starterpack_joined(()); } } @@ -1961,19 +1961,19 @@ where impl<'a, S> PreferencesBuilder<'a, S> where S: preferences_state::State, - S::StarterpackJoined: preferences_state::IsSet, - S::RepostViaRepost: preferences_state::IsSet, - S::SubscribedPost: preferences_state::IsSet, S::Unverified: preferences_state::IsSet, + S::Mention: preferences_state::IsSet, S::Follow: preferences_state::IsSet, + S::Repost: preferences_state::IsSet, S::Verified: preferences_state::IsSet, + S::Reply: preferences_state::IsSet, + S::Chat: preferences_state::IsSet, + S::RepostViaRepost: preferences_state::IsSet, + S::SubscribedPost: preferences_state::IsSet, + S::LikeViaRepost: preferences_state::IsSet, S::Quote: preferences_state::IsSet, S::Like: preferences_state::IsSet, - S::LikeViaRepost: preferences_state::IsSet, - S::Chat: preferences_state::IsSet, - S::Mention: preferences_state::IsSet, - S::Reply: preferences_state::IsSet, - S::Repost: preferences_state::IsSet, + S::StarterpackJoined: preferences_state::IsSet, { /// Build the final struct pub fn build(self) -> Preferences<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification/list_notifications.rs b/crates/weaver-api/src/app_bsky/notification/list_notifications.rs index d4e8e94..f9f7e40 100644 --- a/crates/weaver-api/src/app_bsky/notification/list_notifications.rs +++ b/crates/weaver-api/src/app_bsky/notification/list_notifications.rs @@ -271,127 +271,127 @@ pub mod notification_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reason; - type IsRead; type Author; - type IndexedAt; - type Uri; type Cid; + type Uri; + type Reason; type Record; + type IsRead; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reason = Unset; - type IsRead = Unset; type Author = Unset; - type IndexedAt = Unset; - type Uri = Unset; type Cid = Unset; + type Uri = Unset; + type Reason = Unset; type Record = Unset; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Reason = Set; - type IsRead = S::IsRead; - type Author = S::Author; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - type Cid = S::Cid; - type Record = S::Record; - } - ///State transition - sets the `is_read` field to Set - pub struct SetIsRead(PhantomData S>); - impl sealed::Sealed for SetIsRead {} - impl State for SetIsRead { - type Reason = S::Reason; - type IsRead = Set; - type Author = S::Author; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - type Cid = S::Cid; - type Record = S::Record; + type IsRead = Unset; + type IndexedAt = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Reason = S::Reason; - type IsRead = S::IsRead; type Author = Set; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; type Cid = S::Cid; - type Record = S::Record; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + type Uri = S::Uri; type Reason = S::Reason; + type Record = S::Record; type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Author = S::Author; - type IndexedAt = Set; + type Cid = Set; type Uri = S::Uri; - type Cid = S::Cid; + type Reason = S::Reason; type Record = S::Record; + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Reason = S::Reason; - type IsRead = S::IsRead; type Author = S::Author; - type IndexedAt = S::IndexedAt; - type Uri = Set; type Cid = S::Cid; - type Record = S::Record; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { + type Uri = Set; type Reason = S::Reason; + type Record = S::Record; type IsRead = S::IsRead; - type Author = S::Author; type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Author = S::Author; + type Cid = S::Cid; type Uri = S::Uri; - type Cid = Set; + type Reason = Set; type Record = S::Record; + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { + type Author = S::Author; + type Cid = S::Cid; + type Uri = S::Uri; type Reason = S::Reason; + type Record = Set; type IsRead = S::IsRead; - type Author = S::Author; type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `is_read` field to Set + pub struct SetIsRead(PhantomData S>); + impl sealed::Sealed for SetIsRead {} + impl State for SetIsRead { + type Author = S::Author; + type Cid = S::Cid; type Uri = S::Uri; + type Reason = S::Reason; + type Record = S::Record; + type IsRead = Set; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Author = S::Author; type Cid = S::Cid; - type Record = Set; + type Uri = S::Uri; + type Reason = S::Reason; + type Record = S::Record; + type IsRead = S::IsRead; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reason` field - pub struct reason(()); - ///Marker type for the `is_read` field - pub struct is_read(()); ///Marker type for the `author` field pub struct author(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `reason` field + pub struct reason(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `is_read` field + pub struct is_read(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -614,13 +614,13 @@ where impl<'a, S> NotificationBuilder<'a, S> where S: notification_state::State, - S::Reason: notification_state::IsSet, - S::IsRead: notification_state::IsSet, S::Author: notification_state::IsSet, - S::IndexedAt: notification_state::IsSet, - S::Uri: notification_state::IsSet, S::Cid: notification_state::IsSet, + S::Uri: notification_state::IsSet, + S::Reason: notification_state::IsSet, S::Record: notification_state::IsSet, + S::IsRead: notification_state::IsSet, + S::IndexedAt: notification_state::IsSet, { /// Build the final struct pub fn build(self) -> Notification<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs b/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs index b0c858e..7e167a9 100644 --- a/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs +++ b/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs @@ -33,37 +33,37 @@ pub mod put_activity_subscription_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ActivitySubscription; type Subject; + type ActivitySubscription; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ActivitySubscription = Unset; type Subject = Unset; - } - ///State transition - sets the `activity_subscription` field to Set - pub struct SetActivitySubscription(PhantomData S>); - impl sealed::Sealed for SetActivitySubscription {} - impl State for SetActivitySubscription { - type ActivitySubscription = Set; - type Subject = S::Subject; + type ActivitySubscription = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type ActivitySubscription = S::ActivitySubscription; type Subject = Set; + type ActivitySubscription = S::ActivitySubscription; + } + ///State transition - sets the `activity_subscription` field to Set + pub struct SetActivitySubscription(PhantomData S>); + impl sealed::Sealed for SetActivitySubscription {} + impl State for SetActivitySubscription { + type Subject = S::Subject; + type ActivitySubscription = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `activity_subscription` field - pub struct activity_subscription(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `activity_subscription` field + pub struct activity_subscription(()); } } @@ -148,8 +148,8 @@ where impl<'a, S> PutActivitySubscriptionBuilder<'a, S> where S: put_activity_subscription_state::State, - S::ActivitySubscription: put_activity_subscription_state::IsSet, S::Subject: put_activity_subscription_state::IsSet, + S::ActivitySubscription: put_activity_subscription_state::IsSet, { /// Build the final struct pub fn build(self) -> PutActivitySubscription<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification/register_push.rs b/crates/weaver-api/src/app_bsky/notification/register_push.rs index a99bb8f..b4dcbe7 100644 --- a/crates/weaver-api/src/app_bsky/notification/register_push.rs +++ b/crates/weaver-api/src/app_bsky/notification/register_push.rs @@ -40,67 +40,67 @@ pub mod register_push_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ServiceDid; + type AppId; type Token; + type ServiceDid; type Platform; - type AppId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ServiceDid = Unset; + type AppId = Unset; type Token = Unset; + type ServiceDid = Unset; type Platform = Unset; - type AppId = Unset; } - ///State transition - sets the `service_did` field to Set - pub struct SetServiceDid(PhantomData S>); - impl sealed::Sealed for SetServiceDid {} - impl State for SetServiceDid { - type ServiceDid = Set; + ///State transition - sets the `app_id` field to Set + pub struct SetAppId(PhantomData S>); + impl sealed::Sealed for SetAppId {} + impl State for SetAppId { + type AppId = Set; type Token = S::Token; + type ServiceDid = S::ServiceDid; type Platform = S::Platform; - type AppId = S::AppId; } ///State transition - sets the `token` field to Set pub struct SetToken(PhantomData S>); impl sealed::Sealed for SetToken {} impl State for SetToken { - type ServiceDid = S::ServiceDid; + type AppId = S::AppId; type Token = Set; + type ServiceDid = S::ServiceDid; type Platform = S::Platform; + } + ///State transition - sets the `service_did` field to Set + pub struct SetServiceDid(PhantomData S>); + impl sealed::Sealed for SetServiceDid {} + impl State for SetServiceDid { type AppId = S::AppId; + type Token = S::Token; + type ServiceDid = Set; + type Platform = S::Platform; } ///State transition - sets the `platform` field to Set pub struct SetPlatform(PhantomData S>); impl sealed::Sealed for SetPlatform {} impl State for SetPlatform { - type ServiceDid = S::ServiceDid; - type Token = S::Token; - type Platform = Set; type AppId = S::AppId; - } - ///State transition - sets the `app_id` field to Set - pub struct SetAppId(PhantomData S>); - impl sealed::Sealed for SetAppId {} - impl State for SetAppId { - type ServiceDid = S::ServiceDid; type Token = S::Token; - type Platform = S::Platform; - type AppId = Set; + type ServiceDid = S::ServiceDid; + type Platform = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `service_did` field - pub struct service_did(()); + ///Marker type for the `app_id` field + pub struct app_id(()); ///Marker type for the `token` field pub struct token(()); + ///Marker type for the `service_did` field + pub struct service_did(()); ///Marker type for the `platform` field pub struct platform(()); - ///Marker type for the `app_id` field - pub struct app_id(()); } } @@ -227,10 +227,10 @@ where impl<'a, S> RegisterPushBuilder<'a, S> where S: register_push_state::State, - S::ServiceDid: register_push_state::IsSet, + S::AppId: register_push_state::IsSet, S::Token: register_push_state::IsSet, + S::ServiceDid: register_push_state::IsSet, S::Platform: register_push_state::IsSet, - S::AppId: register_push_state::IsSet, { /// Build the final struct pub fn build(self) -> RegisterPush<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification/unregister_push.rs b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs index 231cd0a..bb9af05 100644 --- a/crates/weaver-api/src/app_bsky/notification/unregister_push.rs +++ b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs @@ -37,8 +37,8 @@ pub mod unregister_push_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AppId; type Platform; + type AppId; type Token; type ServiceDid; } @@ -46,26 +46,26 @@ pub mod unregister_push_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AppId = Unset; type Platform = Unset; + type AppId = Unset; type Token = Unset; type ServiceDid = Unset; } - ///State transition - sets the `app_id` field to Set - pub struct SetAppId(PhantomData S>); - impl sealed::Sealed for SetAppId {} - impl State for SetAppId { - type AppId = Set; - type Platform = S::Platform; - type Token = S::Token; - type ServiceDid = S::ServiceDid; - } ///State transition - sets the `platform` field to Set pub struct SetPlatform(PhantomData S>); impl sealed::Sealed for SetPlatform {} impl State for SetPlatform { - type AppId = S::AppId; type Platform = Set; + type AppId = S::AppId; + type Token = S::Token; + type ServiceDid = S::ServiceDid; + } + ///State transition - sets the `app_id` field to Set + pub struct SetAppId(PhantomData S>); + impl sealed::Sealed for SetAppId {} + impl State for SetAppId { + type Platform = S::Platform; + type AppId = Set; type Token = S::Token; type ServiceDid = S::ServiceDid; } @@ -73,8 +73,8 @@ pub mod unregister_push_state { pub struct SetToken(PhantomData S>); impl sealed::Sealed for SetToken {} impl State for SetToken { - type AppId = S::AppId; type Platform = S::Platform; + type AppId = S::AppId; type Token = Set; type ServiceDid = S::ServiceDid; } @@ -82,18 +82,18 @@ pub mod unregister_push_state { pub struct SetServiceDid(PhantomData S>); impl sealed::Sealed for SetServiceDid {} impl State for SetServiceDid { - type AppId = S::AppId; type Platform = S::Platform; + type AppId = S::AppId; type Token = S::Token; type ServiceDid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `app_id` field - pub struct app_id(()); ///Marker type for the `platform` field pub struct platform(()); + ///Marker type for the `app_id` field + pub struct app_id(()); ///Marker type for the `token` field pub struct token(()); ///Marker type for the `service_did` field @@ -210,8 +210,8 @@ where impl<'a, S> UnregisterPushBuilder<'a, S> where S: unregister_push_state::State, - S::AppId: unregister_push_state::IsSet, S::Platform: unregister_push_state::IsSet, + S::AppId: unregister_push_state::IsSet, S::Token: unregister_push_state::IsSet, S::ServiceDid: unregister_push_state::IsSet, { diff --git a/crates/weaver-api/src/app_bsky/unspecced.rs b/crates/weaver-api/src/app_bsky/unspecced.rs index 19a50bf..470b737 100644 --- a/crates/weaver-api/src/app_bsky/unspecced.rs +++ b/crates/weaver-api/src/app_bsky/unspecced.rs @@ -81,51 +81,51 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Status; type CreatedAt; type AttemptId; - type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Status = Unset; type CreatedAt = Unset; type AttemptId = Unset; - type Status = Unset; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type Status = Set; + type CreatedAt = S::CreatedAt; + type AttemptId = S::AttemptId; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { + type Status = S::Status; type CreatedAt = Set; type AttemptId = S::AttemptId; - type Status = S::Status; } ///State transition - sets the `attempt_id` field to Set pub struct SetAttemptId(PhantomData S>); impl sealed::Sealed for SetAttemptId {} impl State for SetAttemptId { - type CreatedAt = S::CreatedAt; - type AttemptId = Set; type Status = S::Status; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { type CreatedAt = S::CreatedAt; - type AttemptId = S::AttemptId; - type Status = Set; + type AttemptId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `status` field + pub struct status(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `attempt_id` field pub struct attempt_id(()); - ///Marker type for the `status` field - pub struct status(()); } } @@ -309,9 +309,9 @@ where impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, + S::Status: age_assurance_event_state::IsSet, S::CreatedAt: age_assurance_event_state::IsSet, S::AttemptId: age_assurance_event_state::IsSet, - S::Status: age_assurance_event_state::IsSet, { /// Build the final struct pub fn build(self) -> AgeAssuranceEvent<'a> { @@ -1940,105 +1940,105 @@ pub mod skeleton_trend_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Topic; - type StartedAt; - type PostCount; + type Link; type Dids; + type PostCount; + type StartedAt; + type Topic; type DisplayName; - type Link; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Topic = Unset; - type StartedAt = Unset; - type PostCount = Unset; + type Link = Unset; type Dids = Unset; + type PostCount = Unset; + type StartedAt = Unset; + type Topic = Unset; type DisplayName = Unset; - type Link = Unset; } - ///State transition - sets the `topic` field to Set - pub struct SetTopic(PhantomData S>); - impl sealed::Sealed for SetTopic {} - impl State for SetTopic { - type Topic = Set; - type StartedAt = S::StartedAt; - type PostCount = S::PostCount; + ///State transition - sets the `link` field to Set + pub struct SetLink(PhantomData S>); + impl sealed::Sealed for SetLink {} + impl State for SetLink { + type Link = Set; type Dids = S::Dids; + type PostCount = S::PostCount; + type StartedAt = S::StartedAt; + type Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; } - ///State transition - sets the `started_at` field to Set - pub struct SetStartedAt(PhantomData S>); - impl sealed::Sealed for SetStartedAt {} - impl State for SetStartedAt { - type Topic = S::Topic; - type StartedAt = Set; + ///State transition - sets the `dids` field to Set + pub struct SetDids(PhantomData S>); + impl sealed::Sealed for SetDids {} + impl State for SetDids { + type Link = S::Link; + type Dids = Set; type PostCount = S::PostCount; - type Dids = S::Dids; + type StartedAt = S::StartedAt; + type Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; } ///State transition - sets the `post_count` field to Set pub struct SetPostCount(PhantomData S>); impl sealed::Sealed for SetPostCount {} impl State for SetPostCount { - type Topic = S::Topic; - type StartedAt = S::StartedAt; - type PostCount = Set; + type Link = S::Link; type Dids = S::Dids; + type PostCount = Set; + type StartedAt = S::StartedAt; + type Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; } - ///State transition - sets the `dids` field to Set - pub struct SetDids(PhantomData S>); - impl sealed::Sealed for SetDids {} - impl State for SetDids { - type Topic = S::Topic; - type StartedAt = S::StartedAt; + ///State transition - sets the `started_at` field to Set + pub struct SetStartedAt(PhantomData S>); + impl sealed::Sealed for SetStartedAt {} + impl State for SetStartedAt { + type Link = S::Link; + type Dids = S::Dids; type PostCount = S::PostCount; - type Dids = Set; + type StartedAt = Set; + type Topic = S::Topic; type DisplayName = S::DisplayName; + } + ///State transition - sets the `topic` field to Set + pub struct SetTopic(PhantomData S>); + impl sealed::Sealed for SetTopic {} + impl State for SetTopic { type Link = S::Link; + type Dids = S::Dids; + type PostCount = S::PostCount; + type StartedAt = S::StartedAt; + type Topic = Set; + type DisplayName = S::DisplayName; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Topic = S::Topic; - type StartedAt = S::StartedAt; - type PostCount = S::PostCount; - type Dids = S::Dids; - type DisplayName = Set; type Link = S::Link; - } - ///State transition - sets the `link` field to Set - pub struct SetLink(PhantomData S>); - impl sealed::Sealed for SetLink {} - impl State for SetLink { - type Topic = S::Topic; - type StartedAt = S::StartedAt; - type PostCount = S::PostCount; type Dids = S::Dids; - type DisplayName = S::DisplayName; - type Link = Set; + type PostCount = S::PostCount; + type StartedAt = S::StartedAt; + type Topic = S::Topic; + type DisplayName = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `topic` field - pub struct topic(()); - ///Marker type for the `started_at` field - pub struct started_at(()); - ///Marker type for the `post_count` field - pub struct post_count(()); + ///Marker type for the `link` field + pub struct link(()); ///Marker type for the `dids` field pub struct dids(()); + ///Marker type for the `post_count` field + pub struct post_count(()); + ///Marker type for the `started_at` field + pub struct started_at(()); + ///Marker type for the `topic` field + pub struct topic(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `link` field - pub struct link(()); } } @@ -2222,12 +2222,12 @@ where impl<'a, S> SkeletonTrendBuilder<'a, S> where S: skeleton_trend_state::State, - S::Topic: skeleton_trend_state::IsSet, - S::StartedAt: skeleton_trend_state::IsSet, - S::PostCount: skeleton_trend_state::IsSet, + S::Link: skeleton_trend_state::IsSet, S::Dids: skeleton_trend_state::IsSet, + S::PostCount: skeleton_trend_state::IsSet, + S::StartedAt: skeleton_trend_state::IsSet, + S::Topic: skeleton_trend_state::IsSet, S::DisplayName: skeleton_trend_state::IsSet, - S::Link: skeleton_trend_state::IsSet, { /// Build the final struct pub fn build(self) -> SkeletonTrend<'a> { @@ -2601,10 +2601,10 @@ pub mod thread_item_post_state { pub trait State: sealed::Sealed { type Post; type MoreReplies; - type HiddenByThreadgate; type OpThread; type MutedByViewer; type MoreParents; + type HiddenByThreadgate; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -2612,10 +2612,10 @@ pub mod thread_item_post_state { impl State for Empty { type Post = Unset; type MoreReplies = Unset; - type HiddenByThreadgate = Unset; type OpThread = Unset; type MutedByViewer = Unset; type MoreParents = Unset; + type HiddenByThreadgate = Unset; } ///State transition - sets the `post` field to Set pub struct SetPost(PhantomData S>); @@ -2623,10 +2623,10 @@ pub mod thread_item_post_state { impl State for SetPost { type Post = Set; type MoreReplies = S::MoreReplies; - type HiddenByThreadgate = S::HiddenByThreadgate; type OpThread = S::OpThread; type MutedByViewer = S::MutedByViewer; type MoreParents = S::MoreParents; + type HiddenByThreadgate = S::HiddenByThreadgate; } ///State transition - sets the `more_replies` field to Set pub struct SetMoreReplies(PhantomData S>); @@ -2634,21 +2634,10 @@ pub mod thread_item_post_state { impl State for SetMoreReplies { type Post = S::Post; type MoreReplies = Set; - type HiddenByThreadgate = S::HiddenByThreadgate; - type OpThread = S::OpThread; - type MutedByViewer = S::MutedByViewer; - type MoreParents = S::MoreParents; - } - ///State transition - sets the `hidden_by_threadgate` field to Set - pub struct SetHiddenByThreadgate(PhantomData S>); - impl sealed::Sealed for SetHiddenByThreadgate {} - impl State for SetHiddenByThreadgate { - type Post = S::Post; - type MoreReplies = S::MoreReplies; - type HiddenByThreadgate = Set; type OpThread = S::OpThread; type MutedByViewer = S::MutedByViewer; type MoreParents = S::MoreParents; + type HiddenByThreadgate = S::HiddenByThreadgate; } ///State transition - sets the `op_thread` field to Set pub struct SetOpThread(PhantomData S>); @@ -2656,10 +2645,10 @@ pub mod thread_item_post_state { impl State for SetOpThread { type Post = S::Post; type MoreReplies = S::MoreReplies; - type HiddenByThreadgate = S::HiddenByThreadgate; type OpThread = Set; type MutedByViewer = S::MutedByViewer; type MoreParents = S::MoreParents; + type HiddenByThreadgate = S::HiddenByThreadgate; } ///State transition - sets the `muted_by_viewer` field to Set pub struct SetMutedByViewer(PhantomData S>); @@ -2667,10 +2656,10 @@ pub mod thread_item_post_state { impl State for SetMutedByViewer { type Post = S::Post; type MoreReplies = S::MoreReplies; - type HiddenByThreadgate = S::HiddenByThreadgate; type OpThread = S::OpThread; type MutedByViewer = Set; type MoreParents = S::MoreParents; + type HiddenByThreadgate = S::HiddenByThreadgate; } ///State transition - sets the `more_parents` field to Set pub struct SetMoreParents(PhantomData S>); @@ -2678,10 +2667,21 @@ pub mod thread_item_post_state { impl State for SetMoreParents { type Post = S::Post; type MoreReplies = S::MoreReplies; - type HiddenByThreadgate = S::HiddenByThreadgate; type OpThread = S::OpThread; type MutedByViewer = S::MutedByViewer; type MoreParents = Set; + type HiddenByThreadgate = S::HiddenByThreadgate; + } + ///State transition - sets the `hidden_by_threadgate` field to Set + pub struct SetHiddenByThreadgate(PhantomData S>); + impl sealed::Sealed for SetHiddenByThreadgate {} + impl State for SetHiddenByThreadgate { + type Post = S::Post; + type MoreReplies = S::MoreReplies; + type OpThread = S::OpThread; + type MutedByViewer = S::MutedByViewer; + type MoreParents = S::MoreParents; + type HiddenByThreadgate = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -2690,14 +2690,14 @@ pub mod thread_item_post_state { pub struct post(()); ///Marker type for the `more_replies` field pub struct more_replies(()); - ///Marker type for the `hidden_by_threadgate` field - pub struct hidden_by_threadgate(()); ///Marker type for the `op_thread` field pub struct op_thread(()); ///Marker type for the `muted_by_viewer` field pub struct muted_by_viewer(()); ///Marker type for the `more_parents` field pub struct more_parents(()); + ///Marker type for the `hidden_by_threadgate` field + pub struct hidden_by_threadgate(()); } } @@ -2852,10 +2852,10 @@ where S: thread_item_post_state::State, S::Post: thread_item_post_state::IsSet, S::MoreReplies: thread_item_post_state::IsSet, - S::HiddenByThreadgate: thread_item_post_state::IsSet, S::OpThread: thread_item_post_state::IsSet, S::MutedByViewer: thread_item_post_state::IsSet, S::MoreParents: thread_item_post_state::IsSet, + S::HiddenByThreadgate: thread_item_post_state::IsSet, { /// Build the final struct pub fn build(self) -> ThreadItemPost<'a> { @@ -2946,105 +2946,105 @@ pub mod trend_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Topic; type PostCount; + type Actors; + type Link; type DisplayName; type StartedAt; - type Topic; - type Link; - type Actors; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Topic = Unset; type PostCount = Unset; + type Actors = Unset; + type Link = Unset; type DisplayName = Unset; type StartedAt = Unset; - type Topic = Unset; - type Link = Unset; - type Actors = Unset; + } + ///State transition - sets the `topic` field to Set + pub struct SetTopic(PhantomData S>); + impl sealed::Sealed for SetTopic {} + impl State for SetTopic { + type Topic = Set; + type PostCount = S::PostCount; + type Actors = S::Actors; + type Link = S::Link; + type DisplayName = S::DisplayName; + type StartedAt = S::StartedAt; } ///State transition - sets the `post_count` field to Set pub struct SetPostCount(PhantomData S>); impl sealed::Sealed for SetPostCount {} impl State for SetPostCount { + type Topic = S::Topic; type PostCount = Set; + type Actors = S::Actors; + type Link = S::Link; type DisplayName = S::DisplayName; type StartedAt = S::StartedAt; + } + ///State transition - sets the `actors` field to Set + pub struct SetActors(PhantomData S>); + impl sealed::Sealed for SetActors {} + impl State for SetActors { type Topic = S::Topic; + type PostCount = S::PostCount; + type Actors = Set; type Link = S::Link; + type DisplayName = S::DisplayName; + type StartedAt = S::StartedAt; + } + ///State transition - sets the `link` field to Set + pub struct SetLink(PhantomData S>); + impl sealed::Sealed for SetLink {} + impl State for SetLink { + type Topic = S::Topic; + type PostCount = S::PostCount; type Actors = S::Actors; + type Link = Set; + type DisplayName = S::DisplayName; + type StartedAt = S::StartedAt; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { + type Topic = S::Topic; type PostCount = S::PostCount; + type Actors = S::Actors; + type Link = S::Link; type DisplayName = Set; type StartedAt = S::StartedAt; - type Topic = S::Topic; - type Link = S::Link; - type Actors = S::Actors; } ///State transition - sets the `started_at` field to Set pub struct SetStartedAt(PhantomData S>); impl sealed::Sealed for SetStartedAt {} impl State for SetStartedAt { - type PostCount = S::PostCount; - type DisplayName = S::DisplayName; - type StartedAt = Set; type Topic = S::Topic; - type Link = S::Link; - type Actors = S::Actors; - } - ///State transition - sets the `topic` field to Set - pub struct SetTopic(PhantomData S>); - impl sealed::Sealed for SetTopic {} - impl State for SetTopic { type PostCount = S::PostCount; - type DisplayName = S::DisplayName; - type StartedAt = S::StartedAt; - type Topic = Set; - type Link = S::Link; type Actors = S::Actors; - } - ///State transition - sets the `link` field to Set - pub struct SetLink(PhantomData S>); - impl sealed::Sealed for SetLink {} - impl State for SetLink { - type PostCount = S::PostCount; - type DisplayName = S::DisplayName; - type StartedAt = S::StartedAt; - type Topic = S::Topic; - type Link = Set; - type Actors = S::Actors; - } - ///State transition - sets the `actors` field to Set - pub struct SetActors(PhantomData S>); - impl sealed::Sealed for SetActors {} - impl State for SetActors { - type PostCount = S::PostCount; - type DisplayName = S::DisplayName; - type StartedAt = S::StartedAt; - type Topic = S::Topic; type Link = S::Link; - type Actors = Set; + type DisplayName = S::DisplayName; + type StartedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `topic` field + pub struct topic(()); ///Marker type for the `post_count` field pub struct post_count(()); + ///Marker type for the `actors` field + pub struct actors(()); + ///Marker type for the `link` field + pub struct link(()); ///Marker type for the `display_name` field pub struct display_name(()); ///Marker type for the `started_at` field pub struct started_at(()); - ///Marker type for the `topic` field - pub struct topic(()); - ///Marker type for the `link` field - pub struct link(()); - ///Marker type for the `actors` field - pub struct actors(()); } } @@ -3228,12 +3228,12 @@ where impl<'a, S> TrendViewBuilder<'a, S> where S: trend_view_state::State, + S::Topic: trend_view_state::IsSet, S::PostCount: trend_view_state::IsSet, + S::Actors: trend_view_state::IsSet, + S::Link: trend_view_state::IsSet, S::DisplayName: trend_view_state::IsSet, S::StartedAt: trend_view_state::IsSet, - S::Topic: trend_view_state::IsSet, - S::Link: trend_view_state::IsSet, - S::Actors: trend_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TrendView<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_config.rs b/crates/weaver-api/src/app_bsky/unspecced/get_config.rs index d932f1b..1cb09d3 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_config.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_config.rs @@ -33,37 +33,37 @@ pub mod live_now_config_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Domains; type Did; + type Domains; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Domains = Unset; type Did = Unset; - } - ///State transition - sets the `domains` field to Set - pub struct SetDomains(PhantomData S>); - impl sealed::Sealed for SetDomains {} - impl State for SetDomains { - type Domains = Set; - type Did = S::Did; + type Domains = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Domains = S::Domains; type Did = Set; + type Domains = S::Domains; + } + ///State transition - sets the `domains` field to Set + pub struct SetDomains(PhantomData S>); + impl sealed::Sealed for SetDomains {} + impl State for SetDomains { + type Did = S::Did; + type Domains = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `domains` field - pub struct domains(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `domains` field + pub struct domains(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> LiveNowConfigBuilder<'a, S> where S: live_now_config_state::State, - S::Domains: live_now_config_state::IsSet, S::Did: live_now_config_state::IsSet, + S::Domains: live_now_config_state::IsSet, { /// Build the final struct pub fn build(self) -> LiveNowConfig<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs index 254db21..331d35d 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs @@ -265,51 +265,51 @@ pub mod thread_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Depth; type Value; type Uri; - type Depth; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Depth = Unset; type Value = Unset; type Uri = Unset; - type Depth = Unset; + } + ///State transition - sets the `depth` field to Set + pub struct SetDepth(PhantomData S>); + impl sealed::Sealed for SetDepth {} + impl State for SetDepth { + type Depth = Set; + type Value = S::Value; + type Uri = S::Uri; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { + type Depth = S::Depth; type Value = Set; type Uri = S::Uri; - type Depth = S::Depth; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Value = S::Value; - type Uri = Set; type Depth = S::Depth; - } - ///State transition - sets the `depth` field to Set - pub struct SetDepth(PhantomData S>); - impl sealed::Sealed for SetDepth {} - impl State for SetDepth { type Value = S::Value; - type Uri = S::Uri; - type Depth = Set; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `depth` field + pub struct depth(()); ///Marker type for the `value` field pub struct value(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `depth` field - pub struct depth(()); } } @@ -402,9 +402,9 @@ where impl<'a, S> ThreadItemBuilder<'a, S> where S: thread_item_state::State, + S::Depth: thread_item_state::IsSet, S::Value: thread_item_state::IsSet, S::Uri: thread_item_state::IsSet, - S::Depth: thread_item_state::IsSet, { /// Build the final struct pub fn build(self) -> ThreadItem<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs b/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs index 45793aa..4f6a7f7 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs @@ -90,51 +90,51 @@ pub mod suggestion_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Tag; type SubjectType; type Subject; - type Tag; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Tag = Unset; type SubjectType = Unset; type Subject = Unset; - type Tag = Unset; + } + ///State transition - sets the `tag` field to Set + pub struct SetTag(PhantomData S>); + impl sealed::Sealed for SetTag {} + impl State for SetTag { + type Tag = Set; + type SubjectType = S::SubjectType; + type Subject = S::Subject; } ///State transition - sets the `subject_type` field to Set pub struct SetSubjectType(PhantomData S>); impl sealed::Sealed for SetSubjectType {} impl State for SetSubjectType { + type Tag = S::Tag; type SubjectType = Set; type Subject = S::Subject; - type Tag = S::Tag; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type SubjectType = S::SubjectType; - type Subject = Set; type Tag = S::Tag; - } - ///State transition - sets the `tag` field to Set - pub struct SetTag(PhantomData S>); - impl sealed::Sealed for SetTag {} - impl State for SetTag { type SubjectType = S::SubjectType; - type Subject = S::Subject; - type Tag = Set; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `tag` field + pub struct tag(()); ///Marker type for the `subject_type` field pub struct subject_type(()); ///Marker type for the `subject` field pub struct subject(()); - ///Marker type for the `tag` field - pub struct tag(()); } } @@ -227,9 +227,9 @@ where impl<'a, S> SuggestionBuilder<'a, S> where S: suggestion_state::State, + S::Tag: suggestion_state::IsSet, S::SubjectType: suggestion_state::IsSet, S::Subject: suggestion_state::IsSet, - S::Tag: suggestion_state::IsSet, { /// Build the final struct pub fn build(self) -> Suggestion<'a> { diff --git a/crates/weaver-api/src/blog_pckt/block/image.rs b/crates/weaver-api/src/blog_pckt/block/image.rs index 7b11ce6..315dd54 100644 --- a/crates/weaver-api/src/blog_pckt/block/image.rs +++ b/crates/weaver-api/src/blog_pckt/block/image.rs @@ -34,37 +34,37 @@ pub mod aspect_ratio_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Height; type Width; + type Height; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Height = Unset; type Width = Unset; - } - ///State transition - sets the `height` field to Set - pub struct SetHeight(PhantomData S>); - impl sealed::Sealed for SetHeight {} - impl State for SetHeight { - type Height = Set; - type Width = S::Width; + type Height = Unset; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData S>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Height = S::Height; type Width = Set; + type Height = S::Height; + } + ///State transition - sets the `height` field to Set + pub struct SetHeight(PhantomData S>); + impl sealed::Sealed for SetHeight {} + impl State for SetHeight { + type Width = S::Width; + type Height = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `height` field - pub struct height(()); ///Marker type for the `width` field pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); } } @@ -134,8 +134,8 @@ where impl<'a, S> AspectRatioBuilder<'a, S> where S: aspect_ratio_state::State, - S::Height: aspect_ratio_state::IsSet, S::Width: aspect_ratio_state::IsSet, + S::Height: aspect_ratio_state::IsSet, { /// Build the final struct pub fn build(self) -> AspectRatio<'a> { diff --git a/crates/weaver-api/src/blog_pckt/post.rs b/crates/weaver-api/src/blog_pckt/post.rs index 8c6dae6..a9b6989 100644 --- a/crates/weaver-api/src/blog_pckt/post.rs +++ b/crates/weaver-api/src/blog_pckt/post.rs @@ -54,66 +54,66 @@ pub mod post_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Title; - type Blocks; type Blog; type Url; + type Blocks; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Title = Unset; - type Blocks = Unset; type Blog = Unset; type Url = Unset; + type Blocks = Unset; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { type Title = Set; - type Blocks = S::Blocks; - type Blog = S::Blog; - type Url = S::Url; - } - ///State transition - sets the `blocks` field to Set - pub struct SetBlocks(PhantomData S>); - impl sealed::Sealed for SetBlocks {} - impl State for SetBlocks { - type Title = S::Title; - type Blocks = Set; type Blog = S::Blog; type Url = S::Url; + type Blocks = S::Blocks; } ///State transition - sets the `blog` field to Set pub struct SetBlog(PhantomData S>); impl sealed::Sealed for SetBlog {} impl State for SetBlog { type Title = S::Title; - type Blocks = S::Blocks; type Blog = Set; type Url = S::Url; + type Blocks = S::Blocks; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { type Title = S::Title; - type Blocks = S::Blocks; type Blog = S::Blog; type Url = Set; + type Blocks = S::Blocks; + } + ///State transition - sets the `blocks` field to Set + pub struct SetBlocks(PhantomData S>); + impl sealed::Sealed for SetBlocks {} + impl State for SetBlocks { + type Title = S::Title; + type Blog = S::Blog; + type Url = S::Url; + type Blocks = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `title` field pub struct title(()); - ///Marker type for the `blocks` field - pub struct blocks(()); ///Marker type for the `blog` field pub struct blog(()); ///Marker type for the `url` field pub struct url(()); + ///Marker type for the `blocks` field + pub struct blocks(()); } } @@ -358,9 +358,9 @@ impl<'a, S> PostBuilder<'a, S> where S: post_state::State, S::Title: post_state::IsSet, - S::Blocks: post_state::IsSet, S::Blog: post_state::IsSet, S::Url: post_state::IsSet, + S::Blocks: post_state::IsSet, { /// Build the final struct pub fn build(self) -> Post<'a> { diff --git a/crates/weaver-api/src/blog_pckt/richtext/facet.rs b/crates/weaver-api/src/blog_pckt/richtext/facet.rs index 77c2c9f..8e28b64 100644 --- a/crates/weaver-api/src/blog_pckt/richtext/facet.rs +++ b/crates/weaver-api/src/blog_pckt/richtext/facet.rs @@ -1051,37 +1051,37 @@ pub mod facet_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Features; type Index; + type Features; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Features = Unset; type Index = Unset; - } - ///State transition - sets the `features` field to Set - pub struct SetFeatures(PhantomData S>); - impl sealed::Sealed for SetFeatures {} - impl State for SetFeatures { - type Features = Set; - type Index = S::Index; + type Features = Unset; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { - type Features = S::Features; type Index = Set; + type Features = S::Features; + } + ///State transition - sets the `features` field to Set + pub struct SetFeatures(PhantomData S>); + impl sealed::Sealed for SetFeatures {} + impl State for SetFeatures { + type Index = S::Index; + type Features = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `features` field - pub struct features(()); ///Marker type for the `index` field pub struct index(()); + ///Marker type for the `features` field + pub struct features(()); } } @@ -1154,8 +1154,8 @@ where impl<'a, S> FacetBuilder<'a, S> where S: facet_state::State, - S::Features: facet_state::IsSet, S::Index: facet_state::IsSet, + S::Features: facet_state::IsSet, { /// Build the final struct pub fn build(self) -> Facet<'a> { diff --git a/crates/weaver-api/src/blog_pckt/theme.rs b/crates/weaver-api/src/blog_pckt/theme.rs index ba074ec..5852eda 100644 --- a/crates/weaver-api/src/blog_pckt/theme.rs +++ b/crates/weaver-api/src/blog_pckt/theme.rs @@ -40,37 +40,37 @@ pub mod theme_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Dark; type Light; + type Dark; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Dark = Unset; type Light = Unset; - } - ///State transition - sets the `dark` field to Set - pub struct SetDark(PhantomData S>); - impl sealed::Sealed for SetDark {} - impl State for SetDark { - type Dark = Set; - type Light = S::Light; + type Dark = Unset; } ///State transition - sets the `light` field to Set pub struct SetLight(PhantomData S>); impl sealed::Sealed for SetLight {} impl State for SetLight { - type Dark = S::Dark; type Light = Set; + type Dark = S::Dark; + } + ///State transition - sets the `dark` field to Set + pub struct SetDark(PhantomData S>); + impl sealed::Sealed for SetDark {} + impl State for SetDark { + type Light = S::Light; + type Dark = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `dark` field - pub struct dark(()); ///Marker type for the `light` field pub struct light(()); + ///Marker type for the `dark` field + pub struct dark(()); } } @@ -160,8 +160,8 @@ where impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, - S::Dark: theme_state::IsSet, S::Light: theme_state::IsSet, + S::Dark: theme_state::IsSet, { /// Build the final struct pub fn build(self) -> Theme<'a> { diff --git a/crates/weaver-api/src/chat_bsky/convo.rs b/crates/weaver-api/src/chat_bsky/convo.rs index 8c587d5..483ecf6 100644 --- a/crates/weaver-api/src/chat_bsky/convo.rs +++ b/crates/weaver-api/src/chat_bsky/convo.rs @@ -66,85 +66,85 @@ pub mod convo_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Rev; + type Members; type Muted; type UnreadCount; type Id; - type Members; - type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Rev = Unset; + type Members = Unset; type Muted = Unset; type UnreadCount = Unset; type Id = Unset; - type Members = Unset; - type Rev = Unset; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rev = Set; + type Members = S::Members; + type Muted = S::Muted; + type UnreadCount = S::UnreadCount; + type Id = S::Id; + } + ///State transition - sets the `members` field to Set + pub struct SetMembers(PhantomData S>); + impl sealed::Sealed for SetMembers {} + impl State for SetMembers { + type Rev = S::Rev; + type Members = Set; + type Muted = S::Muted; + type UnreadCount = S::UnreadCount; + type Id = S::Id; } ///State transition - sets the `muted` field to Set pub struct SetMuted(PhantomData S>); impl sealed::Sealed for SetMuted {} impl State for SetMuted { + type Rev = S::Rev; + type Members = S::Members; type Muted = Set; type UnreadCount = S::UnreadCount; type Id = S::Id; - type Members = S::Members; - type Rev = S::Rev; } ///State transition - sets the `unread_count` field to Set pub struct SetUnreadCount(PhantomData S>); impl sealed::Sealed for SetUnreadCount {} impl State for SetUnreadCount { + type Rev = S::Rev; + type Members = S::Members; type Muted = S::Muted; type UnreadCount = Set; type Id = S::Id; - type Members = S::Members; - type Rev = S::Rev; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type Muted = S::Muted; - type UnreadCount = S::UnreadCount; - type Id = Set; - type Members = S::Members; - type Rev = S::Rev; - } - ///State transition - sets the `members` field to Set - pub struct SetMembers(PhantomData S>); - impl sealed::Sealed for SetMembers {} - impl State for SetMembers { - type Muted = S::Muted; - type UnreadCount = S::UnreadCount; - type Id = S::Id; - type Members = Set; type Rev = S::Rev; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { + type Members = S::Members; type Muted = S::Muted; type UnreadCount = S::UnreadCount; - type Id = S::Id; - type Members = S::Members; - type Rev = Set; + type Id = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `members` field + pub struct members(()); ///Marker type for the `muted` field pub struct muted(()); ///Marker type for the `unread_count` field pub struct unread_count(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `members` field - pub struct members(()); - ///Marker type for the `rev` field - pub struct rev(()); } } @@ -331,11 +331,11 @@ where impl<'a, S> ConvoViewBuilder<'a, S> where S: convo_view_state::State, + S::Rev: convo_view_state::IsSet, + S::Members: convo_view_state::IsSet, S::Muted: convo_view_state::IsSet, S::UnreadCount: convo_view_state::IsSet, S::Id: convo_view_state::IsSet, - S::Members: convo_view_state::IsSet, - S::Rev: convo_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ConvoView<'a> { @@ -1734,8 +1734,8 @@ pub mod deleted_message_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Id; - type Rev; type SentAt; + type Rev; type Sender; } /// Empty state - all required fields are unset @@ -1743,8 +1743,8 @@ pub mod deleted_message_view_state { impl sealed::Sealed for Empty {} impl State for Empty { type Id = Unset; - type Rev = Unset; type SentAt = Unset; + type Rev = Unset; type Sender = Unset; } ///State transition - sets the `id` field to Set @@ -1752,17 +1752,8 @@ pub mod deleted_message_view_state { impl sealed::Sealed for SetId {} impl State for SetId { type Id = Set; - type Rev = S::Rev; - type SentAt = S::SentAt; - type Sender = S::Sender; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Id = S::Id; - type Rev = Set; type SentAt = S::SentAt; + type Rev = S::Rev; type Sender = S::Sender; } ///State transition - sets the `sent_at` field to Set @@ -1770,8 +1761,17 @@ pub mod deleted_message_view_state { impl sealed::Sealed for SetSentAt {} impl State for SetSentAt { type Id = S::Id; - type Rev = S::Rev; type SentAt = Set; + type Rev = S::Rev; + type Sender = S::Sender; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Id = S::Id; + type SentAt = S::SentAt; + type Rev = Set; type Sender = S::Sender; } ///State transition - sets the `sender` field to Set @@ -1779,8 +1779,8 @@ pub mod deleted_message_view_state { impl sealed::Sealed for SetSender {} impl State for SetSender { type Id = S::Id; - type Rev = S::Rev; type SentAt = S::SentAt; + type Rev = S::Rev; type Sender = Set; } /// Marker types for field names @@ -1788,10 +1788,10 @@ pub mod deleted_message_view_state { pub mod members { ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `sent_at` field pub struct sent_at(()); + ///Marker type for the `rev` field + pub struct rev(()); ///Marker type for the `sender` field pub struct sender(()); } @@ -1907,8 +1907,8 @@ impl<'a, S> DeletedMessageViewBuilder<'a, S> where S: deleted_message_view_state::State, S::Id: deleted_message_view_state::IsSet, - S::Rev: deleted_message_view_state::IsSet, S::SentAt: deleted_message_view_state::IsSet, + S::Rev: deleted_message_view_state::IsSet, S::Sender: deleted_message_view_state::IsSet, { /// Build the final struct @@ -2024,65 +2024,65 @@ pub mod log_add_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; - type Rev; type Message; + type Rev; + type ConvoId; type Reaction; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ConvoId = Unset; - type Rev = Unset; type Message = Unset; + type Rev = Unset; + type ConvoId = Unset; type Reaction = Unset; } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData S>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type ConvoId = Set; + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; type Rev = S::Rev; - type Message = S::Message; + type ConvoId = S::ConvoId; type Reaction = S::Reaction; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type ConvoId = S::ConvoId; - type Rev = Set; type Message = S::Message; + type Rev = Set; + type ConvoId = S::ConvoId; type Reaction = S::Reaction; } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type ConvoId = S::ConvoId; + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData S>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Message = S::Message; type Rev = S::Rev; - type Message = Set; + type ConvoId = Set; type Reaction = S::Reaction; } ///State transition - sets the `reaction` field to Set pub struct SetReaction(PhantomData S>); impl sealed::Sealed for SetReaction {} impl State for SetReaction { - type ConvoId = S::ConvoId; - type Rev = S::Rev; type Message = S::Message; + type Rev = S::Rev; + type ConvoId = S::ConvoId; type Reaction = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convo_id` field - pub struct convo_id(()); - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `message` field pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); ///Marker type for the `reaction` field pub struct reaction(()); } @@ -2197,9 +2197,9 @@ where impl<'a, S> LogAddReactionBuilder<'a, S> where S: log_add_reaction_state::State, - S::ConvoId: log_add_reaction_state::IsSet, - S::Rev: log_add_reaction_state::IsSet, S::Message: log_add_reaction_state::IsSet, + S::Rev: log_add_reaction_state::IsSet, + S::ConvoId: log_add_reaction_state::IsSet, S::Reaction: log_add_reaction_state::IsSet, { /// Build the final struct @@ -2332,49 +2332,49 @@ pub mod log_create_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Message; type Rev; + type Message; type ConvoId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Message = Unset; type Rev = Unset; + type Message = Unset; type ConvoId = Unset; } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type Message = Set; - type Rev = S::Rev; - type ConvoId = S::ConvoId; - } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Message = S::Message; type Rev = Set; + type Message = S::Message; + type ConvoId = S::ConvoId; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Rev = S::Rev; + type Message = Set; type ConvoId = S::ConvoId; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Message = S::Message; type Rev = S::Rev; + type Message = S::Message; type ConvoId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `message` field - pub struct message(()); ///Marker type for the `rev` field pub struct rev(()); + ///Marker type for the `message` field + pub struct message(()); ///Marker type for the `convo_id` field pub struct convo_id(()); } @@ -2469,8 +2469,8 @@ where impl<'a, S> LogCreateMessageBuilder<'a, S> where S: log_create_message_state::State, - S::Message: log_create_message_state::IsSet, S::Rev: log_create_message_state::IsSet, + S::Message: log_create_message_state::IsSet, S::ConvoId: log_create_message_state::IsSet, { /// Build the final struct @@ -2565,49 +2565,49 @@ pub mod log_delete_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; type Rev; + type ConvoId; type Message; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ConvoId = Unset; type Rev = Unset; + type ConvoId = Unset; type Message = Unset; } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData S>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type ConvoId = Set; - type Rev = S::Rev; - type Message = S::Message; - } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type ConvoId = S::ConvoId; type Rev = Set; + type ConvoId = S::ConvoId; + type Message = S::Message; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData S>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = S::Rev; + type ConvoId = Set; type Message = S::Message; } ///State transition - sets the `message` field to Set pub struct SetMessage(PhantomData S>); impl sealed::Sealed for SetMessage {} impl State for SetMessage { - type ConvoId = S::ConvoId; type Rev = S::Rev; + type ConvoId = S::ConvoId; type Message = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convo_id` field - pub struct convo_id(()); ///Marker type for the `rev` field pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); ///Marker type for the `message` field pub struct message(()); } @@ -2702,8 +2702,8 @@ where impl<'a, S> LogDeleteMessageBuilder<'a, S> where S: log_delete_message_state::State, - S::ConvoId: log_delete_message_state::IsSet, S::Rev: log_delete_message_state::IsSet, + S::ConvoId: log_delete_message_state::IsSet, S::Message: log_delete_message_state::IsSet, { /// Build the final struct @@ -2870,51 +2870,51 @@ pub mod log_read_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; - type Rev; type Message; + type Rev; + type ConvoId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ConvoId = Unset; - type Rev = Unset; type Message = Unset; + type Rev = Unset; + type ConvoId = Unset; } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData S>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type ConvoId = Set; + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; type Rev = S::Rev; - type Message = S::Message; + type ConvoId = S::ConvoId; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type ConvoId = S::ConvoId; - type Rev = Set; type Message = S::Message; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { + type Rev = Set; type ConvoId = S::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData S>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Message = S::Message; type Rev = S::Rev; - type Message = Set; + type ConvoId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convo_id` field - pub struct convo_id(()); - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `message` field pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); } } @@ -3007,9 +3007,9 @@ where impl<'a, S> LogReadMessageBuilder<'a, S> where S: log_read_message_state::State, - S::ConvoId: log_read_message_state::IsSet, - S::Rev: log_read_message_state::IsSet, S::Message: log_read_message_state::IsSet, + S::Rev: log_read_message_state::IsSet, + S::ConvoId: log_read_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogReadMessage<'a> { @@ -3105,67 +3105,67 @@ pub mod log_remove_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; - type Message; type Reaction; type ConvoId; + type Message; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; - type Message = Unset; type Reaction = Unset; type ConvoId = Unset; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Rev = Set; - type Message = S::Message; - type Reaction = S::Reaction; - type ConvoId = S::ConvoId; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type Rev = S::Rev; - type Message = Set; - type Reaction = S::Reaction; - type ConvoId = S::ConvoId; + type Message = Unset; + type Rev = Unset; } ///State transition - sets the `reaction` field to Set pub struct SetReaction(PhantomData S>); impl sealed::Sealed for SetReaction {} impl State for SetReaction { - type Rev = S::Rev; - type Message = S::Message; type Reaction = Set; type ConvoId = S::ConvoId; + type Message = S::Message; + type Rev = S::Rev; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Rev = S::Rev; - type Message = S::Message; type Reaction = S::Reaction; type ConvoId = Set; + type Message = S::Message; + type Rev = S::Rev; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Reaction = S::Reaction; + type ConvoId = S::ConvoId; + type Message = Set; + type Rev = S::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Reaction = S::Reaction; + type ConvoId = S::ConvoId; + type Message = S::Message; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rev` field - pub struct rev(()); - ///Marker type for the `message` field - pub struct message(()); ///Marker type for the `reaction` field pub struct reaction(()); ///Marker type for the `convo_id` field pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -3278,10 +3278,10 @@ where impl<'a, S> LogRemoveReactionBuilder<'a, S> where S: log_remove_reaction_state::State, - S::Rev: log_remove_reaction_state::IsSet, - S::Message: log_remove_reaction_state::IsSet, S::Reaction: log_remove_reaction_state::IsSet, S::ConvoId: log_remove_reaction_state::IsSet, + S::Message: log_remove_reaction_state::IsSet, + S::Rev: log_remove_reaction_state::IsSet, { /// Build the final struct pub fn build(self) -> LogRemoveReaction<'a> { @@ -3411,37 +3411,37 @@ pub mod message_and_reaction_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reaction; type Message; + type Reaction; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reaction = Unset; type Message = Unset; - } - ///State transition - sets the `reaction` field to Set - pub struct SetReaction(PhantomData S>); - impl sealed::Sealed for SetReaction {} - impl State for SetReaction { - type Reaction = Set; - type Message = S::Message; + type Reaction = Unset; } ///State transition - sets the `message` field to Set pub struct SetMessage(PhantomData S>); impl sealed::Sealed for SetMessage {} impl State for SetMessage { - type Reaction = S::Reaction; type Message = Set; + type Reaction = S::Reaction; + } + ///State transition - sets the `reaction` field to Set + pub struct SetReaction(PhantomData S>); + impl sealed::Sealed for SetReaction {} + impl State for SetReaction { + type Message = S::Message; + type Reaction = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reaction` field - pub struct reaction(()); ///Marker type for the `message` field pub struct message(()); + ///Marker type for the `reaction` field + pub struct reaction(()); } } @@ -3523,8 +3523,8 @@ where impl<'a, S> MessageAndReactionViewBuilder<'a, S> where S: message_and_reaction_view_state::State, - S::Reaction: message_and_reaction_view_state::IsSet, S::Message: message_and_reaction_view_state::IsSet, + S::Reaction: message_and_reaction_view_state::IsSet, { /// Build the final struct pub fn build(self) -> MessageAndReactionView<'a> { @@ -3670,51 +3670,51 @@ pub mod message_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type MessageId; type ConvoId; type Did; - type MessageId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type MessageId = Unset; type ConvoId = Unset; type Did = Unset; - type MessageId = Unset; + } + ///State transition - sets the `message_id` field to Set + pub struct SetMessageId(PhantomData S>); + impl sealed::Sealed for SetMessageId {} + impl State for SetMessageId { + type MessageId = Set; + type ConvoId = S::ConvoId; + type Did = S::Did; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { + type MessageId = S::MessageId; type ConvoId = Set; type Did = S::Did; - type MessageId = S::MessageId; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type ConvoId = S::ConvoId; - type Did = Set; type MessageId = S::MessageId; - } - ///State transition - sets the `message_id` field to Set - pub struct SetMessageId(PhantomData S>); - impl sealed::Sealed for SetMessageId {} - impl State for SetMessageId { type ConvoId = S::ConvoId; - type Did = S::Did; - type MessageId = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `message_id` field + pub struct message_id(()); ///Marker type for the `convo_id` field pub struct convo_id(()); ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `message_id` field - pub struct message_id(()); } } @@ -3807,9 +3807,9 @@ where impl<'a, S> MessageRefBuilder<'a, S> where S: message_ref_state::State, + S::MessageId: message_ref_state::IsSet, S::ConvoId: message_ref_state::IsSet, S::Did: message_ref_state::IsSet, - S::MessageId: message_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> MessageRef<'a> { @@ -3900,9 +3900,9 @@ pub mod message_view_state { pub trait State: sealed::Sealed { type Rev; type Id; - type Text; type Sender; type SentAt; + type Text; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -3910,9 +3910,9 @@ pub mod message_view_state { impl State for Empty { type Rev = Unset; type Id = Unset; - type Text = Unset; type Sender = Unset; type SentAt = Unset; + type Text = Unset; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); @@ -3920,9 +3920,9 @@ pub mod message_view_state { impl State for SetRev { type Rev = Set; type Id = S::Id; - type Text = S::Text; type Sender = S::Sender; type SentAt = S::SentAt; + type Text = S::Text; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); @@ -3930,19 +3930,9 @@ pub mod message_view_state { impl State for SetId { type Rev = S::Rev; type Id = Set; - type Text = S::Text; - type Sender = S::Sender; - type SentAt = S::SentAt; - } - ///State transition - sets the `text` field to Set - pub struct SetText(PhantomData S>); - impl sealed::Sealed for SetText {} - impl State for SetText { - type Rev = S::Rev; - type Id = S::Id; - type Text = Set; type Sender = S::Sender; type SentAt = S::SentAt; + type Text = S::Text; } ///State transition - sets the `sender` field to Set pub struct SetSender(PhantomData S>); @@ -3950,9 +3940,9 @@ pub mod message_view_state { impl State for SetSender { type Rev = S::Rev; type Id = S::Id; - type Text = S::Text; type Sender = Set; type SentAt = S::SentAt; + type Text = S::Text; } ///State transition - sets the `sent_at` field to Set pub struct SetSentAt(PhantomData S>); @@ -3960,9 +3950,19 @@ pub mod message_view_state { impl State for SetSentAt { type Rev = S::Rev; type Id = S::Id; - type Text = S::Text; type Sender = S::Sender; type SentAt = Set; + type Text = S::Text; + } + ///State transition - sets the `text` field to Set + pub struct SetText(PhantomData S>); + impl sealed::Sealed for SetText {} + impl State for SetText { + type Rev = S::Rev; + type Id = S::Id; + type Sender = S::Sender; + type SentAt = S::SentAt; + type Text = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -3971,12 +3971,12 @@ pub mod message_view_state { pub struct rev(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `text` field - pub struct text(()); ///Marker type for the `sender` field pub struct sender(()); ///Marker type for the `sent_at` field pub struct sent_at(()); + ///Marker type for the `text` field + pub struct text(()); } } @@ -4171,9 +4171,9 @@ where S: message_view_state::State, S::Rev: message_view_state::IsSet, S::Id: message_view_state::IsSet, - S::Text: message_view_state::IsSet, S::Sender: message_view_state::IsSet, S::SentAt: message_view_state::IsSet, + S::Text: message_view_state::IsSet, { /// Build the final struct pub fn build(self) -> MessageView<'a> { @@ -4427,49 +4427,49 @@ pub mod reaction_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Value; type CreatedAt; + type Value; type Sender; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Value = Unset; type CreatedAt = Unset; + type Value = Unset; type Sender = Unset; } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Value = Set; - type CreatedAt = S::CreatedAt; - type Sender = S::Sender; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Value = S::Value; type CreatedAt = Set; + type Value = S::Value; + type Sender = S::Sender; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type CreatedAt = S::CreatedAt; + type Value = Set; type Sender = S::Sender; } ///State transition - sets the `sender` field to Set pub struct SetSender(PhantomData S>); impl sealed::Sealed for SetSender {} impl State for SetSender { - type Value = S::Value; type CreatedAt = S::CreatedAt; + type Value = S::Value; type Sender = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `sender` field pub struct sender(()); } @@ -4564,8 +4564,8 @@ where impl<'a, S> ReactionViewBuilder<'a, S> where S: reaction_view_state::State, - S::Value: reaction_view_state::IsSet, S::CreatedAt: reaction_view_state::IsSet, + S::Value: reaction_view_state::IsSet, S::Sender: reaction_view_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs b/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs index 1780c82..72eb8ac 100644 --- a/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs +++ b/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs @@ -185,67 +185,67 @@ pub mod metadata_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type MessagesReceived; type ConvosStarted; - type Convos; type MessagesSent; - type MessagesReceived; + type Convos; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type MessagesReceived = Unset; type ConvosStarted = Unset; - type Convos = Unset; type MessagesSent = Unset; - type MessagesReceived = Unset; + type Convos = Unset; + } + ///State transition - sets the `messages_received` field to Set + pub struct SetMessagesReceived(PhantomData S>); + impl sealed::Sealed for SetMessagesReceived {} + impl State for SetMessagesReceived { + type MessagesReceived = Set; + type ConvosStarted = S::ConvosStarted; + type MessagesSent = S::MessagesSent; + type Convos = S::Convos; } ///State transition - sets the `convos_started` field to Set pub struct SetConvosStarted(PhantomData S>); impl sealed::Sealed for SetConvosStarted {} impl State for SetConvosStarted { - type ConvosStarted = Set; - type Convos = S::Convos; - type MessagesSent = S::MessagesSent; type MessagesReceived = S::MessagesReceived; - } - ///State transition - sets the `convos` field to Set - pub struct SetConvos(PhantomData S>); - impl sealed::Sealed for SetConvos {} - impl State for SetConvos { - type ConvosStarted = S::ConvosStarted; - type Convos = Set; + type ConvosStarted = Set; type MessagesSent = S::MessagesSent; - type MessagesReceived = S::MessagesReceived; + type Convos = S::Convos; } ///State transition - sets the `messages_sent` field to Set pub struct SetMessagesSent(PhantomData S>); impl sealed::Sealed for SetMessagesSent {} impl State for SetMessagesSent { + type MessagesReceived = S::MessagesReceived; type ConvosStarted = S::ConvosStarted; - type Convos = S::Convos; type MessagesSent = Set; - type MessagesReceived = S::MessagesReceived; + type Convos = S::Convos; } - ///State transition - sets the `messages_received` field to Set - pub struct SetMessagesReceived(PhantomData S>); - impl sealed::Sealed for SetMessagesReceived {} - impl State for SetMessagesReceived { + ///State transition - sets the `convos` field to Set + pub struct SetConvos(PhantomData S>); + impl sealed::Sealed for SetConvos {} + impl State for SetConvos { + type MessagesReceived = S::MessagesReceived; type ConvosStarted = S::ConvosStarted; - type Convos = S::Convos; type MessagesSent = S::MessagesSent; - type MessagesReceived = Set; + type Convos = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `messages_received` field + pub struct messages_received(()); ///Marker type for the `convos_started` field pub struct convos_started(()); - ///Marker type for the `convos` field - pub struct convos(()); ///Marker type for the `messages_sent` field pub struct messages_sent(()); - ///Marker type for the `messages_received` field - pub struct messages_received(()); + ///Marker type for the `convos` field + pub struct convos(()); } } @@ -358,10 +358,10 @@ where impl<'a, S> MetadataBuilder<'a, S> where S: metadata_state::State, + S::MessagesReceived: metadata_state::IsSet, S::ConvosStarted: metadata_state::IsSet, - S::Convos: metadata_state::IsSet, S::MessagesSent: metadata_state::IsSet, - S::MessagesReceived: metadata_state::IsSet, + S::Convos: metadata_state::IsSet, { /// Build the final struct pub fn build(self) -> Metadata<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin.rs b/crates/weaver-api/src/com_atproto/admin.rs index be51833..1715a0d 100644 --- a/crates/weaver-api/src/com_atproto/admin.rs +++ b/crates/weaver-api/src/com_atproto/admin.rs @@ -81,50 +81,50 @@ pub mod account_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type IndexedAt; - type Did; type Handle; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type IndexedAt = Unset; - type Did = Unset; type Handle = Unset; + type Did = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type IndexedAt = Set; - type Did = S::Did; - type Handle = S::Handle; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type IndexedAt = S::IndexedAt; - type Did = Set; type Handle = S::Handle; + type Did = S::Did; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type IndexedAt = S::IndexedAt; - type Did = S::Did; type Handle = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type IndexedAt = S::IndexedAt; + type Handle = S::Handle; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -402,8 +402,8 @@ impl<'a, S> AccountViewBuilder<'a, S> where S: account_view_state::State, S::IndexedAt: account_view_state::IsSet, - S::Did: account_view_state::IsSet, S::Handle: account_view_state::IsSet, + S::Did: account_view_state::IsSet, { /// Build the final struct pub fn build(self) -> AccountView<'a> { @@ -907,37 +907,37 @@ pub mod repo_blob_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Cid; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Cid = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Cid = S::Cid; + type Did = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Did = S::Did; type Cid = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Cid = S::Cid; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -1030,8 +1030,8 @@ impl<'a, S: repo_blob_ref_state::State> RepoBlobRefBuilder<'a, S> { impl<'a, S> RepoBlobRefBuilder<'a, S> where S: repo_blob_ref_state::State, - S::Did: repo_blob_ref_state::IsSet, S::Cid: repo_blob_ref_state::IsSet, + S::Did: repo_blob_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoBlobRef<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin/send_email.rs b/crates/weaver-api/src/com_atproto/admin/send_email.rs index b386221..47b3dfe 100644 --- a/crates/weaver-api/src/com_atproto/admin/send_email.rs +++ b/crates/weaver-api/src/com_atproto/admin/send_email.rs @@ -42,51 +42,51 @@ pub mod send_email_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type SenderDid; type RecipientDid; type Content; + type SenderDid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type SenderDid = Unset; type RecipientDid = Unset; type Content = Unset; - } - ///State transition - sets the `sender_did` field to Set - pub struct SetSenderDid(PhantomData S>); - impl sealed::Sealed for SetSenderDid {} - impl State for SetSenderDid { - type SenderDid = Set; - type RecipientDid = S::RecipientDid; - type Content = S::Content; + type SenderDid = Unset; } ///State transition - sets the `recipient_did` field to Set pub struct SetRecipientDid(PhantomData S>); impl sealed::Sealed for SetRecipientDid {} impl State for SetRecipientDid { - type SenderDid = S::SenderDid; type RecipientDid = Set; type Content = S::Content; + type SenderDid = S::SenderDid; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { - type SenderDid = S::SenderDid; type RecipientDid = S::RecipientDid; type Content = Set; + type SenderDid = S::SenderDid; + } + ///State transition - sets the `sender_did` field to Set + pub struct SetSenderDid(PhantomData S>); + impl sealed::Sealed for SetSenderDid {} + impl State for SetSenderDid { + type RecipientDid = S::RecipientDid; + type Content = S::Content; + type SenderDid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `sender_did` field - pub struct sender_did(()); ///Marker type for the `recipient_did` field pub struct recipient_did(()); ///Marker type for the `content` field pub struct content(()); + ///Marker type for the `sender_did` field + pub struct sender_did(()); } } @@ -213,9 +213,9 @@ impl<'a, S: send_email_state::State> SendEmailBuilder<'a, S> { impl<'a, S> SendEmailBuilder<'a, S> where S: send_email_state::State, - S::SenderDid: send_email_state::IsSet, S::RecipientDid: send_email_state::IsSet, S::Content: send_email_state::IsSet, + S::SenderDid: send_email_state::IsSet, { /// Build the final struct pub fn build(self) -> SendEmail<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin/update_account_signing_key.rs b/crates/weaver-api/src/com_atproto/admin/update_account_signing_key.rs index aae1574..e0cf07f 100644 --- a/crates/weaver-api/src/com_atproto/admin/update_account_signing_key.rs +++ b/crates/weaver-api/src/com_atproto/admin/update_account_signing_key.rs @@ -34,37 +34,37 @@ pub mod update_account_signing_key_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type SigningKey; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type SigningKey = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type SigningKey = S::SigningKey; + type Did = Unset; } ///State transition - sets the `signing_key` field to Set pub struct SetSigningKey(PhantomData S>); impl sealed::Sealed for SetSigningKey {} impl State for SetSigningKey { - type Did = S::Did; type SigningKey = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type SigningKey = S::SigningKey; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `signing_key` field pub struct signing_key(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -149,8 +149,8 @@ where impl<'a, S> UpdateAccountSigningKeyBuilder<'a, S> where S: update_account_signing_key_state::State, - S::Did: update_account_signing_key_state::IsSet, S::SigningKey: update_account_signing_key_state::IsSet, + S::Did: update_account_signing_key_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateAccountSigningKey<'a> { diff --git a/crates/weaver-api/src/com_atproto/identity.rs b/crates/weaver-api/src/com_atproto/identity.rs index 4e1b7a0..062bb12 100644 --- a/crates/weaver-api/src/com_atproto/identity.rs +++ b/crates/weaver-api/src/com_atproto/identity.rs @@ -48,50 +48,50 @@ pub mod identity_info_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Handle; - type DidDoc; type Did; + type DidDoc; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Handle = Unset; - type DidDoc = Unset; type Did = Unset; + type DidDoc = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type Handle = Set; - type DidDoc = S::DidDoc; - type Did = S::Did; - } - ///State transition - sets the `did_doc` field to Set - pub struct SetDidDoc(PhantomData S>); - impl sealed::Sealed for SetDidDoc {} - impl State for SetDidDoc { - type Handle = S::Handle; - type DidDoc = Set; type Did = S::Did; + type DidDoc = S::DidDoc; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Handle = S::Handle; - type DidDoc = S::DidDoc; type Did = Set; + type DidDoc = S::DidDoc; + } + ///State transition - sets the `did_doc` field to Set + pub struct SetDidDoc(PhantomData S>); + impl sealed::Sealed for SetDidDoc {} + impl State for SetDidDoc { + type Handle = S::Handle; + type Did = S::Did; + type DidDoc = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `handle` field pub struct handle(()); - ///Marker type for the `did_doc` field - pub struct did_doc(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `did_doc` field + pub struct did_doc(()); } } @@ -185,8 +185,8 @@ impl<'a, S> IdentityInfoBuilder<'a, S> where S: identity_info_state::State, S::Handle: identity_info_state::IsSet, - S::DidDoc: identity_info_state::IsSet, S::Did: identity_info_state::IsSet, + S::DidDoc: identity_info_state::IsSet, { /// Build the final struct pub fn build(self) -> IdentityInfo<'a> { diff --git a/crates/weaver-api/src/com_atproto/label.rs b/crates/weaver-api/src/com_atproto/label.rs index 3789e54..67acbce 100644 --- a/crates/weaver-api/src/com_atproto/label.rs +++ b/crates/weaver-api/src/com_atproto/label.rs @@ -63,67 +63,67 @@ pub mod label_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Val; - type Src; - type Cts; type Uri; + type Cts; + type Src; + type Val; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Val = Unset; - type Src = Unset; - type Cts = Unset; type Uri = Unset; + type Cts = Unset; + type Src = Unset; + type Val = Unset; } - ///State transition - sets the `val` field to Set - pub struct SetVal(PhantomData S>); - impl sealed::Sealed for SetVal {} - impl State for SetVal { - type Val = Set; - type Src = S::Src; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type Cts = S::Cts; - type Uri = S::Uri; - } - ///State transition - sets the `src` field to Set - pub struct SetSrc(PhantomData S>); - impl sealed::Sealed for SetSrc {} - impl State for SetSrc { + type Src = S::Src; type Val = S::Val; - type Src = Set; - type Cts = S::Cts; - type Uri = S::Uri; } ///State transition - sets the `cts` field to Set pub struct SetCts(PhantomData S>); impl sealed::Sealed for SetCts {} impl State for SetCts { - type Val = S::Val; - type Src = S::Src; - type Cts = Set; type Uri = S::Uri; + type Cts = Set; + type Src = S::Src; + type Val = S::Val; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `src` field to Set + pub struct SetSrc(PhantomData S>); + impl sealed::Sealed for SetSrc {} + impl State for SetSrc { + type Uri = S::Uri; + type Cts = S::Cts; + type Src = Set; type Val = S::Val; - type Src = S::Src; + } + ///State transition - sets the `val` field to Set + pub struct SetVal(PhantomData S>); + impl sealed::Sealed for SetVal {} + impl State for SetVal { + type Uri = S::Uri; type Cts = S::Cts; - type Uri = Set; + type Src = S::Src; + type Val = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `val` field - pub struct val(()); - ///Marker type for the `src` field - pub struct src(()); - ///Marker type for the `cts` field - pub struct cts(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cts` field + pub struct cts(()); + ///Marker type for the `src` field + pub struct src(()); + ///Marker type for the `val` field + pub struct val(()); } } @@ -328,10 +328,10 @@ impl<'a, S: label_state::State> LabelBuilder<'a, S> { impl<'a, S> LabelBuilder<'a, S> where S: label_state::State, - S::Val: label_state::IsSet, - S::Src: label_state::IsSet, - S::Cts: label_state::IsSet, S::Uri: label_state::IsSet, + S::Cts: label_state::IsSet, + S::Src: label_state::IsSet, + S::Val: label_state::IsSet, { /// Build the final struct pub fn build(self) -> Label<'a> { @@ -1059,67 +1059,67 @@ pub mod label_value_definition_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Blurs; - type Identifier; type Severity; + type Blurs; type Locales; + type Identifier; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Blurs = Unset; - type Identifier = Unset; type Severity = Unset; + type Blurs = Unset; type Locales = Unset; - } - ///State transition - sets the `blurs` field to Set - pub struct SetBlurs(PhantomData S>); - impl sealed::Sealed for SetBlurs {} - impl State for SetBlurs { - type Blurs = Set; - type Identifier = S::Identifier; - type Severity = S::Severity; - type Locales = S::Locales; - } - ///State transition - sets the `identifier` field to Set - pub struct SetIdentifier(PhantomData S>); - impl sealed::Sealed for SetIdentifier {} - impl State for SetIdentifier { - type Blurs = S::Blurs; - type Identifier = Set; - type Severity = S::Severity; - type Locales = S::Locales; + type Identifier = Unset; } ///State transition - sets the `severity` field to Set pub struct SetSeverity(PhantomData S>); impl sealed::Sealed for SetSeverity {} impl State for SetSeverity { + type Severity = Set; type Blurs = S::Blurs; + type Locales = S::Locales; type Identifier = S::Identifier; - type Severity = Set; + } + ///State transition - sets the `blurs` field to Set + pub struct SetBlurs(PhantomData S>); + impl sealed::Sealed for SetBlurs {} + impl State for SetBlurs { + type Severity = S::Severity; + type Blurs = Set; type Locales = S::Locales; + type Identifier = S::Identifier; } ///State transition - sets the `locales` field to Set pub struct SetLocales(PhantomData S>); impl sealed::Sealed for SetLocales {} impl State for SetLocales { + type Severity = S::Severity; type Blurs = S::Blurs; + type Locales = Set; type Identifier = S::Identifier; + } + ///State transition - sets the `identifier` field to Set + pub struct SetIdentifier(PhantomData S>); + impl sealed::Sealed for SetIdentifier {} + impl State for SetIdentifier { type Severity = S::Severity; - type Locales = Set; + type Blurs = S::Blurs; + type Locales = S::Locales; + type Identifier = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `blurs` field - pub struct blurs(()); - ///Marker type for the `identifier` field - pub struct identifier(()); ///Marker type for the `severity` field pub struct severity(()); + ///Marker type for the `blurs` field + pub struct blurs(()); ///Marker type for the `locales` field pub struct locales(()); + ///Marker type for the `identifier` field + pub struct identifier(()); } } @@ -1274,10 +1274,10 @@ where impl<'a, S> LabelValueDefinitionBuilder<'a, S> where S: label_value_definition_state::State, - S::Blurs: label_value_definition_state::IsSet, - S::Identifier: label_value_definition_state::IsSet, S::Severity: label_value_definition_state::IsSet, + S::Blurs: label_value_definition_state::IsSet, S::Locales: label_value_definition_state::IsSet, + S::Identifier: label_value_definition_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelValueDefinition<'a> { diff --git a/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs b/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs index 13df8eb..2e30cc0 100644 --- a/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs +++ b/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs @@ -286,37 +286,37 @@ pub mod labels_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Labels; type Seq; + type Labels; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Labels = Unset; type Seq = Unset; - } - ///State transition - sets the `labels` field to Set - pub struct SetLabels(PhantomData S>); - impl sealed::Sealed for SetLabels {} - impl State for SetLabels { - type Labels = Set; - type Seq = S::Seq; + type Labels = Unset; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData S>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { - type Labels = S::Labels; type Seq = Set; + type Labels = S::Labels; + } + ///State transition - sets the `labels` field to Set + pub struct SetLabels(PhantomData S>); + impl sealed::Sealed for SetLabels {} + impl State for SetLabels { + type Seq = S::Seq; + type Labels = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `labels` field - pub struct labels(()); ///Marker type for the `seq` field pub struct seq(()); + ///Marker type for the `labels` field + pub struct labels(()); } } @@ -389,8 +389,8 @@ where impl<'a, S> LabelsBuilder<'a, S> where S: labels_state::State, - S::Labels: labels_state::IsSet, S::Seq: labels_state::IsSet, + S::Labels: labels_state::IsSet, { /// Build the final struct pub fn build(self) -> Labels<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo.rs b/crates/weaver-api/src/com_atproto/repo.rs index 9668377..a43999f 100644 --- a/crates/weaver-api/src/com_atproto/repo.rs +++ b/crates/weaver-api/src/com_atproto/repo.rs @@ -44,37 +44,37 @@ pub mod commit_meta_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; type Cid; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; type Cid = Unset; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Rev = Set; - type Cid = S::Cid; + type Rev = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Rev = S::Rev; type Cid = Set; + type Rev = S::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Cid = S::Cid; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -147,8 +147,8 @@ where impl<'a, S> CommitMetaBuilder<'a, S> where S: commit_meta_state::State, - S::Rev: commit_meta_state::IsSet, S::Cid: commit_meta_state::IsSet, + S::Rev: commit_meta_state::IsSet, { /// Build the final struct pub fn build(self) -> CommitMeta<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/apply_writes.rs b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs index ae10fc9..7532881 100644 --- a/crates/weaver-api/src/com_atproto/repo/apply_writes.rs +++ b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs @@ -1241,37 +1241,37 @@ pub mod apply_writes_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Repo; type Writes; + type Repo; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Repo = Unset; type Writes = Unset; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { - type Repo = Set; - type Writes = S::Writes; + type Repo = Unset; } ///State transition - sets the `writes` field to Set pub struct SetWrites(PhantomData S>); impl sealed::Sealed for SetWrites {} impl State for SetWrites { - type Repo = S::Repo; type Writes = Set; + type Repo = S::Repo; + } + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Writes = S::Writes; + type Repo = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `repo` field - pub struct repo(()); ///Marker type for the `writes` field pub struct writes(()); + ///Marker type for the `repo` field + pub struct repo(()); } } @@ -1378,8 +1378,8 @@ where impl<'a, S> ApplyWritesBuilder<'a, S> where S: apply_writes_state::State, - S::Repo: apply_writes_state::IsSet, S::Writes: apply_writes_state::IsSet, + S::Repo: apply_writes_state::IsSet, { /// Build the final struct pub fn build(self) -> ApplyWrites<'a> { @@ -1568,51 +1568,51 @@ pub mod update_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; type Value; type Rkey; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Collection = Unset; type Value = Unset; type Rkey = Unset; - } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData S>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Collection = Set; - type Value = S::Value; - type Rkey = S::Rkey; + type Collection = Unset; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Collection = S::Collection; type Value = Set; type Rkey = S::Rkey; + type Collection = S::Collection; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Collection = S::Collection; type Value = S::Value; type Rkey = Set; + type Collection = S::Collection; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData S>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Value = S::Value; + type Rkey = S::Rkey; + type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `value` field pub struct value(()); ///Marker type for the `rkey` field pub struct rkey(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -1713,9 +1713,9 @@ where impl<'a, S> UpdateBuilder<'a, S> where S: update_state::State, - S::Collection: update_state::IsSet, S::Value: update_state::IsSet, S::Rkey: update_state::IsSet, + S::Collection: update_state::IsSet, { /// Build the final struct pub fn build(self) -> Update<'a> { @@ -1791,37 +1791,37 @@ pub mod update_result_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = S::Uri; + type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; type Uri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = S::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1914,8 +1914,8 @@ impl<'a, S: update_result_state::State> UpdateResultBuilder<'a, S> { impl<'a, S> UpdateResultBuilder<'a, S> where S: update_result_state::State, - S::Cid: update_result_state::IsSet, S::Uri: update_result_state::IsSet, + S::Cid: update_result_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateResult<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/create_record.rs b/crates/weaver-api/src/com_atproto/repo/create_record.rs index 0f919ee..bec3be1 100644 --- a/crates/weaver-api/src/com_atproto/repo/create_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/create_record.rs @@ -54,50 +54,50 @@ pub mod create_record_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Collection; - type Record; type Repo; + type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Collection = Unset; - type Record = Unset; type Repo = Unset; + type Record = Unset; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { type Collection = Set; - type Record = S::Record; - type Repo = S::Repo; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Collection = S::Collection; - type Record = Set; type Repo = S::Repo; + type Record = S::Record; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { type Collection = S::Collection; - type Record = S::Record; type Repo = Set; + type Record = S::Record; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Collection = S::Collection; + type Repo = S::Repo; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `collection` field pub struct collection(()); - ///Marker type for the `record` field - pub struct record(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -259,8 +259,8 @@ impl<'a, S> CreateRecordBuilder<'a, S> where S: create_record_state::State, S::Collection: create_record_state::IsSet, - S::Record: create_record_state::IsSet, S::Repo: create_record_state::IsSet, + S::Record: create_record_state::IsSet, { /// Build the final struct pub fn build(self) -> CreateRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/delete_record.rs b/crates/weaver-api/src/com_atproto/repo/delete_record.rs index 54cbe85..1e7e485 100644 --- a/crates/weaver-api/src/com_atproto/repo/delete_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/delete_record.rs @@ -48,51 +48,51 @@ pub mod delete_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; type Rkey; type Repo; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Collection = Unset; type Rkey = Unset; type Repo = Unset; - } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData S>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Collection = Set; - type Rkey = S::Rkey; - type Repo = S::Repo; + type Collection = Unset; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Collection = S::Collection; type Rkey = Set; type Repo = S::Repo; + type Collection = S::Collection; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Collection = S::Collection; type Rkey = S::Rkey; type Repo = Set; + type Collection = S::Collection; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData S>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Rkey = S::Rkey; + type Repo = S::Repo; + type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -233,9 +233,9 @@ impl<'a, S: delete_record_state::State> DeleteRecordBuilder<'a, S> { impl<'a, S> DeleteRecordBuilder<'a, S> where S: delete_record_state::State, - S::Collection: delete_record_state::IsSet, S::Rkey: delete_record_state::IsSet, S::Repo: delete_record_state::IsSet, + S::Collection: delete_record_state::IsSet, { /// Build the final struct pub fn build(self) -> DeleteRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/get_record.rs b/crates/weaver-api/src/com_atproto/repo/get_record.rs index 1e2bb9b..8786d05 100644 --- a/crates/weaver-api/src/com_atproto/repo/get_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/get_record.rs @@ -40,50 +40,50 @@ pub mod get_record_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Collection; - type Repo; type Rkey; + type Repo; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Collection = Unset; - type Repo = Unset; type Rkey = Unset; + type Repo = Unset; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { type Collection = Set; - type Repo = S::Repo; - type Rkey = S::Rkey; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { - type Collection = S::Collection; - type Repo = Set; type Rkey = S::Rkey; + type Repo = S::Repo; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { type Collection = S::Collection; - type Repo = S::Repo; type Rkey = Set; + type Repo = S::Repo; + } + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Collection = S::Collection; + type Rkey = S::Rkey; + type Repo = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `collection` field pub struct collection(()); - ///Marker type for the `repo` field - pub struct repo(()); ///Marker type for the `rkey` field pub struct rkey(()); + ///Marker type for the `repo` field + pub struct repo(()); } } @@ -205,8 +205,8 @@ impl<'a, S> GetRecordBuilder<'a, S> where S: get_record_state::State, S::Collection: get_record_state::IsSet, - S::Repo: get_record_state::IsSet, S::Rkey: get_record_state::IsSet, + S::Repo: get_record_state::IsSet, { /// Build the final struct pub fn build(self) -> GetRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/list_records.rs b/crates/weaver-api/src/com_atproto/repo/list_records.rs index 968fa1b..b683462 100644 --- a/crates/weaver-api/src/com_atproto/repo/list_records.rs +++ b/crates/weaver-api/src/com_atproto/repo/list_records.rs @@ -40,37 +40,37 @@ pub mod list_records_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; type Repo; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Collection = Unset; type Repo = Unset; - } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData S>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Collection = Set; - type Repo = S::Repo; + type Collection = Unset; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Collection = S::Collection; type Repo = Set; + type Collection = S::Collection; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData S>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Repo = S::Repo; + type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -188,8 +188,8 @@ impl<'a, S: list_records_state::State> ListRecordsBuilder<'a, S> { impl<'a, S> ListRecordsBuilder<'a, S> where S: list_records_state::State, - S::Collection: list_records_state::IsSet, S::Repo: list_records_state::IsSet, + S::Collection: list_records_state::IsSet, { /// Build the final struct pub fn build(self) -> ListRecords<'a> { @@ -278,49 +278,49 @@ pub mod record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Value; + type Uri; type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Value = Unset; + type Uri = Unset; type Cid = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Value = S::Value; - type Cid = S::Cid; - } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Uri = S::Uri; type Value = Set; + type Uri = S::Uri; + type Cid = S::Cid; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Value = S::Value; + type Uri = Set; type Cid = S::Cid; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; type Value = S::Value; + type Uri = S::Uri; type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); } @@ -415,8 +415,8 @@ where impl<'a, S> RecordBuilder<'a, S> where S: record_state::State, - S::Uri: record_state::IsSet, S::Value: record_state::IsSet, + S::Uri: record_state::IsSet, S::Cid: record_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/com_atproto/repo/put_record.rs b/crates/weaver-api/src/com_atproto/repo/put_record.rs index 2bd3a07..a2a585e 100644 --- a/crates/weaver-api/src/com_atproto/repo/put_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/put_record.rs @@ -54,67 +54,67 @@ pub mod put_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; - type Repo; - type Rkey; type Collection; + type Rkey; + type Repo; + type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; - type Repo = Unset; - type Rkey = Unset; type Collection = Unset; + type Rkey = Unset; + type Repo = Unset; + type Record = Unset; } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; - type Repo = S::Repo; + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData S>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Collection = Set; type Rkey = S::Rkey; - type Collection = S::Collection; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { + type Repo = S::Repo; type Record = S::Record; - type Repo = Set; - type Rkey = S::Rkey; - type Collection = S::Collection; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Record = S::Record; - type Repo = S::Repo; - type Rkey = Set; type Collection = S::Collection; + type Rkey = Set; + type Repo = S::Repo; + type Record = S::Record; } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData S>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Collection = S::Collection; + type Rkey = S::Rkey; + type Repo = Set; type Record = S::Record; - type Repo = S::Repo; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Collection = S::Collection; type Rkey = S::Rkey; - type Collection = Set; + type Repo = S::Repo; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `repo` field - pub struct repo(()); - ///Marker type for the `rkey` field - pub struct rkey(()); ///Marker type for the `collection` field pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); + ///Marker type for the `repo` field + pub struct repo(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -289,10 +289,10 @@ impl<'a, S: put_record_state::State> PutRecordBuilder<'a, S> { impl<'a, S> PutRecordBuilder<'a, S> where S: put_record_state::State, - S::Record: put_record_state::IsSet, - S::Repo: put_record_state::IsSet, - S::Rkey: put_record_state::IsSet, S::Collection: put_record_state::IsSet, + S::Rkey: put_record_state::IsSet, + S::Repo: put_record_state::IsSet, + S::Record: put_record_state::IsSet, { /// Build the final struct pub fn build(self) -> PutRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/strong_ref.rs b/crates/weaver-api/src/com_atproto/repo/strong_ref.rs index f934e76..7d44605 100644 --- a/crates/weaver-api/src/com_atproto/repo/strong_ref.rs +++ b/crates/weaver-api/src/com_atproto/repo/strong_ref.rs @@ -33,37 +33,37 @@ pub mod strong_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = S::Uri; + type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; type Uri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = S::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> StrongRefBuilder<'a, S> where S: strong_ref_state::State, - S::Cid: strong_ref_state::IsSet, S::Uri: strong_ref_state::IsSet, + S::Cid: strong_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> StrongRef<'a> { diff --git a/crates/weaver-api/src/com_atproto/server.rs b/crates/weaver-api/src/com_atproto/server.rs index e7a6623..7b96275 100644 --- a/crates/weaver-api/src/com_atproto/server.rs +++ b/crates/weaver-api/src/com_atproto/server.rs @@ -66,127 +66,127 @@ pub mod invite_code_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Disabled; + type Available; + type Uses; + type Code; type ForAccount; type CreatedBy; - type Uses; - type Available; - type Disabled; type CreatedAt; - type Code; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Disabled = Unset; + type Available = Unset; + type Uses = Unset; + type Code = Unset; type ForAccount = Unset; type CreatedBy = Unset; - type Uses = Unset; - type Available = Unset; - type Disabled = Unset; type CreatedAt = Unset; - type Code = Unset; } - ///State transition - sets the `for_account` field to Set - pub struct SetForAccount(PhantomData S>); - impl sealed::Sealed for SetForAccount {} - impl State for SetForAccount { - type ForAccount = Set; - type CreatedBy = S::CreatedBy; - type Uses = S::Uses; + ///State transition - sets the `disabled` field to Set + pub struct SetDisabled(PhantomData S>); + impl sealed::Sealed for SetDisabled {} + impl State for SetDisabled { + type Disabled = Set; type Available = S::Available; - type Disabled = S::Disabled; - type CreatedAt = S::CreatedAt; - type Code = S::Code; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type ForAccount = S::ForAccount; - type CreatedBy = Set; type Uses = S::Uses; - type Available = S::Available; - type Disabled = S::Disabled; - type CreatedAt = S::CreatedAt; type Code = S::Code; - } - ///State transition - sets the `uses` field to Set - pub struct SetUses(PhantomData S>); - impl sealed::Sealed for SetUses {} - impl State for SetUses { type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; - type Uses = Set; - type Available = S::Available; - type Disabled = S::Disabled; type CreatedAt = S::CreatedAt; - type Code = S::Code; } ///State transition - sets the `available` field to Set pub struct SetAvailable(PhantomData S>); impl sealed::Sealed for SetAvailable {} impl State for SetAvailable { + type Disabled = S::Disabled; + type Available = Set; + type Uses = S::Uses; + type Code = S::Code; type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; - type Uses = S::Uses; - type Available = Set; - type Disabled = S::Disabled; type CreatedAt = S::CreatedAt; - type Code = S::Code; } - ///State transition - sets the `disabled` field to Set - pub struct SetDisabled(PhantomData S>); - impl sealed::Sealed for SetDisabled {} - impl State for SetDisabled { + ///State transition - sets the `uses` field to Set + pub struct SetUses(PhantomData S>); + impl sealed::Sealed for SetUses {} + impl State for SetUses { + type Disabled = S::Disabled; + type Available = S::Available; + type Uses = Set; + type Code = S::Code; type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `code` field to Set + pub struct SetCode(PhantomData S>); + impl sealed::Sealed for SetCode {} + impl State for SetCode { + type Disabled = S::Disabled; + type Available = S::Available; type Uses = S::Uses; + type Code = Set; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `for_account` field to Set + pub struct SetForAccount(PhantomData S>); + impl sealed::Sealed for SetForAccount {} + impl State for SetForAccount { + type Disabled = S::Disabled; type Available = S::Available; - type Disabled = Set; + type Uses = S::Uses; + type Code = S::Code; + type ForAccount = Set; + type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type Disabled = S::Disabled; + type Available = S::Available; + type Uses = S::Uses; type Code = S::Code; + type ForAccount = S::ForAccount; + type CreatedBy = Set; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type ForAccount = S::ForAccount; - type CreatedBy = S::CreatedBy; - type Uses = S::Uses; - type Available = S::Available; type Disabled = S::Disabled; - type CreatedAt = Set; + type Available = S::Available; + type Uses = S::Uses; type Code = S::Code; - } - ///State transition - sets the `code` field to Set - pub struct SetCode(PhantomData S>); - impl sealed::Sealed for SetCode {} - impl State for SetCode { type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; - type Uses = S::Uses; - type Available = S::Available; - type Disabled = S::Disabled; - type CreatedAt = S::CreatedAt; - type Code = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `disabled` field + pub struct disabled(()); + ///Marker type for the `available` field + pub struct available(()); + ///Marker type for the `uses` field + pub struct uses(()); + ///Marker type for the `code` field + pub struct code(()); ///Marker type for the `for_account` field pub struct for_account(()); ///Marker type for the `created_by` field pub struct created_by(()); - ///Marker type for the `uses` field - pub struct uses(()); - ///Marker type for the `available` field - pub struct available(()); - ///Marker type for the `disabled` field - pub struct disabled(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `code` field - pub struct code(()); } } @@ -359,13 +359,13 @@ where impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, + S::Disabled: invite_code_state::IsSet, + S::Available: invite_code_state::IsSet, + S::Uses: invite_code_state::IsSet, + S::Code: invite_code_state::IsSet, S::ForAccount: invite_code_state::IsSet, S::CreatedBy: invite_code_state::IsSet, - S::Uses: invite_code_state::IsSet, - S::Available: invite_code_state::IsSet, - S::Disabled: invite_code_state::IsSet, S::CreatedAt: invite_code_state::IsSet, - S::Code: invite_code_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteCode<'a> { @@ -638,37 +638,37 @@ pub mod invite_code_use_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type UsedBy; type UsedAt; + type UsedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type UsedBy = Unset; type UsedAt = Unset; - } - ///State transition - sets the `used_by` field to Set - pub struct SetUsedBy(PhantomData S>); - impl sealed::Sealed for SetUsedBy {} - impl State for SetUsedBy { - type UsedBy = Set; - type UsedAt = S::UsedAt; + type UsedBy = Unset; } ///State transition - sets the `used_at` field to Set pub struct SetUsedAt(PhantomData S>); impl sealed::Sealed for SetUsedAt {} impl State for SetUsedAt { - type UsedBy = S::UsedBy; type UsedAt = Set; + type UsedBy = S::UsedBy; + } + ///State transition - sets the `used_by` field to Set + pub struct SetUsedBy(PhantomData S>); + impl sealed::Sealed for SetUsedBy {} + impl State for SetUsedBy { + type UsedAt = S::UsedAt; + type UsedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `used_by` field - pub struct used_by(()); ///Marker type for the `used_at` field pub struct used_at(()); + ///Marker type for the `used_by` field + pub struct used_by(()); } } @@ -741,8 +741,8 @@ where impl<'a, S> InviteCodeUseBuilder<'a, S> where S: invite_code_use_state::State, - S::UsedBy: invite_code_use_state::IsSet, S::UsedAt: invite_code_use_state::IsSet, + S::UsedBy: invite_code_use_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteCodeUse<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/create_app_password.rs b/crates/weaver-api/src/com_atproto/server/create_app_password.rs index 2e92c60..db353ba 100644 --- a/crates/weaver-api/src/com_atproto/server/create_app_password.rs +++ b/crates/weaver-api/src/com_atproto/server/create_app_password.rs @@ -36,51 +36,51 @@ pub mod app_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedAt; type Name; type Password; - type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type CreatedAt = Unset; type Name = Unset; type Password = Unset; - type CreatedAt = Unset; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Name = S::Name; + type Password = S::Password; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { + type CreatedAt = S::CreatedAt; type Name = Set; type Password = S::Password; - type CreatedAt = S::CreatedAt; } ///State transition - sets the `password` field to Set pub struct SetPassword(PhantomData S>); impl sealed::Sealed for SetPassword {} impl State for SetPassword { - type Name = S::Name; - type Password = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type Name = S::Name; - type Password = S::Password; - type CreatedAt = Set; + type Password = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `password` field pub struct password(()); - ///Marker type for the `created_at` field - pub struct created_at(()); } } @@ -187,9 +187,9 @@ impl<'a, S: app_password_state::State> AppPasswordBuilder<'a, S> { impl<'a, S> AppPasswordBuilder<'a, S> where S: app_password_state::State, + S::CreatedAt: app_password_state::IsSet, S::Name: app_password_state::IsSet, S::Password: app_password_state::IsSet, - S::CreatedAt: app_password_state::IsSet, { /// Build the final struct pub fn build(self) -> AppPassword<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs b/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs index 9488bca..d046e27 100644 --- a/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs +++ b/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs @@ -33,37 +33,37 @@ pub mod account_codes_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Codes; type Account; + type Codes; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Codes = Unset; type Account = Unset; - } - ///State transition - sets the `codes` field to Set - pub struct SetCodes(PhantomData S>); - impl sealed::Sealed for SetCodes {} - impl State for SetCodes { - type Codes = Set; - type Account = S::Account; + type Codes = Unset; } ///State transition - sets the `account` field to Set pub struct SetAccount(PhantomData S>); impl sealed::Sealed for SetAccount {} impl State for SetAccount { - type Codes = S::Codes; type Account = Set; + type Codes = S::Codes; + } + ///State transition - sets the `codes` field to Set + pub struct SetCodes(PhantomData S>); + impl sealed::Sealed for SetCodes {} + impl State for SetCodes { + type Account = S::Account; + type Codes = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `codes` field - pub struct codes(()); ///Marker type for the `account` field pub struct account(()); + ///Marker type for the `codes` field + pub struct codes(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> AccountCodesBuilder<'a, S> where S: account_codes_state::State, - S::Codes: account_codes_state::IsSet, S::Account: account_codes_state::IsSet, + S::Codes: account_codes_state::IsSet, { /// Build the final struct pub fn build(self) -> AccountCodes<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/delete_account.rs b/crates/weaver-api/src/com_atproto/server/delete_account.rs index 49e46ce..ff3927b 100644 --- a/crates/weaver-api/src/com_atproto/server/delete_account.rs +++ b/crates/weaver-api/src/com_atproto/server/delete_account.rs @@ -35,49 +35,49 @@ pub mod delete_account_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Password; type Did; + type Password; type Token; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Password = Unset; type Did = Unset; + type Password = Unset; type Token = Unset; } - ///State transition - sets the `password` field to Set - pub struct SetPassword(PhantomData S>); - impl sealed::Sealed for SetPassword {} - impl State for SetPassword { - type Password = Set; - type Did = S::Did; - type Token = S::Token; - } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Password = S::Password; type Did = Set; + type Password = S::Password; + type Token = S::Token; + } + ///State transition - sets the `password` field to Set + pub struct SetPassword(PhantomData S>); + impl sealed::Sealed for SetPassword {} + impl State for SetPassword { + type Did = S::Did; + type Password = Set; type Token = S::Token; } ///State transition - sets the `token` field to Set pub struct SetToken(PhantomData S>); impl sealed::Sealed for SetToken {} impl State for SetToken { - type Password = S::Password; type Did = S::Did; + type Password = S::Password; type Token = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `password` field - pub struct password(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `password` field + pub struct password(()); ///Marker type for the `token` field pub struct token(()); } @@ -172,8 +172,8 @@ where impl<'a, S> DeleteAccountBuilder<'a, S> where S: delete_account_state::State, - S::Password: delete_account_state::IsSet, S::Did: delete_account_state::IsSet, + S::Password: delete_account_state::IsSet, S::Token: delete_account_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs b/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs index ecefe89..01aa0e5 100644 --- a/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs +++ b/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs @@ -34,37 +34,37 @@ pub mod app_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; type CreatedAt; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Name = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Name = Set; - type CreatedAt = S::CreatedAt; + type Name = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Name = S::Name; type CreatedAt = Set; + type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type CreatedAt = S::CreatedAt; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -151,8 +151,8 @@ impl<'a, S: app_password_state::State> AppPasswordBuilder<'a, S> { impl<'a, S> AppPasswordBuilder<'a, S> where S: app_password_state::State, - S::Name: app_password_state::IsSet, S::CreatedAt: app_password_state::IsSet, + S::Name: app_password_state::IsSet, { /// Build the final struct pub fn build(self) -> AppPassword<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/get_blob.rs b/crates/weaver-api/src/com_atproto/sync/get_blob.rs index 19d72c4..edc9741 100644 --- a/crates/weaver-api/src/com_atproto/sync/get_blob.rs +++ b/crates/weaver-api/src/com_atproto/sync/get_blob.rs @@ -32,37 +32,37 @@ pub mod get_blob_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Did; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Did = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Did = S::Did; + type Cid = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Cid = S::Cid; type Did = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Did = S::Did; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetBlobBuilder<'a, S> where S: get_blob_state::State, - S::Cid: get_blob_state::IsSet, S::Did: get_blob_state::IsSet, + S::Cid: get_blob_state::IsSet, { /// Build the final struct pub fn build(self) -> GetBlob<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs index 194c965..7857ba1 100644 --- a/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs +++ b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs @@ -41,8 +41,8 @@ pub mod account_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; - type Time; type Active; + type Time; type Seq; } /// Empty state - all required fields are unset @@ -50,8 +50,8 @@ pub mod account_state { impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; - type Time = Unset; type Active = Unset; + type Time = Unset; type Seq = Unset; } ///State transition - sets the `did` field to Set @@ -59,17 +59,8 @@ pub mod account_state { impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; - type Time = S::Time; - type Active = S::Active; - type Seq = S::Seq; - } - ///State transition - sets the `time` field to Set - pub struct SetTime(PhantomData S>); - impl sealed::Sealed for SetTime {} - impl State for SetTime { - type Did = S::Did; - type Time = Set; type Active = S::Active; + type Time = S::Time; type Seq = S::Seq; } ///State transition - sets the `active` field to Set @@ -77,8 +68,17 @@ pub mod account_state { impl sealed::Sealed for SetActive {} impl State for SetActive { type Did = S::Did; - type Time = S::Time; type Active = Set; + type Time = S::Time; + type Seq = S::Seq; + } + ///State transition - sets the `time` field to Set + pub struct SetTime(PhantomData S>); + impl sealed::Sealed for SetTime {} + impl State for SetTime { + type Did = S::Did; + type Active = S::Active; + type Time = Set; type Seq = S::Seq; } ///State transition - sets the `seq` field to Set @@ -86,8 +86,8 @@ pub mod account_state { impl sealed::Sealed for SetSeq {} impl State for SetSeq { type Did = S::Did; - type Time = S::Time; type Active = S::Active; + type Time = S::Time; type Seq = Set; } /// Marker types for field names @@ -95,10 +95,10 @@ pub mod account_state { pub mod members { ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `time` field - pub struct time(()); ///Marker type for the `active` field pub struct active(()); + ///Marker type for the `time` field + pub struct time(()); ///Marker type for the `seq` field pub struct seq(()); } @@ -228,8 +228,8 @@ impl<'a, S> AccountBuilder<'a, S> where S: account_state::State, S::Did: account_state::IsSet, - S::Time: account_state::IsSet, S::Active: account_state::IsSet, + S::Time: account_state::IsSet, S::Seq: account_state::IsSet, { /// Build the final struct @@ -1073,205 +1073,205 @@ pub mod commit_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Ops; + type Rev; type Seq; - type Blocks; type Time; - type Rev; - type Blobs; + type Blocks; type Repo; - type Rebase; type Commit; - type Ops; type TooBig; + type Rebase; + type Blobs; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Ops = Unset; + type Rev = Unset; type Seq = Unset; - type Blocks = Unset; type Time = Unset; - type Rev = Unset; - type Blobs = Unset; + type Blocks = Unset; type Repo = Unset; - type Rebase = Unset; type Commit = Unset; - type Ops = Unset; type TooBig = Unset; + type Rebase = Unset; + type Blobs = Unset; } - ///State transition - sets the `seq` field to Set - pub struct SetSeq(PhantomData S>); - impl sealed::Sealed for SetSeq {} - impl State for SetSeq { - type Seq = Set; - type Blocks = S::Blocks; - type Time = S::Time; + ///State transition - sets the `ops` field to Set + pub struct SetOps(PhantomData S>); + impl sealed::Sealed for SetOps {} + impl State for SetOps { + type Ops = Set; type Rev = S::Rev; - type Blobs = S::Blobs; + type Seq = S::Seq; + type Time = S::Time; + type Blocks = S::Blocks; type Repo = S::Repo; - type Rebase = S::Rebase; type Commit = S::Commit; - type Ops = S::Ops; type TooBig = S::TooBig; + type Rebase = S::Rebase; + type Blobs = S::Blobs; } - ///State transition - sets the `blocks` field to Set - pub struct SetBlocks(PhantomData S>); - impl sealed::Sealed for SetBlocks {} - impl State for SetBlocks { + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Ops = S::Ops; + type Rev = Set; type Seq = S::Seq; - type Blocks = Set; type Time = S::Time; - type Rev = S::Rev; - type Blobs = S::Blobs; + type Blocks = S::Blocks; type Repo = S::Repo; - type Rebase = S::Rebase; type Commit = S::Commit; + type TooBig = S::TooBig; + type Rebase = S::Rebase; + type Blobs = S::Blobs; + } + ///State transition - sets the `seq` field to Set + pub struct SetSeq(PhantomData S>); + impl sealed::Sealed for SetSeq {} + impl State for SetSeq { type Ops = S::Ops; + type Rev = S::Rev; + type Seq = Set; + type Time = S::Time; + type Blocks = S::Blocks; + type Repo = S::Repo; + type Commit = S::Commit; type TooBig = S::TooBig; + type Rebase = S::Rebase; + type Blobs = S::Blobs; } ///State transition - sets the `time` field to Set pub struct SetTime(PhantomData S>); impl sealed::Sealed for SetTime {} impl State for SetTime { - type Seq = S::Seq; - type Blocks = S::Blocks; - type Time = Set; - type Rev = S::Rev; - type Blobs = S::Blobs; - type Repo = S::Repo; - type Rebase = S::Rebase; - type Commit = S::Commit; type Ops = S::Ops; - type TooBig = S::TooBig; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { + type Rev = S::Rev; type Seq = S::Seq; + type Time = Set; type Blocks = S::Blocks; - type Time = S::Time; - type Rev = Set; - type Blobs = S::Blobs; type Repo = S::Repo; - type Rebase = S::Rebase; type Commit = S::Commit; - type Ops = S::Ops; type TooBig = S::TooBig; + type Rebase = S::Rebase; + type Blobs = S::Blobs; } - ///State transition - sets the `blobs` field to Set - pub struct SetBlobs(PhantomData S>); - impl sealed::Sealed for SetBlobs {} - impl State for SetBlobs { + ///State transition - sets the `blocks` field to Set + pub struct SetBlocks(PhantomData S>); + impl sealed::Sealed for SetBlocks {} + impl State for SetBlocks { + type Ops = S::Ops; + type Rev = S::Rev; type Seq = S::Seq; - type Blocks = S::Blocks; type Time = S::Time; - type Rev = S::Rev; - type Blobs = Set; + type Blocks = Set; type Repo = S::Repo; - type Rebase = S::Rebase; type Commit = S::Commit; - type Ops = S::Ops; type TooBig = S::TooBig; + type Rebase = S::Rebase; + type Blobs = S::Blobs; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { + type Ops = S::Ops; + type Rev = S::Rev; type Seq = S::Seq; - type Blocks = S::Blocks; type Time = S::Time; - type Rev = S::Rev; - type Blobs = S::Blobs; + type Blocks = S::Blocks; type Repo = Set; - type Rebase = S::Rebase; type Commit = S::Commit; - type Ops = S::Ops; type TooBig = S::TooBig; - } - ///State transition - sets the `rebase` field to Set - pub struct SetRebase(PhantomData S>); - impl sealed::Sealed for SetRebase {} - impl State for SetRebase { - type Seq = S::Seq; - type Blocks = S::Blocks; - type Time = S::Time; - type Rev = S::Rev; + type Rebase = S::Rebase; type Blobs = S::Blobs; - type Repo = S::Repo; - type Rebase = Set; - type Commit = S::Commit; - type Ops = S::Ops; - type TooBig = S::TooBig; } ///State transition - sets the `commit` field to Set pub struct SetCommit(PhantomData S>); impl sealed::Sealed for SetCommit {} impl State for SetCommit { + type Ops = S::Ops; + type Rev = S::Rev; type Seq = S::Seq; - type Blocks = S::Blocks; type Time = S::Time; - type Rev = S::Rev; - type Blobs = S::Blobs; + type Blocks = S::Blocks; type Repo = S::Repo; - type Rebase = S::Rebase; type Commit = Set; - type Ops = S::Ops; type TooBig = S::TooBig; - } - ///State transition - sets the `ops` field to Set - pub struct SetOps(PhantomData S>); - impl sealed::Sealed for SetOps {} - impl State for SetOps { - type Seq = S::Seq; - type Blocks = S::Blocks; - type Time = S::Time; - type Rev = S::Rev; - type Blobs = S::Blobs; - type Repo = S::Repo; type Rebase = S::Rebase; - type Commit = S::Commit; - type Ops = Set; - type TooBig = S::TooBig; + type Blobs = S::Blobs; } ///State transition - sets the `too_big` field to Set pub struct SetTooBig(PhantomData S>); impl sealed::Sealed for SetTooBig {} impl State for SetTooBig { + type Ops = S::Ops; + type Rev = S::Rev; type Seq = S::Seq; - type Blocks = S::Blocks; type Time = S::Time; - type Rev = S::Rev; - type Blobs = S::Blobs; + type Blocks = S::Blocks; type Repo = S::Repo; + type Commit = S::Commit; + type TooBig = Set; type Rebase = S::Rebase; + type Blobs = S::Blobs; + } + ///State transition - sets the `rebase` field to Set + pub struct SetRebase(PhantomData S>); + impl sealed::Sealed for SetRebase {} + impl State for SetRebase { + type Ops = S::Ops; + type Rev = S::Rev; + type Seq = S::Seq; + type Time = S::Time; + type Blocks = S::Blocks; + type Repo = S::Repo; type Commit = S::Commit; + type TooBig = S::TooBig; + type Rebase = Set; + type Blobs = S::Blobs; + } + ///State transition - sets the `blobs` field to Set + pub struct SetBlobs(PhantomData S>); + impl sealed::Sealed for SetBlobs {} + impl State for SetBlobs { type Ops = S::Ops; - type TooBig = Set; + type Rev = S::Rev; + type Seq = S::Seq; + type Time = S::Time; + type Blocks = S::Blocks; + type Repo = S::Repo; + type Commit = S::Commit; + type TooBig = S::TooBig; + type Rebase = S::Rebase; + type Blobs = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `ops` field + pub struct ops(()); + ///Marker type for the `rev` field + pub struct rev(()); ///Marker type for the `seq` field pub struct seq(()); - ///Marker type for the `blocks` field - pub struct blocks(()); ///Marker type for the `time` field pub struct time(()); - ///Marker type for the `rev` field - pub struct rev(()); - ///Marker type for the `blobs` field - pub struct blobs(()); + ///Marker type for the `blocks` field + pub struct blocks(()); ///Marker type for the `repo` field pub struct repo(()); - ///Marker type for the `rebase` field - pub struct rebase(()); ///Marker type for the `commit` field pub struct commit(()); - ///Marker type for the `ops` field - pub struct ops(()); ///Marker type for the `too_big` field pub struct too_big(()); + ///Marker type for the `rebase` field + pub struct rebase(()); + ///Marker type for the `blobs` field + pub struct blobs(()); } } @@ -1559,16 +1559,16 @@ where impl<'a, S> CommitBuilder<'a, S> where S: commit_state::State, + S::Ops: commit_state::IsSet, + S::Rev: commit_state::IsSet, S::Seq: commit_state::IsSet, - S::Blocks: commit_state::IsSet, S::Time: commit_state::IsSet, - S::Rev: commit_state::IsSet, - S::Blobs: commit_state::IsSet, + S::Blocks: commit_state::IsSet, S::Repo: commit_state::IsSet, - S::Rebase: commit_state::IsSet, S::Commit: commit_state::IsSet, - S::Ops: commit_state::IsSet, S::TooBig: commit_state::IsSet, + S::Rebase: commit_state::IsSet, + S::Blobs: commit_state::IsSet, { /// Build the final struct pub fn build(self) -> Commit<'a> { @@ -1677,51 +1677,51 @@ pub mod identity_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Seq; type Did; type Time; - type Seq; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Seq = Unset; type Did = Unset; type Time = Unset; - type Seq = Unset; + } + ///State transition - sets the `seq` field to Set + pub struct SetSeq(PhantomData S>); + impl sealed::Sealed for SetSeq {} + impl State for SetSeq { + type Seq = Set; + type Did = S::Did; + type Time = S::Time; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { + type Seq = S::Seq; type Did = Set; type Time = S::Time; - type Seq = S::Seq; } ///State transition - sets the `time` field to Set pub struct SetTime(PhantomData S>); impl sealed::Sealed for SetTime {} impl State for SetTime { - type Did = S::Did; - type Time = Set; type Seq = S::Seq; - } - ///State transition - sets the `seq` field to Set - pub struct SetSeq(PhantomData S>); - impl sealed::Sealed for SetSeq {} - impl State for SetSeq { type Did = S::Did; - type Time = S::Time; - type Seq = Set; + type Time = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `seq` field + pub struct seq(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `time` field pub struct time(()); - ///Marker type for the `seq` field - pub struct seq(()); } } @@ -1834,9 +1834,9 @@ where impl<'a, S> IdentityBuilder<'a, S> where S: identity_state::State, + S::Seq: identity_state::IsSet, S::Did: identity_state::IsSet, S::Time: identity_state::IsSet, - S::Seq: identity_state::IsSet, { /// Build the final struct pub fn build(self) -> Identity<'a> { @@ -2257,37 +2257,37 @@ pub mod repo_op_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Path; type Action; + type Path; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Path = Unset; type Action = Unset; - } - ///State transition - sets the `path` field to Set - pub struct SetPath(PhantomData S>); - impl sealed::Sealed for SetPath {} - impl State for SetPath { - type Path = Set; - type Action = S::Action; + type Path = Unset; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type Path = S::Path; type Action = Set; + type Path = S::Path; + } + ///State transition - sets the `path` field to Set + pub struct SetPath(PhantomData S>); + impl sealed::Sealed for SetPath {} + impl State for SetPath { + type Action = S::Action; + type Path = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `path` field - pub struct path(()); ///Marker type for the `action` field pub struct action(()); + ///Marker type for the `path` field + pub struct path(()); } } @@ -2400,8 +2400,8 @@ impl<'a, S: repo_op_state::State> RepoOpBuilder<'a, S> { impl<'a, S> RepoOpBuilder<'a, S> where S: repo_op_state::State, - S::Path: repo_op_state::IsSet, S::Action: repo_op_state::IsSet, + S::Path: repo_op_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoOp<'a> { @@ -2580,84 +2580,84 @@ pub mod sync_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; - type Blocks; type Rev; - type Seq; type Time; + type Seq; + type Blocks; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; - type Blocks = Unset; type Rev = Unset; - type Seq = Unset; type Time = Unset; + type Seq = Unset; + type Blocks = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; - type Blocks = S::Blocks; type Rev = S::Rev; - type Seq = S::Seq; type Time = S::Time; - } - ///State transition - sets the `blocks` field to Set - pub struct SetBlocks(PhantomData S>); - impl sealed::Sealed for SetBlocks {} - impl State for SetBlocks { - type Did = S::Did; - type Blocks = Set; - type Rev = S::Rev; type Seq = S::Seq; - type Time = S::Time; + type Blocks = S::Blocks; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { type Did = S::Did; - type Blocks = S::Blocks; type Rev = Set; - type Seq = S::Seq; type Time = S::Time; + type Seq = S::Seq; + type Blocks = S::Blocks; + } + ///State transition - sets the `time` field to Set + pub struct SetTime(PhantomData S>); + impl sealed::Sealed for SetTime {} + impl State for SetTime { + type Did = S::Did; + type Rev = S::Rev; + type Time = Set; + type Seq = S::Seq; + type Blocks = S::Blocks; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData S>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { type Did = S::Did; - type Blocks = S::Blocks; type Rev = S::Rev; - type Seq = Set; type Time = S::Time; + type Seq = Set; + type Blocks = S::Blocks; } - ///State transition - sets the `time` field to Set - pub struct SetTime(PhantomData S>); - impl sealed::Sealed for SetTime {} - impl State for SetTime { + ///State transition - sets the `blocks` field to Set + pub struct SetBlocks(PhantomData S>); + impl sealed::Sealed for SetBlocks {} + impl State for SetBlocks { type Did = S::Did; - type Blocks = S::Blocks; type Rev = S::Rev; + type Time = S::Time; type Seq = S::Seq; - type Time = Set; + type Blocks = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `blocks` field - pub struct blocks(()); ///Marker type for the `rev` field pub struct rev(()); - ///Marker type for the `seq` field - pub struct seq(()); ///Marker type for the `time` field pub struct time(()); + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `blocks` field + pub struct blocks(()); } } @@ -2791,10 +2791,10 @@ impl<'a, S> SyncBuilder<'a, S> where S: sync_state::State, S::Did: sync_state::IsSet, - S::Blocks: sync_state::IsSet, S::Rev: sync_state::IsSet, - S::Seq: sync_state::IsSet, S::Time: sync_state::IsSet, + S::Seq: sync_state::IsSet, + S::Blocks: sync_state::IsSet, { /// Build the final struct pub fn build(self) -> Sync<'a> { diff --git a/crates/weaver-api/src/com_deckbelcher/deck/list.rs b/crates/weaver-api/src/com_deckbelcher/deck/list.rs index a08f1b7..5dfbcb8 100644 --- a/crates/weaver-api/src/com_deckbelcher/deck/list.rs +++ b/crates/weaver-api/src/com_deckbelcher/deck/list.rs @@ -42,49 +42,49 @@ pub mod card_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Section; type ScryfallId; + type Section; type Quantity; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Section = Unset; type ScryfallId = Unset; + type Section = Unset; type Quantity = Unset; } - ///State transition - sets the `section` field to Set - pub struct SetSection(PhantomData S>); - impl sealed::Sealed for SetSection {} - impl State for SetSection { - type Section = Set; - type ScryfallId = S::ScryfallId; - type Quantity = S::Quantity; - } ///State transition - sets the `scryfall_id` field to Set pub struct SetScryfallId(PhantomData S>); impl sealed::Sealed for SetScryfallId {} impl State for SetScryfallId { - type Section = S::Section; type ScryfallId = Set; + type Section = S::Section; + type Quantity = S::Quantity; + } + ///State transition - sets the `section` field to Set + pub struct SetSection(PhantomData S>); + impl sealed::Sealed for SetSection {} + impl State for SetSection { + type ScryfallId = S::ScryfallId; + type Section = Set; type Quantity = S::Quantity; } ///State transition - sets the `quantity` field to Set pub struct SetQuantity(PhantomData S>); impl sealed::Sealed for SetQuantity {} impl State for SetQuantity { - type Section = S::Section; type ScryfallId = S::ScryfallId; + type Section = S::Section; type Quantity = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `section` field - pub struct section(()); ///Marker type for the `scryfall_id` field pub struct scryfall_id(()); + ///Marker type for the `section` field + pub struct section(()); ///Marker type for the `quantity` field pub struct quantity(()); } @@ -199,8 +199,8 @@ impl<'a, S: card_state::State> CardBuilder<'a, S> { impl<'a, S> CardBuilder<'a, S> where S: card_state::State, - S::Section: card_state::IsSet, S::ScryfallId: card_state::IsSet, + S::Section: card_state::IsSet, S::Quantity: card_state::IsSet, { /// Build the final struct @@ -704,51 +704,51 @@ pub mod list_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; - type Cards; type CreatedAt; + type Cards; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Name = Unset; - type Cards = Unset; type CreatedAt = Unset; + type Cards = Unset; + type Name = Unset; } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Name = Set; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; type Cards = S::Cards; - type CreatedAt = S::CreatedAt; + type Name = S::Name; } ///State transition - sets the `cards` field to Set pub struct SetCards(PhantomData S>); impl sealed::Sealed for SetCards {} impl State for SetCards { - type Name = S::Name; - type Cards = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + type Cards = Set; type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type CreatedAt = S::CreatedAt; type Cards = S::Cards; - type CreatedAt = Set; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `name` field - pub struct name(()); - ///Marker type for the `cards` field - pub struct cards(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `cards` field + pub struct cards(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -915,9 +915,9 @@ impl<'a, S: list_state::State> ListBuilder<'a, S> { impl<'a, S> ListBuilder<'a, S> where S: list_state::State, - S::Name: list_state::IsSet, - S::Cards: list_state::IsSet, S::CreatedAt: list_state::IsSet, + S::Cards: list_state::IsSet, + S::Name: list_state::IsSet, { /// Build the final struct pub fn build(self) -> List<'a> { diff --git a/crates/weaver-api/src/com_deckbelcher/social/like.rs b/crates/weaver-api/src/com_deckbelcher/social/like.rs index 72b761f..55cc9b0 100644 --- a/crates/weaver-api/src/com_deckbelcher/social/like.rs +++ b/crates/weaver-api/src/com_deckbelcher/social/like.rs @@ -35,37 +35,37 @@ pub mod like_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = S::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = S::CreatedAt; type Subject = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -138,8 +138,8 @@ where impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, - S::CreatedAt: like_state::IsSet, S::Subject: like_state::IsSet, + S::CreatedAt: like_state::IsSet, { /// Build the final struct pub fn build(self) -> Like<'a> { diff --git a/crates/weaver-api/src/com_whtwnd/blog.rs b/crates/weaver-api/src/com_whtwnd/blog.rs index 48f3179..722c65a 100644 --- a/crates/weaver-api/src/com_whtwnd/blog.rs +++ b/crates/weaver-api/src/com_whtwnd/blog.rs @@ -454,37 +454,37 @@ pub mod comment_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Content; type EntryUri; + type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Content = Unset; type EntryUri = Unset; - } - ///State transition - sets the `content` field to Set - pub struct SetContent(PhantomData S>); - impl sealed::Sealed for SetContent {} - impl State for SetContent { - type Content = Set; - type EntryUri = S::EntryUri; + type Content = Unset; } ///State transition - sets the `entry_uri` field to Set pub struct SetEntryUri(PhantomData S>); impl sealed::Sealed for SetEntryUri {} impl State for SetEntryUri { - type Content = S::Content; type EntryUri = Set; + type Content = S::Content; + } + ///State transition - sets the `content` field to Set + pub struct SetContent(PhantomData S>); + impl sealed::Sealed for SetContent {} + impl State for SetContent { + type EntryUri = S::EntryUri; + type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `content` field - pub struct content(()); ///Marker type for the `entry_uri` field pub struct entry_uri(()); + ///Marker type for the `content` field + pub struct content(()); } } @@ -557,8 +557,8 @@ where impl<'a, S> CommentBuilder<'a, S> where S: comment_state::State, - S::Content: comment_state::IsSet, S::EntryUri: comment_state::IsSet, + S::Content: comment_state::IsSet, { /// Build the final struct pub fn build(self) -> Comment<'a> { diff --git a/crates/weaver-api/src/com_whtwnd/blog/get_entry_metadata_by_name.rs b/crates/weaver-api/src/com_whtwnd/blog/get_entry_metadata_by_name.rs index 7c49ac1..c6dc8df 100644 --- a/crates/weaver-api/src/com_whtwnd/blog/get_entry_metadata_by_name.rs +++ b/crates/weaver-api/src/com_whtwnd/blog/get_entry_metadata_by_name.rs @@ -32,37 +32,37 @@ pub mod get_entry_metadata_by_name_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type EntryTitle; type Author; + type EntryTitle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type EntryTitle = Unset; type Author = Unset; - } - ///State transition - sets the `entry_title` field to Set - pub struct SetEntryTitle(PhantomData S>); - impl sealed::Sealed for SetEntryTitle {} - impl State for SetEntryTitle { - type EntryTitle = Set; - type Author = S::Author; + type EntryTitle = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type EntryTitle = S::EntryTitle; type Author = Set; + type EntryTitle = S::EntryTitle; + } + ///State transition - sets the `entry_title` field to Set + pub struct SetEntryTitle(PhantomData S>); + impl sealed::Sealed for SetEntryTitle {} + impl State for SetEntryTitle { + type Author = S::Author; + type EntryTitle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `entry_title` field - pub struct entry_title(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `entry_title` field + pub struct entry_title(()); } } @@ -147,8 +147,8 @@ where impl<'a, S> GetEntryMetadataByNameBuilder<'a, S> where S: get_entry_metadata_by_name_state::State, - S::EntryTitle: get_entry_metadata_by_name_state::IsSet, S::Author: get_entry_metadata_by_name_state::IsSet, + S::EntryTitle: get_entry_metadata_by_name_state::IsSet, { /// Build the final struct pub fn build(self) -> GetEntryMetadataByName<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/blocks/button.rs b/crates/weaver-api/src/pub_leaflet/blocks/button.rs index 6305544..b8513dd 100644 --- a/crates/weaver-api/src/pub_leaflet/blocks/button.rs +++ b/crates/weaver-api/src/pub_leaflet/blocks/button.rs @@ -33,37 +33,37 @@ pub mod button_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Text; type Url; + type Text; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Text = Unset; type Url = Unset; - } - ///State transition - sets the `text` field to Set - pub struct SetText(PhantomData S>); - impl sealed::Sealed for SetText {} - impl State for SetText { - type Text = Set; - type Url = S::Url; + type Text = Unset; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { - type Text = S::Text; type Url = Set; + type Text = S::Text; + } + ///State transition - sets the `text` field to Set + pub struct SetText(PhantomData S>); + impl sealed::Sealed for SetText {} + impl State for SetText { + type Url = S::Url; + type Text = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `text` field - pub struct text(()); ///Marker type for the `url` field pub struct url(()); + ///Marker type for the `text` field + pub struct text(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> ButtonBuilder<'a, S> where S: button_state::State, - S::Text: button_state::IsSet, S::Url: button_state::IsSet, + S::Text: button_state::IsSet, { /// Build the final struct pub fn build(self) -> Button<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/blocks/image.rs b/crates/weaver-api/src/pub_leaflet/blocks/image.rs index ee8f544..f79efc1 100644 --- a/crates/weaver-api/src/pub_leaflet/blocks/image.rs +++ b/crates/weaver-api/src/pub_leaflet/blocks/image.rs @@ -31,37 +31,37 @@ pub mod aspect_ratio_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Width; type Height; + type Width; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Width = Unset; type Height = Unset; - } - ///State transition - sets the `width` field to Set - pub struct SetWidth(PhantomData S>); - impl sealed::Sealed for SetWidth {} - impl State for SetWidth { - type Width = Set; - type Height = S::Height; + type Width = Unset; } ///State transition - sets the `height` field to Set pub struct SetHeight(PhantomData S>); impl sealed::Sealed for SetHeight {} impl State for SetHeight { - type Width = S::Width; type Height = Set; + type Width = S::Width; + } + ///State transition - sets the `width` field to Set + pub struct SetWidth(PhantomData S>); + impl sealed::Sealed for SetWidth {} + impl State for SetWidth { + type Height = S::Height; + type Width = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `width` field - pub struct width(()); ///Marker type for the `height` field pub struct height(()); + ///Marker type for the `width` field + pub struct width(()); } } @@ -131,8 +131,8 @@ where impl<'a, S> AspectRatioBuilder<'a, S> where S: aspect_ratio_state::State, - S::Width: aspect_ratio_state::IsSet, S::Height: aspect_ratio_state::IsSet, + S::Width: aspect_ratio_state::IsSet, { /// Build the final struct pub fn build(self) -> AspectRatio<'a> { @@ -316,37 +316,37 @@ pub mod image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AspectRatio; type Image; + type AspectRatio; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AspectRatio = Unset; type Image = Unset; - } - ///State transition - sets the `aspect_ratio` field to Set - pub struct SetAspectRatio(PhantomData S>); - impl sealed::Sealed for SetAspectRatio {} - impl State for SetAspectRatio { - type AspectRatio = Set; - type Image = S::Image; + type AspectRatio = Unset; } ///State transition - sets the `image` field to Set pub struct SetImage(PhantomData S>); impl sealed::Sealed for SetImage {} impl State for SetImage { - type AspectRatio = S::AspectRatio; type Image = Set; + type AspectRatio = S::AspectRatio; + } + ///State transition - sets the `aspect_ratio` field to Set + pub struct SetAspectRatio(PhantomData S>); + impl sealed::Sealed for SetAspectRatio {} + impl State for SetAspectRatio { + type Image = S::Image; + type AspectRatio = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `aspect_ratio` field - pub struct aspect_ratio(()); ///Marker type for the `image` field pub struct image(()); + ///Marker type for the `aspect_ratio` field + pub struct aspect_ratio(()); } } @@ -433,8 +433,8 @@ where impl<'a, S> ImageBuilder<'a, S> where S: image_state::State, - S::AspectRatio: image_state::IsSet, S::Image: image_state::IsSet, + S::AspectRatio: image_state::IsSet, { /// Build the final struct pub fn build(self) -> Image<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/comment.rs b/crates/weaver-api/src/pub_leaflet/comment.rs index fb0f421..58c8fe9 100644 --- a/crates/weaver-api/src/pub_leaflet/comment.rs +++ b/crates/weaver-api/src/pub_leaflet/comment.rs @@ -443,51 +443,51 @@ pub mod comment_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedAt; type Subject; type Plaintext; - type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type CreatedAt = Unset; type Subject = Unset; type Plaintext = Unset; - type CreatedAt = Unset; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Subject = S::Subject; + type Plaintext = S::Plaintext; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { + type CreatedAt = S::CreatedAt; type Subject = Set; type Plaintext = S::Plaintext; - type CreatedAt = S::CreatedAt; } ///State transition - sets the `plaintext` field to Set pub struct SetPlaintext(PhantomData S>); impl sealed::Sealed for SetPlaintext {} impl State for SetPlaintext { - type Subject = S::Subject; - type Plaintext = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type Subject = S::Subject; - type Plaintext = S::Plaintext; - type CreatedAt = Set; + type Plaintext = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); ///Marker type for the `plaintext` field pub struct plaintext(()); - ///Marker type for the `created_at` field - pub struct created_at(()); } } @@ -657,9 +657,9 @@ where impl<'a, S> CommentBuilder<'a, S> where S: comment_state::State, + S::CreatedAt: comment_state::IsSet, S::Subject: comment_state::IsSet, S::Plaintext: comment_state::IsSet, - S::CreatedAt: comment_state::IsSet, { /// Build the final struct pub fn build(self) -> Comment<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/document.rs b/crates/weaver-api/src/pub_leaflet/document.rs index ac5a82e..9a3eb94 100644 --- a/crates/weaver-api/src/pub_leaflet/document.rs +++ b/crates/weaver-api/src/pub_leaflet/document.rs @@ -55,51 +55,51 @@ pub mod document_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; - type Author; type Pages; + type Author; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; - type Author = Unset; type Pages = Unset; + type Author = Unset; + type Title = Unset; } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; + ///State transition - sets the `pages` field to Set + pub struct SetPages(PhantomData S>); + impl sealed::Sealed for SetPages {} + impl State for SetPages { + type Pages = Set; type Author = S::Author; - type Pages = S::Pages; + type Title = S::Title; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Title = S::Title; - type Author = Set; type Pages = S::Pages; - } - ///State transition - sets the `pages` field to Set - pub struct SetPages(PhantomData S>); - impl sealed::Sealed for SetPages {} - impl State for SetPages { + type Author = Set; type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Pages = S::Pages; type Author = S::Author; - type Pages = Set; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); - ///Marker type for the `author` field - pub struct author(()); ///Marker type for the `pages` field pub struct pages(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -322,9 +322,9 @@ where impl<'a, S> DocumentBuilder<'a, S> where S: document_state::State, - S::Title: document_state::IsSet, - S::Author: document_state::IsSet, S::Pages: document_state::IsSet, + S::Author: document_state::IsSet, + S::Title: document_state::IsSet, { /// Build the final struct pub fn build(self) -> Document<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/pages/canvas.rs b/crates/weaver-api/src/pub_leaflet/pages/canvas.rs index 9c238da..a4995a1 100644 --- a/crates/weaver-api/src/pub_leaflet/pages/canvas.rs +++ b/crates/weaver-api/src/pub_leaflet/pages/canvas.rs @@ -40,8 +40,8 @@ pub mod block_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Y; - type X; type Block; + type X; type Width; } /// Empty state - all required fields are unset @@ -49,8 +49,8 @@ pub mod block_state { impl sealed::Sealed for Empty {} impl State for Empty { type Y = Unset; - type X = Unset; type Block = Unset; + type X = Unset; type Width = Unset; } ///State transition - sets the `y` field to Set @@ -58,17 +58,8 @@ pub mod block_state { impl sealed::Sealed for SetY {} impl State for SetY { type Y = Set; - type X = S::X; - type Block = S::Block; - type Width = S::Width; - } - ///State transition - sets the `x` field to Set - pub struct SetX(PhantomData S>); - impl sealed::Sealed for SetX {} - impl State for SetX { - type Y = S::Y; - type X = Set; type Block = S::Block; + type X = S::X; type Width = S::Width; } ///State transition - sets the `block` field to Set @@ -76,8 +67,17 @@ pub mod block_state { impl sealed::Sealed for SetBlock {} impl State for SetBlock { type Y = S::Y; - type X = S::X; type Block = Set; + type X = S::X; + type Width = S::Width; + } + ///State transition - sets the `x` field to Set + pub struct SetX(PhantomData S>); + impl sealed::Sealed for SetX {} + impl State for SetX { + type Y = S::Y; + type Block = S::Block; + type X = Set; type Width = S::Width; } ///State transition - sets the `width` field to Set @@ -85,8 +85,8 @@ pub mod block_state { impl sealed::Sealed for SetWidth {} impl State for SetWidth { type Y = S::Y; - type X = S::X; type Block = S::Block; + type X = S::X; type Width = Set; } /// Marker types for field names @@ -94,10 +94,10 @@ pub mod block_state { pub mod members { ///Marker type for the `y` field pub struct y(()); - ///Marker type for the `x` field - pub struct x(()); ///Marker type for the `block` field pub struct block(()); + ///Marker type for the `x` field + pub struct x(()); ///Marker type for the `width` field pub struct width(()); } @@ -235,8 +235,8 @@ impl<'a, S> BlockBuilder<'a, S> where S: block_state::State, S::Y: block_state::IsSet, - S::X: block_state::IsSet, S::Block: block_state::IsSet, + S::X: block_state::IsSet, S::Width: block_state::IsSet, { /// Build the final struct @@ -764,37 +764,37 @@ pub mod position_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Block; type Offset; + type Block; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Block = Unset; type Offset = Unset; - } - ///State transition - sets the `block` field to Set - pub struct SetBlock(PhantomData S>); - impl sealed::Sealed for SetBlock {} - impl State for SetBlock { - type Block = Set; - type Offset = S::Offset; + type Block = Unset; } ///State transition - sets the `offset` field to Set pub struct SetOffset(PhantomData S>); impl sealed::Sealed for SetOffset {} impl State for SetOffset { - type Block = S::Block; type Offset = Set; + type Block = S::Block; + } + ///State transition - sets the `block` field to Set + pub struct SetBlock(PhantomData S>); + impl sealed::Sealed for SetBlock {} + impl State for SetBlock { + type Offset = S::Offset; + type Block = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `block` field - pub struct block(()); ///Marker type for the `offset` field pub struct offset(()); + ///Marker type for the `block` field + pub struct block(()); } } @@ -867,8 +867,8 @@ where impl<'a, S> PositionBuilder<'a, S> where S: position_state::State, - S::Block: position_state::IsSet, S::Offset: position_state::IsSet, + S::Block: position_state::IsSet, { /// Build the final struct pub fn build(self) -> Position<'a> { @@ -939,37 +939,37 @@ pub mod quote_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type End; type Start; + type End; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type End = Unset; type Start = Unset; - } - ///State transition - sets the `end` field to Set - pub struct SetEnd(PhantomData S>); - impl sealed::Sealed for SetEnd {} - impl State for SetEnd { - type End = Set; - type Start = S::Start; + type End = Unset; } ///State transition - sets the `start` field to Set pub struct SetStart(PhantomData S>); impl sealed::Sealed for SetStart {} impl State for SetStart { - type End = S::End; type Start = Set; + type End = S::End; + } + ///State transition - sets the `end` field to Set + pub struct SetEnd(PhantomData S>); + impl sealed::Sealed for SetEnd {} + impl State for SetEnd { + type Start = S::Start; + type End = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `end` field - pub struct end(()); ///Marker type for the `start` field pub struct start(()); + ///Marker type for the `end` field + pub struct end(()); } } @@ -1042,8 +1042,8 @@ where impl<'a, S> QuoteBuilder<'a, S> where S: quote_state::State, - S::End: quote_state::IsSet, S::Start: quote_state::IsSet, + S::End: quote_state::IsSet, { /// Build the final struct pub fn build(self) -> Quote<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/pages/linear_document.rs b/crates/weaver-api/src/pub_leaflet/pages/linear_document.rs index 396d1a1..4389434 100644 --- a/crates/weaver-api/src/pub_leaflet/pages/linear_document.rs +++ b/crates/weaver-api/src/pub_leaflet/pages/linear_document.rs @@ -701,37 +701,37 @@ pub mod position_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Offset; type Block; + type Offset; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Offset = Unset; type Block = Unset; - } - ///State transition - sets the `offset` field to Set - pub struct SetOffset(PhantomData S>); - impl sealed::Sealed for SetOffset {} - impl State for SetOffset { - type Offset = Set; - type Block = S::Block; + type Offset = Unset; } ///State transition - sets the `block` field to Set pub struct SetBlock(PhantomData S>); impl sealed::Sealed for SetBlock {} impl State for SetBlock { - type Offset = S::Offset; type Block = Set; + type Offset = S::Offset; + } + ///State transition - sets the `offset` field to Set + pub struct SetOffset(PhantomData S>); + impl sealed::Sealed for SetOffset {} + impl State for SetOffset { + type Block = S::Block; + type Offset = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `offset` field - pub struct offset(()); ///Marker type for the `block` field pub struct block(()); + ///Marker type for the `offset` field + pub struct offset(()); } } @@ -804,8 +804,8 @@ where impl<'a, S> PositionBuilder<'a, S> where S: position_state::State, - S::Offset: position_state::IsSet, S::Block: position_state::IsSet, + S::Offset: position_state::IsSet, { /// Build the final struct pub fn build(self) -> Position<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/poll/vote.rs b/crates/weaver-api/src/pub_leaflet/poll/vote.rs index 9e9c9e4..0c9cf82 100644 --- a/crates/weaver-api/src/pub_leaflet/poll/vote.rs +++ b/crates/weaver-api/src/pub_leaflet/poll/vote.rs @@ -34,37 +34,37 @@ pub mod vote_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Option; type Poll; + type Option; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Option = Unset; type Poll = Unset; - } - ///State transition - sets the `option` field to Set - pub struct SetOption(PhantomData S>); - impl sealed::Sealed for SetOption {} - impl State for SetOption { - type Option = Set; - type Poll = S::Poll; + type Option = Unset; } ///State transition - sets the `poll` field to Set pub struct SetPoll(PhantomData S>); impl sealed::Sealed for SetPoll {} impl State for SetPoll { - type Option = S::Option; type Poll = Set; + type Option = S::Option; + } + ///State transition - sets the `option` field to Set + pub struct SetOption(PhantomData S>); + impl sealed::Sealed for SetOption {} + impl State for SetOption { + type Poll = S::Poll; + type Option = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `option` field - pub struct option(()); ///Marker type for the `poll` field pub struct poll(()); + ///Marker type for the `option` field + pub struct option(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> VoteBuilder<'a, S> where S: vote_state::State, - S::Option: vote_state::IsSet, S::Poll: vote_state::IsSet, + S::Option: vote_state::IsSet, { /// Build the final struct pub fn build(self) -> Vote<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/theme/color.rs b/crates/weaver-api/src/pub_leaflet/theme/color.rs index c826253..9200fe0 100644 --- a/crates/weaver-api/src/pub_leaflet/theme/color.rs +++ b/crates/weaver-api/src/pub_leaflet/theme/color.rs @@ -32,51 +32,51 @@ pub mod rgb_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type R; type G; type B; + type R; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type R = Unset; type G = Unset; type B = Unset; - } - ///State transition - sets the `r` field to Set - pub struct SetR(PhantomData S>); - impl sealed::Sealed for SetR {} - impl State for SetR { - type R = Set; - type G = S::G; - type B = S::B; + type R = Unset; } ///State transition - sets the `g` field to Set pub struct SetG(PhantomData S>); impl sealed::Sealed for SetG {} impl State for SetG { - type R = S::R; type G = Set; type B = S::B; + type R = S::R; } ///State transition - sets the `b` field to Set pub struct SetB(PhantomData S>); impl sealed::Sealed for SetB {} impl State for SetB { - type R = S::R; type G = S::G; type B = Set; + type R = S::R; + } + ///State transition - sets the `r` field to Set + pub struct SetR(PhantomData S>); + impl sealed::Sealed for SetR {} + impl State for SetR { + type G = S::G; + type B = S::B; + type R = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `r` field - pub struct r(()); ///Marker type for the `g` field pub struct g(()); ///Marker type for the `b` field pub struct b(()); + ///Marker type for the `r` field + pub struct r(()); } } @@ -160,9 +160,9 @@ where impl<'a, S> RgbBuilder<'a, S> where S: rgb_state::State, - S::R: rgb_state::IsSet, S::G: rgb_state::IsSet, S::B: rgb_state::IsSet, + S::R: rgb_state::IsSet, { /// Build the final struct pub fn build(self) -> Rgb<'a> { @@ -439,66 +439,66 @@ pub mod rgba_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type G; - type B; type A; type R; + type B; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type G = Unset; - type B = Unset; type A = Unset; type R = Unset; + type B = Unset; } ///State transition - sets the `g` field to Set pub struct SetG(PhantomData S>); impl sealed::Sealed for SetG {} impl State for SetG { type G = Set; - type B = S::B; - type A = S::A; - type R = S::R; - } - ///State transition - sets the `b` field to Set - pub struct SetB(PhantomData S>); - impl sealed::Sealed for SetB {} - impl State for SetB { - type G = S::G; - type B = Set; type A = S::A; type R = S::R; + type B = S::B; } ///State transition - sets the `a` field to Set pub struct SetA(PhantomData S>); impl sealed::Sealed for SetA {} impl State for SetA { type G = S::G; - type B = S::B; type A = Set; type R = S::R; + type B = S::B; } ///State transition - sets the `r` field to Set pub struct SetR(PhantomData S>); impl sealed::Sealed for SetR {} impl State for SetR { type G = S::G; - type B = S::B; type A = S::A; type R = Set; + type B = S::B; + } + ///State transition - sets the `b` field to Set + pub struct SetB(PhantomData S>); + impl sealed::Sealed for SetB {} + impl State for SetB { + type G = S::G; + type A = S::A; + type R = S::R; + type B = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `g` field pub struct g(()); - ///Marker type for the `b` field - pub struct b(()); ///Marker type for the `a` field pub struct a(()); ///Marker type for the `r` field pub struct r(()); + ///Marker type for the `b` field + pub struct b(()); } } @@ -600,9 +600,9 @@ impl<'a, S> RgbaBuilder<'a, S> where S: rgba_state::State, S::G: rgba_state::IsSet, - S::B: rgba_state::IsSet, S::A: rgba_state::IsSet, S::R: rgba_state::IsSet, + S::B: rgba_state::IsSet, { /// Build the final struct pub fn build(self) -> Rgba<'a> { diff --git a/crates/weaver-api/src/sh_weaver/actor.rs b/crates/weaver-api/src/sh_weaver/actor.rs index 08c41ee..7b6d8b7 100644 --- a/crates/weaver-api/src/sh_weaver/actor.rs +++ b/crates/weaver-api/src/sh_weaver/actor.rs @@ -3167,50 +3167,50 @@ pub mod tangled_profile_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Handle; - type Did; type Bluesky; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Handle = Unset; - type Did = Unset; type Bluesky = Unset; + type Did = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type Handle = Set; - type Did = S::Did; - type Bluesky = S::Bluesky; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Handle = S::Handle; - type Did = Set; type Bluesky = S::Bluesky; + type Did = S::Did; } ///State transition - sets the `bluesky` field to Set pub struct SetBluesky(PhantomData S>); impl sealed::Sealed for SetBluesky {} impl State for SetBluesky { type Handle = S::Handle; - type Did = S::Did; type Bluesky = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = S::Handle; + type Bluesky = S::Bluesky; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `handle` field pub struct handle(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `bluesky` field pub struct bluesky(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -3401,8 +3401,8 @@ impl<'a, S> TangledProfileViewBuilder<'a, S> where S: tangled_profile_view_state::State, S::Handle: tangled_profile_view_state::IsSet, - S::Did: tangled_profile_view_state::IsSet, S::Bluesky: tangled_profile_view_state::IsSet, + S::Did: tangled_profile_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TangledProfileView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/collab.rs b/crates/weaver-api/src/sh_weaver/collab.rs index 4c8b5a0..8bf43b9 100644 --- a/crates/weaver-api/src/sh_weaver/collab.rs +++ b/crates/weaver-api/src/sh_weaver/collab.rs @@ -94,51 +94,51 @@ pub mod collaboration_state_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Participants; - type Status; type Resource; + type Status; + type Participants; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Participants = Unset; - type Status = Unset; type Resource = Unset; + type Status = Unset; + type Participants = Unset; } - ///State transition - sets the `participants` field to Set - pub struct SetParticipants(PhantomData S>); - impl sealed::Sealed for SetParticipants {} - impl State for SetParticipants { - type Participants = Set; + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; type Status = S::Status; - type Resource = S::Resource; + type Participants = S::Participants; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type Participants = S::Participants; - type Status = Set; type Resource = S::Resource; - } - ///State transition - sets the `resource` field to Set - pub struct SetResource(PhantomData S>); - impl sealed::Sealed for SetResource {} - impl State for SetResource { + type Status = Set; type Participants = S::Participants; + } + ///State transition - sets the `participants` field to Set + pub struct SetParticipants(PhantomData S>); + impl sealed::Sealed for SetParticipants {} + impl State for SetParticipants { + type Resource = S::Resource; type Status = S::Status; - type Resource = Set; + type Participants = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `participants` field - pub struct participants(()); - ///Marker type for the `status` field - pub struct status(()); ///Marker type for the `resource` field pub struct resource(()); + ///Marker type for the `status` field + pub struct status(()); + ///Marker type for the `participants` field + pub struct participants(()); } } @@ -426,9 +426,9 @@ where impl<'a, S> CollaborationStateViewBuilder<'a, S> where S: collaboration_state_view_state::State, - S::Participants: collaboration_state_view_state::IsSet, - S::Status: collaboration_state_view_state::IsSet, S::Resource: collaboration_state_view_state::IsSet, + S::Status: collaboration_state_view_state::IsSet, + S::Participants: collaboration_state_view_state::IsSet, { /// Build the final struct pub fn build(self) -> CollaborationStateView<'a> { @@ -1610,67 +1610,67 @@ pub mod former_collaborator_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type EndReason; - type WasActiveFrom; type User; type WasActiveUntil; + type WasActiveFrom; + type EndReason; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type EndReason = Unset; - type WasActiveFrom = Unset; type User = Unset; type WasActiveUntil = Unset; - } - ///State transition - sets the `end_reason` field to Set - pub struct SetEndReason(PhantomData S>); - impl sealed::Sealed for SetEndReason {} - impl State for SetEndReason { - type EndReason = Set; - type WasActiveFrom = S::WasActiveFrom; - type User = S::User; - type WasActiveUntil = S::WasActiveUntil; - } - ///State transition - sets the `was_active_from` field to Set - pub struct SetWasActiveFrom(PhantomData S>); - impl sealed::Sealed for SetWasActiveFrom {} - impl State for SetWasActiveFrom { - type EndReason = S::EndReason; - type WasActiveFrom = Set; - type User = S::User; - type WasActiveUntil = S::WasActiveUntil; + type WasActiveFrom = Unset; + type EndReason = Unset; } ///State transition - sets the `user` field to Set pub struct SetUser(PhantomData S>); impl sealed::Sealed for SetUser {} impl State for SetUser { - type EndReason = S::EndReason; - type WasActiveFrom = S::WasActiveFrom; type User = Set; type WasActiveUntil = S::WasActiveUntil; + type WasActiveFrom = S::WasActiveFrom; + type EndReason = S::EndReason; } ///State transition - sets the `was_active_until` field to Set pub struct SetWasActiveUntil(PhantomData S>); impl sealed::Sealed for SetWasActiveUntil {} impl State for SetWasActiveUntil { - type EndReason = S::EndReason; - type WasActiveFrom = S::WasActiveFrom; type User = S::User; type WasActiveUntil = Set; + type WasActiveFrom = S::WasActiveFrom; + type EndReason = S::EndReason; + } + ///State transition - sets the `was_active_from` field to Set + pub struct SetWasActiveFrom(PhantomData S>); + impl sealed::Sealed for SetWasActiveFrom {} + impl State for SetWasActiveFrom { + type User = S::User; + type WasActiveUntil = S::WasActiveUntil; + type WasActiveFrom = Set; + type EndReason = S::EndReason; + } + ///State transition - sets the `end_reason` field to Set + pub struct SetEndReason(PhantomData S>); + impl sealed::Sealed for SetEndReason {} + impl State for SetEndReason { + type User = S::User; + type WasActiveUntil = S::WasActiveUntil; + type WasActiveFrom = S::WasActiveFrom; + type EndReason = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `end_reason` field - pub struct end_reason(()); - ///Marker type for the `was_active_from` field - pub struct was_active_from(()); ///Marker type for the `user` field pub struct user(()); ///Marker type for the `was_active_until` field pub struct was_active_until(()); + ///Marker type for the `was_active_from` field + pub struct was_active_from(()); + ///Marker type for the `end_reason` field + pub struct end_reason(()); } } @@ -1843,10 +1843,10 @@ where impl<'a, S> FormerCollaboratorViewBuilder<'a, S> where S: former_collaborator_view_state::State, - S::EndReason: former_collaborator_view_state::IsSet, - S::WasActiveFrom: former_collaborator_view_state::IsSet, S::User: former_collaborator_view_state::IsSet, S::WasActiveUntil: former_collaborator_view_state::IsSet, + S::WasActiveFrom: former_collaborator_view_state::IsSet, + S::EndReason: former_collaborator_view_state::IsSet, { /// Build the final struct pub fn build(self) -> FormerCollaboratorView<'a> { @@ -2061,127 +2061,127 @@ pub mod invite_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedAt; type Status; + type Cid; type Uri; - type Inviter; type Invitee; - type Cid; + type Inviter; type Resource; - type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type CreatedAt = Unset; type Status = Unset; + type Cid = Unset; type Uri = Unset; - type Inviter = Unset; type Invitee = Unset; - type Cid = Unset; + type Inviter = Unset; type Resource = Unset; - type CreatedAt = Unset; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Status = S::Status; + type Cid = S::Cid; + type Uri = S::Uri; + type Invitee = S::Invitee; + type Inviter = S::Inviter; + type Resource = S::Resource; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { + type CreatedAt = S::CreatedAt; type Status = Set; + type Cid = S::Cid; type Uri = S::Uri; - type Inviter = S::Inviter; type Invitee = S::Invitee; - type Cid = S::Cid; + type Inviter = S::Inviter; type Resource = S::Resource; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type CreatedAt = S::CreatedAt; + type Status = S::Status; + type Cid = Set; + type Uri = S::Uri; + type Invitee = S::Invitee; + type Inviter = S::Inviter; + type Resource = S::Resource; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Status = S::Status; - type Uri = Set; - type Inviter = S::Inviter; - type Invitee = S::Invitee; - type Cid = S::Cid; - type Resource = S::Resource; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `inviter` field to Set - pub struct SetInviter(PhantomData S>); - impl sealed::Sealed for SetInviter {} - impl State for SetInviter { type Status = S::Status; - type Uri = S::Uri; - type Inviter = Set; - type Invitee = S::Invitee; type Cid = S::Cid; + type Uri = Set; + type Invitee = S::Invitee; + type Inviter = S::Inviter; type Resource = S::Resource; - type CreatedAt = S::CreatedAt; } ///State transition - sets the `invitee` field to Set pub struct SetInvitee(PhantomData S>); impl sealed::Sealed for SetInvitee {} impl State for SetInvitee { + type CreatedAt = S::CreatedAt; type Status = S::Status; + type Cid = S::Cid; type Uri = S::Uri; - type Inviter = S::Inviter; type Invitee = Set; - type Cid = S::Cid; + type Inviter = S::Inviter; type Resource = S::Resource; - type CreatedAt = S::CreatedAt; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { + ///State transition - sets the `inviter` field to Set + pub struct SetInviter(PhantomData S>); + impl sealed::Sealed for SetInviter {} + impl State for SetInviter { + type CreatedAt = S::CreatedAt; type Status = S::Status; + type Cid = S::Cid; type Uri = S::Uri; - type Inviter = S::Inviter; type Invitee = S::Invitee; - type Cid = Set; + type Inviter = Set; type Resource = S::Resource; - type CreatedAt = S::CreatedAt; } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { - type Status = S::Status; - type Uri = S::Uri; - type Inviter = S::Inviter; - type Invitee = S::Invitee; - type Cid = S::Cid; - type Resource = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type Status = S::Status; + type Cid = S::Cid; type Uri = S::Uri; - type Inviter = S::Inviter; type Invitee = S::Invitee; - type Cid = S::Cid; - type Resource = S::Resource; - type CreatedAt = Set; + type Inviter = S::Inviter; + type Resource = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `inviter` field - pub struct inviter(()); ///Marker type for the `invitee` field pub struct invitee(()); - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `inviter` field + pub struct inviter(()); ///Marker type for the `resource` field pub struct resource(()); - ///Marker type for the `created_at` field - pub struct created_at(()); } } @@ -2479,13 +2479,13 @@ where impl<'a, S> InviteViewBuilder<'a, S> where S: invite_view_state::State, + S::CreatedAt: invite_view_state::IsSet, S::Status: invite_view_state::IsSet, + S::Cid: invite_view_state::IsSet, S::Uri: invite_view_state::IsSet, - S::Inviter: invite_view_state::IsSet, S::Invitee: invite_view_state::IsSet, - S::Cid: invite_view_state::IsSet, + S::Inviter: invite_view_state::IsSet, S::Resource: invite_view_state::IsSet, - S::CreatedAt: invite_view_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteView<'a> { @@ -2821,51 +2821,51 @@ pub mod participant_state_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Status; type User; type Role; - type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Status = Unset; type User = Unset; type Role = Unset; - type Status = Unset; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type Status = Set; + type User = S::User; + type Role = S::Role; } ///State transition - sets the `user` field to Set pub struct SetUser(PhantomData S>); impl sealed::Sealed for SetUser {} impl State for SetUser { + type Status = S::Status; type User = Set; type Role = S::Role; - type Status = S::Status; } ///State transition - sets the `role` field to Set pub struct SetRole(PhantomData S>); impl sealed::Sealed for SetRole {} impl State for SetRole { - type User = S::User; - type Role = Set; type Status = S::Status; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { type User = S::User; - type Role = S::Role; - type Status = Set; + type Role = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `status` field + pub struct status(()); ///Marker type for the `user` field pub struct user(()); ///Marker type for the `role` field pub struct role(()); - ///Marker type for the `status` field - pub struct status(()); } } @@ -3127,9 +3127,9 @@ impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, impl<'a, S> ParticipantStateViewBuilder<'a, S> where S: participant_state_view_state::State, + S::Status: participant_state_view_state::IsSet, S::User: participant_state_view_state::IsSet, S::Role: participant_state_view_state::IsSet, - S::Status: participant_state_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ParticipantStateView<'a> { @@ -3543,85 +3543,85 @@ pub mod session_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type User; type Resource; - type CreatedAt; type NodeId; type Uri; - type User; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type User = Unset; type Resource = Unset; - type CreatedAt = Unset; type NodeId = Unset; type Uri = Unset; - type User = Unset; + type CreatedAt = Unset; + } + ///State transition - sets the `user` field to Set + pub struct SetUser(PhantomData S>); + impl sealed::Sealed for SetUser {} + impl State for SetUser { + type User = Set; + type Resource = S::Resource; + type NodeId = S::NodeId; + type Uri = S::Uri; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { - type Resource = Set; - type CreatedAt = S::CreatedAt; - type NodeId = S::NodeId; - type Uri = S::Uri; type User = S::User; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Resource = S::Resource; - type CreatedAt = Set; + type Resource = Set; type NodeId = S::NodeId; type Uri = S::Uri; - type User = S::User; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `node_id` field to Set pub struct SetNodeId(PhantomData S>); impl sealed::Sealed for SetNodeId {} impl State for SetNodeId { + type User = S::User; type Resource = S::Resource; - type CreatedAt = S::CreatedAt; type NodeId = Set; type Uri = S::Uri; - type User = S::User; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { + type User = S::User; type Resource = S::Resource; - type CreatedAt = S::CreatedAt; type NodeId = S::NodeId; type Uri = Set; - type User = S::User; + type CreatedAt = S::CreatedAt; } - ///State transition - sets the `user` field to Set - pub struct SetUser(PhantomData S>); - impl sealed::Sealed for SetUser {} - impl State for SetUser { + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type User = S::User; type Resource = S::Resource; - type CreatedAt = S::CreatedAt; type NodeId = S::NodeId; type Uri = S::Uri; - type User = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `user` field + pub struct user(()); ///Marker type for the `resource` field pub struct resource(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `node_id` field pub struct node_id(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `user` field - pub struct user(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -3794,11 +3794,11 @@ where impl<'a, S> SessionViewBuilder<'a, S> where S: session_view_state::State, + S::User: session_view_state::IsSet, S::Resource: session_view_state::IsSet, - S::CreatedAt: session_view_state::IsSet, S::NodeId: session_view_state::IsSet, S::Uri: session_view_state::IsSet, - S::User: session_view_state::IsSet, + S::CreatedAt: session_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SessionView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/collab/accept.rs b/crates/weaver-api/src/sh_weaver/collab/accept.rs index f792abd..b7e6103 100644 --- a/crates/weaver-api/src/sh_weaver/collab/accept.rs +++ b/crates/weaver-api/src/sh_weaver/collab/accept.rs @@ -37,51 +37,51 @@ pub mod accept_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedAt; type Invite; type Resource; - type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type CreatedAt = Unset; type Invite = Unset; type Resource = Unset; - type CreatedAt = Unset; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Invite = S::Invite; + type Resource = S::Resource; } ///State transition - sets the `invite` field to Set pub struct SetInvite(PhantomData S>); impl sealed::Sealed for SetInvite {} impl State for SetInvite { + type CreatedAt = S::CreatedAt; type Invite = Set; type Resource = S::Resource; - type CreatedAt = S::CreatedAt; } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { - type Invite = S::Invite; - type Resource = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type Invite = S::Invite; - type Resource = S::Resource; - type CreatedAt = Set; + type Resource = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `invite` field pub struct invite(()); ///Marker type for the `resource` field pub struct resource(()); - ///Marker type for the `created_at` field - pub struct created_at(()); } } @@ -174,9 +174,9 @@ where impl<'a, S> AcceptBuilder<'a, S> where S: accept_state::State, + S::CreatedAt: accept_state::IsSet, S::Invite: accept_state::IsSet, S::Resource: accept_state::IsSet, - S::CreatedAt: accept_state::IsSet, { /// Build the final struct pub fn build(self) -> Accept<'a> { diff --git a/crates/weaver-api/src/sh_weaver/collab/session.rs b/crates/weaver-api/src/sh_weaver/collab/session.rs index c0ffe28..f144b74 100644 --- a/crates/weaver-api/src/sh_weaver/collab/session.rs +++ b/crates/weaver-api/src/sh_weaver/collab/session.rs @@ -44,51 +44,51 @@ pub mod session_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type NodeId; - type CreatedAt; type Resource; + type CreatedAt; + type NodeId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type NodeId = Unset; - type CreatedAt = Unset; type Resource = Unset; + type CreatedAt = Unset; + type NodeId = Unset; } - ///State transition - sets the `node_id` field to Set - pub struct SetNodeId(PhantomData S>); - impl sealed::Sealed for SetNodeId {} - impl State for SetNodeId { - type NodeId = Set; + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; type CreatedAt = S::CreatedAt; - type Resource = S::Resource; + type NodeId = S::NodeId; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type NodeId = S::NodeId; - type CreatedAt = Set; type Resource = S::Resource; - } - ///State transition - sets the `resource` field to Set - pub struct SetResource(PhantomData S>); - impl sealed::Sealed for SetResource {} - impl State for SetResource { + type CreatedAt = Set; type NodeId = S::NodeId; + } + ///State transition - sets the `node_id` field to Set + pub struct SetNodeId(PhantomData S>); + impl sealed::Sealed for SetNodeId {} + impl State for SetNodeId { + type Resource = S::Resource; type CreatedAt = S::CreatedAt; - type Resource = Set; + type NodeId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `node_id` field - pub struct node_id(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `resource` field pub struct resource(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `node_id` field + pub struct node_id(()); } } @@ -221,9 +221,9 @@ where impl<'a, S> SessionBuilder<'a, S> where S: session_state::State, - S::NodeId: session_state::IsSet, - S::CreatedAt: session_state::IsSet, S::Resource: session_state::IsSet, + S::CreatedAt: session_state::IsSet, + S::NodeId: session_state::IsSet, { /// Build the final struct pub fn build(self) -> Session<'a> { diff --git a/crates/weaver-api/src/sh_weaver/domain.rs b/crates/weaver-api/src/sh_weaver/domain.rs index 2addbf7..df89c0f 100644 --- a/crates/weaver-api/src/sh_weaver/domain.rs +++ b/crates/weaver-api/src/sh_weaver/domain.rs @@ -54,151 +54,151 @@ pub mod document_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rkey; - type IndexedAt; type Record; - type Path; type Uri; + type Rkey; type Cid; - type Title; + type IndexedAt; type Did; + type Path; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rkey = Unset; - type IndexedAt = Unset; type Record = Unset; - type Path = Unset; type Uri = Unset; + type Rkey = Unset; type Cid = Unset; - type Title = Unset; + type IndexedAt = Unset; type Did = Unset; - } - ///State transition - sets the `rkey` field to Set - pub struct SetRkey(PhantomData S>); - impl sealed::Sealed for SetRkey {} - impl State for SetRkey { - type Rkey = Set; - type IndexedAt = S::IndexedAt; - type Record = S::Record; - type Path = S::Path; - type Uri = S::Uri; - type Cid = S::Cid; - type Title = S::Title; - type Did = S::Did; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Rkey = S::Rkey; - type IndexedAt = Set; - type Record = S::Record; - type Path = S::Path; - type Uri = S::Uri; - type Cid = S::Cid; - type Title = S::Title; - type Did = S::Did; + type Path = Unset; + type Title = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Rkey = S::Rkey; - type IndexedAt = S::IndexedAt; type Record = Set; - type Path = S::Path; type Uri = S::Uri; - type Cid = S::Cid; - type Title = S::Title; - type Did = S::Did; - } - ///State transition - sets the `path` field to Set - pub struct SetPath(PhantomData S>); - impl sealed::Sealed for SetPath {} - impl State for SetPath { type Rkey = S::Rkey; - type IndexedAt = S::IndexedAt; - type Record = S::Record; - type Path = Set; - type Uri = S::Uri; type Cid = S::Cid; - type Title = S::Title; + type IndexedAt = S::IndexedAt; type Did = S::Did; + type Path = S::Path; + type Title = S::Title; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Rkey = S::Rkey; - type IndexedAt = S::IndexedAt; type Record = S::Record; - type Path = S::Path; type Uri = Set; + type Rkey = S::Rkey; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Did = S::Did; + type Path = S::Path; type Title = S::Title; + } + ///State transition - sets the `rkey` field to Set + pub struct SetRkey(PhantomData S>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Record = S::Record; + type Uri = S::Uri; + type Rkey = Set; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; type Did = S::Did; + type Path = S::Path; + type Title = S::Title; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Rkey = S::Rkey; - type IndexedAt = S::IndexedAt; type Record = S::Record; - type Path = S::Path; type Uri = S::Uri; + type Rkey = S::Rkey; type Cid = Set; - type Title = S::Title; + type IndexedAt = S::IndexedAt; type Did = S::Did; + type Path = S::Path; + type Title = S::Title; } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Rkey = S::Rkey; - type IndexedAt = S::IndexedAt; + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { type Record = S::Record; - type Path = S::Path; type Uri = S::Uri; + type Rkey = S::Rkey; type Cid = S::Cid; - type Title = Set; + type IndexedAt = Set; type Did = S::Did; + type Path = S::Path; + type Title = S::Title; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { + type Record = S::Record; + type Uri = S::Uri; type Rkey = S::Rkey; + type Cid = S::Cid; type IndexedAt = S::IndexedAt; - type Record = S::Record; + type Did = Set; type Path = S::Path; + type Title = S::Title; + } + ///State transition - sets the `path` field to Set + pub struct SetPath(PhantomData S>); + impl sealed::Sealed for SetPath {} + impl State for SetPath { + type Record = S::Record; type Uri = S::Uri; + type Rkey = S::Rkey; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Did = S::Did; + type Path = Set; type Title = S::Title; - type Did = Set; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Record = S::Record; + type Uri = S::Uri; + type Rkey = S::Rkey; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Did = S::Did; + type Path = S::Path; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rkey` field - pub struct rkey(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `record` field pub struct record(()); - ///Marker type for the `path` field - pub struct path(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `rkey` field + pub struct rkey(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `title` field - pub struct title(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `path` field + pub struct path(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -436,14 +436,14 @@ where impl<'a, S> DocumentViewBuilder<'a, S> where S: document_view_state::State, - S::Rkey: document_view_state::IsSet, - S::IndexedAt: document_view_state::IsSet, S::Record: document_view_state::IsSet, - S::Path: document_view_state::IsSet, S::Uri: document_view_state::IsSet, + S::Rkey: document_view_state::IsSet, S::Cid: document_view_state::IsSet, - S::Title: document_view_state::IsSet, + S::IndexedAt: document_view_state::IsSet, S::Did: document_view_state::IsSet, + S::Path: document_view_state::IsSet, + S::Title: document_view_state::IsSet, { /// Build the final struct pub fn build(self) -> DocumentView<'a> { @@ -908,150 +908,150 @@ pub mod publication_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Rkey; - type Did; - type Cid; type Domain; - type Record; - type Name; + type Rkey; type IndexedAt; + type Name; + type Record; + type Cid; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; - type Rkey = Unset; - type Did = Unset; - type Cid = Unset; type Domain = Unset; - type Record = Unset; - type Name = Unset; + type Rkey = Unset; type IndexedAt = Unset; + type Name = Unset; + type Record = Unset; + type Cid = Unset; + type Did = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; - type Rkey = S::Rkey; - type Did = S::Did; - type Cid = S::Cid; type Domain = S::Domain; - type Record = S::Record; + type Rkey = S::Rkey; + type IndexedAt = S::IndexedAt; type Name = S::Name; + type Record = S::Record; + type Cid = S::Cid; + type Did = S::Did; + } + ///State transition - sets the `domain` field to Set + pub struct SetDomain(PhantomData S>); + impl sealed::Sealed for SetDomain {} + impl State for SetDomain { + type Uri = S::Uri; + type Domain = Set; + type Rkey = S::Rkey; type IndexedAt = S::IndexedAt; + type Name = S::Name; + type Record = S::Record; + type Cid = S::Cid; + type Did = S::Did; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { type Uri = S::Uri; - type Rkey = Set; - type Did = S::Did; - type Cid = S::Cid; type Domain = S::Domain; - type Record = S::Record; - type Name = S::Name; + type Rkey = Set; type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Uri = S::Uri; - type Rkey = S::Rkey; - type Did = Set; - type Cid = S::Cid; - type Domain = S::Domain; - type Record = S::Record; type Name = S::Name; - type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Cid = S::Cid; + type Did = S::Did; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { type Uri = S::Uri; - type Rkey = S::Rkey; - type Did = S::Did; - type Cid = Set; type Domain = S::Domain; - type Record = S::Record; + type Rkey = S::Rkey; + type IndexedAt = Set; type Name = S::Name; - type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Cid = S::Cid; + type Did = S::Did; } - ///State transition - sets the `domain` field to Set - pub struct SetDomain(PhantomData S>); - impl sealed::Sealed for SetDomain {} - impl State for SetDomain { + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { type Uri = S::Uri; + type Domain = S::Domain; type Rkey = S::Rkey; - type Did = S::Did; - type Cid = S::Cid; - type Domain = Set; - type Record = S::Record; - type Name = S::Name; type IndexedAt = S::IndexedAt; + type Name = Set; + type Record = S::Record; + type Cid = S::Cid; + type Did = S::Did; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Uri = S::Uri; - type Rkey = S::Rkey; - type Did = S::Did; - type Cid = S::Cid; type Domain = S::Domain; - type Record = Set; - type Name = S::Name; + type Rkey = S::Rkey; type IndexedAt = S::IndexedAt; + type Name = S::Name; + type Record = Set; + type Cid = S::Cid; + type Did = S::Did; } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Uri = S::Uri; - type Rkey = S::Rkey; - type Did = S::Did; - type Cid = S::Cid; type Domain = S::Domain; - type Record = S::Record; - type Name = Set; + type Rkey = S::Rkey; type IndexedAt = S::IndexedAt; + type Name = S::Name; + type Record = S::Record; + type Cid = Set; + type Did = S::Did; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { type Uri = S::Uri; - type Rkey = S::Rkey; - type Did = S::Did; - type Cid = S::Cid; type Domain = S::Domain; - type Record = S::Record; + type Rkey = S::Rkey; + type IndexedAt = S::IndexedAt; type Name = S::Name; - type IndexedAt = Set; + type Record = S::Record; + type Cid = S::Cid; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `rkey` field - pub struct rkey(()); - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `domain` field pub struct domain(()); - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `name` field - pub struct name(()); + ///Marker type for the `rkey` field + pub struct rkey(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -1275,13 +1275,13 @@ impl<'a, S> PublicationViewBuilder<'a, S> where S: publication_view_state::State, S::Uri: publication_view_state::IsSet, - S::Rkey: publication_view_state::IsSet, - S::Did: publication_view_state::IsSet, - S::Cid: publication_view_state::IsSet, S::Domain: publication_view_state::IsSet, - S::Record: publication_view_state::IsSet, - S::Name: publication_view_state::IsSet, + S::Rkey: publication_view_state::IsSet, S::IndexedAt: publication_view_state::IsSet, + S::Name: publication_view_state::IsSet, + S::Record: publication_view_state::IsSet, + S::Cid: publication_view_state::IsSet, + S::Did: publication_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PublicationView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/domain/generate_document.rs b/crates/weaver-api/src/sh_weaver/domain/generate_document.rs index a96fd3c..3e088c2 100644 --- a/crates/weaver-api/src/sh_weaver/domain/generate_document.rs +++ b/crates/weaver-api/src/sh_weaver/domain/generate_document.rs @@ -18,6 +18,9 @@ pub struct GenerateDocument<'a> { #[serde(borrow)] pub entry: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub entry_record: std::option::Option>, #[serde(borrow)] pub path: jacquard_common::CowStr<'a>, #[serde(borrow)] @@ -34,51 +37,51 @@ pub mod generate_document_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Path; type Publication; type Entry; - type Path; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Path = Unset; type Publication = Unset; type Entry = Unset; - type Path = Unset; + } + ///State transition - sets the `path` field to Set + pub struct SetPath(PhantomData S>); + impl sealed::Sealed for SetPath {} + impl State for SetPath { + type Path = Set; + type Publication = S::Publication; + type Entry = S::Entry; } ///State transition - sets the `publication` field to Set pub struct SetPublication(PhantomData S>); impl sealed::Sealed for SetPublication {} impl State for SetPublication { + type Path = S::Path; type Publication = Set; type Entry = S::Entry; - type Path = S::Path; } ///State transition - sets the `entry` field to Set pub struct SetEntry(PhantomData S>); impl sealed::Sealed for SetEntry {} impl State for SetEntry { - type Publication = S::Publication; - type Entry = Set; type Path = S::Path; - } - ///State transition - sets the `path` field to Set - pub struct SetPath(PhantomData S>); - impl sealed::Sealed for SetPath {} - impl State for SetPath { type Publication = S::Publication; - type Entry = S::Entry; - type Path = Set; + type Entry = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `path` field + pub struct path(()); ///Marker type for the `publication` field pub struct publication(()); ///Marker type for the `entry` field pub struct entry(()); - ///Marker type for the `path` field - pub struct path(()); } } @@ -87,6 +90,7 @@ pub struct GenerateDocumentBuilder<'a, S: generate_document_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, + ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), @@ -105,7 +109,7 @@ impl<'a> GenerateDocumentBuilder<'a, generate_document_state::Empty> { pub fn new() -> Self { GenerateDocumentBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None, None, None), + __unsafe_private_named: (None, None, None, None), _phantom: ::core::marker::PhantomData, } } @@ -130,6 +134,25 @@ where } } +impl<'a, S: generate_document_state::State> GenerateDocumentBuilder<'a, S> { + /// Set the `entryRecord` field (optional) + pub fn entry_record( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `entryRecord` field to an Option value (optional) + pub fn maybe_entry_record( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + impl<'a, S> GenerateDocumentBuilder<'a, S> where S: generate_document_state::State, @@ -140,7 +163,7 @@ where mut self, value: impl Into>, ) -> GenerateDocumentBuilder<'a, generate_document_state::SetPath> { - self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); GenerateDocumentBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -159,7 +182,7 @@ where mut self, value: impl Into>, ) -> GenerateDocumentBuilder<'a, generate_document_state::SetPublication> { - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); GenerateDocumentBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -171,16 +194,17 @@ where impl<'a, S> GenerateDocumentBuilder<'a, S> where S: generate_document_state::State, + S::Path: generate_document_state::IsSet, S::Publication: generate_document_state::IsSet, S::Entry: generate_document_state::IsSet, - S::Path: generate_document_state::IsSet, { /// Build the final struct pub fn build(self) -> GenerateDocument<'a> { GenerateDocument { entry: self.__unsafe_private_named.0.unwrap(), - path: self.__unsafe_private_named.1.unwrap(), - publication: self.__unsafe_private_named.2.unwrap(), + entry_record: self.__unsafe_private_named.1, + path: self.__unsafe_private_named.2.unwrap(), + publication: self.__unsafe_private_named.3.unwrap(), } } } diff --git a/crates/weaver-api/src/sh_weaver/edit.rs b/crates/weaver-api/src/sh_weaver/edit.rs index 1695184..8a1bb69 100644 --- a/crates/weaver-api/src/sh_weaver/edit.rs +++ b/crates/weaver-api/src/sh_weaver/edit.rs @@ -721,67 +721,67 @@ pub mod edit_branch_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Length; type Author; type LastUpdated; type Head; + type Length; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Length = Unset; type Author = Unset; type LastUpdated = Unset; type Head = Unset; - } - ///State transition - sets the `length` field to Set - pub struct SetLength(PhantomData S>); - impl sealed::Sealed for SetLength {} - impl State for SetLength { - type Length = Set; - type Author = S::Author; - type LastUpdated = S::LastUpdated; - type Head = S::Head; + type Length = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Length = S::Length; type Author = Set; type LastUpdated = S::LastUpdated; type Head = S::Head; + type Length = S::Length; } ///State transition - sets the `last_updated` field to Set pub struct SetLastUpdated(PhantomData S>); impl sealed::Sealed for SetLastUpdated {} impl State for SetLastUpdated { - type Length = S::Length; type Author = S::Author; type LastUpdated = Set; type Head = S::Head; + type Length = S::Length; } ///State transition - sets the `head` field to Set pub struct SetHead(PhantomData S>); impl sealed::Sealed for SetHead {} impl State for SetHead { - type Length = S::Length; type Author = S::Author; type LastUpdated = S::LastUpdated; type Head = Set; + type Length = S::Length; + } + ///State transition - sets the `length` field to Set + pub struct SetLength(PhantomData S>); + impl sealed::Sealed for SetLength {} + impl State for SetLength { + type Author = S::Author; + type LastUpdated = S::LastUpdated; + type Head = S::Head; + type Length = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `length` field - pub struct length(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `last_updated` field pub struct last_updated(()); ///Marker type for the `head` field pub struct head(()); + ///Marker type for the `length` field + pub struct length(()); } } @@ -948,10 +948,10 @@ impl<'a, S: edit_branch_view_state::State> EditBranchViewBuilder<'a, S> { impl<'a, S> EditBranchViewBuilder<'a, S> where S: edit_branch_view_state::State, - S::Length: edit_branch_view_state::IsSet, S::Author: edit_branch_view_state::IsSet, S::LastUpdated: edit_branch_view_state::IsSet, S::Head: edit_branch_view_state::IsSet, + S::Length: edit_branch_view_state::IsSet, { /// Build the final struct pub fn build(self) -> EditBranchView<'a> { @@ -1054,84 +1054,84 @@ pub mod edit_history_entry_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type CreatedAt; - type Author; - type Cid; type Type; + type Cid; type Uri; + type Author; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type CreatedAt = Unset; - type Author = Unset; - type Cid = Unset; type Type = Unset; + type Cid = Unset; type Uri = Unset; + type Author = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type CreatedAt = Set; - type Author = S::Author; - type Cid = S::Cid; type Type = S::Type; + type Cid = S::Cid; type Uri = S::Uri; + type Author = S::Author; } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { + ///State transition - sets the `type` field to Set + pub struct SetType(PhantomData S>); + impl sealed::Sealed for SetType {} + impl State for SetType { type CreatedAt = S::CreatedAt; - type Author = Set; + type Type = Set; type Cid = S::Cid; - type Type = S::Type; type Uri = S::Uri; + type Author = S::Author; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type CreatedAt = S::CreatedAt; - type Author = S::Author; - type Cid = Set; type Type = S::Type; + type Cid = Set; type Uri = S::Uri; - } - ///State transition - sets the `type` field to Set - pub struct SetType(PhantomData S>); - impl sealed::Sealed for SetType {} - impl State for SetType { - type CreatedAt = S::CreatedAt; type Author = S::Author; - type Cid = S::Cid; - type Type = Set; - type Uri = S::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type CreatedAt = S::CreatedAt; - type Author = S::Author; - type Cid = S::Cid; type Type = S::Type; + type Cid = S::Cid; type Uri = Set; + type Author = S::Author; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type CreatedAt = S::CreatedAt; + type Type = S::Type; + type Cid = S::Cid; + type Uri = S::Uri; + type Author = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `author` field - pub struct author(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `type` field pub struct r#type(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `author` field + pub struct author(()); } } @@ -1349,10 +1349,10 @@ impl<'a, S> EditHistoryEntryBuilder<'a, S> where S: edit_history_entry_state::State, S::CreatedAt: edit_history_entry_state::IsSet, - S::Author: edit_history_entry_state::IsSet, - S::Cid: edit_history_entry_state::IsSet, S::Type: edit_history_entry_state::IsSet, + S::Cid: edit_history_entry_state::IsSet, S::Uri: edit_history_entry_state::IsSet, + S::Author: edit_history_entry_state::IsSet, { /// Build the final struct pub fn build(self) -> EditHistoryEntry<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit/cursor.rs b/crates/weaver-api/src/sh_weaver/edit/cursor.rs index e85cb91..b73f662 100644 --- a/crates/weaver-api/src/sh_weaver/edit/cursor.rs +++ b/crates/weaver-api/src/sh_weaver/edit/cursor.rs @@ -586,37 +586,37 @@ pub mod id_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Peer; type Counter; + type Peer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Peer = Unset; type Counter = Unset; - } - ///State transition - sets the `peer` field to Set - pub struct SetPeer(PhantomData S>); - impl sealed::Sealed for SetPeer {} - impl State for SetPeer { - type Peer = Set; - type Counter = S::Counter; + type Peer = Unset; } ///State transition - sets the `counter` field to Set pub struct SetCounter(PhantomData S>); impl sealed::Sealed for SetCounter {} impl State for SetCounter { - type Peer = S::Peer; type Counter = Set; + type Peer = S::Peer; + } + ///State transition - sets the `peer` field to Set + pub struct SetPeer(PhantomData S>); + impl sealed::Sealed for SetPeer {} + impl State for SetPeer { + type Counter = S::Counter; + type Peer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `peer` field - pub struct peer(()); ///Marker type for the `counter` field pub struct counter(()); + ///Marker type for the `peer` field + pub struct peer(()); } } @@ -683,8 +683,8 @@ where impl<'a, S> IdBuilder<'a, S> where S: id_state::State, - S::Peer: id_state::IsSet, S::Counter: id_state::IsSet, + S::Peer: id_state::IsSet, { /// Build the final struct pub fn build(self) -> Id<'a> { @@ -759,37 +759,37 @@ pub mod cursor_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; type Container; + type Id; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; type Container = Unset; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type Container = S::Container; + type Id = Unset; } ///State transition - sets the `container` field to Set pub struct SetContainer(PhantomData S>); impl sealed::Sealed for SetContainer {} impl State for SetContainer { - type Id = S::Id; type Container = Set; + type Id = S::Id; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Container = S::Container; + type Id = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); ///Marker type for the `container` field pub struct container(()); + ///Marker type for the `id` field + pub struct id(()); } } @@ -882,8 +882,8 @@ impl<'a, S: cursor_state::State> CursorBuilder<'a, S> { impl<'a, S> CursorBuilder<'a, S> where S: cursor_state::State, - S::Id: cursor_state::IsSet, S::Container: cursor_state::IsSet, + S::Id: cursor_state::IsSet, { /// Build the final struct pub fn build(self) -> Cursor<'a> { @@ -1017,51 +1017,51 @@ pub mod normal_container_id_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Peer; type Counter; type ContainerType; + type Peer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Peer = Unset; type Counter = Unset; type ContainerType = Unset; - } - ///State transition - sets the `peer` field to Set - pub struct SetPeer(PhantomData S>); - impl sealed::Sealed for SetPeer {} - impl State for SetPeer { - type Peer = Set; - type Counter = S::Counter; - type ContainerType = S::ContainerType; + type Peer = Unset; } ///State transition - sets the `counter` field to Set pub struct SetCounter(PhantomData S>); impl sealed::Sealed for SetCounter {} impl State for SetCounter { - type Peer = S::Peer; type Counter = Set; type ContainerType = S::ContainerType; + type Peer = S::Peer; } ///State transition - sets the `container_type` field to Set pub struct SetContainerType(PhantomData S>); impl sealed::Sealed for SetContainerType {} impl State for SetContainerType { - type Peer = S::Peer; type Counter = S::Counter; type ContainerType = Set; + type Peer = S::Peer; + } + ///State transition - sets the `peer` field to Set + pub struct SetPeer(PhantomData S>); + impl sealed::Sealed for SetPeer {} + impl State for SetPeer { + type Counter = S::Counter; + type ContainerType = S::ContainerType; + type Peer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `peer` field - pub struct peer(()); ///Marker type for the `counter` field pub struct counter(()); ///Marker type for the `container_type` field pub struct container_type(()); + ///Marker type for the `peer` field + pub struct peer(()); } } @@ -1154,9 +1154,9 @@ where impl<'a, S> NormalContainerIdBuilder<'a, S> where S: normal_container_id_state::State, - S::Peer: normal_container_id_state::IsSet, S::Counter: normal_container_id_state::IsSet, S::ContainerType: normal_container_id_state::IsSet, + S::Peer: normal_container_id_state::IsSet, { /// Build the final struct pub fn build(self) -> NormalContainerId<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs b/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs index 91f810e..d679e1a 100644 --- a/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs +++ b/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs @@ -47,51 +47,51 @@ pub mod draft_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedAt; type Uri; type Cid; - type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type CreatedAt = Unset; type Uri = Unset; type Cid = Unset; - type CreatedAt = Unset; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Uri = S::Uri; + type Cid = S::Cid; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { + type CreatedAt = S::CreatedAt; type Uri = Set; type Cid = S::Cid; - type CreatedAt = S::CreatedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; - type Cid = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type Uri = S::Uri; - type Cid = S::Cid; - type CreatedAt = Set; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `created_at` field - pub struct created_at(()); } } @@ -241,9 +241,9 @@ where impl<'a, S> DraftViewBuilder<'a, S> where S: draft_view_state::State, + S::CreatedAt: draft_view_state::IsSet, S::Uri: draft_view_state::IsSet, S::Cid: draft_view_state::IsSet, - S::CreatedAt: draft_view_state::IsSet, { /// Build the final struct pub fn build(self) -> DraftView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed.rs b/crates/weaver-api/src/sh_weaver/embed.rs index 7c9dccc..ac21341 100644 --- a/crates/weaver-api/src/sh_weaver/embed.rs +++ b/crates/weaver-api/src/sh_weaver/embed.rs @@ -38,37 +38,37 @@ pub mod percent_size_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Width; type Height; + type Width; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Width = Unset; type Height = Unset; - } - ///State transition - sets the `width` field to Set - pub struct SetWidth(PhantomData S>); - impl sealed::Sealed for SetWidth {} - impl State for SetWidth { - type Width = Set; - type Height = S::Height; + type Width = Unset; } ///State transition - sets the `height` field to Set pub struct SetHeight(PhantomData S>); impl sealed::Sealed for SetHeight {} impl State for SetHeight { - type Width = S::Width; type Height = Set; + type Width = S::Width; + } + ///State transition - sets the `width` field to Set + pub struct SetWidth(PhantomData S>); + impl sealed::Sealed for SetWidth {} + impl State for SetWidth { + type Height = S::Height; + type Width = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `width` field - pub struct width(()); ///Marker type for the `height` field pub struct height(()); + ///Marker type for the `width` field + pub struct width(()); } } @@ -138,8 +138,8 @@ where impl<'a, S> PercentSizeBuilder<'a, S> where S: percent_size_state::State, - S::Width: percent_size_state::IsSet, S::Height: percent_size_state::IsSet, + S::Width: percent_size_state::IsSet, { /// Build the final struct pub fn build(self) -> PercentSize<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/external.rs b/crates/weaver-api/src/sh_weaver/embed/external.rs index 57dbc73..6c4cbf2 100644 --- a/crates/weaver-api/src/sh_weaver/embed/external.rs +++ b/crates/weaver-api/src/sh_weaver/embed/external.rs @@ -38,49 +38,49 @@ pub mod external_embed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; type Description; + type Title; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; type Description = Unset; + type Title = Unset; type Uri = Unset; } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; - type Description = S::Description; - type Uri = S::Uri; - } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData S>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { - type Title = S::Title; type Description = Set; + type Title = S::Title; + type Uri = S::Uri; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Description = S::Description; + type Title = Set; type Uri = S::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Title = S::Title; type Description = S::Description; + type Title = S::Title; type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `description` field pub struct description(()); + ///Marker type for the `title` field + pub struct title(()); ///Marker type for the `uri` field pub struct uri(()); } @@ -195,8 +195,8 @@ where impl<'a, S> ExternalEmbedBuilder<'a, S> where S: external_embed_state::State, - S::Title: external_embed_state::IsSet, S::Description: external_embed_state::IsSet, + S::Title: external_embed_state::IsSet, S::Uri: external_embed_state::IsSet, { /// Build the final struct @@ -818,50 +818,50 @@ pub mod view_external_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Title; type Description; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; - type Title = Unset; type Description = Unset; + type Title = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; - type Title = S::Title; - type Description = S::Description; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Uri = S::Uri; - type Title = Set; type Description = S::Description; + type Title = S::Title; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData S>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { type Uri = S::Uri; - type Title = S::Title; type Description = Set; + type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Uri = S::Uri; + type Description = S::Description; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `description` field pub struct description(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -975,8 +975,8 @@ impl<'a, S> ViewExternalBuilder<'a, S> where S: view_external_state::State, S::Uri: view_external_state::IsSet, - S::Title: view_external_state::IsSet, S::Description: view_external_state::IsSet, + S::Title: view_external_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewExternal<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/images.rs b/crates/weaver-api/src/sh_weaver/embed/images.rs index 5ef0d9a..f1d6b32 100644 --- a/crates/weaver-api/src/sh_weaver/embed/images.rs +++ b/crates/weaver-api/src/sh_weaver/embed/images.rs @@ -903,50 +903,50 @@ pub mod view_image_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Thumb; - type Fullsize; type Alt; + type Fullsize; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Thumb = Unset; - type Fullsize = Unset; type Alt = Unset; + type Fullsize = Unset; } ///State transition - sets the `thumb` field to Set pub struct SetThumb(PhantomData S>); impl sealed::Sealed for SetThumb {} impl State for SetThumb { type Thumb = Set; - type Fullsize = S::Fullsize; - type Alt = S::Alt; - } - ///State transition - sets the `fullsize` field to Set - pub struct SetFullsize(PhantomData S>); - impl sealed::Sealed for SetFullsize {} - impl State for SetFullsize { - type Thumb = S::Thumb; - type Fullsize = Set; type Alt = S::Alt; + type Fullsize = S::Fullsize; } ///State transition - sets the `alt` field to Set pub struct SetAlt(PhantomData S>); impl sealed::Sealed for SetAlt {} impl State for SetAlt { type Thumb = S::Thumb; - type Fullsize = S::Fullsize; type Alt = Set; + type Fullsize = S::Fullsize; + } + ///State transition - sets the `fullsize` field to Set + pub struct SetFullsize(PhantomData S>); + impl sealed::Sealed for SetFullsize {} + impl State for SetFullsize { + type Thumb = S::Thumb; + type Alt = S::Alt; + type Fullsize = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `thumb` field pub struct thumb(()); - ///Marker type for the `fullsize` field - pub struct fullsize(()); ///Marker type for the `alt` field pub struct alt(()); + ///Marker type for the `fullsize` field + pub struct fullsize(()); } } @@ -1074,8 +1074,8 @@ impl<'a, S> ViewImageBuilder<'a, S> where S: view_image_state::State, S::Thumb: view_image_state::IsSet, - S::Fullsize: view_image_state::IsSet, S::Alt: view_image_state::IsSet, + S::Fullsize: view_image_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewImage<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs b/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs index a622740..297864a 100644 --- a/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs +++ b/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs @@ -33,37 +33,37 @@ pub mod record_with_media_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Media; type Records; + type Media; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Media = Unset; type Records = Unset; - } - ///State transition - sets the `media` field to Set - pub struct SetMedia(PhantomData S>); - impl sealed::Sealed for SetMedia {} - impl State for SetMedia { - type Media = Set; - type Records = S::Records; + type Media = Unset; } ///State transition - sets the `records` field to Set pub struct SetRecords(PhantomData S>); impl sealed::Sealed for SetRecords {} impl State for SetRecords { - type Media = S::Media; type Records = Set; + type Media = S::Media; + } + ///State transition - sets the `media` field to Set + pub struct SetMedia(PhantomData S>); + impl sealed::Sealed for SetMedia {} + impl State for SetMedia { + type Records = S::Records; + type Media = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `media` field - pub struct media(()); ///Marker type for the `records` field pub struct records(()); + ///Marker type for the `media` field + pub struct media(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> RecordWithMediaBuilder<'a, S> where S: record_with_media_state::State, - S::Media: record_with_media_state::IsSet, S::Records: record_with_media_state::IsSet, + S::Media: record_with_media_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordWithMedia<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/records.rs b/crates/weaver-api/src/sh_weaver/embed/records.rs index 37b1a9e..a4406aa 100644 --- a/crates/weaver-api/src/sh_weaver/embed/records.rs +++ b/crates/weaver-api/src/sh_weaver/embed/records.rs @@ -1188,50 +1188,50 @@ pub mod view_blocked_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Author; - type Uri; type Blocked; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Author = Unset; - type Uri = Unset; type Blocked = Unset; + type Uri = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Author = Set; - type Uri = S::Uri; - type Blocked = S::Blocked; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Author = S::Author; - type Uri = Set; type Blocked = S::Blocked; + type Uri = S::Uri; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { type Author = S::Author; - type Uri = S::Uri; type Blocked = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Author = S::Author; + type Blocked = S::Blocked; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `author` field pub struct author(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `blocked` field pub struct blocked(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1325,8 +1325,8 @@ impl<'a, S> ViewBlockedBuilder<'a, S> where S: view_blocked_state::State, S::Author: view_blocked_state::IsSet, - S::Uri: view_blocked_state::IsSet, S::Blocked: view_blocked_state::IsSet, + S::Uri: view_blocked_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewBlocked<'a> { @@ -1572,37 +1572,37 @@ pub mod view_not_found_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type NotFound; type Uri; + type NotFound; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type NotFound = Unset; type Uri = Unset; - } - ///State transition - sets the `not_found` field to Set - pub struct SetNotFound(PhantomData S>); - impl sealed::Sealed for SetNotFound {} - impl State for SetNotFound { - type NotFound = Set; - type Uri = S::Uri; + type NotFound = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type NotFound = S::NotFound; type Uri = Set; + type NotFound = S::NotFound; + } + ///State transition - sets the `not_found` field to Set + pub struct SetNotFound(PhantomData S>); + impl sealed::Sealed for SetNotFound {} + impl State for SetNotFound { + type Uri = S::Uri; + type NotFound = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `not_found` field - pub struct not_found(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `not_found` field + pub struct not_found(()); } } @@ -1675,8 +1675,8 @@ where impl<'a, S> ViewNotFoundBuilder<'a, S> where S: view_not_found_state::State, - S::NotFound: view_not_found_state::IsSet, S::Uri: view_not_found_state::IsSet, + S::NotFound: view_not_found_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewNotFound<'a> { @@ -1769,83 +1769,83 @@ pub mod view_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; - type Author; + type Cid; type Value; + type Author; type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; - type Author = Unset; + type Cid = Unset; type Value = Unset; + type Author = Unset; type IndexedAt = Unset; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = S::Uri; - type Author = S::Author; - type Value = S::Value; - type IndexedAt = S::IndexedAt; - } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; type Uri = Set; - type Author = S::Author; + type Cid = S::Cid; type Value = S::Value; + type Author = S::Author; type IndexedAt = S::IndexedAt; } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { - type Cid = S::Cid; + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Uri = S::Uri; - type Author = Set; + type Cid = Set; type Value = S::Value; + type Author = S::Author; type IndexedAt = S::IndexedAt; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Cid = S::Cid; type Uri = S::Uri; - type Author = S::Author; + type Cid = S::Cid; type Value = Set; + type Author = S::Author; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type Uri = S::Uri; + type Cid = S::Cid; + type Value = S::Value; + type Author = Set; type IndexedAt = S::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Cid = S::Cid; type Uri = S::Uri; - type Author = S::Author; + type Cid = S::Cid; type Value = S::Value; + type Author = S::Author; type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `author` field - pub struct author(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `author` field + pub struct author(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } @@ -2092,10 +2092,10 @@ where impl<'a, S> ViewRecordBuilder<'a, S> where S: view_record_state::State, - S::Cid: view_record_state::IsSet, S::Uri: view_record_state::IsSet, - S::Author: view_record_state::IsSet, + S::Cid: view_record_state::IsSet, S::Value: view_record_state::IsSet, + S::Author: view_record_state::IsSet, S::IndexedAt: view_record_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/graph.rs b/crates/weaver-api/src/sh_weaver/graph.rs index 5a4ea3d..45a55da 100644 --- a/crates/weaver-api/src/sh_weaver/graph.rs +++ b/crates/weaver-api/src/sh_weaver/graph.rs @@ -883,37 +883,37 @@ pub mod list_item_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Subject; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Subject = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Subject = S::Subject; + type Uri = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Uri = S::Uri; type Subject = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Subject = S::Subject; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1006,8 +1006,8 @@ where impl<'a, S> ListItemViewBuilder<'a, S> where S: list_item_view_state::State, - S::Uri: list_item_view_state::IsSet, S::Subject: list_item_view_state::IsSet, + S::Uri: list_item_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListItemView<'a> { @@ -1212,127 +1212,127 @@ pub mod list_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ItemCount; type Creator; - type Name; - type IndexedAt; - type Uri; type Purpose; + type Uri; + type ItemCount; + type Name; type Cid; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ItemCount = Unset; type Creator = Unset; - type Name = Unset; - type IndexedAt = Unset; - type Uri = Unset; type Purpose = Unset; + type Uri = Unset; + type ItemCount = Unset; + type Name = Unset; type Cid = Unset; - } - ///State transition - sets the `item_count` field to Set - pub struct SetItemCount(PhantomData S>); - impl sealed::Sealed for SetItemCount {} - impl State for SetItemCount { - type ItemCount = Set; - type Creator = S::Creator; - type Name = S::Name; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - type Purpose = S::Purpose; - type Cid = S::Cid; + type IndexedAt = Unset; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { - type ItemCount = S::ItemCount; type Creator = Set; - type Name = S::Name; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; type Purpose = S::Purpose; + type Uri = S::Uri; + type ItemCount = S::ItemCount; + type Name = S::Name; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type ItemCount = S::ItemCount; + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { type Creator = S::Creator; - type Name = Set; - type IndexedAt = S::IndexedAt; + type Purpose = Set; type Uri = S::Uri; - type Purpose = S::Purpose; - type Cid = S::Cid; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type ItemCount = S::ItemCount; - type Creator = S::Creator; type Name = S::Name; - type IndexedAt = Set; - type Uri = S::Uri; - type Purpose = S::Purpose; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type ItemCount = S::ItemCount; type Creator = S::Creator; - type Name = S::Name; - type IndexedAt = S::IndexedAt; - type Uri = Set; type Purpose = S::Purpose; + type Uri = Set; + type ItemCount = S::ItemCount; + type Name = S::Name; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData S>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { - type ItemCount = S::ItemCount; + ///State transition - sets the `item_count` field to Set + pub struct SetItemCount(PhantomData S>); + impl sealed::Sealed for SetItemCount {} + impl State for SetItemCount { type Creator = S::Creator; + type Purpose = S::Purpose; + type Uri = S::Uri; + type ItemCount = Set; type Name = S::Name; + type Cid = S::Cid; type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Creator = S::Creator; + type Purpose = S::Purpose; type Uri = S::Uri; - type Purpose = Set; + type ItemCount = S::ItemCount; + type Name = Set; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type ItemCount = S::ItemCount; type Creator = S::Creator; + type Purpose = S::Purpose; + type Uri = S::Uri; + type ItemCount = S::ItemCount; type Name = S::Name; + type Cid = Set; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Creator = S::Creator; type Purpose = S::Purpose; - type Cid = Set; + type Uri = S::Uri; + type ItemCount = S::ItemCount; + type Name = S::Name; + type Cid = S::Cid; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `item_count` field - pub struct item_count(()); ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `name` field - pub struct name(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `purpose` field pub struct purpose(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `item_count` field + pub struct item_count(()); + ///Marker type for the `name` field + pub struct name(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -1576,13 +1576,13 @@ impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, - S::ItemCount: list_view_state::IsSet, S::Creator: list_view_state::IsSet, - S::Name: list_view_state::IsSet, - S::IndexedAt: list_view_state::IsSet, - S::Uri: list_view_state::IsSet, S::Purpose: list_view_state::IsSet, + S::Uri: list_view_state::IsSet, + S::ItemCount: list_view_state::IsSet, + S::Name: list_view_state::IsSet, S::Cid: list_view_state::IsSet, + S::IndexedAt: list_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListView<'a> { @@ -1696,51 +1696,51 @@ pub mod resource_tags_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AuthorTags; type Resource; type CommunityTags; + type AuthorTags; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AuthorTags = Unset; type Resource = Unset; type CommunityTags = Unset; - } - ///State transition - sets the `author_tags` field to Set - pub struct SetAuthorTags(PhantomData S>); - impl sealed::Sealed for SetAuthorTags {} - impl State for SetAuthorTags { - type AuthorTags = Set; - type Resource = S::Resource; - type CommunityTags = S::CommunityTags; + type AuthorTags = Unset; } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { - type AuthorTags = S::AuthorTags; type Resource = Set; type CommunityTags = S::CommunityTags; + type AuthorTags = S::AuthorTags; } ///State transition - sets the `community_tags` field to Set pub struct SetCommunityTags(PhantomData S>); impl sealed::Sealed for SetCommunityTags {} impl State for SetCommunityTags { - type AuthorTags = S::AuthorTags; type Resource = S::Resource; type CommunityTags = Set; + type AuthorTags = S::AuthorTags; + } + ///State transition - sets the `author_tags` field to Set + pub struct SetAuthorTags(PhantomData S>); + impl sealed::Sealed for SetAuthorTags {} + impl State for SetAuthorTags { + type Resource = S::Resource; + type CommunityTags = S::CommunityTags; + type AuthorTags = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `author_tags` field - pub struct author_tags(()); ///Marker type for the `resource` field pub struct resource(()); ///Marker type for the `community_tags` field pub struct community_tags(()); + ///Marker type for the `author_tags` field + pub struct author_tags(()); } } @@ -1853,9 +1853,9 @@ impl<'a, S: resource_tags_view_state::State> ResourceTagsViewBuilder<'a, S> { impl<'a, S> ResourceTagsViewBuilder<'a, S> where S: resource_tags_view_state::State, - S::AuthorTags: resource_tags_view_state::IsSet, S::Resource: resource_tags_view_state::IsSet, S::CommunityTags: resource_tags_view_state::IsSet, + S::AuthorTags: resource_tags_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ResourceTagsView<'a> { @@ -1952,67 +1952,67 @@ pub mod tag_application_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Tag; - type CreatedAt; - type AppliedBy; type Uri; + type AppliedBy; + type CreatedAt; + type Tag; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Tag = Unset; - type CreatedAt = Unset; - type AppliedBy = Unset; type Uri = Unset; + type AppliedBy = Unset; + type CreatedAt = Unset; + type Tag = Unset; } - ///State transition - sets the `tag` field to Set - pub struct SetTag(PhantomData S>); - impl sealed::Sealed for SetTag {} - impl State for SetTag { - type Tag = Set; - type CreatedAt = S::CreatedAt; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type AppliedBy = S::AppliedBy; - type Uri = S::Uri; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + type CreatedAt = S::CreatedAt; type Tag = S::Tag; - type CreatedAt = Set; - type AppliedBy = S::AppliedBy; - type Uri = S::Uri; } ///State transition - sets the `applied_by` field to Set pub struct SetAppliedBy(PhantomData S>); impl sealed::Sealed for SetAppliedBy {} impl State for SetAppliedBy { - type Tag = S::Tag; - type CreatedAt = S::CreatedAt; - type AppliedBy = Set; type Uri = S::Uri; + type AppliedBy = Set; + type CreatedAt = S::CreatedAt; + type Tag = S::Tag; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Uri = S::Uri; + type AppliedBy = S::AppliedBy; + type CreatedAt = Set; type Tag = S::Tag; - type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `tag` field to Set + pub struct SetTag(PhantomData S>); + impl sealed::Sealed for SetTag {} + impl State for SetTag { + type Uri = S::Uri; type AppliedBy = S::AppliedBy; - type Uri = Set; + type CreatedAt = S::CreatedAt; + type Tag = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `tag` field - pub struct tag(()); - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `applied_by` field - pub struct applied_by(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `applied_by` field + pub struct applied_by(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `tag` field + pub struct tag(()); } } @@ -2125,10 +2125,10 @@ where impl<'a, S> TagApplicationViewBuilder<'a, S> where S: tag_application_view_state::State, - S::Tag: tag_application_view_state::IsSet, - S::CreatedAt: tag_application_view_state::IsSet, - S::AppliedBy: tag_application_view_state::IsSet, S::Uri: tag_application_view_state::IsSet, + S::AppliedBy: tag_application_view_state::IsSet, + S::CreatedAt: tag_application_view_state::IsSet, + S::Tag: tag_application_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TagApplicationView<'a> { @@ -2214,37 +2214,37 @@ pub mod tag_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type UseCount; type Tag; + type UseCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type UseCount = Unset; type Tag = Unset; - } - ///State transition - sets the `use_count` field to Set - pub struct SetUseCount(PhantomData S>); - impl sealed::Sealed for SetUseCount {} - impl State for SetUseCount { - type UseCount = Set; - type Tag = S::Tag; + type UseCount = Unset; } ///State transition - sets the `tag` field to Set pub struct SetTag(PhantomData S>); impl sealed::Sealed for SetTag {} impl State for SetTag { - type UseCount = S::UseCount; type Tag = Set; + type UseCount = S::UseCount; + } + ///State transition - sets the `use_count` field to Set + pub struct SetUseCount(PhantomData S>); + impl sealed::Sealed for SetUseCount {} + impl State for SetUseCount { + type Tag = S::Tag; + type UseCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `use_count` field - pub struct use_count(()); ///Marker type for the `tag` field pub struct tag(()); + ///Marker type for the `use_count` field + pub struct use_count(()); } } @@ -2373,8 +2373,8 @@ where impl<'a, S> TagViewBuilder<'a, S> where S: tag_view_state::State, - S::UseCount: tag_view_state::IsSet, S::Tag: tag_view_state::IsSet, + S::UseCount: tag_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TagView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/follow.rs b/crates/weaver-api/src/sh_weaver/graph/follow.rs index e41bb28..8d57afa 100644 --- a/crates/weaver-api/src/sh_weaver/graph/follow.rs +++ b/crates/weaver-api/src/sh_weaver/graph/follow.rs @@ -34,37 +34,37 @@ pub mod follow_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = S::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = S::CreatedAt; type Subject = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> FollowBuilder<'a, S> where S: follow_state::State, - S::CreatedAt: follow_state::IsSet, S::Subject: follow_state::IsSet, + S::CreatedAt: follow_state::IsSet, { /// Build the final struct pub fn build(self) -> Follow<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs b/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs index 506b20e..f7c6e9e 100644 --- a/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs +++ b/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs @@ -34,37 +34,37 @@ pub mod follow_accept_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Follow; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Follow = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Follow = S::Follow; + type CreatedAt = Unset; } ///State transition - sets the `follow` field to Set pub struct SetFollow(PhantomData S>); impl sealed::Sealed for SetFollow {} impl State for SetFollow { - type CreatedAt = S::CreatedAt; type Follow = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Follow = S::Follow; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `follow` field pub struct follow(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> FollowAcceptBuilder<'a, S> where S: follow_accept_state::State, - S::CreatedAt: follow_accept_state::IsSet, S::Follow: follow_accept_state::IsSet, + S::CreatedAt: follow_accept_state::IsSet, { /// Build the final struct pub fn build(self) -> FollowAccept<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/listitem.rs b/crates/weaver-api/src/sh_weaver/graph/listitem.rs index c3e1866..c07e200 100644 --- a/crates/weaver-api/src/sh_weaver/graph/listitem.rs +++ b/crates/weaver-api/src/sh_weaver/graph/listitem.rs @@ -37,51 +37,51 @@ pub mod listitem_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type List; type Subject; type CreatedAt; - type List; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type List = Unset; type Subject = Unset; type CreatedAt = Unset; - type List = Unset; + } + ///State transition - sets the `list` field to Set + pub struct SetList(PhantomData S>); + impl sealed::Sealed for SetList {} + impl State for SetList { + type List = Set; + type Subject = S::Subject; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { + type List = S::List; type Subject = Set; type CreatedAt = S::CreatedAt; - type List = S::List; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Subject = S::Subject; - type CreatedAt = Set; type List = S::List; - } - ///State transition - sets the `list` field to Set - pub struct SetList(PhantomData S>); - impl sealed::Sealed for SetList {} - impl State for SetList { type Subject = S::Subject; - type CreatedAt = S::CreatedAt; - type List = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `list` field + pub struct list(()); ///Marker type for the `subject` field pub struct subject(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `list` field - pub struct list(()); } } @@ -174,9 +174,9 @@ where impl<'a, S> ListitemBuilder<'a, S> where S: listitem_state::State, + S::List: listitem_state::IsSet, S::Subject: listitem_state::IsSet, S::CreatedAt: listitem_state::IsSet, - S::List: listitem_state::IsSet, { /// Build the final struct pub fn build(self) -> Listitem<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/subscribe.rs b/crates/weaver-api/src/sh_weaver/graph/subscribe.rs index 457be89..a57472a 100644 --- a/crates/weaver-api/src/sh_weaver/graph/subscribe.rs +++ b/crates/weaver-api/src/sh_weaver/graph/subscribe.rs @@ -34,37 +34,37 @@ pub mod subscribe_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Notebook; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Notebook = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Notebook = S::Notebook; + type CreatedAt = Unset; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type CreatedAt = S::CreatedAt; type Notebook = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Notebook = S::Notebook; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `notebook` field pub struct notebook(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> SubscribeBuilder<'a, S> where S: subscribe_state::State, - S::CreatedAt: subscribe_state::IsSet, S::Notebook: subscribe_state::IsSet, + S::CreatedAt: subscribe_state::IsSet, { /// Build the final struct pub fn build(self) -> Subscribe<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/tag.rs b/crates/weaver-api/src/sh_weaver/graph/tag.rs index 8064b87..ce8b34e 100644 --- a/crates/weaver-api/src/sh_weaver/graph/tag.rs +++ b/crates/weaver-api/src/sh_weaver/graph/tag.rs @@ -37,49 +37,49 @@ pub mod tag_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type CreatedAt; + type Subject; type Tag; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type CreatedAt = Unset; + type Subject = Unset; type Tag = Unset; } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type CreatedAt = S::CreatedAt; - type Tag = S::Tag; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Subject = S::Subject; type CreatedAt = Set; + type Subject = S::Subject; + type Tag = S::Tag; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type CreatedAt = S::CreatedAt; + type Subject = Set; type Tag = S::Tag; } ///State transition - sets the `tag` field to Set pub struct SetTag(PhantomData S>); impl sealed::Sealed for SetTag {} impl State for SetTag { - type Subject = S::Subject; type CreatedAt = S::CreatedAt; + type Subject = S::Subject; type Tag = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `subject` field + pub struct subject(()); ///Marker type for the `tag` field pub struct tag(()); } @@ -174,8 +174,8 @@ where impl<'a, S> TagBuilder<'a, S> where S: tag_state::State, - S::Subject: tag_state::IsSet, S::CreatedAt: tag_state::IsSet, + S::Subject: tag_state::IsSet, S::Tag: tag_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/notebook.rs b/crates/weaver-api/src/sh_weaver/notebook.rs index 55b3728..b046a13 100644 --- a/crates/weaver-api/src/sh_weaver/notebook.rs +++ b/crates/weaver-api/src/sh_weaver/notebook.rs @@ -2174,37 +2174,37 @@ pub mod book_entry_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Entry; type Index; + type Entry; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Entry = Unset; type Index = Unset; - } - ///State transition - sets the `entry` field to Set - pub struct SetEntry(PhantomData S>); - impl sealed::Sealed for SetEntry {} - impl State for SetEntry { - type Entry = Set; - type Index = S::Index; + type Entry = Unset; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { - type Entry = S::Entry; type Index = Set; + type Entry = S::Entry; + } + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Index = S::Index; + type Entry = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `entry` field - pub struct entry(()); ///Marker type for the `index` field pub struct index(()); + ///Marker type for the `entry` field + pub struct entry(()); } } @@ -2317,8 +2317,8 @@ impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> { impl<'a, S> BookEntryViewBuilder<'a, S> where S: book_entry_view_state::State, - S::Entry: book_entry_view_state::IsSet, S::Index: book_entry_view_state::IsSet, + S::Entry: book_entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> BookEntryView<'a> { @@ -2634,105 +2634,105 @@ pub mod chapter_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; - type Notebook; + type Uri; type Cid; - type IndexedAt; + type Notebook; type Authors; - type Uri; + type Record; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; - type Notebook = Unset; + type Uri = Unset; type Cid = Unset; - type IndexedAt = Unset; + type Notebook = Unset; type Authors = Unset; - type Uri = Unset; + type Record = Unset; + type IndexedAt = Unset; } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; - type Notebook = S::Notebook; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type Cid = S::Cid; - type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; type Authors = S::Authors; - type Uri = S::Uri; - } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { type Record = S::Record; - type Notebook = Set; - type Cid = S::Cid; type IndexedAt = S::IndexedAt; - type Authors = S::Authors; - type Uri = S::Uri; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Record = S::Record; - type Notebook = S::Notebook; + type Uri = S::Uri; type Cid = Set; - type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; type Authors = S::Authors; - type Uri = S::Uri; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type Record = S::Record; - type Notebook = S::Notebook; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Uri = S::Uri; type Cid = S::Cid; - type IndexedAt = Set; + type Notebook = Set; type Authors = S::Authors; - type Uri = S::Uri; + type Record = S::Record; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { - type Record = S::Record; - type Notebook = S::Notebook; + type Uri = S::Uri; type Cid = S::Cid; - type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; type Authors = Set; - type Uri = S::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { type Record = S::Record; - type Notebook = S::Notebook; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Uri = S::Uri; type Cid = S::Cid; + type Notebook = S::Notebook; + type Authors = S::Authors; + type Record = Set; type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Uri = S::Uri; + type Cid = S::Cid; + type Notebook = S::Notebook; type Authors = S::Authors; - type Uri = Set; + type Record = S::Record; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `notebook` field - pub struct notebook(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `notebook` field + pub struct notebook(()); ///Marker type for the `authors` field pub struct authors(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -2949,12 +2949,12 @@ where impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, - S::Record: chapter_view_state::IsSet, - S::Notebook: chapter_view_state::IsSet, + S::Uri: chapter_view_state::IsSet, S::Cid: chapter_view_state::IsSet, - S::IndexedAt: chapter_view_state::IsSet, + S::Notebook: chapter_view_state::IsSet, S::Authors: chapter_view_state::IsSet, - S::Uri: chapter_view_state::IsSet, + S::Record: chapter_view_state::IsSet, + S::IndexedAt: chapter_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ChapterView<'a> { @@ -3338,85 +3338,85 @@ pub mod entry_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; - type Cid; type Record; - type IndexedAt; + type Cid; + type Uri; type Authors; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; - type Cid = Unset; type Record = Unset; - type IndexedAt = Unset; + type Cid = Unset; + type Uri = Unset; type Authors = Unset; + type IndexedAt = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Record = Set; type Cid = S::Cid; - type Record = S::Record; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Authors = S::Authors; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; - type Cid = Set; type Record = S::Record; - type IndexedAt = S::IndexedAt; - type Authors = S::Authors; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { + type Cid = Set; type Uri = S::Uri; - type Cid = S::Cid; - type Record = Set; - type IndexedAt = S::IndexedAt; type Authors = S::Authors; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Uri = S::Uri; - type Cid = S::Cid; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Record = S::Record; - type IndexedAt = Set; + type Cid = S::Cid; + type Uri = Set; type Authors = S::Authors; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { - type Uri = S::Uri; - type Cid = S::Cid; type Record = S::Record; - type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Uri = S::Uri; type Authors = Set; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Record = S::Record; + type Cid = S::Cid; + type Uri = S::Uri; + type Authors = S::Authors; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `record` field pub struct record(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `authors` field pub struct authors(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -3753,11 +3753,11 @@ impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { impl<'a, S> EntryViewBuilder<'a, S> where S: entry_view_state::State, - S::Uri: entry_view_state::IsSet, - S::Cid: entry_view_state::IsSet, S::Record: entry_view_state::IsSet, - S::IndexedAt: entry_view_state::IsSet, + S::Cid: entry_view_state::IsSet, + S::Uri: entry_view_state::IsSet, S::Authors: entry_view_state::IsSet, + S::IndexedAt: entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> EntryView<'a> { @@ -4049,37 +4049,37 @@ pub mod feed_notebook_context_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; type Uri; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; type Uri = Unset; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; - type Uri = S::Uri; + type Title = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Title = S::Title; type Uri = Set; + type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Uri = S::Uri; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -4169,8 +4169,8 @@ where impl<'a, S> FeedNotebookContextBuilder<'a, S> where S: feed_notebook_context_state::State, - S::Title: feed_notebook_context_state::IsSet, S::Uri: feed_notebook_context_state::IsSet, + S::Title: feed_notebook_context_state::IsSet, { /// Build the final struct pub fn build(self) -> FeedNotebookContext<'a> { @@ -4308,85 +4308,85 @@ pub mod notebook_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; - type IndexedAt; type Cid; - type Authors; + type IndexedAt; + type Record; type Uri; + type Authors; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; - type IndexedAt = Unset; type Cid = Unset; - type Authors = Unset; + type IndexedAt = Unset; + type Record = Unset; type Uri = Unset; + type Authors = Unset; } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; - type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type Authors = S::Authors; + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Cid = Set; + type IndexedAt = S::IndexedAt; + type Record = S::Record; type Uri = S::Uri; + type Authors = S::Authors; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Record = S::Record; - type IndexedAt = Set; type Cid = S::Cid; - type Authors = S::Authors; - type Uri = S::Uri; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { + type IndexedAt = Set; type Record = S::Record; - type IndexedAt = S::IndexedAt; - type Cid = Set; - type Authors = S::Authors; type Uri = S::Uri; + type Authors = S::Authors; } - ///State transition - sets the `authors` field to Set - pub struct SetAuthors(PhantomData S>); - impl sealed::Sealed for SetAuthors {} - impl State for SetAuthors { - type Record = S::Record; - type IndexedAt = S::IndexedAt; + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { type Cid = S::Cid; - type Authors = Set; + type IndexedAt = S::IndexedAt; + type Record = Set; type Uri = S::Uri; + type Authors = S::Authors; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Record = S::Record; - type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type Authors = S::Authors; + type IndexedAt = S::IndexedAt; + type Record = S::Record; type Uri = Set; + type Authors = S::Authors; + } + ///State transition - sets the `authors` field to Set + pub struct SetAuthors(PhantomData S>); + impl sealed::Sealed for SetAuthors {} + impl State for SetAuthors { + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Uri = S::Uri; + type Authors = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `authors` field - pub struct authors(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `record` field + pub struct record(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `authors` field + pub struct authors(()); } } @@ -4753,11 +4753,11 @@ impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, - S::Record: notebook_view_state::IsSet, - S::IndexedAt: notebook_view_state::IsSet, S::Cid: notebook_view_state::IsSet, - S::Authors: notebook_view_state::IsSet, + S::IndexedAt: notebook_view_state::IsSet, + S::Record: notebook_view_state::IsSet, S::Uri: notebook_view_state::IsSet, + S::Authors: notebook_view_state::IsSet, { /// Build the final struct pub fn build(self) -> NotebookView<'a> { @@ -4872,85 +4872,85 @@ pub mod page_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Uri; + type Record; type IndexedAt; type Notebook; - type Uri; type Cid; - type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Uri = Unset; + type Record = Unset; type IndexedAt = Unset; type Notebook = Unset; - type Uri = Unset; type Cid = Unset; - type Record = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Record = S::Record; + type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; + type Cid = S::Cid; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Uri = S::Uri; + type Record = Set; + type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; + type Cid = S::Cid; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { + type Uri = S::Uri; + type Record = S::Record; type IndexedAt = Set; type Notebook = S::Notebook; - type Uri = S::Uri; type Cid = S::Cid; - type Record = S::Record; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type IndexedAt = S::IndexedAt; - type Notebook = Set; type Uri = S::Uri; - type Cid = S::Cid; type Record = S::Record; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { type IndexedAt = S::IndexedAt; - type Notebook = S::Notebook; - type Uri = Set; + type Notebook = Set; type Cid = S::Cid; - type Record = S::Record; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type IndexedAt = S::IndexedAt; - type Notebook = S::Notebook; type Uri = S::Uri; - type Cid = Set; type Record = S::Record; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { type IndexedAt = S::IndexedAt; type Notebook = S::Notebook; - type Uri = S::Uri; - type Cid = S::Cid; - type Record = Set; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `record` field + pub struct record(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `notebook` field pub struct notebook(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `record` field - pub struct record(()); } } @@ -5137,11 +5137,11 @@ where impl<'a, S> PageViewBuilder<'a, S> where S: page_view_state::State, + S::Uri: page_view_state::IsSet, + S::Record: page_view_state::IsSet, S::IndexedAt: page_view_state::IsSet, S::Notebook: page_view_state::IsSet, - S::Uri: page_view_state::IsSet, S::Cid: page_view_state::IsSet, - S::Record: page_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PageView<'a> { @@ -5234,66 +5234,66 @@ pub mod permission_grant_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; - type Scope; type GrantedAt; type Source; + type Scope; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; - type Scope = Unset; type GrantedAt = Unset; type Source = Unset; + type Scope = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; - type Scope = S::Scope; - type GrantedAt = S::GrantedAt; - type Source = S::Source; - } - ///State transition - sets the `scope` field to Set - pub struct SetScope(PhantomData S>); - impl sealed::Sealed for SetScope {} - impl State for SetScope { - type Did = S::Did; - type Scope = Set; type GrantedAt = S::GrantedAt; type Source = S::Source; + type Scope = S::Scope; } ///State transition - sets the `granted_at` field to Set pub struct SetGrantedAt(PhantomData S>); impl sealed::Sealed for SetGrantedAt {} impl State for SetGrantedAt { type Did = S::Did; - type Scope = S::Scope; type GrantedAt = Set; type Source = S::Source; + type Scope = S::Scope; } ///State transition - sets the `source` field to Set pub struct SetSource(PhantomData S>); impl sealed::Sealed for SetSource {} impl State for SetSource { type Did = S::Did; - type Scope = S::Scope; type GrantedAt = S::GrantedAt; type Source = Set; + type Scope = S::Scope; + } + ///State transition - sets the `scope` field to Set + pub struct SetScope(PhantomData S>); + impl sealed::Sealed for SetScope {} + impl State for SetScope { + type Did = S::Did; + type GrantedAt = S::GrantedAt; + type Source = S::Source; + type Scope = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `scope` field - pub struct scope(()); ///Marker type for the `granted_at` field pub struct granted_at(()); ///Marker type for the `source` field pub struct source(()); + ///Marker type for the `scope` field + pub struct scope(()); } } @@ -5407,9 +5407,9 @@ impl<'a, S> PermissionGrantBuilder<'a, S> where S: permission_grant_state::State, S::Did: permission_grant_state::IsSet, - S::Scope: permission_grant_state::IsSet, S::GrantedAt: permission_grant_state::IsSet, S::Source: permission_grant_state::IsSet, + S::Scope: permission_grant_state::IsSet, { /// Build the final struct pub fn build(self) -> PermissionGrant<'a> { @@ -5758,67 +5758,67 @@ pub mod published_version_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type PublishedAt; - type Publisher; type Uri; type Cid; + type Publisher; + type PublishedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type PublishedAt = Unset; - type Publisher = Unset; type Uri = Unset; type Cid = Unset; - } - ///State transition - sets the `published_at` field to Set - pub struct SetPublishedAt(PhantomData S>); - impl sealed::Sealed for SetPublishedAt {} - impl State for SetPublishedAt { - type PublishedAt = Set; - type Publisher = S::Publisher; - type Uri = S::Uri; - type Cid = S::Cid; - } - ///State transition - sets the `publisher` field to Set - pub struct SetPublisher(PhantomData S>); - impl sealed::Sealed for SetPublisher {} - impl State for SetPublisher { - type PublishedAt = S::PublishedAt; - type Publisher = Set; - type Uri = S::Uri; - type Cid = S::Cid; + type Publisher = Unset; + type PublishedAt = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type PublishedAt = S::PublishedAt; - type Publisher = S::Publisher; type Uri = Set; type Cid = S::Cid; + type Publisher = S::Publisher; + type PublishedAt = S::PublishedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type PublishedAt = S::PublishedAt; - type Publisher = S::Publisher; type Uri = S::Uri; type Cid = Set; + type Publisher = S::Publisher; + type PublishedAt = S::PublishedAt; + } + ///State transition - sets the `publisher` field to Set + pub struct SetPublisher(PhantomData S>); + impl sealed::Sealed for SetPublisher {} + impl State for SetPublisher { + type Uri = S::Uri; + type Cid = S::Cid; + type Publisher = Set; + type PublishedAt = S::PublishedAt; + } + ///State transition - sets the `published_at` field to Set + pub struct SetPublishedAt(PhantomData S>); + impl sealed::Sealed for SetPublishedAt {} + impl State for SetPublishedAt { + type Uri = S::Uri; + type Cid = S::Cid; + type Publisher = S::Publisher; + type PublishedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `published_at` field - pub struct published_at(()); - ///Marker type for the `publisher` field - pub struct publisher(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `publisher` field + pub struct publisher(()); + ///Marker type for the `published_at` field + pub struct published_at(()); } } @@ -5991,10 +5991,10 @@ where impl<'a, S> PublishedVersionViewBuilder<'a, S> where S: published_version_view_state::State, - S::PublishedAt: published_version_view_state::IsSet, - S::Publisher: published_version_view_state::IsSet, S::Uri: published_version_view_state::IsSet, S::Cid: published_version_view_state::IsSet, + S::Publisher: published_version_view_state::IsSet, + S::PublishedAt: published_version_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PublishedVersionView<'a> { @@ -6244,37 +6244,37 @@ pub mod reason_bookmark_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type By; type IndexedAt; + type By; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type By = Unset; type IndexedAt = Unset; - } - ///State transition - sets the `by` field to Set - pub struct SetBy(PhantomData S>); - impl sealed::Sealed for SetBy {} - impl State for SetBy { - type By = Set; - type IndexedAt = S::IndexedAt; + type By = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type By = S::By; type IndexedAt = Set; + type By = S::By; + } + ///State transition - sets the `by` field to Set + pub struct SetBy(PhantomData S>); + impl sealed::Sealed for SetBy {} + impl State for SetBy { + type IndexedAt = S::IndexedAt; + type By = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `by` field - pub struct by(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `by` field + pub struct by(()); } } @@ -6347,8 +6347,8 @@ where impl<'a, S> ReasonBookmarkBuilder<'a, S> where S: reason_bookmark_state::State, - S::By: reason_bookmark_state::IsSet, S::IndexedAt: reason_bookmark_state::IsSet, + S::By: reason_bookmark_state::IsSet, { /// Build the final struct pub fn build(self) -> ReasonBookmark<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/book.rs b/crates/weaver-api/src/sh_weaver/notebook/book.rs index cf523b5..b574d36 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/book.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/book.rs @@ -33,7 +33,7 @@ pub struct Book<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub path: std::option::Option>, - /// Notebook opts into accessiblity by path only without identity scoping. Path must be globally unique. + /// Notebook opts into accessiblity by path only without identity scoping. Path must be globally unique and a valid subdomain. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub publish_global: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -63,37 +63,37 @@ pub mod book_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type EntryList; type Authors; + type EntryList; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type EntryList = Unset; type Authors = Unset; - } - ///State transition - sets the `entry_list` field to Set - pub struct SetEntryList(PhantomData S>); - impl sealed::Sealed for SetEntryList {} - impl State for SetEntryList { - type EntryList = Set; - type Authors = S::Authors; + type EntryList = Unset; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { - type EntryList = S::EntryList; type Authors = Set; + type EntryList = S::EntryList; + } + ///State transition - sets the `entry_list` field to Set + pub struct SetEntryList(PhantomData S>); + impl sealed::Sealed for SetEntryList {} + impl State for SetEntryList { + type Authors = S::Authors; + type EntryList = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `entry_list` field - pub struct entry_list(()); ///Marker type for the `authors` field pub struct authors(()); + ///Marker type for the `entry_list` field + pub struct entry_list(()); } } @@ -352,8 +352,8 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { impl<'a, S> BookBuilder<'a, S> where S: book_state::State, - S::EntryList: book_state::IsSet, S::Authors: book_state::IsSet, + S::EntryList: book_state::IsSet, { /// Build the final struct pub fn build(self) -> Book<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/chapter.rs b/crates/weaver-api/src/sh_weaver/notebook/chapter.rs index 5694806..a54908b 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/chapter.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/chapter.rs @@ -54,49 +54,49 @@ pub mod chapter_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Notebook; type EntryList; + type Notebook; type Authors; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Notebook = Unset; type EntryList = Unset; + type Notebook = Unset; type Authors = Unset; } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { - type Notebook = Set; - type EntryList = S::EntryList; - type Authors = S::Authors; - } ///State transition - sets the `entry_list` field to Set pub struct SetEntryList(PhantomData S>); impl sealed::Sealed for SetEntryList {} impl State for SetEntryList { - type Notebook = S::Notebook; type EntryList = Set; + type Notebook = S::Notebook; + type Authors = S::Authors; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type EntryList = S::EntryList; + type Notebook = Set; type Authors = S::Authors; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { - type Notebook = S::Notebook; type EntryList = S::EntryList; + type Notebook = S::Notebook; type Authors = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `notebook` field - pub struct notebook(()); ///Marker type for the `entry_list` field pub struct entry_list(()); + ///Marker type for the `notebook` field + pub struct notebook(()); ///Marker type for the `authors` field pub struct authors(()); } @@ -291,8 +291,8 @@ impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { impl<'a, S> ChapterBuilder<'a, S> where S: chapter_state::State, - S::Notebook: chapter_state::IsSet, S::EntryList: chapter_state::IsSet, + S::Notebook: chapter_state::IsSet, S::Authors: chapter_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/notebook/entry.rs b/crates/weaver-api/src/sh_weaver/notebook/entry.rs index f288cf0..4228660 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/entry.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/entry.rs @@ -60,67 +60,67 @@ pub mod entry_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type Title; - type Content; type Path; + type Content; + type Title; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; - type Title = Unset; - type Content = Unset; type Path = Unset; + type Content = Unset; + type Title = Unset; + type CreatedAt = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Title = S::Title; + ///State transition - sets the `path` field to Set + pub struct SetPath(PhantomData S>); + impl sealed::Sealed for SetPath {} + impl State for SetPath { + type Path = Set; type Content = S::Content; - type Path = S::Path; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { + type Title = S::Title; type CreatedAt = S::CreatedAt; - type Title = Set; - type Content = S::Content; - type Path = S::Path; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { - type CreatedAt = S::CreatedAt; - type Title = S::Title; - type Content = Set; type Path = S::Path; + type Content = Set; + type Title = S::Title; + type CreatedAt = S::CreatedAt; } - ///State transition - sets the `path` field to Set - pub struct SetPath(PhantomData S>); - impl sealed::Sealed for SetPath {} - impl State for SetPath { + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Path = S::Path; + type Content = S::Content; + type Title = Set; type CreatedAt = S::CreatedAt; - type Title = S::Title; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Path = S::Path; type Content = S::Content; - type Path = Set; + type Title = S::Title; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `title` field - pub struct title(()); - ///Marker type for the `content` field - pub struct content(()); ///Marker type for the `path` field pub struct path(()); + ///Marker type for the `content` field + pub struct content(()); + ///Marker type for the `title` field + pub struct title(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -358,10 +358,10 @@ impl<'a, S: entry_state::State> EntryBuilder<'a, S> { impl<'a, S> EntryBuilder<'a, S> where S: entry_state::State, - S::CreatedAt: entry_state::IsSet, - S::Title: entry_state::IsSet, - S::Content: entry_state::IsSet, S::Path: entry_state::IsSet, + S::Content: entry_state::IsSet, + S::Title: entry_state::IsSet, + S::CreatedAt: entry_state::IsSet, { /// Build the final struct pub fn build(self) -> Entry<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs index bc519e4..94d2695 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs @@ -32,37 +32,37 @@ pub mod get_notebook_by_title_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; type Actor; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; type Actor = Unset; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; - type Actor = S::Actor; + type Title = Unset; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData S>); impl sealed::Sealed for SetActor {} impl State for SetActor { - type Title = S::Title; type Actor = Set; + type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Actor = S::Actor; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `actor` field pub struct actor(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetNotebookByTitleBuilder<'a, S> where S: get_notebook_by_title_state::State, - S::Title: get_notebook_by_title_state::IsSet, S::Actor: get_notebook_by_title_state::IsSet, + S::Title: get_notebook_by_title_state::IsSet, { /// Build the final struct pub fn build(self) -> GetNotebookByTitle<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_suggested_notebooks.rs b/crates/weaver-api/src/sh_weaver/notebook/get_suggested_notebooks.rs index 3258a70..a12d033 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/get_suggested_notebooks.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/get_suggested_notebooks.rs @@ -165,37 +165,37 @@ pub mod suggested_notebook_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reason; type Notebook; + type Reason; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reason = Unset; type Notebook = Unset; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Reason = Set; - type Notebook = S::Notebook; + type Reason = Unset; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type Reason = S::Reason; type Notebook = Set; + type Reason = S::Reason; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Notebook = S::Notebook; + type Reason = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reason` field - pub struct reason(()); ///Marker type for the `notebook` field pub struct notebook(()); + ///Marker type for the `reason` field + pub struct reason(()); } } @@ -286,8 +286,8 @@ impl<'a, S: suggested_notebook_state::State> SuggestedNotebookBuilder<'a, S> { impl<'a, S> SuggestedNotebookBuilder<'a, S> where S: suggested_notebook_state::State, - S::Reason: suggested_notebook_state::IsSet, S::Notebook: suggested_notebook_state::IsSet, + S::Reason: suggested_notebook_state::IsSet, { /// Build the final struct pub fn build(self) -> SuggestedNotebook<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/page.rs b/crates/weaver-api/src/sh_weaver/notebook/page.rs index 7d3cead..b0ba27a 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/page.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/page.rs @@ -44,51 +44,51 @@ pub mod page_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Authors; type EntryList; type Notebook; + type Authors; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Authors = Unset; type EntryList = Unset; type Notebook = Unset; - } - ///State transition - sets the `authors` field to Set - pub struct SetAuthors(PhantomData S>); - impl sealed::Sealed for SetAuthors {} - impl State for SetAuthors { - type Authors = Set; - type EntryList = S::EntryList; - type Notebook = S::Notebook; + type Authors = Unset; } ///State transition - sets the `entry_list` field to Set pub struct SetEntryList(PhantomData S>); impl sealed::Sealed for SetEntryList {} impl State for SetEntryList { - type Authors = S::Authors; type EntryList = Set; type Notebook = S::Notebook; + type Authors = S::Authors; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type Authors = S::Authors; type EntryList = S::EntryList; type Notebook = Set; + type Authors = S::Authors; + } + ///State transition - sets the `authors` field to Set + pub struct SetAuthors(PhantomData S>); + impl sealed::Sealed for SetAuthors {} + impl State for SetAuthors { + type EntryList = S::EntryList; + type Notebook = S::Notebook; + type Authors = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `authors` field - pub struct authors(()); ///Marker type for the `entry_list` field pub struct entry_list(()); ///Marker type for the `notebook` field pub struct notebook(()); + ///Marker type for the `authors` field + pub struct authors(()); } } @@ -221,9 +221,9 @@ impl<'a, S: page_state::State> PageBuilder<'a, S> { impl<'a, S> PageBuilder<'a, S> where S: page_state::State, - S::Authors: page_state::IsSet, S::EntryList: page_state::IsSet, S::Notebook: page_state::IsSet, + S::Authors: page_state::IsSet, { /// Build the final struct pub fn build(self) -> Page<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs b/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs index 9275137..afce772 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs @@ -35,50 +35,50 @@ pub mod resolve_entry_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Actor; - type Notebook; type Entry; + type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Actor = Unset; - type Notebook = Unset; type Entry = Unset; + type Notebook = Unset; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData S>); impl sealed::Sealed for SetActor {} impl State for SetActor { type Actor = Set; - type Notebook = S::Notebook; - type Entry = S::Entry; - } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { - type Actor = S::Actor; - type Notebook = Set; type Entry = S::Entry; + type Notebook = S::Notebook; } ///State transition - sets the `entry` field to Set pub struct SetEntry(PhantomData S>); impl sealed::Sealed for SetEntry {} impl State for SetEntry { type Actor = S::Actor; - type Notebook = S::Notebook; type Entry = Set; + type Notebook = S::Notebook; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Actor = S::Actor; + type Entry = S::Entry; + type Notebook = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `actor` field pub struct actor(()); - ///Marker type for the `notebook` field - pub struct notebook(()); ///Marker type for the `entry` field pub struct entry(()); + ///Marker type for the `notebook` field + pub struct notebook(()); } } @@ -172,8 +172,8 @@ impl<'a, S> ResolveEntryBuilder<'a, S> where S: resolve_entry_state::State, S::Actor: resolve_entry_state::IsSet, - S::Notebook: resolve_entry_state::IsSet, S::Entry: resolve_entry_state::IsSet, + S::Notebook: resolve_entry_state::IsSet, { /// Build the final struct pub fn build(self) -> ResolveEntry<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs b/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs index baed045..d0d9b2f 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs @@ -38,37 +38,37 @@ pub mod resolve_notebook_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; type Actor; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Name = Unset; type Actor = Unset; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Name = Set; - type Actor = S::Actor; + type Name = Unset; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData S>); impl sealed::Sealed for SetActor {} impl State for SetActor { - type Name = S::Name; type Actor = Set; + type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Actor = S::Actor; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `actor` field pub struct actor(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -175,8 +175,8 @@ where impl<'a, S> ResolveNotebookBuilder<'a, S> where S: resolve_notebook_state::State, - S::Name: resolve_notebook_state::IsSet, S::Actor: resolve_notebook_state::IsSet, + S::Name: resolve_notebook_state::IsSet, { /// Build the final struct pub fn build(self) -> ResolveNotebook<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/theme.rs b/crates/weaver-api/src/sh_weaver/notebook/theme.rs index 944c171..d2109f1 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/theme.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/theme.rs @@ -36,51 +36,51 @@ pub mod code_theme_file_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Content; type Name; type Did; + type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Content = Unset; type Name = Unset; type Did = Unset; - } - ///State transition - sets the `content` field to Set - pub struct SetContent(PhantomData S>); - impl sealed::Sealed for SetContent {} - impl State for SetContent { - type Content = Set; - type Name = S::Name; - type Did = S::Did; + type Content = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Content = S::Content; type Name = Set; type Did = S::Did; + type Content = S::Content; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Content = S::Content; type Name = S::Name; type Did = Set; + type Content = S::Content; + } + ///State transition - sets the `content` field to Set + pub struct SetContent(PhantomData S>); + impl sealed::Sealed for SetContent {} + impl State for SetContent { + type Name = S::Name; + type Did = S::Did; + type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `content` field - pub struct content(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `content` field + pub struct content(()); } } @@ -173,9 +173,9 @@ where impl<'a, S> CodeThemeFileBuilder<'a, S> where S: code_theme_file_state::State, - S::Content: code_theme_file_state::IsSet, S::Name: code_theme_file_state::IsSet, S::Did: code_theme_file_state::IsSet, + S::Content: code_theme_file_state::IsSet, { /// Build the final struct pub fn build(self) -> CodeThemeFile<'a> { @@ -837,51 +837,51 @@ pub mod font_file_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Name; type Did; type Content; - type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Name = Unset; type Did = Unset; type Content = Unset; - type Name = Unset; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Name = Set; + type Did = S::Did; + type Content = S::Content; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { + type Name = S::Name; type Did = Set; type Content = S::Content; - type Name = S::Name; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { - type Did = S::Did; - type Content = Set; type Name = S::Name; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { type Did = S::Did; - type Content = S::Content; - type Name = Set; + type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `name` field + pub struct name(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `content` field pub struct content(()); - ///Marker type for the `name` field - pub struct name(()); } } @@ -974,9 +974,9 @@ where impl<'a, S> FontFileBuilder<'a, S> where S: font_file_state::State, + S::Name: font_file_state::IsSet, S::Did: font_file_state::IsSet, S::Content: font_file_state::IsSet, - S::Name: font_file_state::IsSet, { /// Build the final struct pub fn build(self) -> FontFile<'a> { @@ -1067,105 +1067,105 @@ pub mod theme_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type DarkScheme; - type LightScheme; - type Spacing; - type DarkCodeTheme; type LightCodeTheme; + type DarkCodeTheme; type Fonts; + type DarkScheme; + type Spacing; + type LightScheme; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type DarkScheme = Unset; - type LightScheme = Unset; - type Spacing = Unset; - type DarkCodeTheme = Unset; type LightCodeTheme = Unset; + type DarkCodeTheme = Unset; type Fonts = Unset; + type DarkScheme = Unset; + type Spacing = Unset; + type LightScheme = Unset; } - ///State transition - sets the `dark_scheme` field to Set - pub struct SetDarkScheme(PhantomData S>); - impl sealed::Sealed for SetDarkScheme {} - impl State for SetDarkScheme { - type DarkScheme = Set; - type LightScheme = S::LightScheme; - type Spacing = S::Spacing; + ///State transition - sets the `light_code_theme` field to Set + pub struct SetLightCodeTheme(PhantomData S>); + impl sealed::Sealed for SetLightCodeTheme {} + impl State for SetLightCodeTheme { + type LightCodeTheme = Set; type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = S::LightCodeTheme; type Fonts = S::Fonts; - } - ///State transition - sets the `light_scheme` field to Set - pub struct SetLightScheme(PhantomData S>); - impl sealed::Sealed for SetLightScheme {} - impl State for SetLightScheme { type DarkScheme = S::DarkScheme; - type LightScheme = Set; type Spacing = S::Spacing; - type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = S::LightCodeTheme; - type Fonts = S::Fonts; - } - ///State transition - sets the `spacing` field to Set - pub struct SetSpacing(PhantomData S>); - impl sealed::Sealed for SetSpacing {} - impl State for SetSpacing { - type DarkScheme = S::DarkScheme; type LightScheme = S::LightScheme; - type Spacing = Set; - type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = S::LightCodeTheme; - type Fonts = S::Fonts; } ///State transition - sets the `dark_code_theme` field to Set pub struct SetDarkCodeTheme(PhantomData S>); impl sealed::Sealed for SetDarkCodeTheme {} impl State for SetDarkCodeTheme { - type DarkScheme = S::DarkScheme; - type LightScheme = S::LightScheme; - type Spacing = S::Spacing; - type DarkCodeTheme = Set; type LightCodeTheme = S::LightCodeTheme; + type DarkCodeTheme = Set; type Fonts = S::Fonts; - } - ///State transition - sets the `light_code_theme` field to Set - pub struct SetLightCodeTheme(PhantomData S>); - impl sealed::Sealed for SetLightCodeTheme {} - impl State for SetLightCodeTheme { type DarkScheme = S::DarkScheme; - type LightScheme = S::LightScheme; type Spacing = S::Spacing; - type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = Set; - type Fonts = S::Fonts; + type LightScheme = S::LightScheme; } ///State transition - sets the `fonts` field to Set pub struct SetFonts(PhantomData S>); impl sealed::Sealed for SetFonts {} impl State for SetFonts { + type LightCodeTheme = S::LightCodeTheme; + type DarkCodeTheme = S::DarkCodeTheme; + type Fonts = Set; type DarkScheme = S::DarkScheme; + type Spacing = S::Spacing; type LightScheme = S::LightScheme; + } + ///State transition - sets the `dark_scheme` field to Set + pub struct SetDarkScheme(PhantomData S>); + impl sealed::Sealed for SetDarkScheme {} + impl State for SetDarkScheme { + type LightCodeTheme = S::LightCodeTheme; + type DarkCodeTheme = S::DarkCodeTheme; + type Fonts = S::Fonts; + type DarkScheme = Set; type Spacing = S::Spacing; + type LightScheme = S::LightScheme; + } + ///State transition - sets the `spacing` field to Set + pub struct SetSpacing(PhantomData S>); + impl sealed::Sealed for SetSpacing {} + impl State for SetSpacing { + type LightCodeTheme = S::LightCodeTheme; type DarkCodeTheme = S::DarkCodeTheme; + type Fonts = S::Fonts; + type DarkScheme = S::DarkScheme; + type Spacing = Set; + type LightScheme = S::LightScheme; + } + ///State transition - sets the `light_scheme` field to Set + pub struct SetLightScheme(PhantomData S>); + impl sealed::Sealed for SetLightScheme {} + impl State for SetLightScheme { type LightCodeTheme = S::LightCodeTheme; - type Fonts = Set; + type DarkCodeTheme = S::DarkCodeTheme; + type Fonts = S::Fonts; + type DarkScheme = S::DarkScheme; + type Spacing = S::Spacing; + type LightScheme = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `dark_scheme` field - pub struct dark_scheme(()); - ///Marker type for the `light_scheme` field - pub struct light_scheme(()); - ///Marker type for the `spacing` field - pub struct spacing(()); - ///Marker type for the `dark_code_theme` field - pub struct dark_code_theme(()); ///Marker type for the `light_code_theme` field pub struct light_code_theme(()); + ///Marker type for the `dark_code_theme` field + pub struct dark_code_theme(()); ///Marker type for the `fonts` field pub struct fonts(()); + ///Marker type for the `dark_scheme` field + pub struct dark_scheme(()); + ///Marker type for the `spacing` field + pub struct spacing(()); + ///Marker type for the `light_scheme` field + pub struct light_scheme(()); } } @@ -1338,12 +1338,12 @@ where impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, - S::DarkScheme: theme_state::IsSet, - S::LightScheme: theme_state::IsSet, - S::Spacing: theme_state::IsSet, - S::DarkCodeTheme: theme_state::IsSet, S::LightCodeTheme: theme_state::IsSet, + S::DarkCodeTheme: theme_state::IsSet, S::Fonts: theme_state::IsSet, + S::DarkScheme: theme_state::IsSet, + S::Spacing: theme_state::IsSet, + S::LightScheme: theme_state::IsSet, { /// Build the final struct pub fn build(self) -> Theme<'a> { @@ -1442,51 +1442,51 @@ pub mod theme_fonts_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Monospace; - type Heading; type Body; + type Heading; + type Monospace; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Monospace = Unset; - type Heading = Unset; type Body = Unset; + type Heading = Unset; + type Monospace = Unset; } - ///State transition - sets the `monospace` field to Set - pub struct SetMonospace(PhantomData S>); - impl sealed::Sealed for SetMonospace {} - impl State for SetMonospace { - type Monospace = Set; + ///State transition - sets the `body` field to Set + pub struct SetBody(PhantomData S>); + impl sealed::Sealed for SetBody {} + impl State for SetBody { + type Body = Set; type Heading = S::Heading; - type Body = S::Body; + type Monospace = S::Monospace; } ///State transition - sets the `heading` field to Set pub struct SetHeading(PhantomData S>); impl sealed::Sealed for SetHeading {} impl State for SetHeading { - type Monospace = S::Monospace; - type Heading = Set; type Body = S::Body; - } - ///State transition - sets the `body` field to Set - pub struct SetBody(PhantomData S>); - impl sealed::Sealed for SetBody {} - impl State for SetBody { + type Heading = Set; type Monospace = S::Monospace; + } + ///State transition - sets the `monospace` field to Set + pub struct SetMonospace(PhantomData S>); + impl sealed::Sealed for SetMonospace {} + impl State for SetMonospace { + type Body = S::Body; type Heading = S::Heading; - type Body = Set; + type Monospace = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `monospace` field - pub struct monospace(()); - ///Marker type for the `heading` field - pub struct heading(()); ///Marker type for the `body` field pub struct body(()); + ///Marker type for the `heading` field + pub struct heading(()); + ///Marker type for the `monospace` field + pub struct monospace(()); } } @@ -1579,9 +1579,9 @@ where impl<'a, S> ThemeFontsBuilder<'a, S> where S: theme_fonts_state::State, - S::Monospace: theme_fonts_state::IsSet, - S::Heading: theme_fonts_state::IsSet, S::Body: theme_fonts_state::IsSet, + S::Heading: theme_fonts_state::IsSet, + S::Monospace: theme_fonts_state::IsSet, { /// Build the final struct pub fn build(self) -> ThemeFonts<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notification.rs b/crates/weaver-api/src/sh_weaver/notification.rs index 96f1b0e..f0b6298 100644 --- a/crates/weaver-api/src/sh_weaver/notification.rs +++ b/crates/weaver-api/src/sh_weaver/notification.rs @@ -53,104 +53,104 @@ pub mod notification_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; + type IsRead; + type Reason; type IndexedAt; type Author; type Cid; - type Reason; - type IsRead; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; + type IsRead = Unset; + type Reason = Unset; type IndexedAt = Unset; type Author = Unset; type Cid = Unset; - type Reason = Unset; - type IsRead = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; + type IsRead = S::IsRead; + type Reason = S::Reason; type IndexedAt = S::IndexedAt; type Author = S::Author; type Cid = S::Cid; + } + ///State transition - sets the `is_read` field to Set + pub struct SetIsRead(PhantomData S>); + impl sealed::Sealed for SetIsRead {} + impl State for SetIsRead { + type Uri = S::Uri; + type IsRead = Set; type Reason = S::Reason; + type IndexedAt = S::IndexedAt; + type Author = S::Author; + type Cid = S::Cid; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Uri = S::Uri; type IsRead = S::IsRead; + type Reason = Set; + type IndexedAt = S::IndexedAt; + type Author = S::Author; + type Cid = S::Cid; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Uri = S::Uri; + type IsRead = S::IsRead; + type Reason = S::Reason; type IndexedAt = Set; type Author = S::Author; type Cid = S::Cid; - type Reason = S::Reason; - type IsRead = S::IsRead; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Uri = S::Uri; + type IsRead = S::IsRead; + type Reason = S::Reason; type IndexedAt = S::IndexedAt; type Author = Set; type Cid = S::Cid; - type Reason = S::Reason; - type IsRead = S::IsRead; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Uri = S::Uri; - type IndexedAt = S::IndexedAt; - type Author = S::Author; - type Cid = Set; - type Reason = S::Reason; - type IsRead = S::IsRead; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Uri = S::Uri; - type IndexedAt = S::IndexedAt; - type Author = S::Author; - type Cid = S::Cid; - type Reason = Set; type IsRead = S::IsRead; - } - ///State transition - sets the `is_read` field to Set - pub struct SetIsRead(PhantomData S>); - impl sealed::Sealed for SetIsRead {} - impl State for SetIsRead { - type Uri = S::Uri; + type Reason = S::Reason; type IndexedAt = S::IndexedAt; type Author = S::Author; - type Cid = S::Cid; - type Reason = S::Reason; - type IsRead = Set; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `is_read` field + pub struct is_read(()); + ///Marker type for the `reason` field + pub struct reason(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `reason` field - pub struct reason(()); - ///Marker type for the `is_read` field - pub struct is_read(()); } } @@ -344,11 +344,11 @@ impl<'a, S> NotificationBuilder<'a, S> where S: notification_state::State, S::Uri: notification_state::IsSet, + S::IsRead: notification_state::IsSet, + S::Reason: notification_state::IsSet, S::IndexedAt: notification_state::IsSet, S::Author: notification_state::IsSet, S::Cid: notification_state::IsSet, - S::Reason: notification_state::IsSet, - S::IsRead: notification_state::IsSet, { /// Build the final struct pub fn build(self) -> Notification<'a> { @@ -801,85 +801,85 @@ pub mod notification_group_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type MostRecentAt; - type Count; - type Subject; type Reason; + type Subject; type Actors; + type Count; + type MostRecentAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type MostRecentAt = Unset; - type Count = Unset; - type Subject = Unset; type Reason = Unset; + type Subject = Unset; type Actors = Unset; + type Count = Unset; + type MostRecentAt = Unset; } - ///State transition - sets the `most_recent_at` field to Set - pub struct SetMostRecentAt(PhantomData S>); - impl sealed::Sealed for SetMostRecentAt {} - impl State for SetMostRecentAt { - type MostRecentAt = Set; - type Count = S::Count; + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Reason = Set; type Subject = S::Subject; - type Reason = S::Reason; type Actors = S::Actors; - } - ///State transition - sets the `count` field to Set - pub struct SetCount(PhantomData S>); - impl sealed::Sealed for SetCount {} - impl State for SetCount { + type Count = S::Count; type MostRecentAt = S::MostRecentAt; - type Count = Set; - type Subject = S::Subject; - type Reason = S::Reason; - type Actors = S::Actors; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type MostRecentAt = S::MostRecentAt; - type Count = S::Count; - type Subject = Set; type Reason = S::Reason; + type Subject = Set; type Actors = S::Actors; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type MostRecentAt = S::MostRecentAt; type Count = S::Count; - type Subject = S::Subject; - type Reason = Set; - type Actors = S::Actors; + type MostRecentAt = S::MostRecentAt; } ///State transition - sets the `actors` field to Set pub struct SetActors(PhantomData S>); impl sealed::Sealed for SetActors {} impl State for SetActors { - type MostRecentAt = S::MostRecentAt; + type Reason = S::Reason; + type Subject = S::Subject; + type Actors = Set; type Count = S::Count; + type MostRecentAt = S::MostRecentAt; + } + ///State transition - sets the `count` field to Set + pub struct SetCount(PhantomData S>); + impl sealed::Sealed for SetCount {} + impl State for SetCount { + type Reason = S::Reason; type Subject = S::Subject; + type Actors = S::Actors; + type Count = Set; + type MostRecentAt = S::MostRecentAt; + } + ///State transition - sets the `most_recent_at` field to Set + pub struct SetMostRecentAt(PhantomData S>); + impl sealed::Sealed for SetMostRecentAt {} + impl State for SetMostRecentAt { type Reason = S::Reason; - type Actors = Set; + type Subject = S::Subject; + type Actors = S::Actors; + type Count = S::Count; + type MostRecentAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `most_recent_at` field - pub struct most_recent_at(()); - ///Marker type for the `count` field - pub struct count(()); - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `reason` field pub struct reason(()); + ///Marker type for the `subject` field + pub struct subject(()); ///Marker type for the `actors` field pub struct actors(()); + ///Marker type for the `count` field + pub struct count(()); + ///Marker type for the `most_recent_at` field + pub struct most_recent_at(()); } } @@ -1026,11 +1026,11 @@ where impl<'a, S> NotificationGroupBuilder<'a, S> where S: notification_group_state::State, - S::MostRecentAt: notification_group_state::IsSet, - S::Count: notification_group_state::IsSet, - S::Subject: notification_group_state::IsSet, S::Reason: notification_group_state::IsSet, + S::Subject: notification_group_state::IsSet, S::Actors: notification_group_state::IsSet, + S::Count: notification_group_state::IsSet, + S::MostRecentAt: notification_group_state::IsSet, { /// Build the final struct pub fn build(self) -> NotificationGroup<'a> { @@ -1292,49 +1292,49 @@ pub mod subscription_update_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type UpdatedAt; type NewEntries; + type UpdatedAt; type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type UpdatedAt = Unset; type NewEntries = Unset; + type UpdatedAt = Unset; type Notebook = Unset; } - ///State transition - sets the `updated_at` field to Set - pub struct SetUpdatedAt(PhantomData S>); - impl sealed::Sealed for SetUpdatedAt {} - impl State for SetUpdatedAt { - type UpdatedAt = Set; - type NewEntries = S::NewEntries; - type Notebook = S::Notebook; - } ///State transition - sets the `new_entries` field to Set pub struct SetNewEntries(PhantomData S>); impl sealed::Sealed for SetNewEntries {} impl State for SetNewEntries { - type UpdatedAt = S::UpdatedAt; type NewEntries = Set; + type UpdatedAt = S::UpdatedAt; + type Notebook = S::Notebook; + } + ///State transition - sets the `updated_at` field to Set + pub struct SetUpdatedAt(PhantomData S>); + impl sealed::Sealed for SetUpdatedAt {} + impl State for SetUpdatedAt { + type NewEntries = S::NewEntries; + type UpdatedAt = Set; type Notebook = S::Notebook; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type UpdatedAt = S::UpdatedAt; type NewEntries = S::NewEntries; + type UpdatedAt = S::UpdatedAt; type Notebook = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `updated_at` field - pub struct updated_at(()); ///Marker type for the `new_entries` field pub struct new_entries(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); ///Marker type for the `notebook` field pub struct notebook(()); } @@ -1461,8 +1461,8 @@ impl<'a, S: subscription_update_view_state::State> SubscriptionUpdateViewBuilder impl<'a, S> SubscriptionUpdateViewBuilder<'a, S> where S: subscription_update_view_state::State, - S::UpdatedAt: subscription_update_view_state::IsSet, S::NewEntries: subscription_update_view_state::IsSet, + S::UpdatedAt: subscription_update_view_state::IsSet, S::Notebook: subscription_update_view_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/site_standard/publication.rs b/crates/weaver-api/src/site_standard/publication.rs index d2c3407..8265b78 100644 --- a/crates/weaver-api/src/site_standard/publication.rs +++ b/crates/weaver-api/src/site_standard/publication.rs @@ -54,37 +54,37 @@ pub mod publication_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Url; type Name; + type Url; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Url = Unset; type Name = Unset; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { - type Url = Set; - type Name = S::Name; + type Url = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Url = S::Url; type Name = Set; + type Url = S::Url; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Name = S::Name; + type Url = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `url` field - pub struct url(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `url` field + pub struct url(()); } } @@ -237,8 +237,8 @@ where impl<'a, S> PublicationBuilder<'a, S> where S: publication_state::State, - S::Url: publication_state::IsSet, S::Name: publication_state::IsSet, + S::Url: publication_state::IsSet, { /// Build the final struct pub fn build(self) -> Publication<'a> { diff --git a/crates/weaver-api/src/site_standard/theme/basic.rs b/crates/weaver-api/src/site_standard/theme/basic.rs index 3a74bf3..7be6a83 100644 --- a/crates/weaver-api/src/site_standard/theme/basic.rs +++ b/crates/weaver-api/src/site_standard/theme/basic.rs @@ -42,67 +42,67 @@ pub mod basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Accent; - type Background; type AccentForeground; + type Accent; type Foreground; + type Background; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Accent = Unset; - type Background = Unset; type AccentForeground = Unset; + type Accent = Unset; type Foreground = Unset; - } - ///State transition - sets the `accent` field to Set - pub struct SetAccent(PhantomData S>); - impl sealed::Sealed for SetAccent {} - impl State for SetAccent { - type Accent = Set; - type Background = S::Background; - type AccentForeground = S::AccentForeground; - type Foreground = S::Foreground; - } - ///State transition - sets the `background` field to Set - pub struct SetBackground(PhantomData S>); - impl sealed::Sealed for SetBackground {} - impl State for SetBackground { - type Accent = S::Accent; - type Background = Set; - type AccentForeground = S::AccentForeground; - type Foreground = S::Foreground; + type Background = Unset; } ///State transition - sets the `accent_foreground` field to Set pub struct SetAccentForeground(PhantomData S>); impl sealed::Sealed for SetAccentForeground {} impl State for SetAccentForeground { + type AccentForeground = Set; type Accent = S::Accent; + type Foreground = S::Foreground; type Background = S::Background; - type AccentForeground = Set; + } + ///State transition - sets the `accent` field to Set + pub struct SetAccent(PhantomData S>); + impl sealed::Sealed for SetAccent {} + impl State for SetAccent { + type AccentForeground = S::AccentForeground; + type Accent = Set; type Foreground = S::Foreground; + type Background = S::Background; } ///State transition - sets the `foreground` field to Set pub struct SetForeground(PhantomData S>); impl sealed::Sealed for SetForeground {} impl State for SetForeground { + type AccentForeground = S::AccentForeground; type Accent = S::Accent; + type Foreground = Set; type Background = S::Background; + } + ///State transition - sets the `background` field to Set + pub struct SetBackground(PhantomData S>); + impl sealed::Sealed for SetBackground {} + impl State for SetBackground { type AccentForeground = S::AccentForeground; - type Foreground = Set; + type Accent = S::Accent; + type Foreground = S::Foreground; + type Background = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `accent` field - pub struct accent(()); - ///Marker type for the `background` field - pub struct background(()); ///Marker type for the `accent_foreground` field pub struct accent_foreground(()); + ///Marker type for the `accent` field + pub struct accent(()); ///Marker type for the `foreground` field pub struct foreground(()); + ///Marker type for the `background` field + pub struct background(()); } } @@ -215,10 +215,10 @@ where impl<'a, S> BasicBuilder<'a, S> where S: basic_state::State, - S::Accent: basic_state::IsSet, - S::Background: basic_state::IsSet, S::AccentForeground: basic_state::IsSet, + S::Accent: basic_state::IsSet, S::Foreground: basic_state::IsSet, + S::Background: basic_state::IsSet, { /// Build the final struct pub fn build(self) -> Basic<'a> { diff --git a/crates/weaver-api/src/site_standard/theme/color.rs b/crates/weaver-api/src/site_standard/theme/color.rs index f4d8f8a..c5512ee 100644 --- a/crates/weaver-api/src/site_standard/theme/color.rs +++ b/crates/weaver-api/src/site_standard/theme/color.rs @@ -32,51 +32,51 @@ pub mod rgb_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type G; - type R; type B; + type R; + type G; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type G = Unset; - type R = Unset; type B = Unset; + type R = Unset; + type G = Unset; } - ///State transition - sets the `g` field to Set - pub struct SetG(PhantomData S>); - impl sealed::Sealed for SetG {} - impl State for SetG { - type G = Set; + ///State transition - sets the `b` field to Set + pub struct SetB(PhantomData S>); + impl sealed::Sealed for SetB {} + impl State for SetB { + type B = Set; type R = S::R; - type B = S::B; + type G = S::G; } ///State transition - sets the `r` field to Set pub struct SetR(PhantomData S>); impl sealed::Sealed for SetR {} impl State for SetR { - type G = S::G; - type R = Set; type B = S::B; - } - ///State transition - sets the `b` field to Set - pub struct SetB(PhantomData S>); - impl sealed::Sealed for SetB {} - impl State for SetB { + type R = Set; type G = S::G; + } + ///State transition - sets the `g` field to Set + pub struct SetG(PhantomData S>); + impl sealed::Sealed for SetG {} + impl State for SetG { + type B = S::B; type R = S::R; - type B = Set; + type G = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `g` field - pub struct g(()); - ///Marker type for the `r` field - pub struct r(()); ///Marker type for the `b` field pub struct b(()); + ///Marker type for the `r` field + pub struct r(()); + ///Marker type for the `g` field + pub struct g(()); } } @@ -160,9 +160,9 @@ where impl<'a, S> RgbBuilder<'a, S> where S: rgb_state::State, - S::G: rgb_state::IsSet, - S::R: rgb_state::IsSet, S::B: rgb_state::IsSet, + S::R: rgb_state::IsSet, + S::G: rgb_state::IsSet, { /// Build the final struct pub fn build(self) -> Rgb<'a> { diff --git a/crates/weaver-api/src/tools_ozone/communication.rs b/crates/weaver-api/src/tools_ozone/communication.rs index e97fa8d..27b3a7b 100644 --- a/crates/weaver-api/src/tools_ozone/communication.rs +++ b/crates/weaver-api/src/tools_ozone/communication.rs @@ -55,127 +55,127 @@ pub mod template_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Disabled; - type LastUpdatedBy; - type Name; type CreatedAt; - type UpdatedAt; type Id; + type UpdatedAt; + type Name; + type LastUpdatedBy; type ContentMarkdown; + type Disabled; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Disabled = Unset; - type LastUpdatedBy = Unset; - type Name = Unset; type CreatedAt = Unset; - type UpdatedAt = Unset; type Id = Unset; + type UpdatedAt = Unset; + type Name = Unset; + type LastUpdatedBy = Unset; type ContentMarkdown = Unset; + type Disabled = Unset; } - ///State transition - sets the `disabled` field to Set - pub struct SetDisabled(PhantomData S>); - impl sealed::Sealed for SetDisabled {} - impl State for SetDisabled { - type Disabled = Set; - type LastUpdatedBy = S::LastUpdatedBy; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Id = S::Id; + type UpdatedAt = S::UpdatedAt; type Name = S::Name; + type LastUpdatedBy = S::LastUpdatedBy; + type ContentMarkdown = S::ContentMarkdown; + type Disabled = S::Disabled; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { type CreatedAt = S::CreatedAt; + type Id = Set; type UpdatedAt = S::UpdatedAt; - type Id = S::Id; + type Name = S::Name; + type LastUpdatedBy = S::LastUpdatedBy; type ContentMarkdown = S::ContentMarkdown; - } - ///State transition - sets the `last_updated_by` field to Set - pub struct SetLastUpdatedBy(PhantomData S>); - impl sealed::Sealed for SetLastUpdatedBy {} - impl State for SetLastUpdatedBy { type Disabled = S::Disabled; - type LastUpdatedBy = Set; - type Name = S::Name; + } + ///State transition - sets the `updated_at` field to Set + pub struct SetUpdatedAt(PhantomData S>); + impl sealed::Sealed for SetUpdatedAt {} + impl State for SetUpdatedAt { type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; type Id = S::Id; + type UpdatedAt = Set; + type Name = S::Name; + type LastUpdatedBy = S::LastUpdatedBy; type ContentMarkdown = S::ContentMarkdown; + type Disabled = S::Disabled; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Disabled = S::Disabled; - type LastUpdatedBy = S::LastUpdatedBy; - type Name = Set; type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; type Id = S::Id; - type ContentMarkdown = S::ContentMarkdown; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Disabled = S::Disabled; - type LastUpdatedBy = S::LastUpdatedBy; - type Name = S::Name; - type CreatedAt = Set; type UpdatedAt = S::UpdatedAt; - type Id = S::Id; - type ContentMarkdown = S::ContentMarkdown; - } - ///State transition - sets the `updated_at` field to Set - pub struct SetUpdatedAt(PhantomData S>); - impl sealed::Sealed for SetUpdatedAt {} - impl State for SetUpdatedAt { - type Disabled = S::Disabled; + type Name = Set; type LastUpdatedBy = S::LastUpdatedBy; - type Name = S::Name; - type CreatedAt = S::CreatedAt; - type UpdatedAt = Set; - type Id = S::Id; type ContentMarkdown = S::ContentMarkdown; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { type Disabled = S::Disabled; - type LastUpdatedBy = S::LastUpdatedBy; - type Name = S::Name; + } + ///State transition - sets the `last_updated_by` field to Set + pub struct SetLastUpdatedBy(PhantomData S>); + impl sealed::Sealed for SetLastUpdatedBy {} + impl State for SetLastUpdatedBy { type CreatedAt = S::CreatedAt; + type Id = S::Id; type UpdatedAt = S::UpdatedAt; - type Id = Set; + type Name = S::Name; + type LastUpdatedBy = Set; type ContentMarkdown = S::ContentMarkdown; + type Disabled = S::Disabled; } ///State transition - sets the `content_markdown` field to Set pub struct SetContentMarkdown(PhantomData S>); impl sealed::Sealed for SetContentMarkdown {} impl State for SetContentMarkdown { - type Disabled = S::Disabled; - type LastUpdatedBy = S::LastUpdatedBy; - type Name = S::Name; type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; type Id = S::Id; + type UpdatedAt = S::UpdatedAt; + type Name = S::Name; + type LastUpdatedBy = S::LastUpdatedBy; type ContentMarkdown = Set; + type Disabled = S::Disabled; + } + ///State transition - sets the `disabled` field to Set + pub struct SetDisabled(PhantomData S>); + impl sealed::Sealed for SetDisabled {} + impl State for SetDisabled { + type CreatedAt = S::CreatedAt; + type Id = S::Id; + type UpdatedAt = S::UpdatedAt; + type Name = S::Name; + type LastUpdatedBy = S::LastUpdatedBy; + type ContentMarkdown = S::ContentMarkdown; + type Disabled = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `disabled` field - pub struct disabled(()); - ///Marker type for the `last_updated_by` field - pub struct last_updated_by(()); - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `updated_at` field - pub struct updated_at(()); ///Marker type for the `id` field pub struct id(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `last_updated_by` field + pub struct last_updated_by(()); ///Marker type for the `content_markdown` field pub struct content_markdown(()); + ///Marker type for the `disabled` field + pub struct disabled(()); } } @@ -395,13 +395,13 @@ where impl<'a, S> TemplateViewBuilder<'a, S> where S: template_view_state::State, - S::Disabled: template_view_state::IsSet, - S::LastUpdatedBy: template_view_state::IsSet, - S::Name: template_view_state::IsSet, S::CreatedAt: template_view_state::IsSet, - S::UpdatedAt: template_view_state::IsSet, S::Id: template_view_state::IsSet, + S::UpdatedAt: template_view_state::IsSet, + S::Name: template_view_state::IsSet, + S::LastUpdatedBy: template_view_state::IsSet, S::ContentMarkdown: template_view_state::IsSet, + S::Disabled: template_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TemplateView<'a> { diff --git a/crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs b/crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs index 03a302d..00382fe 100644 --- a/crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs +++ b/crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs @@ -462,51 +462,51 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedBy; type CreatedAt; type Details; + type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedBy = Unset; type CreatedAt = Unset; type Details = Unset; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type CreatedBy = Set; - type CreatedAt = S::CreatedAt; - type Details = S::Details; + type CreatedBy = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type CreatedBy = S::CreatedBy; type CreatedAt = Set; type Details = S::Details; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `details` field to Set pub struct SetDetails(PhantomData S>); impl sealed::Sealed for SetDetails {} impl State for SetDetails { - type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Details = Set; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type CreatedAt = S::CreatedAt; + type Details = S::Details; + type CreatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_by` field - pub struct created_by(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `details` field pub struct details(()); + ///Marker type for the `created_by` field + pub struct created_by(()); } } @@ -599,9 +599,9 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, - S::CreatedBy: event_state::IsSet, S::CreatedAt: event_state::IsSet, S::Details: event_state::IsSet, + S::CreatedBy: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { diff --git a/crates/weaver-api/src/tools_ozone/moderation.rs b/crates/weaver-api/src/tools_ozone/moderation.rs index 295f334..7997e0f 100644 --- a/crates/weaver-api/src/tools_ozone/moderation.rs +++ b/crates/weaver-api/src/tools_ozone/moderation.rs @@ -55,37 +55,37 @@ pub mod account_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Timestamp; type Active; + type Timestamp; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Timestamp = Unset; type Active = Unset; - } - ///State transition - sets the `timestamp` field to Set - pub struct SetTimestamp(PhantomData S>); - impl sealed::Sealed for SetTimestamp {} - impl State for SetTimestamp { - type Timestamp = Set; - type Active = S::Active; + type Timestamp = Unset; } ///State transition - sets the `active` field to Set pub struct SetActive(PhantomData S>); impl sealed::Sealed for SetActive {} impl State for SetActive { - type Timestamp = S::Timestamp; type Active = Set; + type Timestamp = S::Timestamp; + } + ///State transition - sets the `timestamp` field to Set + pub struct SetTimestamp(PhantomData S>); + impl sealed::Sealed for SetTimestamp {} + impl State for SetTimestamp { + type Active = S::Active; + type Timestamp = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `timestamp` field - pub struct timestamp(()); ///Marker type for the `active` field pub struct active(()); + ///Marker type for the `timestamp` field + pub struct timestamp(()); } } @@ -189,8 +189,8 @@ where impl<'a, S> AccountEventBuilder<'a, S> where S: account_event_state::State, - S::Timestamp: account_event_state::IsSet, S::Active: account_event_state::IsSet, + S::Timestamp: account_event_state::IsSet, { /// Build the final struct pub fn build(self) -> AccountEvent<'a> { @@ -5307,49 +5307,49 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Status; type CreatedAt; + type Status; type AttemptId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Status = Unset; type CreatedAt = Unset; + type Status = Unset; type AttemptId = Unset; } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { - type Status = Set; - type CreatedAt = S::CreatedAt; - type AttemptId = S::AttemptId; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Status = S::Status; type CreatedAt = Set; + type Status = S::Status; + type AttemptId = S::AttemptId; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type CreatedAt = S::CreatedAt; + type Status = Set; type AttemptId = S::AttemptId; } ///State transition - sets the `attempt_id` field to Set pub struct SetAttemptId(PhantomData S>); impl sealed::Sealed for SetAttemptId {} impl State for SetAttemptId { - type Status = S::Status; type CreatedAt = S::CreatedAt; + type Status = S::Status; type AttemptId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `status` field - pub struct status(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `status` field + pub struct status(()); ///Marker type for the `attempt_id` field pub struct attempt_id(()); } @@ -5589,8 +5589,8 @@ where impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, - S::Status: age_assurance_event_state::IsSet, S::CreatedAt: age_assurance_event_state::IsSet, + S::Status: age_assurance_event_state::IsSet, S::AttemptId: age_assurance_event_state::IsSet, { /// Build the final struct @@ -5926,67 +5926,67 @@ pub mod blob_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Size; type Cid; - type MimeType; + type Size; type CreatedAt; + type MimeType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Size = Unset; type Cid = Unset; - type MimeType = Unset; + type Size = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `size` field to Set - pub struct SetSize(PhantomData S>); - impl sealed::Sealed for SetSize {} - impl State for SetSize { - type Size = Set; - type Cid = S::Cid; - type MimeType = S::MimeType; - type CreatedAt = S::CreatedAt; + type MimeType = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Size = S::Size; type Cid = Set; - type MimeType = S::MimeType; + type Size = S::Size; type CreatedAt = S::CreatedAt; + type MimeType = S::MimeType; } - ///State transition - sets the `mime_type` field to Set - pub struct SetMimeType(PhantomData S>); - impl sealed::Sealed for SetMimeType {} - impl State for SetMimeType { - type Size = S::Size; + ///State transition - sets the `size` field to Set + pub struct SetSize(PhantomData S>); + impl sealed::Sealed for SetSize {} + impl State for SetSize { type Cid = S::Cid; - type MimeType = Set; + type Size = Set; type CreatedAt = S::CreatedAt; + type MimeType = S::MimeType; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Size = S::Size; type Cid = S::Cid; - type MimeType = S::MimeType; + type Size = S::Size; type CreatedAt = Set; + type MimeType = S::MimeType; + } + ///State transition - sets the `mime_type` field to Set + pub struct SetMimeType(PhantomData S>); + impl sealed::Sealed for SetMimeType {} + impl State for SetMimeType { + type Cid = S::Cid; + type Size = S::Size; + type CreatedAt = S::CreatedAt; + type MimeType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `size` field - pub struct size(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `mime_type` field - pub struct mime_type(()); + ///Marker type for the `size` field + pub struct size(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `mime_type` field + pub struct mime_type(()); } } @@ -6133,10 +6133,10 @@ where impl<'a, S> BlobViewBuilder<'a, S> where S: blob_view_state::State, - S::Size: blob_view_state::IsSet, S::Cid: blob_view_state::IsSet, - S::MimeType: blob_view_state::IsSet, + S::Size: blob_view_state::IsSet, S::CreatedAt: blob_view_state::IsSet, + S::MimeType: blob_view_state::IsSet, { /// Build the final struct pub fn build(self) -> BlobView<'a> { @@ -6496,37 +6496,37 @@ pub mod image_details_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Width; type Height; + type Width; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Width = Unset; type Height = Unset; - } - ///State transition - sets the `width` field to Set - pub struct SetWidth(PhantomData S>); - impl sealed::Sealed for SetWidth {} - impl State for SetWidth { - type Width = Set; - type Height = S::Height; + type Width = Unset; } ///State transition - sets the `height` field to Set pub struct SetHeight(PhantomData S>); impl sealed::Sealed for SetHeight {} impl State for SetHeight { - type Width = S::Width; type Height = Set; + type Width = S::Width; + } + ///State transition - sets the `width` field to Set + pub struct SetWidth(PhantomData S>); + impl sealed::Sealed for SetWidth {} + impl State for SetWidth { + type Height = S::Height; + type Width = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `width` field - pub struct width(()); ///Marker type for the `height` field pub struct height(()); + ///Marker type for the `width` field + pub struct width(()); } } @@ -6596,8 +6596,8 @@ where impl<'a, S> ImageDetailsBuilder<'a, S> where S: image_details_state::State, - S::Width: image_details_state::IsSet, S::Height: image_details_state::IsSet, + S::Width: image_details_state::IsSet, { /// Build the final struct pub fn build(self) -> ImageDetails<'a> { @@ -6896,37 +6896,37 @@ pub mod mod_event_label_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreateLabelVals; type NegateLabelVals; + type CreateLabelVals; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreateLabelVals = Unset; type NegateLabelVals = Unset; - } - ///State transition - sets the `create_label_vals` field to Set - pub struct SetCreateLabelVals(PhantomData S>); - impl sealed::Sealed for SetCreateLabelVals {} - impl State for SetCreateLabelVals { - type CreateLabelVals = Set; - type NegateLabelVals = S::NegateLabelVals; + type CreateLabelVals = Unset; } ///State transition - sets the `negate_label_vals` field to Set pub struct SetNegateLabelVals(PhantomData S>); impl sealed::Sealed for SetNegateLabelVals {} impl State for SetNegateLabelVals { - type CreateLabelVals = S::CreateLabelVals; type NegateLabelVals = Set; + type CreateLabelVals = S::CreateLabelVals; + } + ///State transition - sets the `create_label_vals` field to Set + pub struct SetCreateLabelVals(PhantomData S>); + impl sealed::Sealed for SetCreateLabelVals {} + impl State for SetCreateLabelVals { + type NegateLabelVals = S::NegateLabelVals; + type CreateLabelVals = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `create_label_vals` field - pub struct create_label_vals(()); ///Marker type for the `negate_label_vals` field pub struct negate_label_vals(()); + ///Marker type for the `create_label_vals` field + pub struct create_label_vals(()); } } @@ -7030,8 +7030,8 @@ where impl<'a, S> ModEventLabelBuilder<'a, S> where S: mod_event_label_state::State, - S::CreateLabelVals: mod_event_label_state::IsSet, S::NegateLabelVals: mod_event_label_state::IsSet, + S::CreateLabelVals: mod_event_label_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventLabel<'a> { @@ -7777,37 +7777,37 @@ pub mod mod_event_tag_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Add; type Remove; + type Add; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Add = Unset; type Remove = Unset; - } - ///State transition - sets the `add` field to Set - pub struct SetAdd(PhantomData S>); - impl sealed::Sealed for SetAdd {} - impl State for SetAdd { - type Add = Set; - type Remove = S::Remove; + type Add = Unset; } ///State transition - sets the `remove` field to Set pub struct SetRemove(PhantomData S>); impl sealed::Sealed for SetRemove {} impl State for SetRemove { - type Add = S::Add; type Remove = Set; + type Add = S::Add; + } + ///State transition - sets the `add` field to Set + pub struct SetAdd(PhantomData S>); + impl sealed::Sealed for SetAdd {} + impl State for SetAdd { + type Remove = S::Remove; + type Add = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `add` field - pub struct add(()); ///Marker type for the `remove` field pub struct remove(()); + ///Marker type for the `add` field + pub struct add(()); } } @@ -7897,8 +7897,8 @@ where impl<'a, S> ModEventTagBuilder<'a, S> where S: mod_event_tag_state::State, - S::Add: mod_event_tag_state::IsSet, S::Remove: mod_event_tag_state::IsSet, + S::Add: mod_event_tag_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventTag<'a> { @@ -8132,105 +8132,105 @@ pub mod mod_event_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; - type Event; type CreatedBy; + type SubjectBlobCids; type CreatedAt; type Id; - type SubjectBlobCids; + type Event; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; - type Event = Unset; type CreatedBy = Unset; + type SubjectBlobCids = Unset; type CreatedAt = Unset; type Id = Unset; - type SubjectBlobCids = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type Event = S::Event; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Id = S::Id; - type SubjectBlobCids = S::SubjectBlobCids; - } - ///State transition - sets the `event` field to Set - pub struct SetEvent(PhantomData S>); - impl sealed::Sealed for SetEvent {} - impl State for SetEvent { - type Subject = S::Subject; - type Event = Set; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Id = S::Id; - type SubjectBlobCids = S::SubjectBlobCids; + type Event = Unset; + type Subject = Unset; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type Subject = S::Subject; - type Event = S::Event; type CreatedBy = Set; + type SubjectBlobCids = S::SubjectBlobCids; type CreatedAt = S::CreatedAt; type Id = S::Id; - type SubjectBlobCids = S::SubjectBlobCids; + type Event = S::Event; + type Subject = S::Subject; + } + ///State transition - sets the `subject_blob_cids` field to Set + pub struct SetSubjectBlobCids(PhantomData S>); + impl sealed::Sealed for SetSubjectBlobCids {} + impl State for SetSubjectBlobCids { + type CreatedBy = S::CreatedBy; + type SubjectBlobCids = Set; + type CreatedAt = S::CreatedAt; + type Id = S::Id; + type Event = S::Event; + type Subject = S::Subject; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Subject = S::Subject; - type Event = S::Event; type CreatedBy = S::CreatedBy; + type SubjectBlobCids = S::SubjectBlobCids; type CreatedAt = Set; type Id = S::Id; - type SubjectBlobCids = S::SubjectBlobCids; + type Event = S::Event; + type Subject = S::Subject; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type Subject = S::Subject; - type Event = S::Event; type CreatedBy = S::CreatedBy; + type SubjectBlobCids = S::SubjectBlobCids; type CreatedAt = S::CreatedAt; type Id = Set; - type SubjectBlobCids = S::SubjectBlobCids; + type Event = S::Event; + type Subject = S::Subject; } - ///State transition - sets the `subject_blob_cids` field to Set - pub struct SetSubjectBlobCids(PhantomData S>); - impl sealed::Sealed for SetSubjectBlobCids {} - impl State for SetSubjectBlobCids { + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData S>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { + type CreatedBy = S::CreatedBy; + type SubjectBlobCids = S::SubjectBlobCids; + type CreatedAt = S::CreatedAt; + type Id = S::Id; + type Event = Set; type Subject = S::Subject; - type Event = S::Event; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { type CreatedBy = S::CreatedBy; + type SubjectBlobCids = S::SubjectBlobCids; type CreatedAt = S::CreatedAt; type Id = S::Id; - type SubjectBlobCids = Set; + type Event = S::Event; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); - ///Marker type for the `event` field - pub struct event(()); ///Marker type for the `created_by` field pub struct created_by(()); + ///Marker type for the `subject_blob_cids` field + pub struct subject_blob_cids(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `subject_blob_cids` field - pub struct subject_blob_cids(()); + ///Marker type for the `event` field + pub struct event(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -8453,12 +8453,12 @@ impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> { impl<'a, S> ModEventViewBuilder<'a, S> where S: mod_event_view_state::State, - S::Subject: mod_event_view_state::IsSet, - S::Event: mod_event_view_state::IsSet, S::CreatedBy: mod_event_view_state::IsSet, + S::SubjectBlobCids: mod_event_view_state::IsSet, S::CreatedAt: mod_event_view_state::IsSet, S::Id: mod_event_view_state::IsSet, - S::SubjectBlobCids: mod_event_view_state::IsSet, + S::Event: mod_event_view_state::IsSet, + S::Subject: mod_event_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventView<'a> { @@ -8652,105 +8652,105 @@ pub mod mod_event_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; - type SubjectBlobs; - type CreatedBy; - type CreatedAt; type Event; type Subject; + type CreatedAt; + type Id; + type CreatedBy; + type SubjectBlobs; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type SubjectBlobs = Unset; - type CreatedBy = Unset; - type CreatedAt = Unset; type Event = Unset; type Subject = Unset; + type CreatedAt = Unset; + type Id = Unset; + type CreatedBy = Unset; + type SubjectBlobs = Unset; } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type SubjectBlobs = S::SubjectBlobs; + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData S>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { + type Event = Set; + type Subject = S::Subject; + type CreatedAt = S::CreatedAt; + type Id = S::Id; type CreatedBy = S::CreatedBy; + type SubjectBlobs = S::SubjectBlobs; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Event = S::Event; + type Subject = Set; type CreatedAt = S::CreatedAt; + type Id = S::Id; + type CreatedBy = S::CreatedBy; + type SubjectBlobs = S::SubjectBlobs; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { type Event = S::Event; type Subject = S::Subject; - } - ///State transition - sets the `subject_blobs` field to Set - pub struct SetSubjectBlobs(PhantomData S>); - impl sealed::Sealed for SetSubjectBlobs {} - impl State for SetSubjectBlobs { + type CreatedAt = Set; type Id = S::Id; - type SubjectBlobs = Set; type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; + type SubjectBlobs = S::SubjectBlobs; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { type Event = S::Event; type Subject = S::Subject; + type CreatedAt = S::CreatedAt; + type Id = Set; + type CreatedBy = S::CreatedBy; + type SubjectBlobs = S::SubjectBlobs; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type Id = S::Id; - type SubjectBlobs = S::SubjectBlobs; - type CreatedBy = Set; - type CreatedAt = S::CreatedAt; type Event = S::Event; type Subject = S::Subject; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + type CreatedAt = S::CreatedAt; type Id = S::Id; + type CreatedBy = Set; type SubjectBlobs = S::SubjectBlobs; - type CreatedBy = S::CreatedBy; - type CreatedAt = Set; + } + ///State transition - sets the `subject_blobs` field to Set + pub struct SetSubjectBlobs(PhantomData S>); + impl sealed::Sealed for SetSubjectBlobs {} + impl State for SetSubjectBlobs { type Event = S::Event; type Subject = S::Subject; - } - ///State transition - sets the `event` field to Set - pub struct SetEvent(PhantomData S>); - impl sealed::Sealed for SetEvent {} - impl State for SetEvent { - type Id = S::Id; - type SubjectBlobs = S::SubjectBlobs; - type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; - type Event = Set; - type Subject = S::Subject; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { type Id = S::Id; - type SubjectBlobs = S::SubjectBlobs; type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Event = S::Event; - type Subject = Set; + type SubjectBlobs = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); - ///Marker type for the `subject_blobs` field - pub struct subject_blobs(()); - ///Marker type for the `created_by` field - pub struct created_by(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `event` field pub struct event(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `id` field + pub struct id(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `subject_blobs` field + pub struct subject_blobs(()); } } @@ -8923,12 +8923,12 @@ where impl<'a, S> ModEventViewDetailBuilder<'a, S> where S: mod_event_view_detail_state::State, - S::Id: mod_event_view_detail_state::IsSet, - S::SubjectBlobs: mod_event_view_detail_state::IsSet, - S::CreatedBy: mod_event_view_detail_state::IsSet, - S::CreatedAt: mod_event_view_detail_state::IsSet, S::Event: mod_event_view_detail_state::IsSet, S::Subject: mod_event_view_detail_state::IsSet, + S::CreatedAt: mod_event_view_detail_state::IsSet, + S::Id: mod_event_view_detail_state::IsSet, + S::CreatedBy: mod_event_view_detail_state::IsSet, + S::SubjectBlobs: mod_event_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventViewDetail<'a> { @@ -9677,127 +9677,127 @@ pub mod record_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Moderation; - type Repo; - type IndexedAt; + type Uri; + type Value; type BlobCids; type Cid; - type Value; - type Uri; + type IndexedAt; + type Moderation; + type Repo; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Moderation = Unset; - type Repo = Unset; - type IndexedAt = Unset; + type Uri = Unset; + type Value = Unset; type BlobCids = Unset; type Cid = Unset; - type Value = Unset; - type Uri = Unset; + type IndexedAt = Unset; + type Moderation = Unset; + type Repo = Unset; } - ///State transition - sets the `moderation` field to Set - pub struct SetModeration(PhantomData S>); - impl sealed::Sealed for SetModeration {} - impl State for SetModeration { - type Moderation = Set; - type Repo = S::Repo; - type IndexedAt = S::IndexedAt; - type BlobCids = S::BlobCids; - type Cid = S::Cid; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type Value = S::Value; - type Uri = S::Uri; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { - type Moderation = S::Moderation; - type Repo = Set; - type IndexedAt = S::IndexedAt; type BlobCids = S::BlobCids; type Cid = S::Cid; - type Value = S::Value; - type Uri = S::Uri; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; type Repo = S::Repo; - type IndexedAt = Set; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Uri = S::Uri; + type Value = Set; type BlobCids = S::BlobCids; type Cid = S::Cid; - type Value = S::Value; - type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = S::Repo; } ///State transition - sets the `blob_cids` field to Set pub struct SetBlobCids(PhantomData S>); impl sealed::Sealed for SetBlobCids {} impl State for SetBlobCids { - type Moderation = S::Moderation; - type Repo = S::Repo; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Value = S::Value; type BlobCids = Set; type Cid = S::Cid; - type Value = S::Value; - type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = S::Repo; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Moderation = S::Moderation; - type Repo = S::Repo; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Value = S::Value; type BlobCids = S::BlobCids; type Cid = Set; - type Value = S::Value; - type Uri = S::Uri; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { + type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; type Repo = S::Repo; - type IndexedAt = S::IndexedAt; - type BlobCids = S::BlobCids; - type Cid = S::Cid; - type Value = Set; - type Uri = S::Uri; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Uri = S::Uri; + type Value = S::Value; + type BlobCids = S::BlobCids; + type Cid = S::Cid; + type IndexedAt = Set; type Moderation = S::Moderation; type Repo = S::Repo; - type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `moderation` field to Set + pub struct SetModeration(PhantomData S>); + impl sealed::Sealed for SetModeration {} + impl State for SetModeration { + type Uri = S::Uri; + type Value = S::Value; type BlobCids = S::BlobCids; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Moderation = Set; + type Repo = S::Repo; + } + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Uri = S::Uri; type Value = S::Value; - type Uri = Set; + type BlobCids = S::BlobCids; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `moderation` field - pub struct moderation(()); - ///Marker type for the `repo` field - pub struct repo(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `blob_cids` field pub struct blob_cids(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `value` field - pub struct value(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `moderation` field + pub struct moderation(()); + ///Marker type for the `repo` field + pub struct repo(()); } } @@ -9970,13 +9970,13 @@ where impl<'a, S> RecordViewBuilder<'a, S> where S: record_view_state::State, - S::Moderation: record_view_state::IsSet, - S::Repo: record_view_state::IsSet, - S::IndexedAt: record_view_state::IsSet, + S::Uri: record_view_state::IsSet, + S::Value: record_view_state::IsSet, S::BlobCids: record_view_state::IsSet, S::Cid: record_view_state::IsSet, - S::Value: record_view_state::IsSet, - S::Uri: record_view_state::IsSet, + S::IndexedAt: record_view_state::IsSet, + S::Moderation: record_view_state::IsSet, + S::Repo: record_view_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordView<'a> { @@ -10069,127 +10069,127 @@ pub mod record_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Blobs; type Value; - type IndexedAt; + type Uri; + type Moderation; + type Blobs; type Repo; + type IndexedAt; type Cid; - type Moderation; - type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Blobs = Unset; type Value = Unset; - type IndexedAt = Unset; + type Uri = Unset; + type Moderation = Unset; + type Blobs = Unset; type Repo = Unset; + type IndexedAt = Unset; type Cid = Unset; - type Moderation = Unset; - type Uri = Unset; - } - ///State transition - sets the `blobs` field to Set - pub struct SetBlobs(PhantomData S>); - impl sealed::Sealed for SetBlobs {} - impl State for SetBlobs { - type Blobs = Set; - type Value = S::Value; - type IndexedAt = S::IndexedAt; - type Repo = S::Repo; - type Cid = S::Cid; - type Moderation = S::Moderation; - type Uri = S::Uri; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Blobs = S::Blobs; type Value = Set; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Moderation = S::Moderation; + type Blobs = S::Blobs; type Repo = S::Repo; + type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type Moderation = S::Moderation; - type Uri = S::Uri; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Value = S::Value; + type Uri = Set; + type Moderation = S::Moderation; type Blobs = S::Blobs; + type Repo = S::Repo; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + } + ///State transition - sets the `moderation` field to Set + pub struct SetModeration(PhantomData S>); + impl sealed::Sealed for SetModeration {} + impl State for SetModeration { type Value = S::Value; - type IndexedAt = Set; + type Uri = S::Uri; + type Moderation = Set; + type Blobs = S::Blobs; type Repo = S::Repo; + type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type Moderation = S::Moderation; + } + ///State transition - sets the `blobs` field to Set + pub struct SetBlobs(PhantomData S>); + impl sealed::Sealed for SetBlobs {} + impl State for SetBlobs { + type Value = S::Value; type Uri = S::Uri; + type Moderation = S::Moderation; + type Blobs = Set; + type Repo = S::Repo; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Blobs = S::Blobs; type Value = S::Value; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Moderation = S::Moderation; + type Blobs = S::Blobs; type Repo = Set; + type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type Moderation = S::Moderation; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Value = S::Value; type Uri = S::Uri; + type Moderation = S::Moderation; + type Blobs = S::Blobs; + type Repo = S::Repo; + type IndexedAt = Set; + type Cid = S::Cid; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Blobs = S::Blobs; type Value = S::Value; - type IndexedAt = S::IndexedAt; - type Repo = S::Repo; - type Cid = Set; - type Moderation = S::Moderation; type Uri = S::Uri; - } - ///State transition - sets the `moderation` field to Set - pub struct SetModeration(PhantomData S>); - impl sealed::Sealed for SetModeration {} - impl State for SetModeration { + type Moderation = S::Moderation; type Blobs = S::Blobs; - type Value = S::Value; - type IndexedAt = S::IndexedAt; type Repo = S::Repo; - type Cid = S::Cid; - type Moderation = Set; - type Uri = S::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Blobs = S::Blobs; - type Value = S::Value; type IndexedAt = S::IndexedAt; - type Repo = S::Repo; - type Cid = S::Cid; - type Moderation = S::Moderation; - type Uri = Set; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `blobs` field - pub struct blobs(()); ///Marker type for the `value` field pub struct value(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `moderation` field + pub struct moderation(()); + ///Marker type for the `blobs` field + pub struct blobs(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `moderation` field - pub struct moderation(()); - ///Marker type for the `uri` field - pub struct uri(()); } } @@ -10382,13 +10382,13 @@ where impl<'a, S> RecordViewDetailBuilder<'a, S> where S: record_view_detail_state::State, - S::Blobs: record_view_detail_state::IsSet, S::Value: record_view_detail_state::IsSet, - S::IndexedAt: record_view_detail_state::IsSet, + S::Uri: record_view_detail_state::IsSet, + S::Moderation: record_view_detail_state::IsSet, + S::Blobs: record_view_detail_state::IsSet, S::Repo: record_view_detail_state::IsSet, + S::IndexedAt: record_view_detail_state::IsSet, S::Cid: record_view_detail_state::IsSet, - S::Moderation: record_view_detail_state::IsSet, - S::Uri: record_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordViewDetail<'a> { @@ -10690,84 +10690,84 @@ pub mod repo_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type IndexedAt; - type RelatedRecords; - type Moderation; type Did; + type Moderation; type Handle; + type RelatedRecords; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type IndexedAt = Unset; - type RelatedRecords = Unset; - type Moderation = Unset; type Did = Unset; + type Moderation = Unset; type Handle = Unset; + type RelatedRecords = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type IndexedAt = Set; - type RelatedRecords = S::RelatedRecords; - type Moderation = S::Moderation; type Did = S::Did; + type Moderation = S::Moderation; type Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; } - ///State transition - sets the `related_records` field to Set - pub struct SetRelatedRecords(PhantomData S>); - impl sealed::Sealed for SetRelatedRecords {} - impl State for SetRelatedRecords { + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { type IndexedAt = S::IndexedAt; - type RelatedRecords = Set; + type Did = Set; type Moderation = S::Moderation; - type Did = S::Did; type Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData S>); impl sealed::Sealed for SetModeration {} impl State for SetModeration { type IndexedAt = S::IndexedAt; - type RelatedRecords = S::RelatedRecords; - type Moderation = Set; type Did = S::Did; + type Moderation = Set; type Handle = S::Handle; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type IndexedAt = S::IndexedAt; type RelatedRecords = S::RelatedRecords; - type Moderation = S::Moderation; - type Did = Set; - type Handle = S::Handle; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type IndexedAt = S::IndexedAt; - type RelatedRecords = S::RelatedRecords; - type Moderation = S::Moderation; type Did = S::Did; + type Moderation = S::Moderation; type Handle = Set; + type RelatedRecords = S::RelatedRecords; } - /// Marker types for field names - #[allow(non_camel_case_types)] - pub mod members { - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `related_records` field - pub struct related_records(()); - ///Marker type for the `moderation` field - pub struct moderation(()); + ///State transition - sets the `related_records` field to Set + pub struct SetRelatedRecords(PhantomData S>); + impl sealed::Sealed for SetRelatedRecords {} + impl State for SetRelatedRecords { + type IndexedAt = S::IndexedAt; + type Did = S::Did; + type Moderation = S::Moderation; + type Handle = S::Handle; + type RelatedRecords = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `moderation` field + pub struct moderation(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `related_records` field + pub struct related_records(()); } } @@ -11024,10 +11024,10 @@ impl<'a, S> RepoViewBuilder<'a, S> where S: repo_view_state::State, S::IndexedAt: repo_view_state::IsSet, - S::RelatedRecords: repo_view_state::IsSet, - S::Moderation: repo_view_state::IsSet, S::Did: repo_view_state::IsSet, + S::Moderation: repo_view_state::IsSet, S::Handle: repo_view_state::IsSet, + S::RelatedRecords: repo_view_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoView<'a> { @@ -11149,85 +11149,85 @@ pub mod repo_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Handle; + type RelatedRecords; type IndexedAt; type Moderation; type Did; - type RelatedRecords; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Handle = Unset; + type RelatedRecords = Unset; type IndexedAt = Unset; type Moderation = Unset; type Did = Unset; - type RelatedRecords = Unset; + type Handle = Unset; } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type Handle = Set; + ///State transition - sets the `related_records` field to Set + pub struct SetRelatedRecords(PhantomData S>); + impl sealed::Sealed for SetRelatedRecords {} + impl State for SetRelatedRecords { + type RelatedRecords = Set; type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; type Did = S::Did; - type RelatedRecords = S::RelatedRecords; + type Handle = S::Handle; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; type IndexedAt = Set; type Moderation = S::Moderation; type Did = S::Did; - type RelatedRecords = S::RelatedRecords; + type Handle = S::Handle; } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData S>); impl sealed::Sealed for SetModeration {} impl State for SetModeration { - type Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; type IndexedAt = S::IndexedAt; type Moderation = Set; type Did = S::Did; - type RelatedRecords = S::RelatedRecords; + type Handle = S::Handle; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; type Did = Set; - type RelatedRecords = S::RelatedRecords; - } - ///State transition - sets the `related_records` field to Set - pub struct SetRelatedRecords(PhantomData S>); - impl sealed::Sealed for SetRelatedRecords {} - impl State for SetRelatedRecords { type Handle = S::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type RelatedRecords = S::RelatedRecords; type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; type Did = S::Did; - type RelatedRecords = Set; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `handle` field - pub struct handle(()); + ///Marker type for the `related_records` field + pub struct related_records(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `moderation` field pub struct moderation(()); ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `related_records` field - pub struct related_records(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -11546,11 +11546,11 @@ impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { impl<'a, S> RepoViewDetailBuilder<'a, S> where S: repo_view_detail_state::State, - S::Handle: repo_view_detail_state::IsSet, + S::RelatedRecords: repo_view_detail_state::IsSet, S::IndexedAt: repo_view_detail_state::IsSet, S::Moderation: repo_view_detail_state::IsSet, S::Did: repo_view_detail_state::IsSet, - S::RelatedRecords: repo_view_detail_state::IsSet, + S::Handle: repo_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoViewDetail<'a> { @@ -11797,177 +11797,177 @@ pub mod reporter_stats_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ReportedAccountCount; - type LabeledRecordCount; - type TakendownRecordCount; - type RecordReportCount; - type AccountReportCount; - type TakendownAccountCount; - type ReportedRecordCount; type LabeledAccountCount; type Did; + type AccountReportCount; + type ReportedRecordCount; + type RecordReportCount; + type LabeledRecordCount; + type TakendownAccountCount; + type TakendownRecordCount; + type ReportedAccountCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ReportedAccountCount = Unset; - type LabeledRecordCount = Unset; - type TakendownRecordCount = Unset; - type RecordReportCount = Unset; - type AccountReportCount = Unset; - type TakendownAccountCount = Unset; - type ReportedRecordCount = Unset; type LabeledAccountCount = Unset; type Did = Unset; + type AccountReportCount = Unset; + type ReportedRecordCount = Unset; + type RecordReportCount = Unset; + type LabeledRecordCount = Unset; + type TakendownAccountCount = Unset; + type TakendownRecordCount = Unset; + type ReportedAccountCount = Unset; } - ///State transition - sets the `reported_account_count` field to Set - pub struct SetReportedAccountCount(PhantomData S>); - impl sealed::Sealed for SetReportedAccountCount {} - impl State for SetReportedAccountCount { - type ReportedAccountCount = Set; + ///State transition - sets the `labeled_account_count` field to Set + pub struct SetLabeledAccountCount(PhantomData S>); + impl sealed::Sealed for SetLabeledAccountCount {} + impl State for SetLabeledAccountCount { + type LabeledAccountCount = Set; + type Did = S::Did; + type AccountReportCount = S::AccountReportCount; + type ReportedRecordCount = S::ReportedRecordCount; + type RecordReportCount = S::RecordReportCount; type LabeledRecordCount = S::LabeledRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; type TakendownRecordCount = S::TakendownRecordCount; - type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type LabeledAccountCount = S::LabeledAccountCount; + type Did = Set; type AccountReportCount = S::AccountReportCount; - type TakendownAccountCount = S::TakendownAccountCount; type ReportedRecordCount = S::ReportedRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; - type Did = S::Did; - } - ///State transition - sets the `labeled_record_count` field to Set - pub struct SetLabeledRecordCount(PhantomData S>); - impl sealed::Sealed for SetLabeledRecordCount {} - impl State for SetLabeledRecordCount { - type ReportedAccountCount = S::ReportedAccountCount; - type LabeledRecordCount = Set; - type TakendownRecordCount = S::TakendownRecordCount; type RecordReportCount = S::RecordReportCount; - type AccountReportCount = S::AccountReportCount; + type LabeledRecordCount = S::LabeledRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedAccountCount = S::ReportedAccountCount; + } + ///State transition - sets the `account_report_count` field to Set + pub struct SetAccountReportCount(PhantomData S>); + impl sealed::Sealed for SetAccountReportCount {} + impl State for SetAccountReportCount { type LabeledAccountCount = S::LabeledAccountCount; type Did = S::Did; - } - ///State transition - sets the `takendown_record_count` field to Set - pub struct SetTakendownRecordCount(PhantomData S>); - impl sealed::Sealed for SetTakendownRecordCount {} - impl State for SetTakendownRecordCount { - type ReportedAccountCount = S::ReportedAccountCount; - type LabeledRecordCount = S::LabeledRecordCount; - type TakendownRecordCount = Set; + type AccountReportCount = Set; + type ReportedRecordCount = S::ReportedRecordCount; type RecordReportCount = S::RecordReportCount; - type AccountReportCount = S::AccountReportCount; + type LabeledRecordCount = S::LabeledRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedAccountCount = S::ReportedAccountCount; + } + ///State transition - sets the `reported_record_count` field to Set + pub struct SetReportedRecordCount(PhantomData S>); + impl sealed::Sealed for SetReportedRecordCount {} + impl State for SetReportedRecordCount { type LabeledAccountCount = S::LabeledAccountCount; type Did = S::Did; + type AccountReportCount = S::AccountReportCount; + type ReportedRecordCount = Set; + type RecordReportCount = S::RecordReportCount; + type LabeledRecordCount = S::LabeledRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedAccountCount = S::ReportedAccountCount; } ///State transition - sets the `record_report_count` field to Set pub struct SetRecordReportCount(PhantomData S>); impl sealed::Sealed for SetRecordReportCount {} impl State for SetRecordReportCount { - type ReportedAccountCount = S::ReportedAccountCount; - type LabeledRecordCount = S::LabeledRecordCount; - type TakendownRecordCount = S::TakendownRecordCount; - type RecordReportCount = Set; - type AccountReportCount = S::AccountReportCount; - type TakendownAccountCount = S::TakendownAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; type LabeledAccountCount = S::LabeledAccountCount; type Did = S::Did; - } - ///State transition - sets the `account_report_count` field to Set - pub struct SetAccountReportCount(PhantomData S>); - impl sealed::Sealed for SetAccountReportCount {} - impl State for SetAccountReportCount { - type ReportedAccountCount = S::ReportedAccountCount; + type AccountReportCount = S::AccountReportCount; + type ReportedRecordCount = S::ReportedRecordCount; + type RecordReportCount = Set; type LabeledRecordCount = S::LabeledRecordCount; - type TakendownRecordCount = S::TakendownRecordCount; - type RecordReportCount = S::RecordReportCount; - type AccountReportCount = Set; type TakendownAccountCount = S::TakendownAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedAccountCount = S::ReportedAccountCount; + } + ///State transition - sets the `labeled_record_count` field to Set + pub struct SetLabeledRecordCount(PhantomData S>); + impl sealed::Sealed for SetLabeledRecordCount {} + impl State for SetLabeledRecordCount { type LabeledAccountCount = S::LabeledAccountCount; type Did = S::Did; + type AccountReportCount = S::AccountReportCount; + type ReportedRecordCount = S::ReportedRecordCount; + type RecordReportCount = S::RecordReportCount; + type LabeledRecordCount = Set; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedAccountCount = S::ReportedAccountCount; } ///State transition - sets the `takendown_account_count` field to Set pub struct SetTakendownAccountCount(PhantomData S>); impl sealed::Sealed for SetTakendownAccountCount {} impl State for SetTakendownAccountCount { - type ReportedAccountCount = S::ReportedAccountCount; - type LabeledRecordCount = S::LabeledRecordCount; - type TakendownRecordCount = S::TakendownRecordCount; - type RecordReportCount = S::RecordReportCount; - type AccountReportCount = S::AccountReportCount; - type TakendownAccountCount = Set; - type ReportedRecordCount = S::ReportedRecordCount; type LabeledAccountCount = S::LabeledAccountCount; type Did = S::Did; - } - ///State transition - sets the `reported_record_count` field to Set - pub struct SetReportedRecordCount(PhantomData S>); - impl sealed::Sealed for SetReportedRecordCount {} - impl State for SetReportedRecordCount { - type ReportedAccountCount = S::ReportedAccountCount; + type AccountReportCount = S::AccountReportCount; + type ReportedRecordCount = S::ReportedRecordCount; + type RecordReportCount = S::RecordReportCount; type LabeledRecordCount = S::LabeledRecordCount; + type TakendownAccountCount = Set; type TakendownRecordCount = S::TakendownRecordCount; - type RecordReportCount = S::RecordReportCount; - type AccountReportCount = S::AccountReportCount; - type TakendownAccountCount = S::TakendownAccountCount; - type ReportedRecordCount = Set; + type ReportedAccountCount = S::ReportedAccountCount; + } + ///State transition - sets the `takendown_record_count` field to Set + pub struct SetTakendownRecordCount(PhantomData S>); + impl sealed::Sealed for SetTakendownRecordCount {} + impl State for SetTakendownRecordCount { type LabeledAccountCount = S::LabeledAccountCount; type Did = S::Did; - } - ///State transition - sets the `labeled_account_count` field to Set - pub struct SetLabeledAccountCount(PhantomData S>); - impl sealed::Sealed for SetLabeledAccountCount {} - impl State for SetLabeledAccountCount { - type ReportedAccountCount = S::ReportedAccountCount; - type LabeledRecordCount = S::LabeledRecordCount; - type TakendownRecordCount = S::TakendownRecordCount; - type RecordReportCount = S::RecordReportCount; type AccountReportCount = S::AccountReportCount; - type TakendownAccountCount = S::TakendownAccountCount; type ReportedRecordCount = S::ReportedRecordCount; - type LabeledAccountCount = Set; - type Did = S::Did; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type ReportedAccountCount = S::ReportedAccountCount; - type LabeledRecordCount = S::LabeledRecordCount; - type TakendownRecordCount = S::TakendownRecordCount; type RecordReportCount = S::RecordReportCount; - type AccountReportCount = S::AccountReportCount; + type LabeledRecordCount = S::LabeledRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; - type Did = Set; + type TakendownRecordCount = Set; + type ReportedAccountCount = S::ReportedAccountCount; } - /// Marker types for field names - #[allow(non_camel_case_types)] - pub mod members { - ///Marker type for the `reported_account_count` field - pub struct reported_account_count(()); - ///Marker type for the `labeled_record_count` field - pub struct labeled_record_count(()); - ///Marker type for the `takendown_record_count` field - pub struct takendown_record_count(()); - ///Marker type for the `record_report_count` field - pub struct record_report_count(()); - ///Marker type for the `account_report_count` field - pub struct account_report_count(()); - ///Marker type for the `takendown_account_count` field - pub struct takendown_account_count(()); - ///Marker type for the `reported_record_count` field - pub struct reported_record_count(()); + ///State transition - sets the `reported_account_count` field to Set + pub struct SetReportedAccountCount(PhantomData S>); + impl sealed::Sealed for SetReportedAccountCount {} + impl State for SetReportedAccountCount { + type LabeledAccountCount = S::LabeledAccountCount; + type Did = S::Did; + type AccountReportCount = S::AccountReportCount; + type ReportedRecordCount = S::ReportedRecordCount; + type RecordReportCount = S::RecordReportCount; + type LabeledRecordCount = S::LabeledRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedAccountCount = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { ///Marker type for the `labeled_account_count` field pub struct labeled_account_count(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `account_report_count` field + pub struct account_report_count(()); + ///Marker type for the `reported_record_count` field + pub struct reported_record_count(()); + ///Marker type for the `record_report_count` field + pub struct record_report_count(()); + ///Marker type for the `labeled_record_count` field + pub struct labeled_record_count(()); + ///Marker type for the `takendown_account_count` field + pub struct takendown_account_count(()); + ///Marker type for the `takendown_record_count` field + pub struct takendown_record_count(()); + ///Marker type for the `reported_account_count` field + pub struct reported_account_count(()); } } @@ -12190,15 +12190,15 @@ where impl<'a, S> ReporterStatsBuilder<'a, S> where S: reporter_stats_state::State, - S::ReportedAccountCount: reporter_stats_state::IsSet, - S::LabeledRecordCount: reporter_stats_state::IsSet, - S::TakendownRecordCount: reporter_stats_state::IsSet, - S::RecordReportCount: reporter_stats_state::IsSet, - S::AccountReportCount: reporter_stats_state::IsSet, - S::TakendownAccountCount: reporter_stats_state::IsSet, - S::ReportedRecordCount: reporter_stats_state::IsSet, S::LabeledAccountCount: reporter_stats_state::IsSet, S::Did: reporter_stats_state::IsSet, + S::AccountReportCount: reporter_stats_state::IsSet, + S::ReportedRecordCount: reporter_stats_state::IsSet, + S::RecordReportCount: reporter_stats_state::IsSet, + S::LabeledRecordCount: reporter_stats_state::IsSet, + S::TakendownAccountCount: reporter_stats_state::IsSet, + S::TakendownRecordCount: reporter_stats_state::IsSet, + S::ReportedAccountCount: reporter_stats_state::IsSet, { /// Build the final struct pub fn build(self) -> ReporterStats<'a> { @@ -12476,105 +12476,105 @@ pub mod scheduled_action_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Did; type CreatedAt; type Status; + type CreatedBy; type Id; - type Did; type Action; - type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Did = Unset; type CreatedAt = Unset; type Status = Unset; + type CreatedBy = Unset; type Id = Unset; - type Did = Unset; type Action = Unset; - type CreatedBy = Unset; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; + type CreatedAt = S::CreatedAt; + type Status = S::Status; + type CreatedBy = S::CreatedBy; + type Id = S::Id; + type Action = S::Action; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { + type Did = S::Did; type CreatedAt = Set; type Status = S::Status; + type CreatedBy = S::CreatedBy; type Id = S::Id; - type Did = S::Did; type Action = S::Action; - type CreatedBy = S::CreatedBy; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { + type Did = S::Did; type CreatedAt = S::CreatedAt; type Status = Set; + type CreatedBy = S::CreatedBy; type Id = S::Id; + type Action = S::Action; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { type Did = S::Did; + type CreatedAt = S::CreatedAt; + type Status = S::Status; + type CreatedBy = Set; + type Id = S::Id; type Action = S::Action; - type CreatedBy = S::CreatedBy; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type CreatedAt = S::CreatedAt; - type Status = S::Status; - type Id = Set; type Did = S::Did; - type Action = S::Action; - type CreatedBy = S::CreatedBy; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { type CreatedAt = S::CreatedAt; type Status = S::Status; - type Id = S::Id; - type Did = Set; - type Action = S::Action; type CreatedBy = S::CreatedBy; + type Id = Set; + type Action = S::Action; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type CreatedAt = S::CreatedAt; - type Status = S::Status; - type Id = S::Id; type Did = S::Did; - type Action = Set; - type CreatedBy = S::CreatedBy; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { type CreatedAt = S::CreatedAt; type Status = S::Status; + type CreatedBy = S::CreatedBy; type Id = S::Id; - type Did = S::Did; - type Action = S::Action; - type CreatedBy = Set; + type Action = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `created_by` field + pub struct created_by(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `action` field pub struct action(()); - ///Marker type for the `created_by` field - pub struct created_by(()); } } @@ -12911,12 +12911,12 @@ impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S impl<'a, S> ScheduledActionViewBuilder<'a, S> where S: scheduled_action_view_state::State, + S::Did: scheduled_action_view_state::IsSet, S::CreatedAt: scheduled_action_view_state::IsSet, S::Status: scheduled_action_view_state::IsSet, + S::CreatedBy: scheduled_action_view_state::IsSet, S::Id: scheduled_action_view_state::IsSet, - S::Did: scheduled_action_view_state::IsSet, S::Action: scheduled_action_view_state::IsSet, - S::CreatedBy: scheduled_action_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ScheduledActionView<'a> { @@ -13401,85 +13401,85 @@ pub mod subject_status_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; - type CreatedAt; + type Subject; type ReviewState; type UpdatedAt; - type Subject; + type CreatedAt; + type Id; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type CreatedAt = Unset; + type Subject = Unset; type ReviewState = Unset; type UpdatedAt = Unset; - type Subject = Unset; + type CreatedAt = Unset; + type Id = Unset; } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type CreatedAt = S::CreatedAt; + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Subject = Set; type ReviewState = S::ReviewState; type UpdatedAt = S::UpdatedAt; - type Subject = S::Subject; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + type CreatedAt = S::CreatedAt; type Id = S::Id; - type CreatedAt = Set; - type ReviewState = S::ReviewState; - type UpdatedAt = S::UpdatedAt; - type Subject = S::Subject; } ///State transition - sets the `review_state` field to Set pub struct SetReviewState(PhantomData S>); impl sealed::Sealed for SetReviewState {} impl State for SetReviewState { - type Id = S::Id; - type CreatedAt = S::CreatedAt; + type Subject = S::Subject; type ReviewState = Set; type UpdatedAt = S::UpdatedAt; - type Subject = S::Subject; + type CreatedAt = S::CreatedAt; + type Id = S::Id; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { - type Id = S::Id; - type CreatedAt = S::CreatedAt; + type Subject = S::Subject; type ReviewState = S::ReviewState; type UpdatedAt = Set; - type Subject = S::Subject; + type CreatedAt = S::CreatedAt; + type Id = S::Id; } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type ReviewState = S::ReviewState; + type UpdatedAt = S::UpdatedAt; + type CreatedAt = Set; type Id = S::Id; - type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Subject = S::Subject; type ReviewState = S::ReviewState; type UpdatedAt = S::UpdatedAt; - type Subject = Set; + type CreatedAt = S::CreatedAt; + type Id = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); - ///Marker type for the `created_at` field - pub struct created_at(()); + ///Marker type for the `subject` field + pub struct subject(()); ///Marker type for the `review_state` field pub struct review_state(()); ///Marker type for the `updated_at` field pub struct updated_at(()); - ///Marker type for the `subject` field - pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `id` field + pub struct id(()); } } @@ -14014,11 +14014,11 @@ where impl<'a, S> SubjectStatusViewBuilder<'a, S> where S: subject_status_view_state::State, - S::Id: subject_status_view_state::IsSet, - S::CreatedAt: subject_status_view_state::IsSet, + S::Subject: subject_status_view_state::IsSet, S::ReviewState: subject_status_view_state::IsSet, S::UpdatedAt: subject_status_view_state::IsSet, - S::Subject: subject_status_view_state::IsSet, + S::CreatedAt: subject_status_view_state::IsSet, + S::Id: subject_status_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SubjectStatusView<'a> { @@ -14425,37 +14425,37 @@ pub mod subject_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Type; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type Type = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type Type = S::Type; + type Subject = Unset; } ///State transition - sets the `type` field to Set pub struct SetType(PhantomData S>); impl sealed::Sealed for SetType {} impl State for SetType { - type Subject = S::Subject; type Type = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Type = S::Type; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `type` field pub struct r#type(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -14608,8 +14608,8 @@ where impl<'a, S> SubjectViewBuilder<'a, S> where S: subject_view_state::State, - S::Subject: subject_view_state::IsSet, S::Type: subject_view_state::IsSet, + S::Subject: subject_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SubjectView<'a> { @@ -14741,49 +14741,49 @@ pub mod video_details_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Height; type Width; + type Height; type Length; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Height = Unset; type Width = Unset; + type Height = Unset; type Length = Unset; } - ///State transition - sets the `height` field to Set - pub struct SetHeight(PhantomData S>); - impl sealed::Sealed for SetHeight {} - impl State for SetHeight { - type Height = Set; - type Width = S::Width; - type Length = S::Length; - } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData S>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Height = S::Height; type Width = Set; + type Height = S::Height; + type Length = S::Length; + } + ///State transition - sets the `height` field to Set + pub struct SetHeight(PhantomData S>); + impl sealed::Sealed for SetHeight {} + impl State for SetHeight { + type Width = S::Width; + type Height = Set; type Length = S::Length; } ///State transition - sets the `length` field to Set pub struct SetLength(PhantomData S>); impl sealed::Sealed for SetLength {} impl State for SetLength { - type Height = S::Height; type Width = S::Width; + type Height = S::Height; type Length = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `height` field - pub struct height(()); ///Marker type for the `width` field pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); ///Marker type for the `length` field pub struct length(()); } @@ -14878,8 +14878,8 @@ where impl<'a, S> VideoDetailsBuilder<'a, S> where S: video_details_state::State, - S::Height: video_details_state::IsSet, S::Width: video_details_state::IsSet, + S::Height: video_details_state::IsSet, S::Length: video_details_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs b/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs index 58cf9d4..d8b726b 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs @@ -219,37 +219,37 @@ pub mod timeline_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Summary; type Day; + type Summary; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Summary = Unset; type Day = Unset; - } - ///State transition - sets the `summary` field to Set - pub struct SetSummary(PhantomData S>); - impl sealed::Sealed for SetSummary {} - impl State for SetSummary { - type Summary = Set; - type Day = S::Day; + type Summary = Unset; } ///State transition - sets the `day` field to Set pub struct SetDay(PhantomData S>); impl sealed::Sealed for SetDay {} impl State for SetDay { - type Summary = S::Summary; type Day = Set; + type Summary = S::Summary; + } + ///State transition - sets the `summary` field to Set + pub struct SetSummary(PhantomData S>); + impl sealed::Sealed for SetSummary {} + impl State for SetSummary { + type Day = S::Day; + type Summary = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `summary` field - pub struct summary(()); ///Marker type for the `day` field pub struct day(()); + ///Marker type for the `summary` field + pub struct summary(()); } } @@ -334,8 +334,8 @@ where impl<'a, S> TimelineItemBuilder<'a, S> where S: timeline_item_state::State, - S::Summary: timeline_item_state::IsSet, S::Day: timeline_item_state::IsSet, + S::Summary: timeline_item_state::IsSet, { /// Build the final struct pub fn build(self) -> TimelineItem<'a> { @@ -575,49 +575,49 @@ pub mod timeline_item_summary_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type EventSubjectType; type Count; + type EventSubjectType; type EventType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type EventSubjectType = Unset; type Count = Unset; + type EventSubjectType = Unset; type EventType = Unset; } - ///State transition - sets the `event_subject_type` field to Set - pub struct SetEventSubjectType(PhantomData S>); - impl sealed::Sealed for SetEventSubjectType {} - impl State for SetEventSubjectType { - type EventSubjectType = Set; - type Count = S::Count; - type EventType = S::EventType; - } ///State transition - sets the `count` field to Set pub struct SetCount(PhantomData S>); impl sealed::Sealed for SetCount {} impl State for SetCount { - type EventSubjectType = S::EventSubjectType; type Count = Set; + type EventSubjectType = S::EventSubjectType; + type EventType = S::EventType; + } + ///State transition - sets the `event_subject_type` field to Set + pub struct SetEventSubjectType(PhantomData S>); + impl sealed::Sealed for SetEventSubjectType {} + impl State for SetEventSubjectType { + type Count = S::Count; + type EventSubjectType = Set; type EventType = S::EventType; } ///State transition - sets the `event_type` field to Set pub struct SetEventType(PhantomData S>); impl sealed::Sealed for SetEventType {} impl State for SetEventType { - type EventSubjectType = S::EventSubjectType; type Count = S::Count; + type EventSubjectType = S::EventSubjectType; type EventType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `event_subject_type` field - pub struct event_subject_type(()); ///Marker type for the `count` field pub struct count(()); + ///Marker type for the `event_subject_type` field + pub struct event_subject_type(()); ///Marker type for the `event_type` field pub struct event_type(()); } @@ -715,8 +715,8 @@ where impl<'a, S> TimelineItemSummaryBuilder<'a, S> where S: timeline_item_summary_state::State, - S::EventSubjectType: timeline_item_summary_state::IsSet, S::Count: timeline_item_summary_state::IsSet, + S::EventSubjectType: timeline_item_summary_state::IsSet, S::EventType: timeline_item_summary_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs index 4d279ea..a3a7bdd 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs @@ -761,67 +761,67 @@ pub mod schedule_action_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subjects; type Action; - type Scheduling; + type Subjects; type CreatedBy; + type Scheduling; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subjects = Unset; type Action = Unset; - type Scheduling = Unset; + type Subjects = Unset; type CreatedBy = Unset; - } - ///State transition - sets the `subjects` field to Set - pub struct SetSubjects(PhantomData S>); - impl sealed::Sealed for SetSubjects {} - impl State for SetSubjects { - type Subjects = Set; - type Action = S::Action; - type Scheduling = S::Scheduling; - type CreatedBy = S::CreatedBy; + type Scheduling = Unset; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type Subjects = S::Subjects; type Action = Set; - type Scheduling = S::Scheduling; + type Subjects = S::Subjects; type CreatedBy = S::CreatedBy; + type Scheduling = S::Scheduling; } - ///State transition - sets the `scheduling` field to Set - pub struct SetScheduling(PhantomData S>); - impl sealed::Sealed for SetScheduling {} - impl State for SetScheduling { - type Subjects = S::Subjects; + ///State transition - sets the `subjects` field to Set + pub struct SetSubjects(PhantomData S>); + impl sealed::Sealed for SetSubjects {} + impl State for SetSubjects { type Action = S::Action; - type Scheduling = Set; + type Subjects = Set; type CreatedBy = S::CreatedBy; + type Scheduling = S::Scheduling; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type Subjects = S::Subjects; type Action = S::Action; - type Scheduling = S::Scheduling; + type Subjects = S::Subjects; type CreatedBy = Set; + type Scheduling = S::Scheduling; + } + ///State transition - sets the `scheduling` field to Set + pub struct SetScheduling(PhantomData S>); + impl sealed::Sealed for SetScheduling {} + impl State for SetScheduling { + type Action = S::Action; + type Subjects = S::Subjects; + type CreatedBy = S::CreatedBy; + type Scheduling = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subjects` field - pub struct subjects(()); ///Marker type for the `action` field pub struct action(()); - ///Marker type for the `scheduling` field - pub struct scheduling(()); + ///Marker type for the `subjects` field + pub struct subjects(()); ///Marker type for the `created_by` field pub struct created_by(()); + ///Marker type for the `scheduling` field + pub struct scheduling(()); } } @@ -960,10 +960,10 @@ where impl<'a, S> ScheduleActionBuilder<'a, S> where S: schedule_action_state::State, - S::Subjects: schedule_action_state::IsSet, S::Action: schedule_action_state::IsSet, - S::Scheduling: schedule_action_state::IsSet, + S::Subjects: schedule_action_state::IsSet, S::CreatedBy: schedule_action_state::IsSet, + S::Scheduling: schedule_action_state::IsSet, { /// Build the final struct pub fn build(self) -> ScheduleAction<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink.rs b/crates/weaver-api/src/tools_ozone/safelink.rs index 0b26e38..0e65a28 100644 --- a/crates/weaver-api/src/tools_ozone/safelink.rs +++ b/crates/weaver-api/src/tools_ozone/safelink.rs @@ -144,151 +144,151 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Pattern; - type Url; - type Action; type CreatedAt; - type Id; - type EventType; type CreatedBy; + type EventType; + type Action; + type Id; type Reason; + type Url; + type Pattern; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Pattern = Unset; - type Url = Unset; - type Action = Unset; type CreatedAt = Unset; - type Id = Unset; - type EventType = Unset; type CreatedBy = Unset; + type EventType = Unset; + type Action = Unset; + type Id = Unset; type Reason = Unset; + type Url = Unset; + type Pattern = Unset; } - ///State transition - sets the `pattern` field to Set - pub struct SetPattern(PhantomData S>); - impl sealed::Sealed for SetPattern {} - impl State for SetPattern { - type Pattern = Set; - type Url = S::Url; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type CreatedBy = S::CreatedBy; + type EventType = S::EventType; type Action = S::Action; - type CreatedAt = S::CreatedAt; type Id = S::Id; - type EventType = S::EventType; - type CreatedBy = S::CreatedBy; type Reason = S::Reason; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { + type Url = S::Url; type Pattern = S::Pattern; - type Url = Set; - type Action = S::Action; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { type CreatedAt = S::CreatedAt; - type Id = S::Id; + type CreatedBy = Set; type EventType = S::EventType; + type Action = S::Action; + type Id = S::Id; + type Reason = S::Reason; + type Url = S::Url; + type Pattern = S::Pattern; + } + ///State transition - sets the `event_type` field to Set + pub struct SetEventType(PhantomData S>); + impl sealed::Sealed for SetEventType {} + impl State for SetEventType { + type CreatedAt = S::CreatedAt; type CreatedBy = S::CreatedBy; + type EventType = Set; + type Action = S::Action; + type Id = S::Id; type Reason = S::Reason; + type Url = S::Url; + type Pattern = S::Pattern; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type Pattern = S::Pattern; - type Url = S::Url; - type Action = Set; type CreatedAt = S::CreatedAt; - type Id = S::Id; - type EventType = S::EventType; type CreatedBy = S::CreatedBy; - type Reason = S::Reason; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Pattern = S::Pattern; - type Url = S::Url; - type Action = S::Action; - type CreatedAt = Set; - type Id = S::Id; type EventType = S::EventType; - type CreatedBy = S::CreatedBy; + type Action = Set; + type Id = S::Id; type Reason = S::Reason; + type Url = S::Url; + type Pattern = S::Pattern; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type Pattern = S::Pattern; - type Url = S::Url; - type Action = S::Action; type CreatedAt = S::CreatedAt; - type Id = Set; - type EventType = S::EventType; type CreatedBy = S::CreatedBy; - type Reason = S::Reason; - } - ///State transition - sets the `event_type` field to Set - pub struct SetEventType(PhantomData S>); - impl sealed::Sealed for SetEventType {} - impl State for SetEventType { - type Pattern = S::Pattern; - type Url = S::Url; + type EventType = S::EventType; type Action = S::Action; - type CreatedAt = S::CreatedAt; - type Id = S::Id; - type EventType = Set; - type CreatedBy = S::CreatedBy; + type Id = Set; type Reason = S::Reason; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type Pattern = S::Pattern; type Url = S::Url; - type Action = S::Action; - type CreatedAt = S::CreatedAt; - type Id = S::Id; - type EventType = S::EventType; - type CreatedBy = Set; - type Reason = S::Reason; + type Pattern = S::Pattern; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); impl sealed::Sealed for SetReason {} impl State for SetReason { - type Pattern = S::Pattern; - type Url = S::Url; - type Action = S::Action; type CreatedAt = S::CreatedAt; + type CreatedBy = S::CreatedBy; + type EventType = S::EventType; + type Action = S::Action; type Id = S::Id; + type Reason = Set; + type Url = S::Url; + type Pattern = S::Pattern; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type CreatedAt = S::CreatedAt; + type CreatedBy = S::CreatedBy; type EventType = S::EventType; + type Action = S::Action; + type Id = S::Id; + type Reason = S::Reason; + type Url = Set; + type Pattern = S::Pattern; + } + ///State transition - sets the `pattern` field to Set + pub struct SetPattern(PhantomData S>); + impl sealed::Sealed for SetPattern {} + impl State for SetPattern { + type CreatedAt = S::CreatedAt; type CreatedBy = S::CreatedBy; - type Reason = Set; + type EventType = S::EventType; + type Action = S::Action; + type Id = S::Id; + type Reason = S::Reason; + type Url = S::Url; + type Pattern = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `pattern` field - pub struct pattern(()); - ///Marker type for the `url` field - pub struct url(()); - ///Marker type for the `action` field - pub struct action(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `id` field - pub struct id(()); - ///Marker type for the `event_type` field - pub struct event_type(()); ///Marker type for the `created_by` field pub struct created_by(()); + ///Marker type for the `event_type` field + pub struct event_type(()); + ///Marker type for the `action` field + pub struct action(()); + ///Marker type for the `id` field + pub struct id(()); ///Marker type for the `reason` field pub struct reason(()); + ///Marker type for the `url` field + pub struct url(()); + ///Marker type for the `pattern` field + pub struct pattern(()); } } @@ -508,14 +508,14 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, - S::Pattern: event_state::IsSet, - S::Url: event_state::IsSet, - S::Action: event_state::IsSet, S::CreatedAt: event_state::IsSet, - S::Id: event_state::IsSet, - S::EventType: event_state::IsSet, S::CreatedBy: event_state::IsSet, + S::EventType: event_state::IsSet, + S::Action: event_state::IsSet, + S::Id: event_state::IsSet, S::Reason: event_state::IsSet, + S::Url: event_state::IsSet, + S::Pattern: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { @@ -1258,126 +1258,126 @@ pub mod url_rule_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type CreatedAt; - type UpdatedAt; - type Url; - type Pattern; - type Reason; type Action; + type Reason; type CreatedBy; + type Url; + type Pattern; + type UpdatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type CreatedAt = Unset; - type UpdatedAt = Unset; - type Url = Unset; - type Pattern = Unset; - type Reason = Unset; type Action = Unset; + type Reason = Unset; type CreatedBy = Unset; + type Url = Unset; + type Pattern = Unset; + type UpdatedAt = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type CreatedAt = Set; - type UpdatedAt = S::UpdatedAt; + type Action = S::Action; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; type Url = S::Url; type Pattern = S::Pattern; + type UpdatedAt = S::UpdatedAt; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData S>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { + type CreatedAt = S::CreatedAt; + type Action = Set; type Reason = S::Reason; - type Action = S::Action; type CreatedBy = S::CreatedBy; + type Url = S::Url; + type Pattern = S::Pattern; + type UpdatedAt = S::UpdatedAt; } - ///State transition - sets the `updated_at` field to Set - pub struct SetUpdatedAt(PhantomData S>); - impl sealed::Sealed for SetUpdatedAt {} - impl State for SetUpdatedAt { + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { type CreatedAt = S::CreatedAt; - type UpdatedAt = Set; + type Action = S::Action; + type Reason = Set; + type CreatedBy = S::CreatedBy; type Url = S::Url; type Pattern = S::Pattern; - type Reason = S::Reason; + type UpdatedAt = S::UpdatedAt; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type CreatedAt = S::CreatedAt; type Action = S::Action; - type CreatedBy = S::CreatedBy; + type Reason = S::Reason; + type CreatedBy = Set; + type Url = S::Url; + type Pattern = S::Pattern; + type UpdatedAt = S::UpdatedAt; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; - type Url = Set; - type Pattern = S::Pattern; - type Reason = S::Reason; type Action = S::Action; + type Reason = S::Reason; type CreatedBy = S::CreatedBy; + type Url = Set; + type Pattern = S::Pattern; + type UpdatedAt = S::UpdatedAt; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; - type Url = S::Url; - type Pattern = Set; - type Reason = S::Reason; type Action = S::Action; + type Reason = S::Reason; type CreatedBy = S::CreatedBy; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; type Url = S::Url; - type Pattern = S::Pattern; - type Reason = Set; - type Action = S::Action; - type CreatedBy = S::CreatedBy; + type Pattern = Set; + type UpdatedAt = S::UpdatedAt; } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { + ///State transition - sets the `updated_at` field to Set + pub struct SetUpdatedAt(PhantomData S>); + impl sealed::Sealed for SetUpdatedAt {} + impl State for SetUpdatedAt { type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; - type Url = S::Url; - type Pattern = S::Pattern; + type Action = S::Action; type Reason = S::Reason; - type Action = Set; type CreatedBy = S::CreatedBy; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; type Url = S::Url; type Pattern = S::Pattern; - type Reason = S::Reason; - type Action = S::Action; - type CreatedBy = Set; + type UpdatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `updated_at` field - pub struct updated_at(()); - ///Marker type for the `url` field - pub struct url(()); - ///Marker type for the `pattern` field - pub struct pattern(()); - ///Marker type for the `reason` field - pub struct reason(()); ///Marker type for the `action` field pub struct action(()); + ///Marker type for the `reason` field + pub struct reason(()); ///Marker type for the `created_by` field pub struct created_by(()); + ///Marker type for the `url` field + pub struct url(()); + ///Marker type for the `pattern` field + pub struct pattern(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); } } @@ -1568,12 +1568,12 @@ impl<'a, S> UrlRuleBuilder<'a, S> where S: url_rule_state::State, S::CreatedAt: url_rule_state::IsSet, - S::UpdatedAt: url_rule_state::IsSet, - S::Url: url_rule_state::IsSet, - S::Pattern: url_rule_state::IsSet, - S::Reason: url_rule_state::IsSet, S::Action: url_rule_state::IsSet, + S::Reason: url_rule_state::IsSet, S::CreatedBy: url_rule_state::IsSet, + S::Url: url_rule_state::IsSet, + S::Pattern: url_rule_state::IsSet, + S::UpdatedAt: url_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> UrlRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs index c49f347..94aa424 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs @@ -46,67 +46,67 @@ pub mod add_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Url; - type Action; type Reason; + type Url; type Pattern; + type Action; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Url = Unset; - type Action = Unset; type Reason = Unset; + type Url = Unset; type Pattern = Unset; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { - type Url = Set; - type Action = S::Action; - type Reason = S::Reason; - type Pattern = S::Pattern; - } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Url = S::Url; - type Action = Set; - type Reason = S::Reason; - type Pattern = S::Pattern; + type Action = Unset; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); impl sealed::Sealed for SetReason {} impl State for SetReason { + type Reason = Set; type Url = S::Url; + type Pattern = S::Pattern; type Action = S::Action; - type Reason = Set; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Reason = S::Reason; + type Url = Set; type Pattern = S::Pattern; + type Action = S::Action; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { + type Reason = S::Reason; type Url = S::Url; + type Pattern = Set; type Action = S::Action; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData S>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { type Reason = S::Reason; - type Pattern = Set; + type Url = S::Url; + type Pattern = S::Pattern; + type Action = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `url` field - pub struct url(()); - ///Marker type for the `action` field - pub struct action(()); ///Marker type for the `reason` field pub struct reason(()); + ///Marker type for the `url` field + pub struct url(()); ///Marker type for the `pattern` field pub struct pattern(()); + ///Marker type for the `action` field + pub struct action(()); } } @@ -256,10 +256,10 @@ where impl<'a, S> AddRuleBuilder<'a, S> where S: add_rule_state::State, - S::Url: add_rule_state::IsSet, - S::Action: add_rule_state::IsSet, S::Reason: add_rule_state::IsSet, + S::Url: add_rule_state::IsSet, S::Pattern: add_rule_state::IsSet, + S::Action: add_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> AddRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs index dd96902..45dfdab 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs @@ -42,37 +42,37 @@ pub mod remove_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Url; type Pattern; + type Url; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Url = Unset; type Pattern = Unset; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { - type Url = Set; - type Pattern = S::Pattern; + type Url = Unset; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { - type Url = S::Url; type Pattern = Set; + type Url = S::Url; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Pattern = S::Pattern; + type Url = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `url` field - pub struct url(()); ///Marker type for the `pattern` field pub struct pattern(()); + ///Marker type for the `url` field + pub struct url(()); } } @@ -182,8 +182,8 @@ where impl<'a, S> RemoveRuleBuilder<'a, S> where S: remove_rule_state::State, - S::Url: remove_rule_state::IsSet, S::Pattern: remove_rule_state::IsSet, + S::Url: remove_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> RemoveRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs index e7947e6..d530c29 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs @@ -46,67 +46,67 @@ pub mod update_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Pattern; type Action; type Reason; type Url; - type Pattern; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Pattern = Unset; type Action = Unset; type Reason = Unset; type Url = Unset; - type Pattern = Unset; + } + ///State transition - sets the `pattern` field to Set + pub struct SetPattern(PhantomData S>); + impl sealed::Sealed for SetPattern {} + impl State for SetPattern { + type Pattern = Set; + type Action = S::Action; + type Reason = S::Reason; + type Url = S::Url; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { + type Pattern = S::Pattern; type Action = Set; type Reason = S::Reason; type Url = S::Url; - type Pattern = S::Pattern; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); impl sealed::Sealed for SetReason {} impl State for SetReason { + type Pattern = S::Pattern; type Action = S::Action; type Reason = Set; type Url = S::Url; - type Pattern = S::Pattern; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { - type Action = S::Action; - type Reason = S::Reason; - type Url = Set; type Pattern = S::Pattern; - } - ///State transition - sets the `pattern` field to Set - pub struct SetPattern(PhantomData S>); - impl sealed::Sealed for SetPattern {} - impl State for SetPattern { type Action = S::Action; type Reason = S::Reason; - type Url = S::Url; - type Pattern = Set; + type Url = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `pattern` field + pub struct pattern(()); ///Marker type for the `action` field pub struct action(()); ///Marker type for the `reason` field pub struct reason(()); ///Marker type for the `url` field pub struct url(()); - ///Marker type for the `pattern` field - pub struct pattern(()); } } @@ -256,10 +256,10 @@ where impl<'a, S> UpdateRuleBuilder<'a, S> where S: update_rule_state::State, + S::Pattern: update_rule_state::IsSet, S::Action: update_rule_state::IsSet, S::Reason: update_rule_state::IsSet, S::Url: update_rule_state::IsSet, - S::Pattern: update_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/set.rs b/crates/weaver-api/src/tools_ozone/set.rs index d162a69..c14ded1 100644 --- a/crates/weaver-api/src/tools_ozone/set.rs +++ b/crates/weaver-api/src/tools_ozone/set.rs @@ -300,67 +300,67 @@ pub mod set_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; + type SetSize; type UpdatedAt; type CreatedAt; - type SetSize; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Name = Unset; + type SetSize = Unset; type UpdatedAt = Unset; type CreatedAt = Unset; - type SetSize = Unset; + type Name = Unset; } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Name = Set; + ///State transition - sets the `set_size` field to Set + pub struct SetSetSize(PhantomData S>); + impl sealed::Sealed for SetSetSize {} + impl State for SetSetSize { + type SetSize = Set; type UpdatedAt = S::UpdatedAt; type CreatedAt = S::CreatedAt; - type SetSize = S::SetSize; + type Name = S::Name; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { - type Name = S::Name; + type SetSize = S::SetSize; type UpdatedAt = Set; type CreatedAt = S::CreatedAt; - type SetSize = S::SetSize; + type Name = S::Name; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Name = S::Name; + type SetSize = S::SetSize; type UpdatedAt = S::UpdatedAt; type CreatedAt = Set; - type SetSize = S::SetSize; - } - ///State transition - sets the `set_size` field to Set - pub struct SetSetSize(PhantomData S>); - impl sealed::Sealed for SetSetSize {} - impl State for SetSetSize { type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type SetSize = S::SetSize; type UpdatedAt = S::UpdatedAt; type CreatedAt = S::CreatedAt; - type SetSize = Set; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `name` field - pub struct name(()); + ///Marker type for the `set_size` field + pub struct set_size(()); ///Marker type for the `updated_at` field pub struct updated_at(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `set_size` field - pub struct set_size(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -493,10 +493,10 @@ where impl<'a, S> SetViewBuilder<'a, S> where S: set_view_state::State, - S::Name: set_view_state::IsSet, + S::SetSize: set_view_state::IsSet, S::UpdatedAt: set_view_state::IsSet, S::CreatedAt: set_view_state::IsSet, - S::SetSize: set_view_state::IsSet, + S::Name: set_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SetView<'a> { diff --git a/crates/weaver-api/src/tools_ozone/set/add_values.rs b/crates/weaver-api/src/tools_ozone/set/add_values.rs index 426fd0d..06c548b 100644 --- a/crates/weaver-api/src/tools_ozone/set/add_values.rs +++ b/crates/weaver-api/src/tools_ozone/set/add_values.rs @@ -35,37 +35,37 @@ pub mod add_values_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Values; type Name; + type Values; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Values = Unset; type Name = Unset; - } - ///State transition - sets the `values` field to Set - pub struct SetValues(PhantomData S>); - impl sealed::Sealed for SetValues {} - impl State for SetValues { - type Values = Set; - type Name = S::Name; + type Values = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Values = S::Values; type Name = Set; + type Values = S::Values; + } + ///State transition - sets the `values` field to Set + pub struct SetValues(PhantomData S>); + impl sealed::Sealed for SetValues {} + impl State for SetValues { + type Name = S::Name; + type Values = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `values` field - pub struct values(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `values` field + pub struct values(()); } } @@ -138,8 +138,8 @@ where impl<'a, S> AddValuesBuilder<'a, S> where S: add_values_state::State, - S::Values: add_values_state::IsSet, S::Name: add_values_state::IsSet, + S::Values: add_values_state::IsSet, { /// Build the final struct pub fn build(self) -> AddValues<'a> { diff --git a/crates/weaver-api/src/tools_ozone/setting.rs b/crates/weaver-api/src/tools_ozone/setting.rs index 231c0c1..9573c82 100644 --- a/crates/weaver-api/src/tools_ozone/setting.rs +++ b/crates/weaver-api/src/tools_ozone/setting.rs @@ -55,10 +55,10 @@ pub mod defs_option_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Key; + type Did; type Scope; type Value; - type Did; - type Key; type CreatedBy; type LastUpdatedBy; } @@ -66,32 +66,21 @@ pub mod defs_option_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Key = Unset; + type Did = Unset; type Scope = Unset; type Value = Unset; - type Did = Unset; - type Key = Unset; type CreatedBy = Unset; type LastUpdatedBy = Unset; } - ///State transition - sets the `scope` field to Set - pub struct SetScope(PhantomData S>); - impl sealed::Sealed for SetScope {} - impl State for SetScope { - type Scope = Set; - type Value = S::Value; + ///State transition - sets the `key` field to Set + pub struct SetKey(PhantomData S>); + impl sealed::Sealed for SetKey {} + impl State for SetKey { + type Key = Set; type Did = S::Did; - type Key = S::Key; - type CreatedBy = S::CreatedBy; - type LastUpdatedBy = S::LastUpdatedBy; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { type Scope = S::Scope; - type Value = Set; - type Did = S::Did; - type Key = S::Key; + type Value = S::Value; type CreatedBy = S::CreatedBy; type LastUpdatedBy = S::LastUpdatedBy; } @@ -99,21 +88,32 @@ pub mod defs_option_state { pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { + type Key = S::Key; + type Did = Set; type Scope = S::Scope; type Value = S::Value; - type Did = Set; - type Key = S::Key; type CreatedBy = S::CreatedBy; type LastUpdatedBy = S::LastUpdatedBy; } - ///State transition - sets the `key` field to Set - pub struct SetKey(PhantomData S>); - impl sealed::Sealed for SetKey {} - impl State for SetKey { - type Scope = S::Scope; + ///State transition - sets the `scope` field to Set + pub struct SetScope(PhantomData S>); + impl sealed::Sealed for SetScope {} + impl State for SetScope { + type Key = S::Key; + type Did = S::Did; + type Scope = Set; type Value = S::Value; + type CreatedBy = S::CreatedBy; + type LastUpdatedBy = S::LastUpdatedBy; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Key = S::Key; type Did = S::Did; - type Key = Set; + type Scope = S::Scope; + type Value = Set; type CreatedBy = S::CreatedBy; type LastUpdatedBy = S::LastUpdatedBy; } @@ -121,10 +121,10 @@ pub mod defs_option_state { pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { + type Key = S::Key; + type Did = S::Did; type Scope = S::Scope; type Value = S::Value; - type Did = S::Did; - type Key = S::Key; type CreatedBy = Set; type LastUpdatedBy = S::LastUpdatedBy; } @@ -132,24 +132,24 @@ pub mod defs_option_state { pub struct SetLastUpdatedBy(PhantomData S>); impl sealed::Sealed for SetLastUpdatedBy {} impl State for SetLastUpdatedBy { + type Key = S::Key; + type Did = S::Did; type Scope = S::Scope; type Value = S::Value; - type Did = S::Did; - type Key = S::Key; type CreatedBy = S::CreatedBy; type LastUpdatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `key` field + pub struct key(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `scope` field pub struct scope(()); ///Marker type for the `value` field pub struct value(()); - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `key` field - pub struct key(()); ///Marker type for the `created_by` field pub struct created_by(()); ///Marker type for the `last_updated_by` field @@ -397,10 +397,10 @@ where impl<'a, S> DefsOptionBuilder<'a, S> where S: defs_option_state::State, + S::Key: defs_option_state::IsSet, + S::Did: defs_option_state::IsSet, S::Scope: defs_option_state::IsSet, S::Value: defs_option_state::IsSet, - S::Did: defs_option_state::IsSet, - S::Key: defs_option_state::IsSet, S::CreatedBy: defs_option_state::IsSet, S::LastUpdatedBy: defs_option_state::IsSet, { diff --git a/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs index 3b6e480..4da22d4 100644 --- a/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs +++ b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs @@ -41,51 +41,51 @@ pub mod upsert_option_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Key; type Scope; type Value; - type Key; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Key = Unset; type Scope = Unset; type Value = Unset; - type Key = Unset; + } + ///State transition - sets the `key` field to Set + pub struct SetKey(PhantomData S>); + impl sealed::Sealed for SetKey {} + impl State for SetKey { + type Key = Set; + type Scope = S::Scope; + type Value = S::Value; } ///State transition - sets the `scope` field to Set pub struct SetScope(PhantomData S>); impl sealed::Sealed for SetScope {} impl State for SetScope { + type Key = S::Key; type Scope = Set; type Value = S::Value; - type Key = S::Key; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Scope = S::Scope; - type Value = Set; type Key = S::Key; - } - ///State transition - sets the `key` field to Set - pub struct SetKey(PhantomData S>); - impl sealed::Sealed for SetKey {} - impl State for SetKey { type Scope = S::Scope; - type Value = S::Value; - type Key = Set; + type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `key` field + pub struct key(()); ///Marker type for the `scope` field pub struct scope(()); ///Marker type for the `value` field pub struct value(()); - ///Marker type for the `key` field - pub struct key(()); } } @@ -218,9 +218,9 @@ where impl<'a, S> UpsertOptionBuilder<'a, S> where S: upsert_option_state::State, + S::Key: upsert_option_state::IsSet, S::Scope: upsert_option_state::IsSet, S::Value: upsert_option_state::IsSet, - S::Key: upsert_option_state::IsSet, { /// Build the final struct pub fn build(self) -> UpsertOption<'a> { diff --git a/crates/weaver-api/src/tools_ozone/team/add_member.rs b/crates/weaver-api/src/tools_ozone/team/add_member.rs index e2de037..94b3e75 100644 --- a/crates/weaver-api/src/tools_ozone/team/add_member.rs +++ b/crates/weaver-api/src/tools_ozone/team/add_member.rs @@ -33,37 +33,37 @@ pub mod add_member_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Role; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Role = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Role = S::Role; + type Did = Unset; } ///State transition - sets the `role` field to Set pub struct SetRole(PhantomData S>); impl sealed::Sealed for SetRole {} impl State for SetRole { - type Did = S::Did; type Role = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Role = S::Role; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `role` field pub struct role(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> AddMemberBuilder<'a, S> where S: add_member_state::State, - S::Did: add_member_state::IsSet, S::Role: add_member_state::IsSet, + S::Did: add_member_state::IsSet, { /// Build the final struct pub fn build(self) -> AddMember<'a> { diff --git a/crates/weaver-api/src/tools_ozone/verification.rs b/crates/weaver-api/src/tools_ozone/verification.rs index 0c4fe34..4be50b3 100644 --- a/crates/weaver-api/src/tools_ozone/verification.rs +++ b/crates/weaver-api/src/tools_ozone/verification.rs @@ -74,105 +74,105 @@ pub mod verification_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Issuer; - type Uri; type Handle; + type CreatedAt; type Subject; + type Issuer; type DisplayName; - type CreatedAt; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Issuer = Unset; - type Uri = Unset; type Handle = Unset; + type CreatedAt = Unset; type Subject = Unset; + type Issuer = Unset; type DisplayName = Unset; - type CreatedAt = Unset; - } - ///State transition - sets the `issuer` field to Set - pub struct SetIssuer(PhantomData S>); - impl sealed::Sealed for SetIssuer {} - impl State for SetIssuer { - type Issuer = Set; - type Uri = S::Uri; - type Handle = S::Handle; - type Subject = S::Subject; - type DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Issuer = S::Issuer; - type Uri = Set; - type Handle = S::Handle; - type Subject = S::Subject; - type DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; + type Uri = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { + type Handle = Set; + type CreatedAt = S::CreatedAt; + type Subject = S::Subject; type Issuer = S::Issuer; + type DisplayName = S::DisplayName; type Uri = S::Uri; - type Handle = Set; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Handle = S::Handle; + type CreatedAt = Set; type Subject = S::Subject; + type Issuer = S::Issuer; type DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; + type Uri = S::Uri; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Issuer = S::Issuer; - type Uri = S::Uri; type Handle = S::Handle; + type CreatedAt = S::CreatedAt; type Subject = Set; + type Issuer = S::Issuer; type DisplayName = S::DisplayName; + type Uri = S::Uri; + } + ///State transition - sets the `issuer` field to Set + pub struct SetIssuer(PhantomData S>); + impl sealed::Sealed for SetIssuer {} + impl State for SetIssuer { + type Handle = S::Handle; type CreatedAt = S::CreatedAt; + type Subject = S::Subject; + type Issuer = Set; + type DisplayName = S::DisplayName; + type Uri = S::Uri; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Issuer = S::Issuer; - type Uri = S::Uri; type Handle = S::Handle; - type Subject = S::Subject; - type DisplayName = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + type Subject = S::Subject; type Issuer = S::Issuer; + type DisplayName = Set; type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Handle = S::Handle; + type CreatedAt = S::CreatedAt; type Subject = S::Subject; + type Issuer = S::Issuer; type DisplayName = S::DisplayName; - type CreatedAt = Set; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `issuer` field - pub struct issuer(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `issuer` field + pub struct issuer(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `created_at` field - pub struct created_at(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -479,12 +479,12 @@ where impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, - S::Issuer: verification_view_state::IsSet, - S::Uri: verification_view_state::IsSet, S::Handle: verification_view_state::IsSet, + S::CreatedAt: verification_view_state::IsSet, S::Subject: verification_view_state::IsSet, + S::Issuer: verification_view_state::IsSet, S::DisplayName: verification_view_state::IsSet, - S::CreatedAt: verification_view_state::IsSet, + S::Uri: verification_view_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationView<'a> { diff --git a/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs b/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs index e4159ca..49eb8d3 100644 --- a/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs +++ b/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs @@ -36,37 +36,37 @@ pub mod grant_error_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Error; type Subject; + type Error; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Error = Unset; type Subject = Unset; - } - ///State transition - sets the `error` field to Set - pub struct SetError(PhantomData S>); - impl sealed::Sealed for SetError {} - impl State for SetError { - type Error = Set; - type Subject = S::Subject; + type Error = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Error = S::Error; type Subject = Set; + type Error = S::Error; + } + ///State transition - sets the `error` field to Set + pub struct SetError(PhantomData S>); + impl sealed::Sealed for SetError {} + impl State for SetError { + type Subject = S::Subject; + type Error = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `error` field - pub struct error(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `error` field + pub struct error(()); } } @@ -139,8 +139,8 @@ where impl<'a, S> GrantErrorBuilder<'a, S> where S: grant_error_state::State, - S::Error: grant_error_state::IsSet, S::Subject: grant_error_state::IsSet, + S::Error: grant_error_state::IsSet, { /// Build the final struct pub fn build(self) -> GrantError<'a> { @@ -640,51 +640,51 @@ pub mod verification_input_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Handle; type Subject; type DisplayName; - type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Handle = Unset; type Subject = Unset; type DisplayName = Unset; - type Handle = Unset; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Handle = Set; + type Subject = S::Subject; + type DisplayName = S::DisplayName; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { + type Handle = S::Handle; type Subject = Set; type DisplayName = S::DisplayName; - type Handle = S::Handle; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Subject = S::Subject; - type DisplayName = Set; type Handle = S::Handle; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { type Subject = S::Subject; - type DisplayName = S::DisplayName; - type Handle = Set; + type DisplayName = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `handle` field + pub struct handle(()); ///Marker type for the `subject` field pub struct subject(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `handle` field - pub struct handle(()); } } @@ -797,9 +797,9 @@ where impl<'a, S> VerificationInputBuilder<'a, S> where S: verification_input_state::State, + S::Handle: verification_input_state::IsSet, S::Subject: verification_input_state::IsSet, S::DisplayName: verification_input_state::IsSet, - S::Handle: verification_input_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationInput<'a> { diff --git a/crates/weaver-app/src/components/editor/storage.rs b/crates/weaver-app/src/components/editor/storage.rs index 144f905..01a70b9 100644 --- a/crates/weaver-app/src/components/editor/storage.rs +++ b/crates/weaver-app/src/components/editor/storage.rs @@ -278,19 +278,17 @@ pub async fn delete_draft_from_pds( fetcher: &crate::fetch::Fetcher, draft_key: &str, ) -> Result<(), weaver_common::WeaverError> { - use jacquard::prelude::XrpcClient; - use jacquard::types::ident::AtIdentifier; + use jacquard::client::AgentSessionExt; use jacquard::types::recordkey::RecordKey; - use jacquard::types::string::Nsid; - use weaver_api::com_atproto::repo::delete_record::DeleteRecord; + use weaver_api::sh_weaver::edit::draft::Draft; // Only delete if authenticated - let Some(did) = fetcher.current_did().await else { + if fetcher.current_did().await.is_none() { tracing::debug!("Not authenticated, skipping PDS draft deletion"); return Ok(()); - }; + } - // Extract rkey from draft_key + // Extract rkey from draft_key. let rkey_str = if let Some(tid) = draft_key.strip_prefix("new:") { tid.to_string() } else if draft_key.starts_with("at://") { @@ -302,22 +300,15 @@ pub async fn delete_draft_from_pds( let rkey = RecordKey::any(&rkey_str) .map_err(|e| weaver_common::WeaverError::InvalidNotebook(e.to_string()))?; - // Build the delete request - let request = DeleteRecord::new() - .repo(AtIdentifier::Did(did)) - .collection(Nsid::new_static("sh.weaver.edit.draft").unwrap()) - .rkey(rkey) - .build(); - - // Execute deletion + // Execute deletion using delete_record helper. let client = fetcher.get_client(); - match client.send(request).await { + match client.delete_record::(rkey).await { Ok(_) => { tracing::info!("Deleted draft stub from PDS: {}", draft_key); Ok(()) } Err(e) => { - // Log but don't fail - draft may not exist on PDS + // Log but don't fail - draft may not exist on PDS. tracing::warn!("Failed to delete draft from PDS (may not exist): {}", e); Ok(()) } diff --git a/crates/weaver-app/src/components/entry_actions.rs b/crates/weaver-app/src/components/entry_actions.rs index af06015..63db3a7 100644 --- a/crates/weaver-app/src/components/entry_actions.rs +++ b/crates/weaver-app/src/components/entry_actions.rs @@ -11,7 +11,6 @@ use jacquard::types::aturi::AtUri; use jacquard::types::ident::AtIdentifier; use jacquard::types::string::Cid; use jacquard::IntoStatic; -use weaver_api::com_atproto::repo::delete_record::DeleteRecord; use weaver_api::com_atproto::repo::put_record::PutRecord; use weaver_api::com_atproto::repo::strong_ref::StrongRef; use weaver_api::sh_weaver::actor::profile::Profile as WeaverProfile; @@ -124,45 +123,42 @@ pub fn EntryActions(props: EntryActionsProps) -> Element { let navigate = navigate.clone(); spawn(async move { - use jacquard::prelude::*; + use jacquard::client::AgentSessionExt; + use weaver_api::sh_weaver::notebook::entry::Entry; deleting.set(true); error.set(None); - let client = fetcher.get_client(); - let collection = uri.collection(); - let rkey = uri.rkey(); - - if let (Some(collection), Some(rkey)) = (collection, rkey) { - let did = match fetcher.current_did().await { - Some(d) => d, - None => { - error.set(Some("Not authenticated".to_string())); - deleting.set(false); - return; - } - }; + let rkey = match uri.rkey() { + Some(r) => r.clone().into_static(), + None => { + error.set(Some("Invalid entry URI".to_string())); + deleting.set(false); + return; + } + }; - let request = DeleteRecord::new() - .repo(AtIdentifier::Did(did.clone())) - .collection(collection.clone()) - .rkey(rkey.clone()) - .build(); + let did = match fetcher.current_did().await { + Some(d) => d, + None => { + error.set(Some("Not authenticated".to_string())); + deleting.set(false); + return; + } + }; - match client.send(request).await { - Ok(_) => { - show_delete_confirm.set(false); - // Navigate to profile after delete - navigate(AppLinkTarget::Profile { - ident: AtIdentifier::Did(did), - }); - } - Err(e) => { - error.set(Some(format!("Delete failed: {:?}", e))); - } + let client = fetcher.get_client(); + match client.delete_record::(rkey).await { + Ok(_) => { + show_delete_confirm.set(false); + // Navigate to profile after delete. + navigate(AppLinkTarget::Profile { + ident: AtIdentifier::Did(did), + }); + } + Err(e) => { + error.set(Some(format!("Delete failed: {:?}", e))); } - } else { - error.set(Some("Invalid entry URI".to_string())); } deleting.set(false); }); diff --git a/crates/weaver-app/src/components/identity.rs b/crates/weaver-app/src/components/identity.rs index 6f2bdca..4e37263 100644 --- a/crates/weaver-app/src/components/identity.rs +++ b/crates/weaver-app/src/components/identity.rs @@ -626,6 +626,11 @@ pub fn NotebookCard( let fetcher = use_context::(); let auth_state = use_context::>(); + // Parse Book from the NotebookView's record field for settings. + let book: Option> = from_data(¬ebook.record) + .ok() + .map(|b: Book<'_>| b.into_static()); + let title = notebook .title .as_ref() @@ -683,13 +688,16 @@ pub fn NotebookCard( "Add" } } - crate::components::NotebookActions { - notebook_uri: notebook.uri.clone().into_static(), - notebook_cid: notebook.cid.clone().into_static(), - notebook_title: title.to_string(), - is_pinned, - on_pinned_changed, - on_deleted + if let Some(ref book) = book { + crate::components::NotebookActions { + notebook_uri: notebook.uri.clone().into_static(), + notebook_cid: notebook.cid.clone().into_static(), + notebook_title: title.to_string(), + notebook: book.clone(), + is_pinned, + on_pinned_changed, + on_deleted + } } } } diff --git a/crates/weaver-app/src/components/inline_theme_editor.rs b/crates/weaver-app/src/components/inline_theme_editor.rs index d2147d1..80e0e69 100644 --- a/crates/weaver-app/src/components/inline_theme_editor.rs +++ b/crates/weaver-app/src/components/inline_theme_editor.rs @@ -5,8 +5,8 @@ use dioxus::prelude::*; use weaver_renderer::themes::{BUILTIN_CODE_THEMES, BUILTIN_COLOUR_SCHEMES}; -use crate::components::toggle_group::{ToggleGroup, ToggleItem}; use crate::components::HexColourInput; +use crate::components::toggle_group::{ToggleGroup, ToggleItem}; /// Strip leading # or 0x from hex colour strings. fn strip_hex_prefix(s: &str) -> String { @@ -40,14 +40,65 @@ const INLINE_THEME_EDITOR_CSS: Asset = asset!("/assets/styling/inline-theme-edit /// Theme values being edited. #[derive(Debug, Clone, PartialEq, Default)] pub struct InlineThemeValues { + // Primary colours (based on default_mode). pub background: String, pub text: String, pub primary: String, pub link: String, - pub code_theme: String, + + // Light-specific overrides (None = use generated from primary colours). + pub light_background: Option, + pub light_text: Option, + pub light_primary: Option, + pub light_link: Option, + + // Dark-specific overrides (None = use generated from primary colours). + pub dark_background: Option, + pub dark_text: Option, + pub dark_primary: Option, + pub dark_link: Option, + + // Code themes (separate for light/dark). + pub light_code_theme: String, + pub dark_code_theme: String, + pub default_mode: String, // "light", "dark", or "auto" } +impl InlineThemeValues { + /// Get inputs for the light variant. + pub fn light_inputs(&self) -> weaver_renderer::colour_gen::ThemeInputs { + weaver_renderer::colour_gen::ThemeInputs { + background: self + .light_background + .clone() + .unwrap_or_else(|| self.background.clone()), + text: self.light_text.clone().unwrap_or_else(|| self.text.clone()), + primary: self + .light_primary + .clone() + .unwrap_or_else(|| self.primary.clone()), + link: self.light_link.clone().unwrap_or_else(|| self.link.clone()), + } + } + + /// Get inputs for the dark variant. + pub fn dark_inputs(&self) -> weaver_renderer::colour_gen::ThemeInputs { + weaver_renderer::colour_gen::ThemeInputs { + background: self + .dark_background + .clone() + .unwrap_or_else(|| self.background.clone()), + text: self.dark_text.clone().unwrap_or_else(|| self.text.clone()), + primary: self + .dark_primary + .clone() + .unwrap_or_else(|| self.primary.clone()), + link: self.dark_link.clone().unwrap_or_else(|| self.link.clone()), + } + } +} + /// Props for InlineThemeEditor. #[derive(Props, Clone, PartialEq)] pub struct InlineThemeEditorProps { @@ -61,13 +112,7 @@ pub struct InlineThemeEditorProps { #[component] pub fn InlineThemeEditor(props: InlineThemeEditorProps) -> Element { let values = props.values.clone(); - - // Filter code themes by current mode for the selector. - let mode = &values.default_mode; - let relevant_code_themes: Vec<_> = BUILTIN_CODE_THEMES - .iter() - .filter(|t| mode == "auto" || t.variant == mode) - .collect(); + let mut advanced_expanded = use_signal(|| false); rsx! { document::Stylesheet { href: INLINE_THEME_EDITOR_CSS } @@ -81,7 +126,7 @@ pub fn InlineThemeEditor(props: InlineThemeEditorProps) -> Element { select { onchange: { let onchange = props.onchange.clone(); - let code_theme = props.values.code_theme.clone(); + let values = props.values.clone(); move |e: Event| { let preset_id = e.value(); if let Some(scheme) = BUILTIN_COLOUR_SCHEMES.iter().find(|s| s.id == preset_id) { @@ -90,8 +135,10 @@ pub fn InlineThemeEditor(props: InlineThemeEditorProps) -> Element { text: strip_hex_prefix(&scheme.colours.text), primary: strip_hex_prefix(&scheme.colours.primary), link: strip_hex_prefix(&scheme.colours.link), - code_theme: code_theme.clone(), + light_code_theme: values.light_code_theme.clone(), + dark_code_theme: values.dark_code_theme.clone(), default_mode: scheme.variant.to_string(), + ..Default::default() }); } } @@ -162,21 +209,42 @@ pub fn InlineThemeEditor(props: InlineThemeEditorProps) -> Element { } } - // Code theme selector. + // Code theme selectors (light and dark). div { class: "inline-theme-editor-code-theme", - label { "Code theme:" } + label { "Light code theme:" } select { - value: "{values.code_theme}", + value: "{values.light_code_theme}", onchange: { let values = props.values.clone(); let onchange = props.onchange.clone(); move |e: Event| { let mut v = values.clone(); - v.code_theme = e.value(); + v.light_code_theme = e.value(); onchange.call(v); } }, - for theme in relevant_code_themes { + for theme in BUILTIN_CODE_THEMES.iter().filter(|t| t.variant == "light") { + option { + value: "{theme.id}", + "{theme.name}" + } + } + } + } + div { class: "inline-theme-editor-code-theme", + label { "Dark code theme:" } + select { + value: "{values.dark_code_theme}", + onchange: { + let values = props.values.clone(); + let onchange = props.onchange.clone(); + move |e: Event| { + let mut v = values.clone(); + v.dark_code_theme = e.value(); + onchange.call(v); + } + }, + for theme in BUILTIN_CODE_THEMES.iter().filter(|t| t.variant == "dark") { option { value: "{theme.id}", "{theme.name}" @@ -209,6 +277,146 @@ pub fn InlineThemeEditor(props: InlineThemeEditorProps) -> Element { } } + // Advanced section for per-variant colour customization. + div { class: "inline-theme-editor-advanced", + button { + class: "inline-theme-editor-advanced-toggle", + onclick: move |_| advanced_expanded.toggle(), + if advanced_expanded() { "â–¼ " } else { "â–¶ " } + "Advanced colour options" + } + + if advanced_expanded() { + div { class: "inline-theme-editor-advanced-content", + // Light variant colours. + div { class: "inline-theme-editor-variant", + h5 { "Light variant" } + div { class: "inline-theme-editor-colours", + HexColourInput { + label: Some("Background".to_string()), + value: values.light_background.clone().unwrap_or_default(), + placeholder: values.background.clone(), + onchange: { + let values = props.values.clone(); + let onchange = props.onchange.clone(); + move |val: String| { + let mut v = values.clone(); + v.light_background = if val.is_empty() { None } else { Some(val) }; + onchange.call(v); + } + }, + } + HexColourInput { + label: Some("Text".to_string()), + value: values.light_text.clone().unwrap_or_default(), + placeholder: values.text.clone(), + onchange: { + let values = props.values.clone(); + let onchange = props.onchange.clone(); + move |val: String| { + let mut v = values.clone(); + v.light_text = if val.is_empty() { None } else { Some(val) }; + onchange.call(v); + } + }, + } + HexColourInput { + label: Some("Primary".to_string()), + value: values.light_primary.clone().unwrap_or_default(), + placeholder: values.primary.clone(), + onchange: { + let values = props.values.clone(); + let onchange = props.onchange.clone(); + move |val: String| { + let mut v = values.clone(); + v.light_primary = if val.is_empty() { None } else { Some(val) }; + onchange.call(v); + } + }, + } + HexColourInput { + label: Some("Link".to_string()), + value: values.light_link.clone().unwrap_or_default(), + placeholder: values.link.clone(), + onchange: { + let values = props.values.clone(); + let onchange = props.onchange.clone(); + move |val: String| { + let mut v = values.clone(); + v.light_link = if val.is_empty() { None } else { Some(val) }; + onchange.call(v); + } + }, + } + } + } + + // Dark variant colours. + div { class: "inline-theme-editor-variant", + h5 { "Dark variant" } + div { class: "inline-theme-editor-colours", + HexColourInput { + label: Some("Background".to_string()), + value: values.dark_background.clone().unwrap_or_default(), + placeholder: values.background.clone(), + onchange: { + let values = props.values.clone(); + let onchange = props.onchange.clone(); + move |val: String| { + let mut v = values.clone(); + v.dark_background = if val.is_empty() { None } else { Some(val) }; + onchange.call(v); + } + }, + } + HexColourInput { + label: Some("Text".to_string()), + value: values.dark_text.clone().unwrap_or_default(), + placeholder: values.text.clone(), + onchange: { + let values = props.values.clone(); + let onchange = props.onchange.clone(); + move |val: String| { + let mut v = values.clone(); + v.dark_text = if val.is_empty() { None } else { Some(val) }; + onchange.call(v); + } + }, + } + HexColourInput { + label: Some("Primary".to_string()), + value: values.dark_primary.clone().unwrap_or_default(), + placeholder: values.primary.clone(), + onchange: { + let values = props.values.clone(); + let onchange = props.onchange.clone(); + move |val: String| { + let mut v = values.clone(); + v.dark_primary = if val.is_empty() { None } else { Some(val) }; + onchange.call(v); + } + }, + } + HexColourInput { + label: Some("Link".to_string()), + value: values.dark_link.clone().unwrap_or_default(), + placeholder: values.link.clone(), + onchange: { + let values = props.values.clone(); + let onchange = props.onchange.clone(); + move |val: String| { + let mut v = values.clone(); + v.dark_link = if val.is_empty() { None } else { Some(val) }; + onchange.call(v); + } + }, + } + } + } + } + } + } + // Link to full editor. // TODO: Enable once theme page exists // a { href: "/{ident}/themes", class: "inline-theme-editor-full-link", diff --git a/crates/weaver-app/src/components/mod.rs b/crates/weaver-app/src/components/mod.rs index 3663e7e..d56e8a1 100644 --- a/crates/weaver-app/src/components/mod.rs +++ b/crates/weaver-app/src/components/mod.rs @@ -368,3 +368,6 @@ pub use inline_theme_editor::{InlineThemeEditor, InlineThemeValues}; mod notebook_editor; pub use notebook_editor::{NotebookEditor, NotebookEditorMode, NotebookFormState}; + +pub mod notebook; +pub use notebook::{delete_publication, sync_publication}; diff --git a/crates/weaver-app/src/components/notebook/mod.rs b/crates/weaver-app/src/components/notebook/mod.rs new file mode 100644 index 0000000..bebb92e --- /dev/null +++ b/crates/weaver-app/src/components/notebook/mod.rs @@ -0,0 +1,7 @@ +//! Notebook-related components and helpers. + +pub mod publication_sync; +pub mod theme_sync; + +pub use publication_sync::{delete_publication, sync_publication}; +pub use theme_sync::{has_theme_customizations, load_theme_values, sync_theme, ThemeSyncResult}; diff --git a/crates/weaver-app/src/components/notebook/publication_sync.rs b/crates/weaver-app/src/components/notebook/publication_sync.rs new file mode 100644 index 0000000..56b7799 --- /dev/null +++ b/crates/weaver-app/src/components/notebook/publication_sync.rs @@ -0,0 +1,205 @@ +//! Sync notebook to site.standard.publication. + +use jacquard::CowStr; +use jacquard::IntoStatic; +use jacquard::client::AgentSessionExt; +use jacquard::types::aturi::AtUri; +use jacquard::types::string::{RecordKey, Uri}; +use weaver_api::site_standard::publication::Publication; +use weaver_api::site_standard::theme::basic::Basic as BasicTheme; +use weaver_api::site_standard::theme::color::Rgb; +use weaver_common::WeaverError; + +use crate::components::inline_theme_editor::InlineThemeValues; +use crate::fetch::Fetcher; + +/// Create or update a site.standard.publication for a notebook. +pub async fn sync_publication( + fetcher: &Fetcher, + notebook_uri: &AtUri<'_>, + title: &str, + path: &str, + theme: &InlineThemeValues, +) -> Result, WeaverError> { + // Build basicTheme from inline values. + let basic_theme = build_basic_theme(theme); + + // Build publication record. + let url_str = format!("https://weaver.sh/{}/{}", notebook_uri.authority(), path); + let url = Uri::new(&url_str) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .into_static(); + let publication = Publication::new() + .name(CowStr::from(title)) + .url(url) + .maybe_basic_theme(Some(basic_theme)) + .build(); + + // Use same rkey as notebook for 1:1 mapping. + let notebook_rkey = notebook_uri + .rkey() + .ok_or_else(|| WeaverError::InvalidNotebook("Notebook URI missing rkey".into()))?; + + // Use put_record for upsert behavior. + let response = fetcher + .put_record( + RecordKey::any(notebook_rkey.as_ref()) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .into_static(), + publication, + ) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?; + + Ok(response.uri.into_static()) +} + +/// Delete a site.standard.publication. +pub async fn delete_publication( + fetcher: &Fetcher, + notebook_uri: &AtUri<'_>, +) -> Result<(), WeaverError> { + let notebook_rkey = notebook_uri + .rkey() + .ok_or_else(|| WeaverError::InvalidNotebook("Notebook URI missing rkey".into()))?; + + // Use delete_record - ignore errors if doesn't exist. + let _ = fetcher + .delete_record::( + RecordKey::any(notebook_rkey.as_ref()) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .into_static(), + ) + .await; + + Ok(()) +} + +/// Build a BasicTheme from InlineThemeValues. +fn build_basic_theme(values: &InlineThemeValues) -> BasicTheme<'static> { + // Parse hex colours to RGB values. + let (bg_r, bg_g, bg_b) = parse_hex_to_rgb(&values.background); + let (fg_r, fg_g, fg_b) = parse_hex_to_rgb(&values.text); + let (ac_r, ac_g, ac_b) = parse_hex_to_rgb(&values.primary); + + // Calculate accentForeground for contrast. + let (ac_fg_r, ac_fg_g, ac_fg_b) = calculate_contrast_rgb(ac_r, ac_g, ac_b); + + BasicTheme::new() + .background( + Rgb::new() + .r(bg_r as i64) + .g(bg_g as i64) + .b(bg_b as i64) + .build(), + ) + .foreground( + Rgb::new() + .r(fg_r as i64) + .g(fg_g as i64) + .b(fg_b as i64) + .build(), + ) + .accent( + Rgb::new() + .r(ac_r as i64) + .g(ac_g as i64) + .b(ac_b as i64) + .build(), + ) + .accent_foreground( + Rgb::new() + .r(ac_fg_r as i64) + .g(ac_fg_g as i64) + .b(ac_fg_b as i64) + .build(), + ) + .build() +} + +/// Parse a hex string (without #) to RGB tuple. +fn parse_hex_to_rgb(hex: &str) -> (u8, u8, u8) { + // Strip leading # if present. + let hex = hex.trim_start_matches('#'); + + let r = u8::from_str_radix(&hex.get(0..2).unwrap_or("80"), 16).unwrap_or(128); + let g = u8::from_str_radix(&hex.get(2..4).unwrap_or("80"), 16).unwrap_or(128); + let b = u8::from_str_radix(&hex.get(4..6).unwrap_or("80"), 16).unwrap_or(128); + + (r, g, b) +} + +/// Calculate a contrasting colour (black or white) based on luminance. +fn calculate_contrast_rgb(r: u8, g: u8, b: u8) -> (u8, u8, u8) { + // Calculate relative luminance. + let luminance = (0.299 * r as f64 + 0.587 * g as f64 + 0.114 * b as f64) / 255.0; + + // Return black or white for contrast. + if luminance > 0.5 { + (0, 0, 0) // Black. + } else { + (255, 255, 255) // White. + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_hex_to_rgb() { + assert_eq!(parse_hex_to_rgb("FF0000"), (255, 0, 0)); + assert_eq!(parse_hex_to_rgb("00FF00"), (0, 255, 0)); + assert_eq!(parse_hex_to_rgb("0000FF"), (0, 0, 255)); + assert_eq!(parse_hex_to_rgb("#FFFFFF"), (255, 255, 255)); + assert_eq!(parse_hex_to_rgb("000000"), (0, 0, 0)); + } + + #[test] + fn test_calculate_contrast_rgb() { + // White background -> black text. + assert_eq!(calculate_contrast_rgb(255, 255, 255), (0, 0, 0)); + // Black background -> white text. + assert_eq!(calculate_contrast_rgb(0, 0, 0), (255, 255, 255)); + // Bright yellow -> black text. + assert_eq!(calculate_contrast_rgb(255, 255, 0), (0, 0, 0)); + // Dark blue -> white text. + assert_eq!(calculate_contrast_rgb(0, 0, 128), (255, 255, 255)); + } + + #[test] + fn test_build_basic_theme() { + let values = InlineThemeValues { + background: "FFFFFF".to_string(), + text: "000000".to_string(), + primary: "0066CC".to_string(), + link: "0066CC".to_string(), + light_code_theme: "github".to_string(), + dark_code_theme: "github-dark".to_string(), + default_mode: "light".to_string(), + ..Default::default() + }; + + let theme = build_basic_theme(&values); + + // Background should be white. + assert_eq!(theme.background.r, 255); + assert_eq!(theme.background.g, 255); + assert_eq!(theme.background.b, 255); + + // Foreground should be black. + assert_eq!(theme.foreground.r, 0); + assert_eq!(theme.foreground.g, 0); + assert_eq!(theme.foreground.b, 0); + + // Accent should be blue. + assert_eq!(theme.accent.r, 0); + assert_eq!(theme.accent.g, 102); + assert_eq!(theme.accent.b, 204); + + // Accent foreground should be white (contrast against dark blue). + assert_eq!(theme.accent_foreground.r, 255); + assert_eq!(theme.accent_foreground.g, 255); + assert_eq!(theme.accent_foreground.b, 255); + } +} diff --git a/crates/weaver-app/src/components/notebook/theme_sync.rs b/crates/weaver-app/src/components/notebook/theme_sync.rs new file mode 100644 index 0000000..81d026b --- /dev/null +++ b/crates/weaver-app/src/components/notebook/theme_sync.rs @@ -0,0 +1,399 @@ +//! Sync notebook theme to ColourScheme and Theme records. + +use jacquard::client::AgentSessionExt; +use jacquard::types::aturi::AtUri; +use jacquard::types::string::{Cid, RecordKey}; +use jacquard::CowStr; +use jacquard::IntoStatic; +use weaver_api::com_atproto::repo::strong_ref::StrongRef; +use weaver_api::sh_weaver::notebook::colour_scheme::ColourScheme; +use weaver_api::sh_weaver::notebook::theme::{ + Theme, ThemeDarkCodeTheme, ThemeFonts, ThemeLightCodeTheme, ThemeSpacing, +}; +use weaver_common::WeaverError; +use weaver_renderer::colour_gen::{ + detect_variant, generate_counterpart_palette, generate_palette, ThemeVariant, +}; + +use crate::components::inline_theme_editor::InlineThemeValues; +use crate::fetch::Fetcher; + +/// Result of syncing theme records. +pub struct ThemeSyncResult { + pub theme_uri: AtUri<'static>, + pub theme_cid: Cid<'static>, +} + +/// Create or update theme records for a notebook. +/// +/// Returns the Theme record's URI and CID for updating Book.theme. +pub async fn sync_theme( + fetcher: &Fetcher, + existing_theme_ref: Option<&StrongRef<'_>>, + values: &InlineThemeValues, +) -> Result { + // Determine primary variant. + let primary_variant = match values.default_mode.as_str() { + "light" => ThemeVariant::Light, + "dark" => ThemeVariant::Dark, + _ => detect_variant(&values.background) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?, + }; + + // Generate palettes. + let light_inputs = values.light_inputs(); + let dark_inputs = values.dark_inputs(); + + let (light_palette, dark_palette) = match primary_variant { + ThemeVariant::Light => { + let light = generate_palette(&light_inputs, ThemeVariant::Light) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?; + let dark = if values.dark_background.is_some() { + generate_palette(&dark_inputs, ThemeVariant::Dark) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + } else { + generate_counterpart_palette(&light_inputs, ThemeVariant::Light) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + }; + (light, dark) + } + ThemeVariant::Dark => { + let dark = generate_palette(&dark_inputs, ThemeVariant::Dark) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?; + let light = if values.light_background.is_some() { + generate_palette(&light_inputs, ThemeVariant::Light) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + } else { + generate_counterpart_palette(&dark_inputs, ThemeVariant::Dark) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + }; + (light, dark) + } + }; + + // Code theme values. + let light_code = ThemeLightCodeTheme::CodeThemeName(Box::new(CowStr::from( + values.light_code_theme.clone(), + ))); + let dark_code = + ThemeDarkCodeTheme::CodeThemeName(Box::new(CowStr::from(values.dark_code_theme.clone()))); + let default_theme: Option> = match values.default_mode.as_str() { + "light" => Some(CowStr::from("light")), + "dark" => Some(CowStr::from("dark")), + _ => None, + }; + + if let Some(theme_ref) = existing_theme_ref { + // UPDATE existing records. + let theme_uri = &theme_ref.uri; + let existing_theme: Theme<'static> = fetcher + .fetch_record(&Theme::uri(theme_uri.as_ref()) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .value + .into_static(); + + // Update light ColourScheme. + let light_scheme_rkey = existing_theme + .light_scheme + .uri + .rkey() + .ok_or_else(|| WeaverError::InvalidNotebook("Light scheme URI missing rkey".into()))?; + let light_result = fetcher + .put_record( + RecordKey::any(light_scheme_rkey.as_ref()) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .into_static(), + ColourScheme::new() + .name(CowStr::from("Custom Light")) + .variant(CowStr::from("light")) + .colours(light_palette) + .build(), + ) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?; + + // Update dark ColourScheme. + let dark_scheme_rkey = existing_theme + .dark_scheme + .uri + .rkey() + .ok_or_else(|| WeaverError::InvalidNotebook("Dark scheme URI missing rkey".into()))?; + let dark_result = fetcher + .put_record( + RecordKey::any(dark_scheme_rkey.as_ref()) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .into_static(), + ColourScheme::new() + .name(CowStr::from("Custom Dark")) + .variant(CowStr::from("dark")) + .colours(dark_palette) + .build(), + ) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?; + + // Update Theme with new CIDs. + let theme_rkey = theme_uri + .rkey() + .ok_or_else(|| WeaverError::InvalidNotebook("Theme URI missing rkey".into()))?; + let theme_result = fetcher + .put_record( + RecordKey::any(theme_rkey.as_ref()) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .into_static(), + Theme::new() + .light_scheme( + StrongRef::new() + .uri(light_result.uri.clone().into_static()) + .cid(light_result.cid.clone().into_static()) + .build(), + ) + .dark_scheme( + StrongRef::new() + .uri(dark_result.uri.clone().into_static()) + .cid(dark_result.cid.clone().into_static()) + .build(), + ) + .light_code_theme(light_code) + .dark_code_theme(dark_code) + .fonts( + ThemeFonts::new() + .body(vec![]) + .heading(vec![]) + .monospace(vec![]) + .build(), + ) + .spacing(ThemeSpacing { + base_size: CowStr::from("1rem"), + line_height: CowStr::from("1.6"), + scale: CowStr::from("1.25"), + extra_data: None, + }) + .maybe_default_theme(default_theme) + .build(), + ) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?; + + Ok(ThemeSyncResult { + theme_uri: theme_result.uri.into_static(), + theme_cid: theme_result.cid.into_static(), + }) + } else { + // CREATE new records with fresh TIDs. + let light_scheme = ColourScheme::new() + .name(CowStr::from("Custom Light")) + .variant(CowStr::from("light")) + .colours(light_palette) + .build(); + + let light_result = fetcher + .create_record(light_scheme, None) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?; + + let dark_scheme = ColourScheme::new() + .name(CowStr::from("Custom Dark")) + .variant(CowStr::from("dark")) + .colours(dark_palette) + .build(); + + let dark_result = fetcher + .create_record(dark_scheme, None) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?; + + let theme = Theme::new() + .light_scheme( + StrongRef::new() + .uri(light_result.uri.clone().into_static()) + .cid(light_result.cid.clone().into_static()) + .build(), + ) + .dark_scheme( + StrongRef::new() + .uri(dark_result.uri.clone().into_static()) + .cid(dark_result.cid.clone().into_static()) + .build(), + ) + .light_code_theme(light_code) + .dark_code_theme(dark_code) + .fonts( + ThemeFonts::new() + .body(vec![]) + .heading(vec![]) + .monospace(vec![]) + .build(), + ) + .spacing(ThemeSpacing { + base_size: CowStr::from("1rem"), + line_height: CowStr::from("1.6"), + scale: CowStr::from("1.25"), + extra_data: None, + }) + .maybe_default_theme(default_theme) + .build(); + + let theme_result = fetcher + .create_record(theme, None) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?; + + Ok(ThemeSyncResult { + theme_uri: theme_result.uri.into_static(), + theme_cid: theme_result.cid.into_static(), + }) + } +} + +/// Check if theme values have been customized from defaults. +pub fn has_theme_customizations(values: &InlineThemeValues) -> bool { + !values.background.is_empty() + || !values.text.is_empty() + || !values.primary.is_empty() + || !values.link.is_empty() + || values.light_background.is_some() + || values.dark_background.is_some() +} + +/// Load theme values from an existing theme reference. +/// +/// Fetches Theme and ColourScheme records, extracts the 4 base colours +/// (base→background, text→text, primary→primary, link→link). +pub async fn load_theme_values( + fetcher: &Fetcher, + theme_ref: &StrongRef<'_>, +) -> Result { + // Fetch Theme record. + let theme: Theme<'static> = fetcher + .fetch_record( + &Theme::uri(theme_ref.uri.as_ref()) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?, + ) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .value + .into_static(); + + // Fetch light ColourScheme. + let light_scheme: ColourScheme<'static> = fetcher + .fetch_record( + &ColourScheme::uri(theme.light_scheme.uri.as_ref()) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?, + ) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .value + .into_static(); + + // Fetch dark ColourScheme. + let dark_scheme: ColourScheme<'static> = fetcher + .fetch_record( + &ColourScheme::uri(theme.dark_scheme.uri.as_ref()) + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))?, + ) + .await + .map_err(|e| WeaverError::InvalidNotebook(e.to_string().into()))? + .value + .into_static(); + + // Determine default mode. + let default_mode = theme + .default_theme + .as_ref() + .map(|s| s.to_string()) + .unwrap_or_else(|| "auto".to_string()); + + // Extract code themes. + let light_code_theme = match &theme.light_code_theme { + ThemeLightCodeTheme::CodeThemeName(name) => name.as_ref().to_string(), + ThemeLightCodeTheme::CodeThemeFile(file) => file.name.as_ref().to_string(), + ThemeLightCodeTheme::Unknown(_) => "base16-ocean.light".to_string(), + }; + let dark_code_theme = match &theme.dark_code_theme { + ThemeDarkCodeTheme::CodeThemeName(name) => name.as_ref().to_string(), + ThemeDarkCodeTheme::CodeThemeFile(file) => file.name.as_ref().to_string(), + ThemeDarkCodeTheme::Unknown(_) => "base16-ocean.dark".to_string(), + }; + + // Determine primary variant and extract base colours. + let (background, text, primary, link) = match default_mode.as_str() { + "dark" => ( + dark_scheme.colours.base.to_string(), + dark_scheme.colours.text.to_string(), + dark_scheme.colours.primary.to_string(), + dark_scheme.colours.link.to_string(), + ), + _ => ( + light_scheme.colours.base.to_string(), + light_scheme.colours.text.to_string(), + light_scheme.colours.primary.to_string(), + light_scheme.colours.link.to_string(), + ), + }; + + // Check if variants differ (user customized per-variant colours). + let light_differs = default_mode == "dark" + && (light_scheme.colours.base.as_ref() != dark_scheme.colours.base.as_ref() + || light_scheme.colours.text.as_ref() != dark_scheme.colours.text.as_ref() + || light_scheme.colours.primary.as_ref() != dark_scheme.colours.primary.as_ref() + || light_scheme.colours.link.as_ref() != dark_scheme.colours.link.as_ref()); + + let dark_differs = default_mode != "dark" + && (dark_scheme.colours.base.as_ref() != light_scheme.colours.base.as_ref() + || dark_scheme.colours.text.as_ref() != light_scheme.colours.text.as_ref() + || dark_scheme.colours.primary.as_ref() != light_scheme.colours.primary.as_ref() + || dark_scheme.colours.link.as_ref() != light_scheme.colours.link.as_ref()); + + Ok(InlineThemeValues { + background, + text, + primary, + link, + light_background: if light_differs { + Some(light_scheme.colours.base.to_string()) + } else { + None + }, + light_text: if light_differs { + Some(light_scheme.colours.text.to_string()) + } else { + None + }, + light_primary: if light_differs { + Some(light_scheme.colours.primary.to_string()) + } else { + None + }, + light_link: if light_differs { + Some(light_scheme.colours.link.to_string()) + } else { + None + }, + dark_background: if dark_differs { + Some(dark_scheme.colours.base.to_string()) + } else { + None + }, + dark_text: if dark_differs { + Some(dark_scheme.colours.text.to_string()) + } else { + None + }, + dark_primary: if dark_differs { + Some(dark_scheme.colours.primary.to_string()) + } else { + None + }, + dark_link: if dark_differs { + Some(dark_scheme.colours.link.to_string()) + } else { + None + }, + light_code_theme, + dark_code_theme, + default_mode, + }) +} diff --git a/crates/weaver-app/src/components/notebook_actions.rs b/crates/weaver-app/src/components/notebook_actions.rs index d4505bf..f373205 100644 --- a/crates/weaver-app/src/components/notebook_actions.rs +++ b/crates/weaver-app/src/components/notebook_actions.rs @@ -1,37 +1,47 @@ -//! Action buttons for notebooks (pin/unpin, delete). +//! Action buttons for notebooks (pin/unpin, delete, settings). use crate::auth::AuthState; use crate::components::button::{Button, ButtonVariant}; use crate::components::dialog::{DialogContent, DialogDescription, DialogRoot, DialogTitle}; +use crate::components::notebook::{ + delete_publication, has_theme_customizations, load_theme_values, sync_publication, sync_theme, +}; +use crate::components::notebook_editor::{NotebookEditor, NotebookEditorMode, NotebookFormState}; use crate::fetch::Fetcher; use dioxus::prelude::*; use jacquard::types::aturi::AtUri; use jacquard::types::ident::AtIdentifier; -use jacquard::types::string::Cid; +use jacquard::types::string::{Cid, Datetime}; use jacquard::IntoStatic; -use weaver_api::com_atproto::repo::delete_record::DeleteRecord; use weaver_api::com_atproto::repo::put_record::PutRecord; use weaver_api::com_atproto::repo::strong_ref::StrongRef; use weaver_api::sh_weaver::actor::profile::Profile as WeaverProfile; +use weaver_api::sh_weaver::notebook::book::Book; -/// Action buttons for a notebook: pin/unpin, delete. +/// Action buttons for a notebook: pin/unpin, delete, settings. #[component] pub fn NotebookActions( notebook_uri: AtUri<'static>, notebook_cid: Cid<'static>, notebook_title: String, + /// The Book record for populating settings form. + notebook: Book<'static>, #[props(default = false)] is_pinned: bool, #[props(default)] on_deleted: Option>, #[props(default)] on_pinned_changed: Option>, + #[props(default)] on_settings_saved: Option>, ) -> Element { let auth_state = use_context::>(); let fetcher = use_context::(); let mut show_delete_confirm = use_signal(|| false); + let mut show_settings = use_signal(|| false); let mut show_dropdown = use_signal(|| false); let mut deleting = use_signal(|| false); let mut pinning = use_signal(|| false); + let mut saving_settings = use_signal(|| false); let mut error = use_signal(|| None::); + let mut settings_error = use_signal(|| None::); // Check ownership - compare auth DID with notebook's authority let current_did = auth_state.read().did.clone(); @@ -56,44 +66,31 @@ pub fn NotebookActions( let on_deleted = on_deleted_handler.clone(); spawn(async move { - use jacquard::prelude::*; + use jacquard::client::AgentSessionExt; deleting.set(true); error.set(None); - let client = fetcher.get_client(); - let collection = uri.collection(); - let rkey = uri.rkey(); - - if let (Some(collection), Some(rkey)) = (collection, rkey) { - let did = match fetcher.current_did().await { - Some(d) => d, - None => { - error.set(Some("Not authenticated".to_string())); - deleting.set(false); - return; - } - }; - - let request = DeleteRecord::new() - .repo(AtIdentifier::Did(did)) - .collection(collection.clone()) - .rkey(rkey.clone()) - .build(); + let rkey = match uri.rkey() { + Some(r) => r.clone().into_static(), + None => { + error.set(Some("Invalid notebook URI".to_string())); + deleting.set(false); + return; + } + }; - match client.send(request).await { - Ok(_) => { - show_delete_confirm.set(false); - if let Some(handler) = &on_deleted { - handler.call(()); - } - } - Err(e) => { - error.set(Some(format!("Delete failed: {:?}", e))); + let client = fetcher.get_client(); + match client.delete_record::(rkey).await { + Ok(_) => { + show_delete_confirm.set(false); + if let Some(handler) = &on_deleted { + handler.call(()); } } - } else { - error.set(Some("Invalid notebook URI".to_string())); + Err(e) => { + error.set(Some(format!("Delete failed: {:?}", e))); + } } deleting.set(false); }); @@ -244,6 +241,149 @@ pub fn NotebookActions( }); }; + // Handler for saving settings. + let notebook_uri_for_settings = notebook_uri.clone(); + let notebook_for_settings = notebook.clone(); + let on_settings_saved_handler = on_settings_saved.clone(); + let settings_fetcher = fetcher.clone(); + let handle_settings_save = move |form_state: NotebookFormState| { + let fetcher = settings_fetcher.clone(); + let notebook_uri = notebook_uri_for_settings.clone(); + let existing_book = notebook_for_settings.clone(); + let on_settings_saved = on_settings_saved_handler.clone(); + + spawn(async move { + use jacquard::client::AgentSessionExt; + use jacquard::CowStr; + + saving_settings.set(true); + settings_error.set(None); + + let now = Datetime::now(); + + let tags: Option>> = if form_state.tags.is_empty() { + None + } else { + Some(form_state.tags.iter().map(|s| CowStr::from(s.clone())).collect()) + }; + + let path: CowStr<'static> = form_state.path.clone().into(); + let title: CowStr<'static> = form_state.title.clone().into(); + let publish_global = form_state.publish_global; + + // Sync theme if there are customizations. + let theme_ref: Option> = + if has_theme_customizations(&form_state.theme) { + match sync_theme( + &fetcher, + existing_book.theme.as_ref(), + &form_state.theme, + ) + .await + { + Ok(result) => Some( + StrongRef::new() + .uri(result.theme_uri) + .cid(result.theme_cid) + .build(), + ), + Err(e) => { + settings_error + .set(Some(format!("Failed to sync theme: {:?}", e))); + saving_settings.set(false); + return; + } + } + } else { + existing_book.theme.clone() + }; + + let client = fetcher.get_client(); + match client + .update_record::(¬ebook_uri, |book| { + book.title = Some(title.clone()); + if !path.is_empty() { + book.path = Some(path.clone()); + } + book.publish_global = Some(publish_global); + book.tags = tags.clone(); + book.updated_at = Some(now.clone()); + book.theme = theme_ref.clone(); + }) + .await + { + Ok(_output) => { + // Sync or delete publication based on publish_global. + if publish_global { + if let Err(e) = sync_publication( + &fetcher, + ¬ebook_uri, + &title, + &path, + &form_state.theme, + ) + .await + { + tracing::warn!("Failed to sync publication: {:?}", e); + } + } else { + if let Err(e) = delete_publication(&fetcher, ¬ebook_uri).await { + tracing::warn!("Failed to delete publication: {:?}", e); + } + } + + show_settings.set(false); + saving_settings.set(false); + if let Some(handler) = &on_settings_saved { + handler.call(()); + } + } + Err(e) => { + settings_error.set(Some(format!("Failed to save settings: {:?}", e))); + saving_settings.set(false); + } + } + }); + }; + + let handle_settings_cancel = move |_| { + show_settings.set(false); + settings_error.set(None); + }; + + // Form state signal - initialized without theme, updated async when settings opens. + let mut form_state = use_signal(|| NotebookFormState::from_book(¬ebook)); + let mut theme_loaded = use_signal(|| false); + + // Handler for opening settings - loads theme async. + let notebook_for_theme = notebook.clone(); + let theme_fetcher = fetcher.clone(); + let handle_open_settings = move |_| { + show_dropdown.set(false); + + if !theme_loaded() { + // Load theme values asynchronously. + let fetcher = theme_fetcher.clone(); + let book = notebook_for_theme.clone(); + + spawn(async move { + if let Some(theme_ref) = &book.theme { + match load_theme_values(&fetcher, theme_ref).await { + Ok(theme_values) => { + form_state.write().theme = theme_values; + } + Err(e) => { + tracing::warn!("Failed to load theme: {:?}", e); + } + } + } + theme_loaded.set(true); + }); + } + + show_settings.set(true); + }; + rsx! { div { class: "notebook-actions", // Dropdown for actions @@ -269,6 +409,12 @@ pub fn NotebookActions( "Pin" } } + // Settings + button { + class: "dropdown-item", + onclick: handle_open_settings, + "Settings" + } // Delete (danger style) button { class: "dropdown-item dropdown-item-danger", @@ -309,6 +455,20 @@ pub fn NotebookActions( } } } + + // Settings panel + if show_settings() { + div { class: "notebook-settings-panel", + NotebookEditor { + mode: NotebookEditorMode::Edit, + initial_state: Some(form_state()), + on_save: handle_settings_save, + on_cancel: handle_settings_cancel, + saving: saving_settings(), + error: settings_error(), + } + } + } } } } diff --git a/crates/weaver-app/src/components/notebook_editor.rs b/crates/weaver-app/src/components/notebook_editor.rs index 73300ca..997633e 100644 --- a/crates/weaver-app/src/components/notebook_editor.rs +++ b/crates/weaver-app/src/components/notebook_editor.rs @@ -31,6 +31,11 @@ pub struct NotebookFormState { impl NotebookFormState { /// Create form state from an existing Book record. pub fn from_book(book: &Book<'_>) -> Self { + Self::from_book_with_theme(book, None) + } + + /// Create form state with pre-loaded theme values. + pub fn from_book_with_theme(book: &Book<'_>, theme: Option) -> Self { Self { title: book.title.as_ref().map(|t| t.to_string()).unwrap_or_default(), path: book.path.as_ref().map(|p| p.to_string()).unwrap_or_default(), @@ -47,7 +52,7 @@ impl NotebookFormState { .map(|cw| cw.iter().map(|s| s.to_string()).collect()) .unwrap_or_default(), rating: book.rating.as_ref().map(|r| r.to_string()), - theme: InlineThemeValues::default(), // TODO: Load from theme record if present. + theme: theme.unwrap_or_default(), } } } diff --git a/crates/weaver-app/src/components/profile_actions.rs b/crates/weaver-app/src/components/profile_actions.rs index db5899b..50a034e 100644 --- a/crates/weaver-app/src/components/profile_actions.rs +++ b/crates/weaver-app/src/components/profile_actions.rs @@ -1,20 +1,51 @@ //! Actions sidebar/menubar for profile page. +use crate::Route; use crate::auth::AuthState; use crate::components::app_link::{AppLink, AppLinkTarget}; use crate::components::button::{Button, ButtonVariant}; use crate::components::dialog::{DialogContent, DialogDescription, DialogRoot, DialogTitle}; use crate::components::notebook_editor::{NotebookEditor, NotebookEditorMode, NotebookFormState}; use crate::fetch::Fetcher; -use crate::Route; use dioxus::prelude::*; +use jacquard::IntoStatic; +use jacquard::client::AgentSessionExt; use jacquard::types::ident::AtIdentifier; -use weaver_api::com_atproto::repo::create_record::CreateRecord; +use jacquard::types::string::Datetime; use weaver_api::sh_weaver::actor::Author; use weaver_api::sh_weaver::notebook::book::Book; const PROFILE_ACTIONS_CSS: Asset = asset!("/assets/styling/profile-actions.css"); +/// Build a Book record from form state. +fn build_book_from_form( + form_state: &NotebookFormState, + did: &jacquard::types::string::Did<'_>, + path: String, +) -> Book<'static> { + let now = Datetime::now(); + let author = Author::new().did(did.clone().into_static()).build(); + + let title = form_state.title.clone(); + + let tags: Option> = if form_state.tags.is_empty() { + None + } else { + Some(form_state.tags.iter().map(|s| s.clone().into()).collect()) + }; + + Book::new() + .authors(vec![author]) + .entry_list(vec![]) + .maybe_title(Some(title.into())) + .maybe_path(Some(path.into())) + .maybe_publish_global(Some(form_state.publish_global)) + .maybe_tags(tags) + .created_at(now.clone()) + .updated_at(now) + .build() +} + /// Actions available on the profile page for the owner. #[component] pub fn ProfileActions(ident: ReadSignal>) -> Element { @@ -40,7 +71,6 @@ pub fn ProfileActions(ident: ReadSignal>) -> Element { return rsx! {}; } - // Handler for saving a new notebook. let create_fetcher = fetcher.clone(); let handle_save = move |form_state: NotebookFormState| { let fetcher = create_fetcher.clone(); @@ -48,15 +78,9 @@ pub fn ProfileActions(ident: ReadSignal>) -> Element { let ident_value = ident(); spawn(async move { - use jacquard::prelude::*; - use jacquard::types::string::{Datetime, Nsid}; - saving.set(true); error.set(None); - let client = fetcher.get_client(); - - // Get current DID. let did = match fetcher.current_did().await { Some(d) => d, None => { @@ -66,82 +90,23 @@ pub fn ProfileActions(ident: ReadSignal>) -> Element { } }; - // Build the Book record. - let now = Datetime::now(); - - // Create author from current DID. - let author = Author::new().did(did.clone()).build(); - - // Generate path from title if empty. let path = if form_state.path.is_empty() { slugify(&form_state.title) } else { form_state.path.clone() }; - let path_for_navigation = path.clone(); - // Build tags if present. - let tags: Option> = if form_state.tags.is_empty() { - None - } else { - Some(form_state.tags.iter().map(|s| s.as_str().into()).collect()) - }; + let book = build_book_from_form(&form_state, &did, path.clone()); - // Build the notebook. - let book = Book::new() - .authors(vec![author]) - .entry_list(vec![]) // New notebook starts empty. - .maybe_title(Some(form_state.title.as_str().into())) - .maybe_path(Some(path.as_str().into())) - .maybe_publish_global(Some(form_state.publish_global)) - .maybe_tags(tags) - .created_at(now.clone()) - .updated_at(now) - .build(); - - // Serialize to Data. - let book_data = match jacquard::to_data(&book) { - Ok(d) => d, - Err(e) => { - error.set(Some(format!("Failed to serialize notebook: {:?}", e))); + match fetcher.create_record(book, None).await { + Ok(_output) => { + // TODO: If publish_global, create site.standard.publication record (Task 8). + show_create_dialog.set(false); saving.set(false); - return; - } - }; - - // Create the record. - let request = CreateRecord::new() - .repo(AtIdentifier::Did(did.clone())) - .collection(Nsid::new_static("sh.weaver.notebook.book").unwrap()) - .record(book_data) - .build(); - - match client.send(request).await { - Ok(resp) => { - match resp.into_output() { - Ok(_output) => { - // TODO: If publish_global, create site.standard.publication record (Task 8). - - // Navigate to the new notebook. - show_create_dialog.set(false); - saving.set(false); - - // Navigate using path or title. - let book_title = if path_for_navigation.is_empty() { - form_state.title.clone() - } else { - path_for_navigation - }; - navigator.push(Route::NotebookIndex { - ident: ident_value, - book_title: book_title.into(), - }); - } - Err(e) => { - error.set(Some(format!("Failed to create notebook: {:?}", e))); - saving.set(false); - } - } + navigator.push(Route::NotebookIndex { + ident: ident_value, + book_title: path.into(), + }); } Err(e) => { error.set(Some(format!("Failed to create notebook: {:?}", e))); @@ -248,7 +213,6 @@ pub fn ProfileActionsMenubar(ident: ReadSignal>) -> Elemen let fetcher = use_context::(); let navigator = use_navigator(); - // State for the create notebook dialog. let mut show_create_dialog = use_signal(|| false); let mut saving = use_signal(|| false); let mut error = use_signal(|| None::); @@ -265,7 +229,6 @@ pub fn ProfileActionsMenubar(ident: ReadSignal>) -> Elemen return rsx! {}; } - // Handler for saving a new notebook. let create_fetcher = fetcher.clone(); let handle_save = move |form_state: NotebookFormState| { let fetcher = create_fetcher.clone(); @@ -273,15 +236,9 @@ pub fn ProfileActionsMenubar(ident: ReadSignal>) -> Elemen let ident_value = ident(); spawn(async move { - use jacquard::prelude::*; - use jacquard::types::string::{Datetime, Nsid}; - saving.set(true); error.set(None); - let client = fetcher.get_client(); - - // Get current DID. let did = match fetcher.current_did().await { Some(d) => d, None => { @@ -291,82 +248,23 @@ pub fn ProfileActionsMenubar(ident: ReadSignal>) -> Elemen } }; - // Build the Book record. - let now = Datetime::now(); - - // Create author from current DID. - let author = Author::new().did(did.clone()).build(); - - // Generate path from title if empty. let path = if form_state.path.is_empty() { slugify(&form_state.title) } else { form_state.path.clone() }; - let path_for_navigation = path.clone(); - // Build tags if present. - let tags: Option> = if form_state.tags.is_empty() { - None - } else { - Some(form_state.tags.iter().map(|s| s.as_str().into()).collect()) - }; + let book = build_book_from_form(&form_state, &did, path.clone()); - // Build the notebook. - let book = Book::new() - .authors(vec![author]) - .entry_list(vec![]) // New notebook starts empty. - .maybe_title(Some(form_state.title.as_str().into())) - .maybe_path(Some(path.as_str().into())) - .maybe_publish_global(Some(form_state.publish_global)) - .maybe_tags(tags) - .created_at(now.clone()) - .updated_at(now) - .build(); - - // Serialize to Data. - let book_data = match jacquard::to_data(&book) { - Ok(d) => d, - Err(e) => { - error.set(Some(format!("Failed to serialize notebook: {:?}", e))); + match fetcher.create_record(book, None).await { + Ok(_output) => { + // TODO: If publish_global, create site.standard.publication record (Task 8). + show_create_dialog.set(false); saving.set(false); - return; - } - }; - - // Create the record. - let request = CreateRecord::new() - .repo(AtIdentifier::Did(did.clone())) - .collection(Nsid::new_static("sh.weaver.notebook.book").unwrap()) - .record(book_data) - .build(); - - match client.send(request).await { - Ok(resp) => { - match resp.into_output() { - Ok(_output) => { - // TODO: If publish_global, create site.standard.publication record (Task 8). - - // Navigate to the new notebook. - show_create_dialog.set(false); - saving.set(false); - - // Navigate using path or title. - let book_title = if path_for_navigation.is_empty() { - form_state.title.clone() - } else { - path_for_navigation - }; - navigator.push(Route::NotebookIndex { - ident: ident_value, - book_title: book_title.into(), - }); - } - Err(e) => { - error.set(Some(format!("Failed to create notebook: {:?}", e))); - saving.set(false); - } - } + navigator.push(Route::NotebookIndex { + ident: ident_value, + book_title: path.into(), + }); } Err(e) => { error.set(Some(format!("Failed to create notebook: {:?}", e))); diff --git a/crates/weaver-index/src/bin/weaver_indexer.rs b/crates/weaver-index/src/bin/weaver_indexer.rs index 9c46ffd..7ef88b1 100644 --- a/crates/weaver-index/src/bin/weaver_indexer.rs +++ b/crates/weaver-index/src/bin/weaver_indexer.rs @@ -1,8 +1,8 @@ use std::path::PathBuf; use clap::{Parser, Subcommand}; -use tracing::{error, info, warn}; use jacquard::client::UnauthenticatedSession; +use tracing::{error, info, warn}; use weaver_index::clickhouse::InserterConfig; use weaver_index::clickhouse::{Client, Migrator}; use weaver_index::config::{ diff --git a/crates/weaver-index/src/clickhouse/queries/identity.rs b/crates/weaver-index/src/clickhouse/queries/identity.rs index f824ec3..9ee6b39 100644 --- a/crates/weaver-index/src/clickhouse/queries/identity.rs +++ b/crates/weaver-index/src/clickhouse/queries/identity.rs @@ -21,7 +21,10 @@ impl Client { /// /// Returns the active (non-freed) mapping for the handle, if one exists. /// Query orders by freed ASC, event_time DESC to get active mapping first. - pub async fn resolve_handle(&self, handle: &str) -> Result, IndexError> { + pub async fn resolve_handle( + &self, + handle: &str, + ) -> Result, IndexError> { let query = r#" SELECT handle, did, freed, account_status FROM handle_mappings @@ -48,7 +51,10 @@ impl Client { /// Resolve a DID to its current handle using the handle_mappings table. /// /// Uses the by_did projection for efficient lookup. - pub async fn resolve_did_to_handle(&self, did: &str) -> Result, IndexError> { + pub async fn resolve_did_to_handle( + &self, + did: &str, + ) -> Result, IndexError> { let query = r#" SELECT handle, did, freed, account_status FROM handle_mappings @@ -75,11 +81,7 @@ impl Client { /// Cache a handle resolution result in handle_mappings. /// /// Used when we resolve via external resolver and want to cache the result. - pub async fn cache_handle_resolution( - &self, - handle: &str, - did: &str, - ) -> Result<(), IndexError> { + pub async fn cache_handle_resolution(&self, handle: &str, did: &str) -> Result<(), IndexError> { use chrono::Utc; let query = r#" diff --git a/crates/weaver-index/src/clickhouse/queries/notebooks.rs b/crates/weaver-index/src/clickhouse/queries/notebooks.rs index a6087da..e90c74e 100644 --- a/crates/weaver-index/src/clickhouse/queries/notebooks.rs +++ b/crates/weaver-index/src/clickhouse/queries/notebooks.rs @@ -816,4 +816,56 @@ impl Client { Ok(row) } + + /// Get the index of an entry within a notebook. + /// + /// Returns the position (0-indexed) of the entry in the notebook's entry list. + pub async fn get_entry_index_in_notebook( + &self, + notebook_did: &str, + notebook_rkey: &str, + entry_did: &str, + entry_rkey: &str, + ) -> Result, IndexError> { + // Query the notebook_entries table to find the position of this entry + let query = r#" + WITH ranked AS ( + SELECT + entry_did, + entry_rkey, + argMax(position, indexed_at) AS position, + ROW_NUMBER() OVER (ORDER BY argMax(position, indexed_at) ASC) - 1 AS idx + FROM notebook_entries + WHERE notebook_did = ? + AND notebook_rkey = ? + GROUP BY entry_did, entry_rkey + ) + SELECT idx + FROM ranked + WHERE entry_did = ? AND entry_rkey = ? + LIMIT 1 + "#; + + let result: Option = self + .inner() + .query(query) + .bind(notebook_did) + .bind(notebook_rkey) + .bind(entry_did) + .bind(entry_rkey) + .fetch_optional::() + .await + .map_err(|e| ClickHouseError::Query { + message: "failed to get entry index in notebook".into(), + source: e, + })?; + + Ok(result.map(|r| r.idx as u32)) + } +} + +/// Row for entry index query. +#[derive(Debug, Clone, Row, Deserialize)] +struct EntryIndexRow { + pub idx: u64, } diff --git a/crates/weaver-index/src/clickhouse/queries/profiles.rs b/crates/weaver-index/src/clickhouse/queries/profiles.rs index c563cf4..6ac7af9 100644 --- a/crates/weaver-index/src/clickhouse/queries/profiles.rs +++ b/crates/weaver-index/src/clickhouse/queries/profiles.rs @@ -76,7 +76,10 @@ impl Client { /// Get profile counts for a DID from profile_counts (SummingMergeTree). /// /// Note: SummingMergeTree requires sum() to get final values. - pub async fn get_profile_counts(&self, did: &str) -> Result, IndexError> { + pub async fn get_profile_counts( + &self, + did: &str, + ) -> Result, IndexError> { let query = r#" SELECT did, @@ -106,19 +109,16 @@ impl Client { /// Get a profile with counts in a single call. /// /// Runs both queries concurrently for efficiency. - pub async fn get_profile_with_counts(&self, did: &str) -> Result, IndexError> { - let (profile, counts) = tokio::join!( - self.get_profile(did), - self.get_profile_counts(did) - ); + pub async fn get_profile_with_counts( + &self, + did: &str, + ) -> Result, IndexError> { + let (profile, counts) = tokio::join!(self.get_profile(did), self.get_profile_counts(did)); let profile = profile?; let counts = counts?; - Ok(profile.map(|p| ProfileWithCounts { - profile: p, - counts, - })) + Ok(profile.map(|p| ProfileWithCounts { profile: p, counts })) } /// Batch get profiles for multiple DIDs. diff --git a/crates/weaver-index/src/endpoints/collab.rs b/crates/weaver-index/src/endpoints/collab.rs index 8175da2..86bc0b5 100644 --- a/crates/weaver-index/src/endpoints/collab.rs +++ b/crates/weaver-index/src/endpoints/collab.rs @@ -25,8 +25,8 @@ use weaver_api::sh_weaver::collab::{CollaborationStateView, ParticipantStateView use crate::clickhouse::{CollaboratorRow, ProfileRow}; use crate::endpoints::actor::Viewer; -use crate::endpoints::{non_empty_str, resolve_uri}; use crate::endpoints::repo::XrpcErrorResponse; +use crate::endpoints::{non_empty_str, resolve_uri}; use crate::server::AppState; /// Handle sh.weaver.collab.getResourceParticipants diff --git a/crates/weaver-index/src/endpoints/domain.rs b/crates/weaver-index/src/endpoints/domain.rs index abc8665..5484281 100644 --- a/crates/weaver-index/src/endpoints/domain.rs +++ b/crates/weaver-index/src/endpoints/domain.rs @@ -1,19 +1,26 @@ //! sh.weaver.domain.* endpoint handlers +use std::collections::{HashMap, HashSet}; + use axum::{Json, extract::State}; use jacquard::IntoStatic; -use serde::{Deserialize, Serialize}; use jacquard::cowstr::ToCowStr; -use jacquard::types::string::{AtUri, Cid, Did}; +use jacquard::types::string::{AtUri, Cid, Did, Uri}; +use jacquard::types::value::Data; use jacquard_axum::ExtractXrpc; +use serde::{Deserialize, Serialize}; use weaver_api::sh_weaver::domain::{ DocumentView, PublicationView, + generate_document::{GenerateDocumentOutput, GenerateDocumentRequest}, resolve_by_domain::{ResolveByDomainOutput, ResolveByDomainRequest}, resolve_document::{ResolveDocumentOutput, ResolveDocumentRequest}, }; +use weaver_api::sh_weaver::notebook::{BookEntryView, EntryView}; +use weaver_api::site_standard::document::Document; -use crate::clickhouse::{DocumentRow, PublicationRow}; -use crate::endpoints::notebook::parse_record_json; +use crate::clickhouse::{DocumentRow, ProfileRow, PublicationRow}; +use crate::endpoints::actor::resolve_actor; +use crate::endpoints::notebook::{build_entry_view, hydrate_authors, parse_record_json}; use crate::endpoints::repo::XrpcErrorResponse; use crate::server::AppState; @@ -201,6 +208,369 @@ fn build_document_view(row: &DocumentRow) -> Result, XrpcE .build()) } +/// Handle sh.weaver.domain.generateDocument +/// +/// Generates a site.standard.document record from a weaver entry. +/// Returns a ready-to-write record with fully hydrated BookEntryView in content. +pub async fn generate_document( + State(state): State, + ExtractXrpc(args): ExtractXrpc, +) -> Result>, XrpcErrorResponse> { + // Parse entry URI + let entry_uri = &args.entry; + let entry_authority = entry_uri.authority(); + let entry_rkey = entry_uri + .rkey() + .ok_or_else(|| XrpcErrorResponse::invalid_request("Entry URI must include rkey"))?; + + // Resolve entry authority to DID + let entry_did = resolve_actor(&state, entry_authority).await?; + let entry_did_str = entry_did.as_str(); + let entry_rkey_str = entry_rkey.as_ref(); + + // Parse publication URI + let pub_uri = &args.publication; + let pub_authority = pub_uri.authority(); + let pub_rkey = pub_uri + .rkey() + .ok_or_else(|| XrpcErrorResponse::invalid_request("Publication URI must include rkey"))?; + + // Resolve publication authority to DID + let pub_did = resolve_actor(&state, pub_authority).await?; + let pub_did_str = pub_did.as_str(); + let pub_rkey_str = pub_rkey.as_ref(); + + // Verify publication exists and get notebook info + let pub_row = state + .clickhouse + .get_publication(pub_did_str, pub_rkey_str) + .await + .map_err(|e| { + tracing::error!("Failed to get publication: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })? + .ok_or_else(|| publication_not_found("Publication not found"))?; + + // Check that publication is linked to a notebook + if pub_row.notebook_uri.is_empty() { + return Err(notebook_not_linked( + "Publication is not linked to a notebook", + )); + } + + // Get entry - either from inline record or from index + let (entry_view, entry_record) = if let Some(ref inline_record) = args.entry_record { + // Use inline record directly - build an EntryView from the Data + build_entry_view_from_data(&entry_did, entry_rkey_str, inline_record.clone(), &state) + .await? + } else { + // Fetch entry from index + let entry_row = state + .clickhouse + .get_entry_exact(entry_did_str, entry_rkey_str) + .await + .map_err(|e| { + tracing::error!("Failed to get entry: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })? + .ok_or_else(|| entry_not_found("Entry not found"))?; + + // Hydrate authors for the entry + let mut author_dids: HashSet<&str> = HashSet::new(); + for did in &entry_row.author_dids { + author_dids.insert(did.as_str()); + } + let author_dids_vec: Vec<&str> = author_dids.into_iter().collect(); + let profiles = state + .clickhouse + .get_profiles_batch(&author_dids_vec) + .await + .map_err(|e| { + tracing::error!("Failed to fetch profiles: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + let profile_map: HashMap<&str, &ProfileRow> = + profiles.iter().map(|p| (p.did.as_str(), p)).collect(); + + let entry_view = build_entry_view(&entry_row, &profile_map)?; + let entry_record = parse_record_json(&entry_row.record)?; + (entry_view, entry_record) + }; + + // Extract title from entry + let title = entry_view + .title + .as_ref() + .map(|t| t.as_ref().to_string()) + .unwrap_or_else(|| "Untitled".to_string()); + + // Try to extract description from the entry record (extract content summary) + let description = extract_description_from_entry(&entry_record); + + // Get the entry index within the notebook. + let entry_index = + get_entry_index_in_notebook(&state, &pub_row.notebook_uri, entry_did_str, entry_rkey_str) + .await + .unwrap_or_else(|| { + tracing::warn!( + entry_did = %entry_did_str, + entry_rkey = %entry_rkey_str, + notebook_uri = %pub_row.notebook_uri, + "Could not determine entry index, defaulting to 0" + ); + 0 + }); + + // Build BookEntryView (without prev/next for now - caller can add if needed) + let book_entry = BookEntryView::new() + .entry(entry_view) + .index(entry_index) + .build(); + + // Serialize BookEntryView to JSON string, then parse as Data + let content_json = serde_json::to_string(&book_entry).map_err(|e| { + tracing::error!("Failed to serialize BookEntryView: {}", e); + XrpcErrorResponse::internal_error("Failed to serialize content") + })?; + let content_data: Data<'_> = serde_json::from_str(&content_json).map_err(|e| { + tracing::error!("Failed to parse content as Data: {}", e); + XrpcErrorResponse::internal_error("Failed to convert to Data") + })?; + let content_data = content_data.into_static(); + + // Build the site.standard.document record + let document = Document::new() + .site(Uri::new(args.publication.as_str()).map_err(|e| { + tracing::error!("Invalid publication URI: {}", e); + XrpcErrorResponse::internal_error("Invalid publication URI") + })?) + .title(title) + .published_at(chrono::Utc::now().fixed_offset()) + .path(Some(args.path.clone())) + .content(content_data) + .maybe_description(description.map(|d| d.into())) + .build(); + + Ok(Json( + GenerateDocumentOutput { + record: document.into_static(), + extra_data: None, + } + .into_static(), + )) +} + +/// Build an EntryView from inline Data (when entry_record is provided). +async fn build_entry_view_from_data( + entry_did: &Did<'_>, + entry_rkey: &str, + entry_record: Data<'_>, + state: &AppState, +) -> Result<(EntryView<'static>, Data<'static>), XrpcErrorResponse> { + // Extract authorDids from record, fallback to entry owner. + let author_dids = extract_author_dids(&entry_record) + .unwrap_or_else(|| vec![entry_did.as_str().to_string()]); + + // Fetch profiles for authors + let author_dids_ref: Vec<&str> = author_dids.iter().map(|s| s.as_str()).collect(); + let profiles = state + .clickhouse + .get_profiles_batch(&author_dids_ref) + .await + .map_err(|e| { + tracing::error!("Failed to fetch profiles: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + let profile_map: HashMap<&str, &ProfileRow> = + profiles.iter().map(|p| (p.did.as_str(), p)).collect(); + + // Hydrate authors + let author_smolstrs: Vec = author_dids + .iter() + .map(|s| smol_str::SmolStr::new(s)) + .collect(); + let authors = hydrate_authors(&author_smolstrs, &profile_map)?; + + // Extract title and path from record using pattern matching on Data + let (title, path) = extract_title_and_path(&entry_record); + + // Build URI + let uri_str = format!( + "at://{}/sh.weaver.notebook.entry/{}", + entry_did.as_str(), + entry_rkey + ); + let uri = AtUri::new(&uri_str).map_err(|e| { + tracing::error!("Invalid entry URI: {}", e); + XrpcErrorResponse::internal_error("Invalid entry URI") + })?; + + // Use a placeholder CID since we're building from inline data. + // This is a valid CIDv1 with identity codec (bafkrei prefix) and 32 'a' chars. + let placeholder_cid = + Cid::str("bafkreiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); + + // Build entry view + let mut builder = EntryView::new() + .uri(uri.into_static()) + .cid(placeholder_cid.into_static()) + .authors(authors) + .record(entry_record.clone().into_static()) + .indexed_at(chrono::Utc::now().fixed_offset()); + + if let Some(t) = title { + builder = builder.title(jacquard::CowStr::from(t)); + } + if let Some(p) = path { + builder = builder.path(jacquard::CowStr::from(p)); + } + + Ok((builder.build(), entry_record.into_static())) +} + +/// Extract title and path from a Data record using pattern matching. +fn extract_title_and_path(entry_record: &Data<'_>) -> (Option, Option) { + use jacquard::types::value::Object; + + if let Data::Object(Object(map)) = entry_record { + let title = map.get("title").and_then(|v| { + if let Data::String(s) = v { + Some(s.as_ref().to_string()) + } else { + None + } + }); + let path = map.get("path").and_then(|v| { + if let Data::String(s) = v { + Some(s.as_ref().to_string()) + } else { + None + } + }); + (title, path) + } else { + (None, None) + } +} + +/// Extract authorDids from a Data record using pattern matching. +fn extract_author_dids(entry_record: &Data<'_>) -> Option> { + use jacquard::types::value::Object; + + if let Data::Object(Object(map)) = entry_record { + map.get("authorDids").and_then(|v| { + if let Data::Array(arr) = v { + let dids: Vec = arr + .iter() + .filter_map(|item| { + if let Data::String(s) = item { + Some(s.as_ref().to_string()) + } else { + None + } + }) + .collect(); + if dids.is_empty() { + None + } else { + Some(dids) + } + } else { + None + } + }) + } else { + None + } +} + +/// Extract a description from an entry record (first ~300 chars of content). +fn extract_description_from_entry(entry_record: &Data<'_>) -> Option { + use jacquard::types::value::Object; + + if let Data::Object(Object(map)) = entry_record { + map.get("content").and_then(|v| { + if let Data::String(s) = v { + let content = s.as_ref(); + // Take first 300 chars, break at word boundary + let trimmed: String = content.chars().take(300).collect(); + if content.len() > 300 { + // Find last space to break at word boundary + if let Some(last_space) = trimmed.rfind(' ') { + Some(format!("{}...", &trimmed[..last_space])) + } else { + Some(format!("{}...", trimmed)) + } + } else { + Some(trimmed) + } + } else { + None + } + }) + } else { + None + } +} + +/// Get the index of an entry within a notebook. +async fn get_entry_index_in_notebook( + state: &AppState, + notebook_uri: &str, + entry_did: &str, + entry_rkey: &str, +) -> Option { + // Parse notebook URI to get DID and rkey + let notebook_at_uri = AtUri::new(notebook_uri).ok()?; + let notebook_did = notebook_at_uri.authority(); + let notebook_rkey = notebook_at_uri.rkey()?; + + // Resolve notebook DID if it's a handle + let notebook_did_resolved = resolve_actor(state, notebook_did).await.ok()?; + + // Get entry index from ClickHouse + let index = state + .clickhouse + .get_entry_index_in_notebook( + notebook_did_resolved.as_str(), + notebook_rkey.as_ref(), + entry_did, + entry_rkey, + ) + .await + .ok() + .flatten(); + + index.map(|i| i as i64) +} + +// === Custom error constructors for generateDocument === + +fn publication_not_found(message: impl Into) -> XrpcErrorResponse { + XrpcErrorResponse { + status: axum::http::StatusCode::NOT_FOUND, + error: "PublicationNotFound".to_string(), + message: Some(message.into()), + } +} + +fn entry_not_found(message: impl Into) -> XrpcErrorResponse { + XrpcErrorResponse { + status: axum::http::StatusCode::NOT_FOUND, + error: "EntryNotFound".to_string(), + message: Some(message.into()), + } +} + +fn notebook_not_linked(message: impl Into) -> XrpcErrorResponse { + XrpcErrorResponse { + status: axum::http::StatusCode::BAD_REQUEST, + error: "NotebookNotLinked".to_string(), + message: Some(message.into()), + } +} + // === Internal Caddy Verification Endpoint === #[derive(Debug, Deserialize)] diff --git a/crates/weaver-index/src/endpoints/repo.rs b/crates/weaver-index/src/endpoints/repo.rs index ae3e642..a4ac9dd 100644 --- a/crates/weaver-index/src/endpoints/repo.rs +++ b/crates/weaver-index/src/endpoints/repo.rs @@ -167,7 +167,13 @@ pub async fn get_record( let record_json = serde_json::to_string(&upstream.value).unwrap_or_default(); if !record_json.is_empty() { if let Err(e) = clickhouse - .insert_record(&did_str, &collection_str, &rkey_str, upstream_cid, &record_json) + .insert_record( + &did_str, + &collection_str, + &rkey_str, + upstream_cid, + &record_json, + ) .await { tracing::warn!("Failed to update stale cache entry: {}", e); diff --git a/crates/weaver-index/src/error.rs b/crates/weaver-index/src/error.rs index c331136..f0ec6e2 100644 --- a/crates/weaver-index/src/error.rs +++ b/crates/weaver-index/src/error.rs @@ -181,7 +181,10 @@ pub enum ConfigError { #[error("invalid configuration value for {field}: {message}")] #[diagnostic(code(config::invalid))] - Invalid { field: &'static str, message: String }, + Invalid { + field: &'static str, + message: String, + }, #[error("failed to parse URL: {url}")] #[diagnostic(code(config::url_parse))] diff --git a/crates/weaver-index/src/lib.rs b/crates/weaver-index/src/lib.rs index 952079a..9e28d0c 100644 --- a/crates/weaver-index/src/lib.rs +++ b/crates/weaver-index/src/lib.rs @@ -18,4 +18,4 @@ pub use parallel_tap::TapIndexer; pub use server::{AppState, ServerConfig}; pub use service_identity::ServiceIdentity; pub use sqlite::{ShardKey, ShardRouter, SqliteShard}; -pub use tasks::{run_draft_title_task, DraftTitleTaskConfig}; +pub use tasks::{DraftTitleTaskConfig, run_draft_title_task}; diff --git a/crates/weaver-index/src/server.rs b/crates/weaver-index/src/server.rs index de3970c..e8b0bae 100644 --- a/crates/weaver-index/src/server.rs +++ b/crates/weaver-index/src/server.rs @@ -2,9 +2,10 @@ use std::net::SocketAddr; use std::sync::Arc; use axum::{ - Json, Router, middleware, + Json, Router, extract::State, http::{StatusCode, header}, + middleware, response::{Html, IntoResponse}, routing::get, }; @@ -32,18 +33,19 @@ use weaver_api::sh_weaver::actor::{ use weaver_api::sh_weaver::collab::get_collaboration_state::GetCollaborationStateRequest; use weaver_api::sh_weaver::collab::get_resource_participants::GetResourceParticipantsRequest; use weaver_api::sh_weaver::collab::get_resource_sessions::GetResourceSessionsRequest; +use weaver_api::sh_weaver::domain::{ + generate_document::GenerateDocumentRequest, resolve_by_domain::ResolveByDomainRequest, + resolve_document::ResolveDocumentRequest, +}; use weaver_api::sh_weaver::edit::get_contributors::GetContributorsRequest; use weaver_api::sh_weaver::edit::get_edit_history::GetEditHistoryRequest; use weaver_api::sh_weaver::edit::list_drafts::ListDraftsRequest; -use weaver_api::sh_weaver::domain::{ - resolve_by_domain::ResolveByDomainRequest, resolve_document::ResolveDocumentRequest, -}; use weaver_api::sh_weaver::notebook::{ get_book_entry::GetBookEntryRequest, get_entry::GetEntryRequest, get_entry_feed::GetEntryFeedRequest, get_entry_notebooks::GetEntryNotebooksRequest, get_notebook::GetNotebookRequest, get_notebook_feed::GetNotebookFeedRequest, - resolve_entry::ResolveEntryRequest, - resolve_global_notebook::ResolveGlobalNotebookRequest, resolve_notebook::ResolveNotebookRequest, + resolve_entry::ResolveEntryRequest, resolve_global_notebook::ResolveGlobalNotebookRequest, + resolve_notebook::ResolveNotebookRequest, }; use crate::clickhouse::Client; @@ -152,6 +154,9 @@ pub fn router(state: AppState, did_doc: DidDocument<'static>) -> Router { .merge(ResolveDocumentRequest::into_router( domain::resolve_document, )) + .merge(GenerateDocumentRequest::into_router( + domain::generate_document, + )) // sh.weaver.collab.* endpoints .merge(GetResourceParticipantsRequest::into_router( collab::get_resource_participants, diff --git a/crates/weaver-index/src/tasks/draft_titles.rs b/crates/weaver-index/src/tasks/draft_titles.rs index e2b803f..53c0fb8 100644 --- a/crates/weaver-index/src/tasks/draft_titles.rs +++ b/crates/weaver-index/src/tasks/draft_titles.rs @@ -197,8 +197,14 @@ async fn extract_and_save_title( // Fetch snapshot blob let snapshot_cid = root_record.snapshot.blob().cid(); - let snapshot_bytes = - fetch_blob(resolver, blob_cache, pds_url.clone(), &node_did, snapshot_cid).await?; + let snapshot_bytes = fetch_blob( + resolver, + blob_cache, + pds_url.clone(), + &node_did, + snapshot_cid, + ) + .await?; // Import snapshot doc.import(&snapshot_bytes) @@ -224,7 +230,14 @@ async fn extract_and_save_title( } else if let Some(ref snapshot_blob) = diff_record.snapshot { // Fetch snapshot blob let snapshot_cid = snapshot_blob.blob().cid(); - fetch_blob(resolver, blob_cache, pds_url.clone(), &node_did, snapshot_cid).await? + fetch_blob( + resolver, + blob_cache, + pds_url.clone(), + &node_did, + snapshot_cid, + ) + .await? } else { warn!( did = %node.did, diff --git a/crates/weaver-index/src/tasks/mod.rs b/crates/weaver-index/src/tasks/mod.rs index b8c1b3b..a5efd4d 100644 --- a/crates/weaver-index/src/tasks/mod.rs +++ b/crates/weaver-index/src/tasks/mod.rs @@ -2,4 +2,4 @@ mod draft_titles; -pub use draft_titles::{run_draft_title_task, DraftTitleTaskConfig}; +pub use draft_titles::{DraftTitleTaskConfig, run_draft_title_task}; diff --git a/crates/weaver-renderer/Cargo.toml b/crates/weaver-renderer/Cargo.toml index d0c4b79..febac5e 100644 --- a/crates/weaver-renderer/Cargo.toml +++ b/crates/weaver-renderer/Cargo.toml @@ -38,6 +38,8 @@ pin-project = "1.1.10" smol_str = { version = "0.3", features = ["serde"] } pulldown-latex = "0.6" mime-sniffer = "0.1.3" +palette = "0.7" +csscolorparser = { version = "0.7", features = ["lab"] } # Native: full syntect with onig (fast) + themes for CSS generation [target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dependencies] diff --git a/crates/weaver-renderer/src/colour_gen/mod.rs b/crates/weaver-renderer/src/colour_gen/mod.rs new file mode 100644 index 0000000..7926ec0 --- /dev/null +++ b/crates/weaver-renderer/src/colour_gen/mod.rs @@ -0,0 +1,333 @@ +//! Colour generation for notebook themes. +//! +//! Generates a full 16-colour palette from 4 user-specified colours +//! (background, text, primary, link) using perceptual colour operations. + +use palette::{Clamp, FromColor, IntoColor, LinSrgb, Oklch, Srgb}; +use weaver_api::sh_weaver::notebook::colour_scheme::ColourSchemeColours; + +use crate::themes::BUILTIN_COLOUR_SCHEMES; + +/// Parse any CSS colour string to Oklch. +/// +/// Supports: hex (#rgb, #rrggbb, #rrggbbaa), rgb(), rgba(), hsl(), hsla(), +/// hwb(), lab(), lch(), oklab(), oklch(), and named colours. +pub fn css_to_oklch(css: &str) -> Result { + let css = css.trim(); + let css = if !css.starts_with('#') + && !css.contains('(') + && css.chars().all(|c| c.is_ascii_hexdigit()) + { + format!("#{}", css) + } else { + css.to_string() + }; + + let color = csscolorparser::parse(&css) + .map_err(|e| ColourGenError::InvalidColour(format!("{}: {}", css, e)))?; + + let [r, g, b, _a] = color.to_array(); + let srgb = Srgb::new(r as f32, g as f32, b as f32); + Ok(Oklch::from_color(srgb.into_linear())) +} + +/// Convert Oklch to hex string (without #, uppercase). +pub fn oklch_to_hex(oklch: Oklch) -> String { + let linear: LinSrgb = oklch.into_color(); + let clamped = linear.clamp(); + let rgb: Srgb = Srgb::from_linear(clamped); + format!("{:02X}{:02X}{:02X}", rgb.red, rgb.green, rgb.blue) +} + +/// Determine if a colour is "dark" based on Oklch lightness. +pub fn is_dark(oklch: &Oklch) -> bool { + oklch.l < 0.5 +} + +/// Apply the hue and chroma from `source` to the lightness of `target`. +/// +/// The chroma is scaled proportionally to maintain the relative colourfulness +/// while respecting the target lightness. +pub fn transfer_hue_chroma(source: Oklch, target: Oklch) -> Oklch { + Oklch::new(target.l, source.chroma, source.hue) +} + +/// Apply hue/chroma with lightness clamping for dark themes. +/// Ensures text is lightest, base is darkest. +pub fn transfer_for_dark_theme( + source: Oklch, + target: Oklch, + is_text: bool, + is_base: bool, +) -> Oklch { + let mut result = transfer_hue_chroma(source, target); + + if is_base { + result.l = result.l.min(0.25); + } else if is_text { + result.l = result.l.max(0.85); + } + + result +} + +/// Apply hue/chroma with lightness clamping for light themes. +/// Ensures text is darkest, base is lightest. +pub fn transfer_for_light_theme( + source: Oklch, + target: Oklch, + is_text: bool, + is_base: bool, +) -> Oklch { + let mut result = transfer_hue_chroma(source, target); + + if is_base { + result.l = result.l.max(0.92); + } else if is_text { + result.l = result.l.min(0.25); + } + + result +} + +/// Semantic colour configuration. +mod semantic { + /// Hues in Oklch degrees. + pub mod hue { + pub const ERROR: f32 = 30.0; // Red + pub const WARNING: f32 = 80.0; // Gold-amber with high saturation + pub const SUCCESS: f32 = 165.0; // Teal-green (shifted from pure green to allow more cyan) + } + + /// Minimum chroma values to keep semantic colours recognizable. + pub mod min_chroma { + pub const ERROR: f32 = 0.16; // Must stay clearly red + pub const WARNING: f32 = 0.19; // Needs high saturation to avoid looking muddy + pub const SUCCESS: f32 = 0.08; // Can be quite muted, teal reads well + } + + /// Lightness values per variant. Warning needs to be brighter to avoid going brown. + pub mod lightness { + pub const ERROR_DARK: f32 = 0.70; + pub const ERROR_LIGHT: f32 = 0.55; + pub const WARNING_DARK: f32 = 0.78; // Brighter to stay amber + pub const WARNING_LIGHT: f32 = 0.78; // Brighter to avoid brown + pub const SUCCESS_DARK: f32 = 0.70; + pub const SUCCESS_LIGHT: f32 = 0.50; // Can be slightly darker, teal handles it + } +} + +/// Generate a semantic colour derived from user's primary. +/// +/// Takes the user's chroma (clamped to minimum) and applies a fixed semantic hue. +fn generate_semantic_colour( + user_primary: Oklch, + hue: f32, + min_chroma: f32, + lightness: f32, +) -> Oklch { + let chroma = user_primary.chroma.max(min_chroma); + Oklch::new(lightness, chroma, hue) +} + +#[derive(Debug, Clone, thiserror::Error)] +pub enum ColourGenError { + #[error("invalid colour: {0}")] + InvalidColour(String), +} + +/// The 4 user-provided colours for theme generation. +#[derive(Debug, Clone)] +pub struct ThemeInputs { + pub background: String, + pub text: String, + pub primary: String, + pub link: String, +} + +/// Which variant to generate. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ThemeVariant { + Light, + Dark, +} + +/// Find the most neutral base theme for a variant. +fn get_neutral_base(variant: ThemeVariant) -> &'static ColourSchemeColours<'static> { + let target_variant = match variant { + ThemeVariant::Light => "light", + ThemeVariant::Dark => "dark", + }; + + BUILTIN_COLOUR_SCHEMES + .iter() + .find(|s| s.variant == target_variant) + .map(|s| &s.colours) + .expect("should have at least one builtin theme per variant") +} + +/// Determine theme variant from background colour luminance. +pub fn detect_variant(background: &str) -> Result { + let oklch = css_to_oklch(background)?; + Ok(if is_dark(&oklch) { + ThemeVariant::Dark + } else { + ThemeVariant::Light + }) +} + +/// Generate a full 16-colour palette from 4 user inputs. +pub fn generate_palette( + inputs: &ThemeInputs, + variant: ThemeVariant, +) -> Result, ColourGenError> { + let user_base = css_to_oklch(&inputs.background)?; + let user_text = css_to_oklch(&inputs.text)?; + let user_primary = css_to_oklch(&inputs.primary)?; + let user_link = css_to_oklch(&inputs.link)?; + + let base_theme = get_neutral_base(variant); + + let base_base = css_to_oklch(base_theme.base.as_ref())?; + let base_surface = css_to_oklch(base_theme.surface.as_ref())?; + let base_overlay = css_to_oklch(base_theme.overlay.as_ref())?; + let base_text = css_to_oklch(base_theme.text.as_ref())?; + let base_muted = css_to_oklch(base_theme.muted.as_ref())?; + let base_subtle = css_to_oklch(base_theme.subtle.as_ref())?; + let base_emphasis = css_to_oklch(base_theme.emphasis.as_ref())?; + let base_primary = css_to_oklch(base_theme.primary.as_ref())?; + let base_secondary = css_to_oklch(base_theme.secondary.as_ref())?; + let base_tertiary = css_to_oklch(base_theme.tertiary.as_ref())?; + let base_border = css_to_oklch(base_theme.border.as_ref())?; + let base_link = css_to_oklch(base_theme.link.as_ref())?; + let base_highlight = css_to_oklch(base_theme.highlight.as_ref())?; + + let transfer: fn(Oklch, Oklch, bool, bool) -> Oklch = match variant { + ThemeVariant::Dark => transfer_for_dark_theme, + ThemeVariant::Light => transfer_for_light_theme, + }; + + // Generate semantic colours derived from user's primary with fixed hues. + let error = generate_semantic_colour( + user_primary, + semantic::hue::ERROR, + semantic::min_chroma::ERROR, + match variant { + ThemeVariant::Dark => semantic::lightness::ERROR_DARK, + ThemeVariant::Light => semantic::lightness::ERROR_LIGHT, + }, + ); + let warning = generate_semantic_colour( + user_primary, + semantic::hue::WARNING, + semantic::min_chroma::WARNING, + match variant { + ThemeVariant::Dark => semantic::lightness::WARNING_DARK, + ThemeVariant::Light => semantic::lightness::WARNING_LIGHT, + }, + ); + let success = generate_semantic_colour( + user_primary, + semantic::hue::SUCCESS, + semantic::min_chroma::SUCCESS, + match variant { + ThemeVariant::Dark => semantic::lightness::SUCCESS_DARK, + ThemeVariant::Light => semantic::lightness::SUCCESS_LIGHT, + }, + ); + + Ok(ColourSchemeColours { + base: oklch_to_hex(transfer(user_base, base_base, false, true)).into(), + surface: oklch_to_hex(transfer(user_base, base_surface, false, false)).into(), + overlay: oklch_to_hex(transfer(user_base, base_overlay, false, false)).into(), + text: oklch_to_hex(transfer(user_text, base_text, true, false)).into(), + muted: oklch_to_hex(transfer(user_text, base_muted, false, false)).into(), + subtle: oklch_to_hex(transfer(user_text, base_subtle, false, false)).into(), + emphasis: oklch_to_hex(transfer(user_text, base_emphasis, false, false)).into(), + primary: oklch_to_hex(transfer(user_primary, base_primary, false, false)).into(), + secondary: oklch_to_hex(transfer(user_primary, base_secondary, false, false)).into(), + tertiary: oklch_to_hex(transfer(user_primary, base_tertiary, false, false)).into(), + error: oklch_to_hex(error).into(), + warning: oklch_to_hex(warning).into(), + success: oklch_to_hex(success).into(), + border: oklch_to_hex(transfer(user_base, base_border, false, false)).into(), + link: oklch_to_hex(transfer(user_link, base_link, false, false)).into(), + highlight: oklch_to_hex(transfer(user_primary, base_highlight, false, false)).into(), + extra_data: None, + }) +} + +/// Generate the counterpart palette (light for dark, dark for light). +/// Uses neutral base for the counterpart and applies user hue/chroma. +pub fn generate_counterpart_palette( + inputs: &ThemeInputs, + primary_variant: ThemeVariant, +) -> Result, ColourGenError> { + let counterpart_variant = match primary_variant { + ThemeVariant::Light => ThemeVariant::Dark, + ThemeVariant::Dark => ThemeVariant::Light, + }; + + let neutral_base = get_neutral_base(counterpart_variant); + + let user_primary = css_to_oklch(&inputs.primary)?; + let user_link = css_to_oklch(&inputs.link)?; + + let base_primary = css_to_oklch(neutral_base.primary.as_ref())?; + let base_secondary = css_to_oklch(neutral_base.secondary.as_ref())?; + let base_tertiary = css_to_oklch(neutral_base.tertiary.as_ref())?; + let base_link = css_to_oklch(neutral_base.link.as_ref())?; + let base_highlight = css_to_oklch(neutral_base.highlight.as_ref())?; + + // Generate semantic colours for the counterpart variant. + let error = generate_semantic_colour( + user_primary, + semantic::hue::ERROR, + semantic::min_chroma::ERROR, + match counterpart_variant { + ThemeVariant::Dark => semantic::lightness::ERROR_DARK, + ThemeVariant::Light => semantic::lightness::ERROR_LIGHT, + }, + ); + let warning = generate_semantic_colour( + user_primary, + semantic::hue::WARNING, + semantic::min_chroma::WARNING, + match counterpart_variant { + ThemeVariant::Dark => semantic::lightness::WARNING_DARK, + ThemeVariant::Light => semantic::lightness::WARNING_LIGHT, + }, + ); + let success = generate_semantic_colour( + user_primary, + semantic::hue::SUCCESS, + semantic::min_chroma::SUCCESS, + match counterpart_variant { + ThemeVariant::Dark => semantic::lightness::SUCCESS_DARK, + ThemeVariant::Light => semantic::lightness::SUCCESS_LIGHT, + }, + ); + + Ok(ColourSchemeColours { + base: neutral_base.base.clone(), + surface: neutral_base.surface.clone(), + overlay: neutral_base.overlay.clone(), + text: neutral_base.text.clone(), + muted: neutral_base.muted.clone(), + subtle: neutral_base.subtle.clone(), + emphasis: neutral_base.emphasis.clone(), + border: neutral_base.border.clone(), + error: oklch_to_hex(error).into(), + warning: oklch_to_hex(warning).into(), + success: oklch_to_hex(success).into(), + primary: oklch_to_hex(transfer_hue_chroma(user_primary, base_primary)).into(), + secondary: oklch_to_hex(transfer_hue_chroma(user_primary, base_secondary)).into(), + tertiary: oklch_to_hex(transfer_hue_chroma(user_primary, base_tertiary)).into(), + link: oklch_to_hex(transfer_hue_chroma(user_link, base_link)).into(), + highlight: oklch_to_hex(transfer_hue_chroma(user_primary, base_highlight)).into(), + extra_data: None, + }) +} + +#[cfg(test)] +mod tests; diff --git a/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__custom_blue_dark.snap b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__custom_blue_dark.snap new file mode 100644 index 0000000..63edd1b --- /dev/null +++ b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__custom_blue_dark.snap @@ -0,0 +1,20 @@ +--- +source: crates/weaver-renderer/src/colour_gen/tests.rs +expression: palette +--- +base: 0D192B +border: "334156" +emphasis: DBE1E9 +error: FE6753 +highlight: 0048B7 +link: 86CDFF +muted: 696F76 +overlay: 1A273A +primary: 6AB4FF +secondary: 78C3FF +subtle: 8B9198 +success: 00C180 +surface: "132033" +tertiary: 7DC8FF +text: DBE1E9 +warning: F5A600 diff --git a/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__custom_green_light.snap b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__custom_green_light.snap new file mode 100644 index 0000000..dfa2a49 --- /dev/null +++ b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__custom_green_light.snap @@ -0,0 +1,20 @@ +--- +source: crates/weaver-renderer/src/colour_gen/tests.rs +expression: palette +--- +base: ECF9F0 +border: D2DFD6 +emphasis: 0F230F +error: C93021 +highlight: 5AED84 +link: 39B95F +muted: "526952" +overlay: E2EFE6 +primary: 00A33D +secondary: 00A741 +subtle: 3B503A +success: "008246" +surface: F2FFF6 +tertiary: 007B0E +text: "112512" +warning: F6A500 diff --git a/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__rose_pine_counterpart_light.snap b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__rose_pine_counterpart_light.snap new file mode 100644 index 0000000..75017fa --- /dev/null +++ b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__rose_pine_counterpart_light.snap @@ -0,0 +1,20 @@ +--- +source: crates/weaver-renderer/src/colour_gen/tests.rs +expression: counterpart +--- +base: "#faf4ed" +border: "#dfdad9" +emphasis: "#1e1a2d" +error: BD4334 +highlight: DABCFE +link: BD908E +muted: "#635e74" +overlay: "#f2e9e1" +primary: 9276B3 +secondary: 967AB7 +subtle: "#4a4560" +success: 1D7456 +surface: "#fffaf3" +tertiary: 6D528C +text: "#1f1d2e" +warning: F5A600 diff --git a/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__rose_pine_dawn_inspired_light.snap b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__rose_pine_dawn_inspired_light.snap new file mode 100644 index 0000000..1efaedf --- /dev/null +++ b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__rose_pine_dawn_inspired_light.snap @@ -0,0 +1,20 @@ +--- +source: crates/weaver-renderer/src/colour_gen/tests.rs +expression: palette +--- +base: FAF4ED +border: E0DAD3 +emphasis: 1D1B2C +error: BD4334 +highlight: D7C0F2 +link: D7827E +muted: 615F73 +overlay: F0EAE3 +primary: 907AA9 +secondary: 947EAD +subtle: 49475A +success: 2F7258 +surface: FFFAF3 +tertiary: 6B5682 +text: 1F1D2E +warning: F5A600 diff --git a/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__rose_pine_inspired_dark.snap b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__rose_pine_inspired_dark.snap new file mode 100644 index 0000000..fe3f3b4 --- /dev/null +++ b/crates/weaver-renderer/src/colour_gen/snapshots/weaver_renderer__colour_gen__tests__rose_pine_inspired_dark.snap @@ -0,0 +1,20 @@ +--- +source: crates/weaver-renderer/src/colour_gen/tests.rs +expression: palette +--- +base: "191724" +border: 403E4D +emphasis: E0DEF4 +error: F17260 +highlight: 5F447C +link: EBBCBA +muted: 6D6C7F +overlay: "262532" +primary: C4A7E7 +secondary: D3B6F6 +subtle: 908EA2 +success: 61B190 +surface: 1F1D2B +tertiary: D7BAFB +text: E0DEF4 +warning: F5A600 diff --git a/crates/weaver-renderer/src/colour_gen/tests.rs b/crates/weaver-renderer/src/colour_gen/tests.rs new file mode 100644 index 0000000..2c9d71f --- /dev/null +++ b/crates/weaver-renderer/src/colour_gen/tests.rs @@ -0,0 +1,109 @@ +use super::*; +use insta::assert_yaml_snapshot; + +#[test] +fn test_rose_pine_inspired_dark() { + let inputs = ThemeInputs { + background: "191724".to_string(), + text: "e0def4".to_string(), + primary: "c4a7e7".to_string(), + link: "ebbcba".to_string(), + }; + + let palette = generate_palette(&inputs, ThemeVariant::Dark).unwrap(); + assert_yaml_snapshot!("rose_pine_inspired_dark", palette); +} + +#[test] +fn test_rose_pine_dawn_inspired_light() { + let inputs = ThemeInputs { + background: "faf4ed".to_string(), + text: "1f1d2e".to_string(), + primary: "907aa9".to_string(), + link: "d7827e".to_string(), + }; + + let palette = generate_palette(&inputs, ThemeVariant::Light).unwrap(); + assert_yaml_snapshot!("rose_pine_dawn_inspired_light", palette); +} + +#[test] +fn test_custom_blue_dark() { + let inputs = ThemeInputs { + background: "0a1628".to_string(), + text: "e2e8f0".to_string(), + primary: "3b82f6".to_string(), + link: "60a5fa".to_string(), + }; + + let palette = generate_palette(&inputs, ThemeVariant::Dark).unwrap(); + assert_yaml_snapshot!("custom_blue_dark", palette); +} + +#[test] +fn test_custom_green_light() { + let inputs = ThemeInputs { + background: "f0fdf4".to_string(), + text: "1a2e1a".to_string(), + primary: "22c55e".to_string(), + link: "16a34a".to_string(), + }; + + let palette = generate_palette(&inputs, ThemeVariant::Light).unwrap(); + assert_yaml_snapshot!("custom_green_light", palette); +} + +#[test] +fn test_auto_variant_detection() { + assert_eq!(detect_variant("191724").unwrap(), ThemeVariant::Dark); + assert_eq!(detect_variant("faf4ed").unwrap(), ThemeVariant::Light); + assert_eq!(detect_variant("000000").unwrap(), ThemeVariant::Dark); + assert_eq!(detect_variant("ffffff").unwrap(), ThemeVariant::Light); +} + +#[test] +fn test_counterpart_generation() { + let inputs = ThemeInputs { + background: "191724".to_string(), + text: "e0def4".to_string(), + primary: "c4a7e7".to_string(), + link: "ebbcba".to_string(), + }; + + let counterpart = generate_counterpart_palette(&inputs, ThemeVariant::Dark).unwrap(); + assert_yaml_snapshot!("rose_pine_counterpart_light", counterpart); +} + +#[test] +fn test_hex_roundtrip() { + let original = "c4a7e7"; + let oklch = css_to_oklch(original).unwrap(); + let back = oklch_to_hex(oklch); + assert_eq!(back.to_lowercase(), original.to_lowercase()); +} + +#[test] +fn test_css_colour_formats() { + let formats = [ + "#ff0000", + "ff0000", + "rgb(255, 0, 0)", + "rgba(255, 0, 0, 1)", + "hsl(0, 100%, 50%)", + "red", + ]; + + for format in formats { + let oklch = css_to_oklch(format); + assert!(oklch.is_ok(), "Failed to parse: {}", format); + let hex = oklch_to_hex(oklch.unwrap()); + assert_eq!(hex, "FF0000", "Wrong output for: {}", format); + } +} + +#[test] +fn test_oklch_input() { + let oklch = css_to_oklch("oklch(0.7 0.15 30)").unwrap(); + assert!((oklch.l - 0.7).abs() < 0.01); + assert!((oklch.chroma - 0.15).abs() < 0.01); +} diff --git a/crates/weaver-renderer/src/lib.rs b/crates/weaver-renderer/src/lib.rs index f4bd9eb..bb6e7d5 100644 --- a/crates/weaver-renderer/src/lib.rs +++ b/crates/weaver-renderer/src/lib.rs @@ -39,6 +39,8 @@ pub mod pckt; pub mod static_site; pub mod theme; #[cfg(feature = "themes")] +pub mod colour_gen; +#[cfg(feature = "themes")] pub mod themes; pub mod types; pub mod utils; diff --git a/docs/graph-data.json b/docs/graph-data.json index 144aec0..df0a801 100644 --- a/docs/graph-data.json +++ b/docs/graph-data.json @@ -2485,6 +2485,72 @@ "created_at": "2026-01-11T16:25:55.912466284-05:00", "updated_at": "2026-01-11T16:25:55.912466284-05:00", "metadata_json": "{\"confidence\":95}" + }, + { + "id": 228, + "change_id": "f2501008-1a31-415d-ae04-2ff8fb117e6c", + "node_type": "action", + "title": "Implement Settings in NotebookActions dropdown (Task 7)", + "description": null, + "status": "pending", + "created_at": "2026-01-11T17:37:09.974610127-05:00", + "updated_at": "2026-01-11T17:37:09.974610127-05:00", + "metadata_json": "{\"confidence\":90}" + }, + { + "id": 229, + "change_id": "d24069d4-7977-4de7-ac4f-739906ec8f09", + "node_type": "outcome", + "title": "Task 7 completed - Settings dropdown item and panel added to NotebookActions", + "description": null, + "status": "pending", + "created_at": "2026-01-11T17:40:19.714915380-05:00", + "updated_at": "2026-01-11T17:40:19.714915380-05:00", + "metadata_json": "{\"confidence\":95}" + }, + { + "id": 230, + "change_id": "2632c728-84c8-4f5d-b6ab-279655604974", + "node_type": "action", + "title": "Create publication_sync.rs for syncing notebooks to site.standard.publication records", + "description": null, + "status": "pending", + "created_at": "2026-01-11T17:46:29.583730884-05:00", + "updated_at": "2026-01-11T17:46:29.583730884-05:00", + "metadata_json": "{\"confidence\":85}" + }, + { + "id": 231, + "change_id": "67d02a1b-dd63-4390-a515-1dc1b489b547", + "node_type": "outcome", + "title": "Task 8 complete: Created publication_sync.rs with sync_publication and delete_publication functions, plus unit tests", + "description": null, + "status": "pending", + "created_at": "2026-01-11T17:48:55.303225505-05:00", + "updated_at": "2026-01-11T17:48:55.303225505-05:00", + "metadata_json": "{\"confidence\":95}" + }, + { + "id": 232, + "change_id": "c0d3b943-01b8-4c13-bc17-5d91f8371278", + "node_type": "action", + "title": "Implementing Task 9: generateDocument endpoint - add entryRecord param and handler", + "description": null, + "status": "pending", + "created_at": "2026-01-11T17:52:34.580224225-05:00", + "updated_at": "2026-01-11T17:52:34.580224225-05:00", + "metadata_json": "{\"confidence\":85}" + }, + { + "id": 233, + "change_id": "e1cc1c7f-0359-4070-bb40-0ff158687872", + "node_type": "outcome", + "title": "Successfully implemented generateDocument endpoint - lexicon updated, API regenerated, handler added with ClickHouse query", + "description": null, + "status": "pending", + "created_at": "2026-01-11T18:01:58.818873458-05:00", + "updated_at": "2026-01-11T18:01:58.818873458-05:00", + "metadata_json": "{\"confidence\":95}" } ], "edges": [ @@ -4896,6 +4962,39 @@ "weight": 1.0, "rationale": "Design doc led to implementation plan", "created_at": "2026-01-11T16:25:56.055454076-05:00" + }, + { + "id": 221, + "from_node_id": 228, + "to_node_id": 229, + "from_change_id": "f2501008-1a31-415d-ae04-2ff8fb117e6c", + "to_change_id": "d24069d4-7977-4de7-ac4f-739906ec8f09", + "edge_type": "leads_to", + "weight": 1.0, + "rationale": "Task 7 implementation complete", + "created_at": "2026-01-11T17:40:24.746921377-05:00" + }, + { + "id": 222, + "from_node_id": 225, + "to_node_id": 230, + "from_change_id": "7fbf023e-55b9-47d4-81c2-e72d4aed6a68", + "to_change_id": "2632c728-84c8-4f5d-b6ab-279655604974", + "edge_type": "leads_to", + "weight": 1.0, + "rationale": "Part of notebook creation/settings feature", + "created_at": "2026-01-11T17:46:33.403548864-05:00" + }, + { + "id": 223, + "from_node_id": 230, + "to_node_id": 231, + "from_change_id": "2632c728-84c8-4f5d-b6ab-279655604974", + "to_change_id": "67d02a1b-dd63-4390-a515-1dc1b489b547", + "edge_type": "leads_to", + "weight": 1.0, + "rationale": "Implementation complete with tests passing", + "created_at": "2026-01-11T17:48:58.685671907-05:00" } ] } \ No newline at end of file diff --git a/lexicons/domain/generateDocument.json b/lexicons/domain/generateDocument.json index 6dd06a5..2e1ed72 100644 --- a/lexicons/domain/generateDocument.json +++ b/lexicons/domain/generateDocument.json @@ -18,6 +18,10 @@ "description": "AT-URI of the sh.weaver.notebook.entry to convert.", "format": "at-uri" }, + "entryRecord": { + "type": "unknown", + "description": "The entry record data to use (avoids staleness from index cache)." + }, "path": { "type": "string", "description": "URL path for the document."