diff --git a/Cargo.lock b/Cargo.lock index 3bc8ee3..113ae25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2648,6 +2648,27 @@ dependencies = [ "syn 2.0.110", ] +[[package]] +name = "dioxus-sdk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79a653986dc3151f00a2be4cf04f83ec6c2af24b600ab926d5fcbcd159c6dadf" +dependencies = [ + "dioxus-sdk-time", +] + +[[package]] +name = "dioxus-sdk-time" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80c25ae93a3f72e734873b97fbd09d9b1b6adff97205fb0ffd8543e3564fb78e" +dependencies = [ + "dioxus 0.7.1", + "futures", + "gloo-timers", + "tokio", +] + [[package]] name = "dioxus-server" version = "0.7.1" @@ -4839,6 +4860,7 @@ dependencies = [ "miette 7.6.0", "rustversion", "serde", + "serde_bytes", "serde_ipld_dagcbor", "thiserror 2.0.17", "unicode-segmentation", @@ -4894,6 +4916,7 @@ dependencies = [ "regex-lite", "reqwest", "serde", + "serde_bytes", "serde_html_form", "serde_ipld_dagcbor", "serde_json", @@ -10282,6 +10305,7 @@ dependencies = [ "miette 7.6.0", "rustversion", "serde", + "serde_bytes", "serde_ipld_dagcbor", "thiserror 2.0.17", "unicode-segmentation", @@ -10300,6 +10324,7 @@ dependencies = [ "dioxus 0.7.1", "dioxus-free-icons", "dioxus-primitives", + "dioxus-sdk", "dotenvy", "fontdb", "gloo-storage", diff --git a/crates/weaver-api/Cargo.toml b/crates/weaver-api/Cargo.toml index e7fb000..e576f64 100644 --- a/crates/weaver-api/Cargo.toml +++ b/crates/weaver-api/Cargo.toml @@ -16,7 +16,7 @@ serde.workspace = true serde_ipld_dagcbor = { version = "0.6", optional = true } thiserror.workspace = true unicode-segmentation = "1.12" - +serde_bytes = "0.11" [lints.rust] # just so that my rust-analyzer shuts up about the module name for 2048.blue's namespace diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_defs.json b/crates/weaver-api/lexicons/sh_weaver_edit_defs.json index 471d5c7..7ef52e5 100644 --- a/crates/weaver-api/lexicons/sh_weaver_edit_defs.json +++ b/crates/weaver-api/lexicons/sh_weaver_edit_defs.json @@ -21,10 +21,10 @@ "draftRef": { "type": "object", "required": [ - "draft_key" + "draftKey" ], "properties": { - "draft_key": { + "draftKey": { "type": "string", "maxLength": 200 } diff --git a/crates/weaver-api/src/app_bsky/actor.rs b/crates/weaver-api/src/app_bsky/actor.rs index 8abc794..d95b153 100644 --- a/crates/weaver-api/src/app_bsky/actor.rs +++ b/crates/weaver-api/src/app_bsky/actor.rs @@ -3037,37 +3037,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(()); } } @@ -3140,8 +3140,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> { @@ -4600,37 +4600,37 @@ pub mod profile_view_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(()); } } @@ -4955,8 +4955,8 @@ impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { impl<'a, S> ProfileViewBuilder<'a, S> where S: profile_view_state::State, - S::Did: profile_view_state::IsSet, S::Handle: profile_view_state::IsSet, + S::Did: profile_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ProfileView<'a> { @@ -6290,67 +6290,67 @@ pub mod saved_feed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; - type Type; type Value; + type Id; type Pinned; + type Type; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type Type = Unset; type Value = Unset; + type Id = Unset; type Pinned = 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 Type = S::Type; - type Value = S::Value; - type Pinned = S::Pinned; - } - ///State transition - sets the `type` field to Set - pub struct SetType(PhantomData S>); - impl sealed::Sealed for SetType {} - impl State for SetType { - type Id = S::Id; - type Type = Set; - type Value = S::Value; - type Pinned = S::Pinned; + type Type = 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 Id = S::Id; + type Pinned = S::Pinned; type Type = S::Type; - type Value = Set; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Value = S::Value; + type Id = Set; type Pinned = S::Pinned; + type Type = S::Type; } ///State transition - sets the `pinned` field to Set pub struct SetPinned(PhantomData S>); impl sealed::Sealed for SetPinned {} impl State for SetPinned { + type Value = S::Value; type Id = S::Id; + type Pinned = Set; type Type = S::Type; + } + ///State transition - sets the `type` field to Set + pub struct SetType(PhantomData S>); + impl sealed::Sealed for SetType {} + impl State for SetType { type Value = S::Value; - type Pinned = Set; + type Id = S::Id; + type Pinned = S::Pinned; + type Type = 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 `type` field - pub struct r#type(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `id` field + pub struct id(()); ///Marker type for the `pinned` field pub struct pinned(()); + ///Marker type for the `type` field + pub struct r#type(()); } } @@ -6463,10 +6463,10 @@ where impl<'a, S> SavedFeedBuilder<'a, S> where S: saved_feed_state::State, - S::Id: saved_feed_state::IsSet, - S::Type: saved_feed_state::IsSet, S::Value: saved_feed_state::IsSet, + S::Id: saved_feed_state::IsSet, S::Pinned: saved_feed_state::IsSet, + S::Type: saved_feed_state::IsSet, { /// Build the final struct pub fn build(self) -> SavedFeed<'a> { @@ -6543,37 +6543,37 @@ pub mod saved_feeds_pref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Pinned; type Saved; + type Pinned; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Pinned = Unset; type Saved = Unset; - } - ///State transition - sets the `pinned` field to Set - pub struct SetPinned(PhantomData S>); - impl sealed::Sealed for SetPinned {} - impl State for SetPinned { - type Pinned = Set; - type Saved = S::Saved; + type Pinned = Unset; } ///State transition - sets the `saved` field to Set pub struct SetSaved(PhantomData S>); impl sealed::Sealed for SetSaved {} impl State for SetSaved { - type Pinned = S::Pinned; type Saved = Set; + type Pinned = S::Pinned; + } + ///State transition - sets the `pinned` field to Set + pub struct SetPinned(PhantomData S>); + impl sealed::Sealed for SetPinned {} + impl State for SetPinned { + type Saved = S::Saved; + type Pinned = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `pinned` field - pub struct pinned(()); ///Marker type for the `saved` field pub struct saved(()); + ///Marker type for the `pinned` field + pub struct pinned(()); } } @@ -6660,8 +6660,8 @@ impl<'a, S: saved_feeds_pref_state::State> SavedFeedsPrefBuilder<'a, S> { impl<'a, S> SavedFeedsPrefBuilder<'a, S> where S: saved_feeds_pref_state::State, - S::Pinned: saved_feeds_pref_state::IsSet, S::Saved: saved_feeds_pref_state::IsSet, + S::Pinned: saved_feeds_pref_state::IsSet, { /// Build the final struct pub fn build(self) -> SavedFeedsPref<'a> { @@ -6883,37 +6883,37 @@ pub mod status_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Status; type Record; + 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 Record = 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 Record = S::Record; + type Status = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Status = S::Status; type Record = 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 Record = S::Record; + type Status = 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 `record` field pub struct record(()); + ///Marker type for the `status` field + pub struct status(()); } } @@ -7040,8 +7040,8 @@ where impl<'a, S> StatusViewBuilder<'a, S> where S: status_view_state::State, - S::Status: status_view_state::IsSet, S::Record: status_view_state::IsSet, + S::Status: status_view_state::IsSet, { /// Build the final struct pub fn build(self) -> StatusView<'a> { @@ -7196,49 +7196,49 @@ pub mod verification_state_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Verifications; type VerifiedStatus; + type Verifications; type TrustedVerifierStatus; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Verifications = Unset; type VerifiedStatus = Unset; + type Verifications = Unset; type TrustedVerifierStatus = Unset; } - ///State transition - sets the `verifications` field to Set - pub struct SetVerifications(PhantomData S>); - impl sealed::Sealed for SetVerifications {} - impl State for SetVerifications { - 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 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 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 Verifications = S::Verifications; type VerifiedStatus = S::VerifiedStatus; + type Verifications = S::Verifications; type TrustedVerifierStatus = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `verifications` field - pub struct verifications(()); ///Marker type for the `verified_status` field pub struct verified_status(()); + ///Marker type for the `verifications` field + pub struct verifications(()); ///Marker type for the `trusted_verifier_status` field pub struct trusted_verifier_status(()); } @@ -7336,8 +7336,8 @@ where impl<'a, S> VerificationStateBuilder<'a, S> where S: verification_state_state::State, - S::Verifications: verification_state_state::IsSet, S::VerifiedStatus: verification_state_state::IsSet, + S::Verifications: verification_state_state::IsSet, S::TrustedVerifierStatus: verification_state_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/actor/status.rs b/crates/weaver-api/src/app_bsky/actor/status.rs index 1d27df6..468ba6c 100644 --- a/crates/weaver-api/src/app_bsky/actor/status.rs +++ b/crates/weaver-api/src/app_bsky/actor/status.rs @@ -59,37 +59,37 @@ pub mod status_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Status; type CreatedAt; + 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; - } - ///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 Status = 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 Status = S::Status; type CreatedAt = 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 Status = 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(()); } } @@ -196,8 +196,8 @@ where impl<'a, S> StatusBuilder<'a, S> where S: status_state::State, - S::Status: status_state::IsSet, S::CreatedAt: status_state::IsSet, + S::Status: status_state::IsSet, { /// Build the final struct pub fn build(self) -> Status<'a> { diff --git a/crates/weaver-api/src/app_bsky/ageassurance.rs b/crates/weaver-api/src/app_bsky/ageassurance.rs index 48019c5..c49bc4f 100644 --- a/crates/weaver-api/src/app_bsky/ageassurance.rs +++ b/crates/weaver-api/src/app_bsky/ageassurance.rs @@ -1111,37 +1111,37 @@ pub mod config_region_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CountryCode; type Rules; + 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 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 CountryCode = Set; - type Rules = S::Rules; + 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 CountryCode = S::CountryCode; type Rules = Set; + type CountryCode = S::CountryCode; + } + ///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; } /// 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 `rules` field pub struct rules(()); + ///Marker type for the `country_code` field + pub struct country_code(()); } } @@ -1234,8 +1234,8 @@ where impl<'a, S> ConfigRegionBuilder<'a, S> where S: config_region_state::State, - S::CountryCode: config_region_state::IsSet, S::Rules: config_region_state::IsSet, + S::CountryCode: config_region_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegion<'a> { @@ -1888,37 +1888,37 @@ pub mod config_region_rule_if_assured_over_age_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Age; type Access; + type Age; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Age = Unset; 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 Age = Set; - type Access = S::Access; + 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 Age = S::Age; type Access = Set; + type Age = S::Age; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `age` field - pub struct age(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `age` field + pub struct age(()); } } @@ -2008,8 +2008,8 @@ where impl<'a, S> ConfigRegionRuleIfAssuredOverAgeBuilder<'a, S> where S: config_region_rule_if_assured_over_age_state::State, - S::Age: config_region_rule_if_assured_over_age_state::IsSet, S::Access: config_region_rule_if_assured_over_age_state::IsSet, + S::Age: config_region_rule_if_assured_over_age_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfAssuredOverAge<'a> { @@ -2082,37 +2082,37 @@ pub mod config_region_rule_if_assured_under_age_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Age; type Access; + type Age; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Age = Unset; 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 Age = Set; - type Access = S::Access; + 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 Age = S::Age; type Access = Set; + type Age = S::Age; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `age` field - pub struct age(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `age` field + pub struct age(()); } } @@ -2202,8 +2202,8 @@ where impl<'a, S> ConfigRegionRuleIfAssuredUnderAgeBuilder<'a, S> where S: config_region_rule_if_assured_under_age_state::State, - S::Age: config_region_rule_if_assured_under_age_state::IsSet, S::Access: config_region_rule_if_assured_under_age_state::IsSet, + S::Age: config_region_rule_if_assured_under_age_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfAssuredUnderAge<'a> { @@ -2276,37 +2276,37 @@ pub mod config_region_rule_if_declared_over_age_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Age; type Access; + type Age; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Age = Unset; 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 Age = Set; - type Access = S::Access; + 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 Age = S::Age; type Access = Set; + type Age = S::Age; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `age` field - pub struct age(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `age` field + pub struct age(()); } } @@ -2396,8 +2396,8 @@ where impl<'a, S> ConfigRegionRuleIfDeclaredOverAgeBuilder<'a, S> where S: config_region_rule_if_declared_over_age_state::State, - S::Age: config_region_rule_if_declared_over_age_state::IsSet, S::Access: config_region_rule_if_declared_over_age_state::IsSet, + S::Age: config_region_rule_if_declared_over_age_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfDeclaredOverAge<'a> { @@ -2470,37 +2470,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 Age; type Access; + type Age; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Age = Unset; 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 Age = Set; - type Access = S::Access; + 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 Age = S::Age; type Access = Set; + type Age = S::Age; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `age` field - pub struct age(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `age` field + pub struct age(()); } } @@ -2590,8 +2590,8 @@ where impl<'a, S> ConfigRegionRuleIfDeclaredUnderAgeBuilder<'a, S> where S: config_region_rule_if_declared_under_age_state::State, - S::Age: config_region_rule_if_declared_under_age_state::IsSet, S::Access: config_region_rule_if_declared_under_age_state::IsSet, + S::Age: config_region_rule_if_declared_under_age_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfDeclaredUnderAge<'a> { @@ -2698,85 +2698,85 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Status; - type Access; type AttemptId; + type Access; type CountryCode; + 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 Access = Unset; type AttemptId = Unset; + type Access = Unset; type CountryCode = 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 Access = S::Access; - type AttemptId = S::AttemptId; - type CountryCode = S::CountryCode; + type CreatedAt = Unset; } ///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 Access = S::Access; type AttemptId = S::AttemptId; + type Access = S::Access; type CountryCode = S::CountryCode; - } - ///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 Status = S::Status; - type Access = Set; - type AttemptId = S::AttemptId; - 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 CreatedAt = S::CreatedAt; type Status = S::Status; - type Access = S::Access; type AttemptId = Set; + type Access = S::Access; type CountryCode = S::CountryCode; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `access` field to Set + pub struct SetAccess(PhantomData S>); + impl sealed::Sealed for SetAccess {} + impl State for SetAccess { + type Status = S::Status; + type AttemptId = S::AttemptId; + type Access = Set; + type CountryCode = S::CountryCode; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `country_code` field to Set pub struct SetCountryCode(PhantomData S>); impl sealed::Sealed for SetCountryCode {} impl State for SetCountryCode { - type CreatedAt = S::CreatedAt; type Status = S::Status; - type Access = S::Access; type AttemptId = S::AttemptId; + type Access = S::Access; type CountryCode = 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 AttemptId = S::AttemptId; + type Access = S::Access; + type CountryCode = S::CountryCode; + 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 `status` field pub struct status(()); - ///Marker type for the `access` field - pub struct access(()); ///Marker type for the `attempt_id` field pub struct attempt_id(()); + ///Marker type for the `access` field + pub struct access(()); ///Marker type for the `country_code` field pub struct country_code(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -3032,11 +3032,11 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, - S::CreatedAt: event_state::IsSet, S::Status: event_state::IsSet, - S::Access: event_state::IsSet, S::AttemptId: event_state::IsSet, + S::Access: event_state::IsSet, S::CountryCode: event_state::IsSet, + S::CreatedAt: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { @@ -3129,37 +3129,37 @@ pub mod state_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Status; type Access; + 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 Access = 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 Access = S::Access; + type Status = Unset; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type Status = S::Status; type Access = 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 Access = S::Access; + type Status = 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 `access` field pub struct access(()); + ///Marker type for the `status` field + pub struct status(()); } } @@ -3252,8 +3252,8 @@ where impl<'a, S> StateBuilder<'a, S> where S: state_state::State, - S::Status: state_state::IsSet, S::Access: state_state::IsSet, + S::Status: state_state::IsSet, { /// Build the final struct pub fn build(self) -> State<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/external.rs b/crates/weaver-api/src/app_bsky/embed/external.rs index 7b5f686..a693915 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 Uri; type Title; type Description; + 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 Title = Unset; type Description = 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; + 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 Uri = S::Uri; 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 Uri = S::Uri; type Title = S::Title; type Description = 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 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 `title` field pub struct title(()); ///Marker type for the `description` field pub struct description(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -195,9 +195,9 @@ where impl<'a, S> ExternalBuilder<'a, S> where S: external_state::State, - S::Uri: external_state::IsSet, S::Title: external_state::IsSet, S::Description: external_state::IsSet, + S::Uri: external_state::IsSet, { /// Build the final struct pub fn build(self) -> External<'a> { @@ -785,50 +785,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(()); } } @@ -942,8 +942,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/app_bsky/embed/images.rs b/crates/weaver-api/src/app_bsky/embed/images.rs index 700418d..38edf27 100644 --- a/crates/weaver-api/src/app_bsky/embed/images.rs +++ b/crates/weaver-api/src/app_bsky/embed/images.rs @@ -760,51 +760,51 @@ pub mod view_image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Alt; type Thumb; type Fullsize; - type Alt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Alt = Unset; type Thumb = Unset; type Fullsize = Unset; - type Alt = Unset; + } + ///State transition - sets the `alt` field to Set + pub struct SetAlt(PhantomData S>); + impl sealed::Sealed for SetAlt {} + impl State for SetAlt { + type Alt = Set; + type Thumb = S::Thumb; + type Fullsize = S::Fullsize; } ///State transition - sets the `thumb` field to Set pub struct SetThumb(PhantomData S>); impl sealed::Sealed for SetThumb {} impl State for SetThumb { + type Alt = S::Alt; 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; - } - ///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 = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `alt` field + pub struct alt(()); ///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(()); } } @@ -917,9 +917,9 @@ where impl<'a, S> ViewImageBuilder<'a, S> where S: view_image_state::State, + S::Alt: view_image_state::IsSet, S::Thumb: view_image_state::IsSet, S::Fullsize: view_image_state::IsSet, - S::Alt: view_image_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewImage<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/record.rs b/crates/weaver-api/src/app_bsky/embed/record.rs index a936c52..abeaac6 100644 --- a/crates/weaver-api/src/app_bsky/embed/record.rs +++ b/crates/weaver-api/src/app_bsky/embed/record.rs @@ -724,50 +724,50 @@ pub mod view_blocked_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Blocked; type Author; + type Blocked; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; - type Blocked = Unset; type Author = Unset; + type Blocked = 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 Blocked = S::Blocked; - type Author = S::Author; - } - ///State transition - sets the `blocked` field to Set - pub struct SetBlocked(PhantomData S>); - impl sealed::Sealed for SetBlocked {} - impl State for SetBlocked { - type Uri = S::Uri; - type Blocked = 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 Blocked = S::Blocked; 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 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 `uri` field pub struct uri(()); - ///Marker type for the `blocked` field - pub struct blocked(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `blocked` field + pub struct blocked(()); } } @@ -861,8 +861,8 @@ impl<'a, S> ViewBlockedBuilder<'a, S> where S: view_blocked_state::State, S::Uri: view_blocked_state::IsSet, - S::Blocked: view_blocked_state::IsSet, S::Author: view_blocked_state::IsSet, + S::Blocked: view_blocked_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewBlocked<'a> { @@ -1305,8 +1305,8 @@ pub mod view_record_state { pub trait State: sealed::Sealed { type Uri; type Cid; - type Author; type Value; + type Author; type IndexedAt; } /// Empty state - all required fields are unset @@ -1315,8 +1315,8 @@ pub mod view_record_state { impl State for Empty { type Uri = Unset; type Cid = Unset; - type Author = Unset; type Value = Unset; + type Author = Unset; type IndexedAt = Unset; } ///State transition - sets the `uri` field to Set @@ -1325,8 +1325,8 @@ pub mod view_record_state { impl State for SetUri { type Uri = Set; type Cid = S::Cid; - type Author = S::Author; type Value = S::Value; + type Author = S::Author; type IndexedAt = S::IndexedAt; } ///State transition - sets the `cid` field to Set @@ -1335,18 +1335,8 @@ pub mod view_record_state { impl State for SetCid { type Uri = S::Uri; type Cid = Set; - type Author = S::Author; - type Value = S::Value; - 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 Author = Set; type Value = S::Value; + type Author = S::Author; type IndexedAt = S::IndexedAt; } ///State transition - sets the `value` field to Set @@ -1355,8 +1345,18 @@ pub mod view_record_state { impl State for SetValue { type Uri = S::Uri; type Cid = S::Cid; - type Author = S::Author; 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 @@ -1365,8 +1365,8 @@ pub mod view_record_state { impl State for SetIndexedAt { type Uri = S::Uri; type Cid = S::Cid; - type Author = S::Author; type Value = S::Value; + type Author = S::Author; type IndexedAt = Set; } /// Marker types for field names @@ -1376,10 +1376,10 @@ pub mod view_record_state { pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `author` field - pub struct author(()); ///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(()); } @@ -1621,8 +1621,8 @@ where S: view_record_state::State, S::Uri: view_record_state::IsSet, S::Cid: view_record_state::IsSet, - S::Author: 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/app_bsky/embed/video.rs b/crates/weaver-api/src/app_bsky/embed/video.rs index 73ef658..a4169e3 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 Lang; type File; + type Lang; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Lang = Unset; 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 Lang = Set; - type File = S::File; + 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 Lang = S::Lang; type File = Set; + type Lang = S::Lang; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `lang` field - pub struct lang(()); ///Marker type for the `file` field pub struct file(()); + ///Marker type for the `lang` field + pub struct lang(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> CaptionBuilder<'a, S> where S: caption_state::State, - S::Lang: caption_state::IsSet, S::File: caption_state::IsSet, + S::Lang: 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 2b23ffd..96387eb 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 Author; type Uri; type Blocked; - type Author; } /// 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 Author = 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 Author = S::Author; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Uri = S::Uri; - type Blocked = 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 = S::Uri; - type Blocked = S::Blocked; - type Author = Set; + 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 `blocked` field pub struct blocked(()); - ///Marker type for the `author` field - pub struct author(()); } } @@ -1746,9 +1746,9 @@ where impl<'a, S> BlockedPostBuilder<'a, S> where S: blocked_post_state::State, + S::Author: blocked_post_state::IsSet, S::Uri: blocked_post_state::IsSet, S::Blocked: blocked_post_state::IsSet, - S::Author: blocked_post_state::IsSet, { /// Build the final struct pub fn build(self) -> BlockedPost<'a> { @@ -2235,104 +2235,104 @@ pub mod generator_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Cid; - type Did; + type IndexedAt; type Creator; + type Cid; type DisplayName; - type IndexedAt; + 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 Cid = Unset; - type Did = Unset; + type IndexedAt = Unset; type Creator = Unset; + type Cid = Unset; type DisplayName = Unset; - type IndexedAt = 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 Cid = S::Cid; - type Did = S::Did; - type Creator = S::Creator; - type DisplayName = S::DisplayName; 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 Did = S::Did; type Creator = S::Creator; + type Cid = S::Cid; type DisplayName = S::DisplayName; - type IndexedAt = S::IndexedAt; + 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 { + ///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 Did = Set; + type IndexedAt = Set; type Creator = S::Creator; + type Cid = S::Cid; type DisplayName = S::DisplayName; - 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 Cid = S::Cid; - type Did = S::Did; + type IndexedAt = S::IndexedAt; type Creator = Set; + type Cid = S::Cid; type DisplayName = S::DisplayName; + 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 Uri = S::Uri; type IndexedAt = S::IndexedAt; + type Creator = S::Creator; + type Cid = Set; + type DisplayName = S::DisplayName; + 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 Cid = S::Cid; - type Did = S::Did; + type IndexedAt = S::IndexedAt; type Creator = S::Creator; + type Cid = S::Cid; type DisplayName = Set; - type IndexedAt = S::IndexedAt; + 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 Cid = S::Cid; - type Did = S::Did; + type IndexedAt = S::IndexedAt; type Creator = S::Creator; + type Cid = S::Cid; type DisplayName = S::DisplayName; - type IndexedAt = 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 `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 `creator` field pub struct creator(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -2649,11 +2649,11 @@ impl<'a, S> GeneratorViewBuilder<'a, S> where S: generator_view_state::State, S::Uri: generator_view_state::IsSet, - S::Cid: generator_view_state::IsSet, - S::Did: generator_view_state::IsSet, + S::IndexedAt: generator_view_state::IsSet, S::Creator: generator_view_state::IsSet, + S::Cid: generator_view_state::IsSet, S::DisplayName: generator_view_state::IsSet, - S::IndexedAt: generator_view_state::IsSet, + S::Did: generator_view_state::IsSet, { /// Build the final struct pub fn build(self) -> GeneratorView<'a> { @@ -3207,85 +3207,85 @@ pub mod post_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type IndexedAt; type Uri; - type Cid; type Author; + type Cid; type Record; - type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type IndexedAt = Unset; type Uri = Unset; - type Cid = Unset; type Author = Unset; + type Cid = Unset; type Record = Unset; - type IndexedAt = 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 Uri = S::Uri; + type Author = S::Author; + 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 Uri = Set; - type Cid = S::Cid; - type Author = S::Author; - type Record = S::Record; 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 Uri = Set; type Author = S::Author; + type Cid = S::Cid; type Record = S::Record; - 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 IndexedAt = S::IndexedAt; type Uri = S::Uri; - type Cid = S::Cid; type Author = 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 Uri = S::Uri; + type Author = S::Author; + 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 Uri = S::Uri; - type Cid = S::Cid; - type Author = S::Author; - 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 Author = S::Author; - type Record = S::Record; - type IndexedAt = Set; + type Cid = S::Cid; + type Record = 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 `uri` field pub struct uri(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `author` field pub struct author(()); + ///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(()); } } @@ -3598,11 +3598,11 @@ impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { impl<'a, S> PostViewBuilder<'a, S> where S: post_view_state::State, + S::IndexedAt: post_view_state::IsSet, S::Uri: post_view_state::IsSet, - S::Cid: post_view_state::IsSet, S::Author: post_view_state::IsSet, + S::Cid: post_view_state::IsSet, S::Record: post_view_state::IsSet, - S::IndexedAt: post_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PostView<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/generator.rs b/crates/weaver-api/src/app_bsky/feed/generator.rs index 113990d..711b6f4 100644 --- a/crates/weaver-api/src/app_bsky/feed/generator.rs +++ b/crates/weaver-api/src/app_bsky/feed/generator.rs @@ -56,49 +56,49 @@ pub mod generator_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type DisplayName; + type Did; type CreatedAt; } /// 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 Did = Unset; type CreatedAt = 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 DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; - } ///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 Did = S::Did; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type DisplayName = S::DisplayName; + type Did = 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 Did = S::Did; type DisplayName = S::DisplayName; + type Did = S::Did; type CreatedAt = 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 `did` field + pub struct did(()); ///Marker type for the `created_at` field pub struct created_at(()); } @@ -317,8 +317,8 @@ 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::Did: generator_state::IsSet, S::CreatedAt: generator_state::IsSet, { /// Build the final struct 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 e108641..0036f79 100644 --- a/crates/weaver-api/src/app_bsky/feed/get_likes.rs +++ b/crates/weaver-api/src/app_bsky/feed/get_likes.rs @@ -33,49 +33,49 @@ pub mod like_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type IndexedAt; type CreatedAt; + type IndexedAt; type Actor; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type IndexedAt = Unset; type CreatedAt = Unset; + type IndexedAt = Unset; type Actor = 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 CreatedAt = S::CreatedAt; - type Actor = S::Actor; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type IndexedAt = S::IndexedAt; type CreatedAt = Set; + type IndexedAt = S::IndexedAt; + type Actor = S::Actor; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type CreatedAt = S::CreatedAt; + type IndexedAt = Set; type Actor = S::Actor; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData S>); impl sealed::Sealed for SetActor {} impl State for SetActor { - type IndexedAt = S::IndexedAt; type CreatedAt = S::CreatedAt; + type IndexedAt = S::IndexedAt; type Actor = 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 `created_at` field pub struct created_at(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `actor` field pub struct actor(()); } @@ -170,8 +170,8 @@ where impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, - S::IndexedAt: like_state::IsSet, S::CreatedAt: like_state::IsSet, + S::IndexedAt: like_state::IsSet, S::Actor: like_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/feed/like.rs b/crates/weaver-api/src/app_bsky/feed/like.rs index 7d60480..29aa754 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 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(()); } } @@ -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::Subject: like_state::IsSet, S::CreatedAt: like_state::IsSet, + S::Subject: like_state::IsSet, { /// Build the final struct pub fn build(self) -> Like<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/repost.rs b/crates/weaver-api/src/app_bsky/feed/repost.rs index 3c88b6b..bd94244 100644 --- a/crates/weaver-api/src/app_bsky/feed/repost.rs +++ b/crates/weaver-api/src/app_bsky/feed/repost.rs @@ -36,37 +36,37 @@ pub mod repost_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(()); } } @@ -159,8 +159,8 @@ impl<'a, S: repost_state::State> RepostBuilder<'a, S> { impl<'a, S> RepostBuilder<'a, S> where S: repost_state::State, - S::Subject: repost_state::IsSet, S::CreatedAt: repost_state::IsSet, + S::Subject: repost_state::IsSet, { /// Build the final struct pub fn build(self) -> Repost<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/threadgate.rs b/crates/weaver-api/src/app_bsky/feed/threadgate.rs index e68990f..6384dab 100644 --- a/crates/weaver-api/src/app_bsky/feed/threadgate.rs +++ b/crates/weaver-api/src/app_bsky/feed/threadgate.rs @@ -463,37 +463,37 @@ pub mod threadgate_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Post; type CreatedAt; + 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 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 Post = Set; - type CreatedAt = S::CreatedAt; + 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 Post = S::Post; type CreatedAt = 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 CreatedAt = S::CreatedAt; + 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 `created_at` field pub struct created_at(()); + ///Marker type for the `post` field + pub struct post(()); } } @@ -603,8 +603,8 @@ where impl<'a, S> ThreadgateBuilder<'a, S> where S: threadgate_state::State, - S::Post: threadgate_state::IsSet, S::CreatedAt: threadgate_state::IsSet, + S::Post: threadgate_state::IsSet, { /// Build the final struct pub fn build(self) -> Threadgate<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph.rs b/crates/weaver-api/src/app_bsky/graph.rs index f2e3fbd..8a2ceed 100644 --- a/crates/weaver-api/src/app_bsky/graph.rs +++ b/crates/weaver-api/src/app_bsky/graph.rs @@ -1277,105 +1277,105 @@ pub mod list_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; - type Cid; - type Creator; - type Name; type Purpose; type IndexedAt; + type Name; + type Cid; + type Creator; + 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 Cid = Unset; - type Creator = Unset; - type Name = Unset; type Purpose = Unset; type IndexedAt = Unset; + type Name = Unset; + type Cid = Unset; + type Creator = Unset; + type Uri = 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 `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Purpose = Set; + type IndexedAt = S::IndexedAt; + type Name = S::Name; type Cid = S::Cid; type Creator = S::Creator; + 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 Purpose = S::Purpose; + type IndexedAt = Set; type Name = S::Name; + type Cid = S::Cid; + type Creator = S::Creator; + type Uri = S::Uri; + } + ///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 IndexedAt = S::IndexedAt; + type Name = Set; + type Cid = S::Cid; + type Creator = S::Creator; + 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 Uri = S::Uri; - type Cid = Set; - type Creator = S::Creator; - type Name = S::Name; type Purpose = S::Purpose; type IndexedAt = S::IndexedAt; + type Name = S::Name; + type Cid = Set; + type Creator = S::Creator; + type Uri = S::Uri; } ///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 Creator = Set; - type Name = S::Name; type Purpose = S::Purpose; 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 Uri = S::Uri; + type Name = S::Name; type Cid = S::Cid; - type Creator = S::Creator; - type Name = Set; + type Creator = 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 Purpose = S::Purpose; 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 Uri = S::Uri; - type Cid = S::Cid; - type Creator = S::Creator; type Name = S::Name; - type Purpose = 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 Creator = S::Creator; - type Name = S::Name; - type Purpose = S::Purpose; - type IndexedAt = Set; + 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 `cid` field - pub struct cid(()); - ///Marker type for the `creator` field - pub struct creator(()); - ///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 `name` field + pub struct name(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1655,12 +1655,12 @@ impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, - S::Uri: list_view_state::IsSet, - S::Cid: list_view_state::IsSet, - S::Creator: list_view_state::IsSet, - S::Name: list_view_state::IsSet, S::Purpose: list_view_state::IsSet, S::IndexedAt: list_view_state::IsSet, + S::Name: list_view_state::IsSet, + S::Cid: list_view_state::IsSet, + S::Creator: list_view_state::IsSet, + S::Uri: list_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListView<'a> { @@ -1837,8 +1837,8 @@ pub mod list_view_basic_state { pub trait State: sealed::Sealed { type Uri; type Cid; - type Name; type Purpose; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -1846,8 +1846,8 @@ pub mod list_view_basic_state { impl State for Empty { type Uri = Unset; type Cid = Unset; - type Name = Unset; type Purpose = Unset; + type Name = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); @@ -1855,8 +1855,8 @@ pub mod list_view_basic_state { impl State for SetUri { type Uri = Set; type Cid = S::Cid; - type Name = S::Name; type Purpose = S::Purpose; + type Name = S::Name; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); @@ -1864,17 +1864,8 @@ pub mod list_view_basic_state { impl State for SetCid { type Uri = S::Uri; type Cid = Set; - type Name = S::Name; - type Purpose = S::Purpose; - } - ///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 Cid = S::Cid; - type Name = Set; type Purpose = S::Purpose; + type Name = S::Name; } ///State transition - sets the `purpose` field to Set pub struct SetPurpose(PhantomData S>); @@ -1882,8 +1873,17 @@ pub mod list_view_basic_state { impl State for SetPurpose { type Uri = S::Uri; type Cid = S::Cid; - type Name = S::Name; type Purpose = 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 Uri = S::Uri; + type Cid = S::Cid; + type Purpose = S::Purpose; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -1892,10 +1892,10 @@ pub mod list_view_basic_state { pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `purpose` field pub struct purpose(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -2114,8 +2114,8 @@ where S: list_view_basic_state::State, S::Uri: list_view_basic_state::IsSet, S::Cid: list_view_basic_state::IsSet, - S::Name: list_view_basic_state::IsSet, S::Purpose: list_view_basic_state::IsSet, + S::Name: list_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> ListViewBasic<'a> { @@ -2292,37 +2292,37 @@ pub mod not_found_actor_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Actor; type NotFound; + type Actor; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Actor = Unset; 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 Actor = Set; - type NotFound = S::NotFound; + 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 Actor = S::Actor; type NotFound = Set; + type Actor = S::Actor; + } + ///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; } /// 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 `not_found` field pub struct not_found(()); + ///Marker type for the `actor` field + pub struct actor(()); } } @@ -2395,8 +2395,8 @@ where impl<'a, S> NotFoundActorBuilder<'a, S> where S: not_found_actor_state::State, - S::Actor: not_found_actor_state::IsSet, S::NotFound: not_found_actor_state::IsSet, + S::Actor: not_found_actor_state::IsSet, { /// Build the final struct pub fn build(self) -> NotFoundActor<'a> { @@ -2699,85 +2699,85 @@ pub mod starter_pack_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; - type Cid; type Record; + type Cid; type Creator; type IndexedAt; + 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 Cid = Unset; type Record = Unset; + type Cid = Unset; type Creator = Unset; type IndexedAt = Unset; + type Uri = 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 Creator = S::Creator; type IndexedAt = S::IndexedAt; + 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 Uri = S::Uri; - type Cid = Set; type Record = S::Record; + type Cid = Set; type Creator = S::Creator; 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 Record = Set; - type Creator = S::Creator; - type IndexedAt = S::IndexedAt; } ///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 Record = S::Record; + type Cid = S::Cid; type Creator = 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 Uri = S::Uri; - type Cid = S::Cid; type Record = S::Record; + type Cid = S::Cid; type Creator = S::Creator; type IndexedAt = 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 Cid = S::Cid; + type Creator = S::Creator; + type IndexedAt = S::IndexedAt; + 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 `cid` field - pub struct cid(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `creator` field pub struct creator(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -3030,11 +3030,11 @@ where impl<'a, S> StarterPackViewBuilder<'a, S> where S: starter_pack_view_state::State, - S::Uri: starter_pack_view_state::IsSet, - S::Cid: starter_pack_view_state::IsSet, S::Record: starter_pack_view_state::IsSet, + S::Cid: starter_pack_view_state::IsSet, S::Creator: starter_pack_view_state::IsSet, S::IndexedAt: starter_pack_view_state::IsSet, + S::Uri: starter_pack_view_state::IsSet, { /// Build the final struct pub fn build(self) -> StarterPackView<'a> { @@ -3183,85 +3183,85 @@ pub mod starter_pack_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; + type IndexedAt; type Cid; type Record; type Creator; - type IndexedAt; + 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 IndexedAt = Unset; type Cid = Unset; type Record = Unset; type Creator = Unset; - type IndexedAt = Unset; + type Uri = 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 `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; type Cid = S::Cid; type Record = S::Record; type Creator = S::Creator; - type IndexedAt = S::IndexedAt; + 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 Uri = S::Uri; + type IndexedAt = S::IndexedAt; type Cid = Set; type Record = S::Record; type Creator = S::Creator; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; } ///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 IndexedAt = S::IndexedAt; type Cid = S::Cid; type Record = Set; type Creator = S::Creator; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; } ///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 Cid = S::Cid; type Record = S::Record; type Creator = 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; + } + ///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 Cid = S::Cid; type Record = S::Record; type Creator = S::Creator; - type IndexedAt = Set; + 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 `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `record` field pub struct record(()); ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -3472,11 +3472,11 @@ where impl<'a, S> StarterPackViewBasicBuilder<'a, S> where S: starter_pack_view_basic_state::State, - S::Uri: starter_pack_view_basic_state::IsSet, + S::IndexedAt: starter_pack_view_basic_state::IsSet, S::Cid: starter_pack_view_basic_state::IsSet, S::Record: starter_pack_view_basic_state::IsSet, S::Creator: starter_pack_view_basic_state::IsSet, - S::IndexedAt: starter_pack_view_basic_state::IsSet, + S::Uri: 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/listblock.rs b/crates/weaver-api/src/app_bsky/graph/listblock.rs index 9e2bb50..b81e93c 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 fa585a6..4455bad 100644 --- a/crates/weaver-api/src/app_bsky/graph/listitem.rs +++ b/crates/weaver-api/src/app_bsky/graph/listitem.rs @@ -38,50 +38,50 @@ pub mod listitem_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Subject; - type List; type CreatedAt; + type List; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Subject = Unset; - type List = Unset; type CreatedAt = Unset; + type List = 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 List = S::List; - type CreatedAt = S::CreatedAt; - } - ///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 List = 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 List = S::List; 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; } /// 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 `list` field - pub struct list(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `list` field + pub struct list(()); } } @@ -175,8 +175,8 @@ impl<'a, S> ListitemBuilder<'a, S> where S: listitem_state::State, S::Subject: listitem_state::IsSet, - S::List: 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/app_bsky/graph/starterpack.rs b/crates/weaver-api/src/app_bsky/graph/starterpack.rs index da639ff..3f6999a 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 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 List = 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 List = S::List; - type CreatedAt = S::CreatedAt; + type Name = Unset; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData S>); impl sealed::Sealed for SetList {} impl State for SetList { - type Name = S::Name; type List = 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 Name = S::Name; type List = S::List; 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 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 `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::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 55ad99d..777a571 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 Handle; type DisplayName; type CreatedAt; + type Handle; + 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 Handle = Unset; type DisplayName = 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 Handle = S::Handle; - type DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; - } - ///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 Handle = Set; - type DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; + type Handle = Unset; + type Subject = Unset; } ///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 Handle = S::Handle; type DisplayName = Set; type CreatedAt = S::CreatedAt; + type Handle = S::Handle; + 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 Handle = S::Handle; type DisplayName = S::DisplayName; type CreatedAt = Set; + type Handle = S::Handle; + type Subject = S::Subject; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + type Handle = 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 DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + type Handle = S::Handle; + 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 `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 `handle` field + pub struct handle(()); + ///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::Handle: verification_state::IsSet, S::DisplayName: verification_state::IsSet, S::CreatedAt: verification_state::IsSet, + S::Handle: 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 311608e..e369202 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 Uri; type Cid; type Creator; - type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type IndexedAt = Unset; type Uri = Unset; type Cid = Unset; type Creator = Unset; - type IndexedAt = 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 Uri = S::Uri; + type Cid = S::Cid; + type Creator = S::Creator; } ///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 Uri = Set; type Cid = S::Cid; type Creator = S::Creator; - 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 IndexedAt = S::IndexedAt; type Uri = S::Uri; type Cid = Set; type Creator = S::Creator; - type IndexedAt = S::IndexedAt; } ///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 Creator = 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 Creator = S::Creator; - type IndexedAt = Set; + 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 `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); } } @@ -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::Uri: labeler_view_state::IsSet, S::Cid: labeler_view_state::IsSet, S::Creator: labeler_view_state::IsSet, - S::IndexedAt: labeler_view_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerView<'a> { @@ -986,84 +986,84 @@ pub mod labeler_view_detailed_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Cid; type Creator; - type Policies; type IndexedAt; + type Policies; + 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 Cid = Unset; type Creator = Unset; - type Policies = Unset; type IndexedAt = Unset; + type Policies = 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 Cid = S::Cid; type Creator = S::Creator; - type Policies = S::Policies; 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 Creator = S::Creator; type Policies = S::Policies; - 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 Cid = S::Cid; type Creator = Set; - type Policies = S::Policies; type IndexedAt = S::IndexedAt; + type Policies = S::Policies; + 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 Creator = S::Creator; + type IndexedAt = Set; + type Policies = S::Policies; + type Cid = S::Cid; } ///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 Cid = S::Cid; type Creator = S::Creator; - type Policies = Set; type IndexedAt = S::IndexedAt; + type Policies = Set; + 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 { + ///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 = S::Cid; type Creator = S::Creator; + type IndexedAt = S::IndexedAt; type Policies = S::Policies; - type IndexedAt = 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 `cid` field - pub struct cid(()); ///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 `policies` field + pub struct policies(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1323,10 +1323,10 @@ impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, S::Uri: labeler_view_detailed_state::IsSet, - S::Cid: 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::Policies: labeler_view_detailed_state::IsSet, + S::Cid: labeler_view_detailed_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerViewDetailed<'a> { diff --git a/crates/weaver-api/src/app_bsky/labeler/service.rs b/crates/weaver-api/src/app_bsky/labeler/service.rs index c9ccb61..24e3395 100644 --- a/crates/weaver-api/src/app_bsky/labeler/service.rs +++ b/crates/weaver-api/src/app_bsky/labeler/service.rs @@ -54,37 +54,37 @@ pub mod service_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Policies; type CreatedAt; + type Policies; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Policies = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `policies` field to Set - pub struct SetPolicies(PhantomData S>); - impl sealed::Sealed for SetPolicies {} - impl State for SetPolicies { - type Policies = Set; - type CreatedAt = S::CreatedAt; + type Policies = 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 Policies = S::Policies; type CreatedAt = Set; + type Policies = S::Policies; + } + ///State transition - sets the `policies` field to Set + pub struct SetPolicies(PhantomData S>); + impl sealed::Sealed for SetPolicies {} + impl State for SetPolicies { + type CreatedAt = S::CreatedAt; + type Policies = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `policies` field - pub struct policies(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `policies` field + pub struct policies(()); } } @@ -237,8 +237,8 @@ impl<'a, S: service_state::State> ServiceBuilder<'a, S> { impl<'a, S> ServiceBuilder<'a, S> where S: service_state::State, - S::Policies: service_state::IsSet, S::CreatedAt: service_state::IsSet, + S::Policies: service_state::IsSet, { /// Build the final struct pub fn build(self) -> Service<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification.rs b/crates/weaver-api/src/app_bsky/notification.rs index 908c18b..28ce04b 100644 --- a/crates/weaver-api/src/app_bsky/notification.rs +++ b/crates/weaver-api/src/app_bsky/notification.rs @@ -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> { @@ -776,51 +776,51 @@ pub mod filterable_preference_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Include; type List; 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 List = 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 List = S::List; - type Push = S::Push; + type Include = Unset; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData S>); impl sealed::Sealed for SetList {} impl State for SetList { - type Include = S::Include; type List = Set; type Push = S::Push; + type Include = S::Include; } ///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 List = S::List; 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 List = S::List; + 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 `list` field pub struct list(()); ///Marker type for the `push` field pub struct push(()); + ///Marker type for the `include` field + pub struct include(()); } } @@ -913,9 +913,9 @@ where impl<'a, S> FilterablePreferenceBuilder<'a, S> where S: filterable_preference_state::State, - S::Include: filterable_preference_state::IsSet, S::List: filterable_preference_state::IsSet, S::Push: filterable_preference_state::IsSet, + S::Include: filterable_preference_state::IsSet, { /// Build the final struct pub fn build(self) -> FilterablePreference<'a> { @@ -1181,300 +1181,300 @@ pub mod preferences_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Chat; + type Verified; + type StarterpackJoined; type Follow; - type Like; - type LikeViaRepost; - type Mention; - type Quote; type Reply; - type Repost; - type RepostViaRepost; - type StarterpackJoined; + type Quote; type SubscribedPost; + type Mention; type Unverified; - type Verified; + type LikeViaRepost; + type Repost; + type Like; + type RepostViaRepost; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Chat = Unset; + type Verified = Unset; + type StarterpackJoined = Unset; type Follow = Unset; - type Like = Unset; - type LikeViaRepost = Unset; - type Mention = Unset; - type Quote = Unset; type Reply = Unset; - type Repost = Unset; - type RepostViaRepost = Unset; - type StarterpackJoined = Unset; + type Quote = Unset; type SubscribedPost = Unset; + type Mention = Unset; type Unverified = Unset; - type Verified = Unset; + type LikeViaRepost = Unset; + type Repost = Unset; + type Like = Unset; + type RepostViaRepost = Unset; } ///State transition - sets the `chat` field to Set pub struct SetChat(PhantomData S>); impl sealed::Sealed for SetChat {} impl State for SetChat { type Chat = Set; + type Verified = S::Verified; + type StarterpackJoined = S::StarterpackJoined; type Follow = S::Follow; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = S::Quote; type Reply = S::Reply; - type Repost = S::Repost; - type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; + type Quote = S::Quote; type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; type Unverified = S::Unverified; - type Verified = S::Verified; - } - ///State transition - sets the `follow` field to Set - pub struct SetFollow(PhantomData S>); - impl sealed::Sealed for SetFollow {} - impl State for SetFollow { - type Chat = S::Chat; - type Follow = Set; - type Like = S::Like; type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = S::Quote; - type Reply = S::Reply; type Repost = S::Repost; + type Like = S::Like; type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; - type Verified = S::Verified; } - ///State transition - sets the `like` field to Set - pub struct SetLike(PhantomData S>); - impl sealed::Sealed for SetLike {} - impl State for SetLike { + ///State transition - sets the `verified` field to Set + pub struct SetVerified(PhantomData S>); + impl sealed::Sealed for SetVerified {} + impl State for SetVerified { type Chat = S::Chat; + type Verified = Set; + type StarterpackJoined = S::StarterpackJoined; type Follow = S::Follow; - type Like = Set; - type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = S::Quote; type Reply = S::Reply; - type Repost = S::Repost; - type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; + type Quote = S::Quote; type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; type Unverified = S::Unverified; - type Verified = S::Verified; + type LikeViaRepost = S::LikeViaRepost; + type Repost = S::Repost; + type Like = S::Like; + type RepostViaRepost = S::RepostViaRepost; } - ///State transition - sets the `like_via_repost` field to Set - pub struct SetLikeViaRepost(PhantomData S>); - impl sealed::Sealed for SetLikeViaRepost {} - impl State for SetLikeViaRepost { + ///State transition - sets the `starterpack_joined` field to Set + pub struct SetStarterpackJoined(PhantomData S>); + impl sealed::Sealed for SetStarterpackJoined {} + impl State for SetStarterpackJoined { type Chat = S::Chat; + type Verified = S::Verified; + type StarterpackJoined = Set; type Follow = S::Follow; - type Like = S::Like; - type LikeViaRepost = Set; - type Mention = S::Mention; - type Quote = S::Quote; type Reply = S::Reply; - type Repost = S::Repost; - type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; + type Quote = S::Quote; type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; type Unverified = S::Unverified; - type Verified = S::Verified; - } - ///State transition - sets the `mention` field to Set - pub struct SetMention(PhantomData S>); - impl sealed::Sealed for SetMention {} - impl State for SetMention { - type Chat = S::Chat; - type Follow = S::Follow; - type Like = S::Like; type LikeViaRepost = S::LikeViaRepost; - type Mention = Set; - type Quote = S::Quote; - type Reply = S::Reply; type Repost = S::Repost; + type Like = S::Like; type RepostViaRepost = S::RepostViaRepost; + } + ///State transition - sets the `follow` field to Set + pub struct SetFollow(PhantomData S>); + impl sealed::Sealed for SetFollow {} + impl State for SetFollow { + type Chat = S::Chat; + type Verified = S::Verified; type StarterpackJoined = S::StarterpackJoined; + type Follow = Set; + type Reply = S::Reply; + type Quote = S::Quote; type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; type Unverified = S::Unverified; - type Verified = S::Verified; - } - ///State transition - sets the `quote` field to Set - pub struct SetQuote(PhantomData S>); - impl sealed::Sealed for SetQuote {} - impl State for SetQuote { - type Chat = S::Chat; - type Follow = S::Follow; - type Like = S::Like; type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = Set; - type Reply = S::Reply; type Repost = S::Repost; + type Like = S::Like; type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; - type Verified = S::Verified; } ///State transition - sets the `reply` field to Set pub struct SetReply(PhantomData S>); impl sealed::Sealed for SetReply {} impl State for SetReply { type Chat = S::Chat; + type Verified = S::Verified; + type StarterpackJoined = S::StarterpackJoined; type Follow = S::Follow; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = S::Quote; type Reply = Set; - type Repost = S::Repost; - type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; + type Quote = S::Quote; type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; type Unverified = S::Unverified; - type Verified = S::Verified; - } - ///State transition - sets the `repost` field to Set - pub struct SetRepost(PhantomData S>); - impl sealed::Sealed for SetRepost {} - impl State for SetRepost { - type Chat = S::Chat; - type Follow = S::Follow; - type Like = S::Like; type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = S::Quote; - type Reply = S::Reply; - type Repost = Set; + type Repost = S::Repost; + type Like = S::Like; type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; - type Verified = S::Verified; } - ///State transition - sets the `repost_via_repost` field to Set - pub struct SetRepostViaRepost(PhantomData S>); - impl sealed::Sealed for SetRepostViaRepost {} - impl State for SetRepostViaRepost { + ///State transition - sets the `quote` field to Set + pub struct SetQuote(PhantomData S>); + impl sealed::Sealed for SetQuote {} + impl State for SetQuote { type Chat = S::Chat; + type Verified = S::Verified; + type StarterpackJoined = S::StarterpackJoined; type Follow = S::Follow; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = S::Quote; type Reply = S::Reply; - type Repost = S::Repost; - type RepostViaRepost = Set; - type StarterpackJoined = S::StarterpackJoined; + type Quote = Set; type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; type Unverified = S::Unverified; - type Verified = S::Verified; - } - ///State transition - sets the `starterpack_joined` field to Set - pub struct SetStarterpackJoined(PhantomData S>); - impl sealed::Sealed for SetStarterpackJoined {} - impl State for SetStarterpackJoined { - type Chat = S::Chat; - type Follow = S::Follow; - type Like = S::Like; type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = S::Quote; - type Reply = S::Reply; type Repost = S::Repost; + type Like = S::Like; type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = Set; - type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; - type Verified = S::Verified; } ///State transition - sets the `subscribed_post` field to Set pub struct SetSubscribedPost(PhantomData S>); impl sealed::Sealed for SetSubscribedPost {} impl State for SetSubscribedPost { type Chat = S::Chat; + type Verified = S::Verified; + type StarterpackJoined = S::StarterpackJoined; type Follow = S::Follow; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = S::Quote; type Reply = S::Reply; + type Quote = S::Quote; + type SubscribedPost = Set; + type Mention = S::Mention; + type Unverified = S::Unverified; + type LikeViaRepost = S::LikeViaRepost; type Repost = S::Repost; + type Like = S::Like; type RepostViaRepost = S::RepostViaRepost; + } + ///State transition - sets the `mention` field to Set + pub struct SetMention(PhantomData S>); + impl sealed::Sealed for SetMention {} + impl State for SetMention { + type Chat = S::Chat; + type Verified = S::Verified; type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = Set; + type Follow = S::Follow; + type Reply = S::Reply; + type Quote = S::Quote; + type SubscribedPost = S::SubscribedPost; + type Mention = Set; type Unverified = S::Unverified; - type Verified = S::Verified; + type LikeViaRepost = S::LikeViaRepost; + type Repost = S::Repost; + type Like = S::Like; + type RepostViaRepost = S::RepostViaRepost; } ///State transition - sets the `unverified` field to Set pub struct SetUnverified(PhantomData S>); impl sealed::Sealed for SetUnverified {} impl State for SetUnverified { type Chat = S::Chat; + type Verified = S::Verified; + type StarterpackJoined = S::StarterpackJoined; type Follow = S::Follow; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; - type Quote = S::Quote; type Reply = S::Reply; + type Quote = S::Quote; + type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; + type Unverified = Set; + type LikeViaRepost = S::LikeViaRepost; type Repost = S::Repost; + type Like = S::Like; type RepostViaRepost = S::RepostViaRepost; + } + ///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 Chat = S::Chat; + type Verified = S::Verified; type StarterpackJoined = S::StarterpackJoined; + type Follow = S::Follow; + type Reply = S::Reply; + type Quote = S::Quote; type SubscribedPost = S::SubscribedPost; - type Unverified = Set; - type Verified = S::Verified; + type Mention = S::Mention; + type Unverified = S::Unverified; + type LikeViaRepost = Set; + type Repost = S::Repost; + type Like = S::Like; + type RepostViaRepost = S::RepostViaRepost; } - ///State transition - sets the `verified` field to Set - pub struct SetVerified(PhantomData S>); - impl sealed::Sealed for SetVerified {} - impl State for SetVerified { + ///State transition - sets the `repost` field to Set + pub struct SetRepost(PhantomData S>); + impl sealed::Sealed for SetRepost {} + impl State for SetRepost { type Chat = S::Chat; + type Verified = S::Verified; + type StarterpackJoined = S::StarterpackJoined; type Follow = S::Follow; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Mention = S::Mention; + type Reply = S::Reply; type Quote = S::Quote; + type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; + type Unverified = S::Unverified; + type LikeViaRepost = S::LikeViaRepost; + type Repost = Set; + type Like = S::Like; + type RepostViaRepost = S::RepostViaRepost; + } + ///State transition - sets the `like` field to Set + pub struct SetLike(PhantomData S>); + impl sealed::Sealed for SetLike {} + impl State for SetLike { + type Chat = S::Chat; + type Verified = S::Verified; + type StarterpackJoined = S::StarterpackJoined; + type Follow = S::Follow; type Reply = S::Reply; + type Quote = S::Quote; + type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; + type Unverified = S::Unverified; + type LikeViaRepost = S::LikeViaRepost; type Repost = S::Repost; + type Like = Set; type RepostViaRepost = S::RepostViaRepost; + } + ///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 Chat = S::Chat; + type Verified = S::Verified; type StarterpackJoined = S::StarterpackJoined; + type Follow = S::Follow; + type Reply = S::Reply; + type Quote = S::Quote; type SubscribedPost = S::SubscribedPost; + type Mention = S::Mention; type Unverified = S::Unverified; - type Verified = Set; + type LikeViaRepost = S::LikeViaRepost; + type Repost = S::Repost; + type Like = S::Like; + type RepostViaRepost = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `chat` field pub struct chat(()); + ///Marker type for the `verified` field + pub struct verified(()); + ///Marker type for the `starterpack_joined` field + pub struct starterpack_joined(()); ///Marker type for the `follow` field pub struct follow(()); - ///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 `mention` field - pub struct mention(()); - ///Marker type for the `quote` field - pub struct quote(()); ///Marker type for the `reply` field pub struct reply(()); - ///Marker type for the `repost` field - pub struct repost(()); - ///Marker type for the `repost_via_repost` field - pub struct repost_via_repost(()); - ///Marker type for the `starterpack_joined` field - pub struct starterpack_joined(()); + ///Marker type for the `quote` field + pub struct quote(()); ///Marker type for the `subscribed_post` field pub struct subscribed_post(()); + ///Marker type for the `mention` field + pub struct mention(()); ///Marker type for the `unverified` field pub struct unverified(()); - ///Marker type for the `verified` field - pub struct verified(()); + ///Marker type for the `like_via_repost` field + pub struct like_via_repost(()); + ///Marker type for the `repost` field + pub struct repost(()); + ///Marker type for the `like` field + pub struct like(()); + ///Marker type for the `repost_via_repost` field + pub struct repost_via_repost(()); } } @@ -1782,18 +1782,18 @@ impl<'a, S> PreferencesBuilder<'a, S> where S: preferences_state::State, S::Chat: preferences_state::IsSet, + S::Verified: preferences_state::IsSet, + S::StarterpackJoined: preferences_state::IsSet, S::Follow: preferences_state::IsSet, - S::Like: preferences_state::IsSet, - S::LikeViaRepost: preferences_state::IsSet, - S::Mention: preferences_state::IsSet, - S::Quote: preferences_state::IsSet, S::Reply: preferences_state::IsSet, - S::Repost: preferences_state::IsSet, - S::RepostViaRepost: preferences_state::IsSet, - S::StarterpackJoined: preferences_state::IsSet, + S::Quote: preferences_state::IsSet, S::SubscribedPost: preferences_state::IsSet, + S::Mention: preferences_state::IsSet, S::Unverified: preferences_state::IsSet, - S::Verified: preferences_state::IsSet, + S::LikeViaRepost: preferences_state::IsSet, + S::Repost: preferences_state::IsSet, + S::Like: preferences_state::IsSet, + S::RepostViaRepost: 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 cd00439..ee34da4 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 Uri; type Cid; type Author; - type Reason; type Record; type IsRead; type IndexedAt; + type Reason; + 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 Cid = Unset; type Author = Unset; - type Reason = Unset; type Record = Unset; type IsRead = 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; - type Cid = S::Cid; - type Author = S::Author; - type Reason = S::Reason; - type Record = S::Record; - type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; + type Reason = 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 Uri = S::Uri; type Cid = Set; type Author = S::Author; - type Reason = S::Reason; type Record = S::Record; type IsRead = S::IsRead; type IndexedAt = S::IndexedAt; + type Reason = S::Reason; + type Uri = S::Uri; } ///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 Author = Set; - type Reason = S::Reason; type Record = S::Record; type IsRead = S::IsRead; 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 Reason = S::Reason; type Uri = S::Uri; - type Cid = S::Cid; - type Author = S::Author; - 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 Uri = S::Uri; type Cid = S::Cid; type Author = S::Author; - type Reason = S::Reason; type Record = Set; type IsRead = S::IsRead; type IndexedAt = S::IndexedAt; + type Reason = S::Reason; + type Uri = S::Uri; } ///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 Cid = S::Cid; type Author = S::Author; - type Reason = S::Reason; type Record = S::Record; type IsRead = Set; type IndexedAt = S::IndexedAt; + type Reason = S::Reason; + 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 Uri = S::Uri; type Cid = S::Cid; type Author = S::Author; - type Reason = S::Reason; type Record = S::Record; type IsRead = S::IsRead; type IndexedAt = Set; + type Reason = S::Reason; + type Uri = S::Uri; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Cid = S::Cid; + type Author = S::Author; + type Record = S::Record; + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + type Reason = 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 Cid = S::Cid; + type Author = S::Author; + type Record = S::Record; + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + type Reason = S::Reason; + 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 `cid` field pub struct cid(()); ///Marker type for the `author` field pub struct author(()); - ///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(()); + ///Marker type for the `reason` field + pub struct reason(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -614,13 +614,13 @@ where impl<'a, S> NotificationBuilder<'a, S> where S: notification_state::State, - S::Uri: notification_state::IsSet, S::Cid: notification_state::IsSet, S::Author: notification_state::IsSet, - S::Reason: notification_state::IsSet, S::Record: notification_state::IsSet, S::IsRead: notification_state::IsSet, S::IndexedAt: notification_state::IsSet, + S::Reason: notification_state::IsSet, + S::Uri: 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 7e167a9..b0c858e 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 Subject; type ActivitySubscription; + 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 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 Subject = Set; - type ActivitySubscription = S::ActivitySubscription; + 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 Subject = S::Subject; type ActivitySubscription = 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 ActivitySubscription = S::ActivitySubscription; + 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 `activity_subscription` field pub struct activity_subscription(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -148,8 +148,8 @@ where impl<'a, S> PutActivitySubscriptionBuilder<'a, S> where S: put_activity_subscription_state::State, - S::Subject: put_activity_subscription_state::IsSet, S::ActivitySubscription: put_activity_subscription_state::IsSet, + S::Subject: 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 be75103..12b4a93 100644 --- a/crates/weaver-api/src/app_bsky/notification/register_push.rs +++ b/crates/weaver-api/src/app_bsky/notification/register_push.rs @@ -41,8 +41,8 @@ pub mod register_push_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type ServiceDid; - type Token; type Platform; + type Token; type AppId; } /// Empty state - all required fields are unset @@ -50,8 +50,8 @@ pub mod register_push_state { impl sealed::Sealed for Empty {} impl State for Empty { type ServiceDid = Unset; - type Token = Unset; type Platform = Unset; + type Token = Unset; type AppId = Unset; } ///State transition - sets the `service_did` field to Set @@ -59,17 +59,8 @@ pub mod register_push_state { impl sealed::Sealed for SetServiceDid {} impl State for SetServiceDid { type ServiceDid = Set; - type Token = S::Token; - 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 Token = Set; type Platform = S::Platform; + type Token = S::Token; type AppId = S::AppId; } ///State transition - sets the `platform` field to Set @@ -77,8 +68,17 @@ pub mod register_push_state { impl sealed::Sealed for SetPlatform {} impl State for SetPlatform { type ServiceDid = S::ServiceDid; - type Token = S::Token; type Platform = Set; + type Token = S::Token; + 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 Platform = S::Platform; + type Token = Set; type AppId = S::AppId; } ///State transition - sets the `app_id` field to Set @@ -86,8 +86,8 @@ pub mod register_push_state { impl sealed::Sealed for SetAppId {} impl State for SetAppId { type ServiceDid = S::ServiceDid; - type Token = S::Token; type Platform = S::Platform; + type Token = S::Token; type AppId = Set; } /// Marker types for field names @@ -95,10 +95,10 @@ pub mod register_push_state { pub mod members { ///Marker type for the `service_did` field pub struct service_did(()); - ///Marker type for the `token` field - pub struct token(()); ///Marker type for the `platform` field pub struct platform(()); + ///Marker type for the `token` field + pub struct token(()); ///Marker type for the `app_id` field pub struct app_id(()); } @@ -228,8 +228,8 @@ impl<'a, S> RegisterPushBuilder<'a, S> where S: register_push_state::State, S::ServiceDid: register_push_state::IsSet, - S::Token: register_push_state::IsSet, S::Platform: register_push_state::IsSet, + S::Token: register_push_state::IsSet, S::AppId: register_push_state::IsSet, { /// Build the final struct 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 75f5382..b229e6b 100644 --- a/crates/weaver-api/src/app_bsky/notification/unregister_push.rs +++ b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs @@ -37,67 +37,67 @@ pub mod unregister_push_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ServiceDid; - type Token; - type Platform; type AppId; + type Platform; + type Token; + type ServiceDid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ServiceDid = Unset; - type Token = Unset; - type Platform = Unset; type AppId = Unset; + type Platform = Unset; + type Token = Unset; + type ServiceDid = 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; - type Token = S::Token; + ///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 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 Token = S::Token; type ServiceDid = S::ServiceDid; - type Token = Set; - type Platform = S::Platform; - type AppId = S::AppId; } ///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; + type Platform = Set; + 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 { + ///State transition - sets the `token` field to Set + pub struct SetToken(PhantomData S>); + impl sealed::Sealed for SetToken {} + impl State for SetToken { + type AppId = S::AppId; + type Platform = S::Platform; + type Token = Set; type ServiceDid = S::ServiceDid; - type Token = S::Token; + } + ///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 Platform = S::Platform; - type AppId = Set; + type Token = S::Token; + type ServiceDid = 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 `token` field - pub struct token(()); - ///Marker type for the `platform` field - pub struct platform(()); ///Marker type for the `app_id` field pub struct app_id(()); + ///Marker type for the `platform` field + pub struct platform(()); + ///Marker type for the `token` field + pub struct token(()); + ///Marker type for the `service_did` field + pub struct service_did(()); } } @@ -210,10 +210,10 @@ where impl<'a, S> UnregisterPushBuilder<'a, S> where S: unregister_push_state::State, - S::ServiceDid: unregister_push_state::IsSet, - S::Token: unregister_push_state::IsSet, - S::Platform: unregister_push_state::IsSet, S::AppId: unregister_push_state::IsSet, + S::Platform: unregister_push_state::IsSet, + S::Token: unregister_push_state::IsSet, + S::ServiceDid: unregister_push_state::IsSet, { /// Build the final struct pub fn build(self) -> UnregisterPush<'a> { diff --git a/crates/weaver-api/src/app_bsky/richtext/facet.rs b/crates/weaver-api/src/app_bsky/richtext/facet.rs index 46a7337..aeae106 100644 --- a/crates/weaver-api/src/app_bsky/richtext/facet.rs +++ b/crates/weaver-api/src/app_bsky/richtext/facet.rs @@ -32,37 +32,37 @@ pub mod byte_slice_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ByteStart; type ByteEnd; + type ByteStart; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ByteStart = Unset; type ByteEnd = Unset; - } - ///State transition - sets the `byte_start` field to Set - pub struct SetByteStart(PhantomData S>); - impl sealed::Sealed for SetByteStart {} - impl State for SetByteStart { - type ByteStart = Set; - type ByteEnd = S::ByteEnd; + type ByteStart = Unset; } ///State transition - sets the `byte_end` field to Set pub struct SetByteEnd(PhantomData S>); impl sealed::Sealed for SetByteEnd {} impl State for SetByteEnd { - type ByteStart = S::ByteStart; type ByteEnd = Set; + type ByteStart = S::ByteStart; + } + ///State transition - sets the `byte_start` field to Set + pub struct SetByteStart(PhantomData S>); + impl sealed::Sealed for SetByteStart {} + impl State for SetByteStart { + type ByteEnd = S::ByteEnd; + type ByteStart = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `byte_start` field - pub struct byte_start(()); ///Marker type for the `byte_end` field pub struct byte_end(()); + ///Marker type for the `byte_start` field + pub struct byte_start(()); } } @@ -132,8 +132,8 @@ where impl<'a, S> ByteSliceBuilder<'a, S> where S: byte_slice_state::State, - S::ByteStart: byte_slice_state::IsSet, S::ByteEnd: byte_slice_state::IsSet, + S::ByteStart: byte_slice_state::IsSet, { /// Build the final struct pub fn build(self) -> ByteSlice<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced.rs b/crates/weaver-api/src/app_bsky/unspecced.rs index 86542a1..22556c0 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 CreatedAt; - type Status; type AttemptId; + type Status; + 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 AttemptId = Unset; + type Status = 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; + ///State transition - sets the `attempt_id` field to Set + pub struct SetAttemptId(PhantomData S>); + impl sealed::Sealed for SetAttemptId {} + impl State for SetAttemptId { + type AttemptId = Set; type Status = S::Status; - type AttemptId = S::AttemptId; + type CreatedAt = S::CreatedAt; } ///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 = 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 AttemptId = S::AttemptId; type Status = S::Status; - type AttemptId = Set; + 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 `status` field - pub struct status(()); ///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(()); } } @@ -309,9 +309,9 @@ where impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, - S::CreatedAt: age_assurance_event_state::IsSet, - S::Status: age_assurance_event_state::IsSet, S::AttemptId: age_assurance_event_state::IsSet, + S::Status: age_assurance_event_state::IsSet, + S::CreatedAt: age_assurance_event_state::IsSet, { /// Build the final struct pub fn build(self) -> AgeAssuranceEvent<'a> { @@ -1745,10 +1745,10 @@ pub mod skeleton_trend_state { pub trait State: sealed::Sealed { type Topic; type DisplayName; - type Link; type StartedAt; type PostCount; type Dids; + type Link; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -1756,10 +1756,10 @@ pub mod skeleton_trend_state { impl State for Empty { type Topic = Unset; type DisplayName = Unset; - type Link = Unset; type StartedAt = Unset; type PostCount = Unset; type Dids = Unset; + type Link = Unset; } ///State transition - sets the `topic` field to Set pub struct SetTopic(PhantomData S>); @@ -1767,10 +1767,10 @@ pub mod skeleton_trend_state { impl State for SetTopic { type Topic = Set; type DisplayName = S::DisplayName; - type Link = S::Link; type StartedAt = S::StartedAt; type PostCount = S::PostCount; type Dids = S::Dids; + type Link = S::Link; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); @@ -1778,21 +1778,10 @@ pub mod skeleton_trend_state { impl State for SetDisplayName { type Topic = S::Topic; type DisplayName = Set; - type Link = S::Link; - type StartedAt = S::StartedAt; - type PostCount = S::PostCount; - type Dids = S::Dids; - } - ///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 DisplayName = S::DisplayName; - type Link = Set; type StartedAt = S::StartedAt; type PostCount = S::PostCount; type Dids = S::Dids; + type Link = S::Link; } ///State transition - sets the `started_at` field to Set pub struct SetStartedAt(PhantomData S>); @@ -1800,10 +1789,10 @@ pub mod skeleton_trend_state { impl State for SetStartedAt { type Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; type StartedAt = Set; type PostCount = S::PostCount; type Dids = S::Dids; + type Link = S::Link; } ///State transition - sets the `post_count` field to Set pub struct SetPostCount(PhantomData S>); @@ -1811,10 +1800,10 @@ pub mod skeleton_trend_state { impl State for SetPostCount { type Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; type StartedAt = S::StartedAt; type PostCount = Set; type Dids = S::Dids; + type Link = S::Link; } ///State transition - sets the `dids` field to Set pub struct SetDids(PhantomData S>); @@ -1822,10 +1811,21 @@ pub mod skeleton_trend_state { impl State for SetDids { type Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; type StartedAt = S::StartedAt; type PostCount = S::PostCount; type Dids = 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 DisplayName = S::DisplayName; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + type Dids = S::Dids; + type Link = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -1834,14 +1834,14 @@ pub mod skeleton_trend_state { pub struct topic(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `link` field - pub struct link(()); ///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 `dids` field pub struct dids(()); + ///Marker type for the `link` field + pub struct link(()); } } @@ -2030,10 +2030,10 @@ where S: skeleton_trend_state::State, S::Topic: skeleton_trend_state::IsSet, S::DisplayName: skeleton_trend_state::IsSet, - S::Link: skeleton_trend_state::IsSet, S::StartedAt: skeleton_trend_state::IsSet, S::PostCount: skeleton_trend_state::IsSet, S::Dids: skeleton_trend_state::IsSet, + S::Link: skeleton_trend_state::IsSet, { /// Build the final struct pub fn build(self) -> SkeletonTrend<'a> { @@ -2322,10 +2322,10 @@ pub mod thread_item_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type OpThread; type Post; type MoreParents; type MoreReplies; - type OpThread; type HiddenByThreadgate; type MutedByViewer; } @@ -2333,21 +2333,32 @@ pub mod thread_item_post_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type OpThread = Unset; type Post = Unset; type MoreParents = Unset; type MoreReplies = Unset; - type OpThread = Unset; type HiddenByThreadgate = Unset; type MutedByViewer = Unset; } + ///State transition - sets the `op_thread` field to Set + pub struct SetOpThread(PhantomData S>); + impl sealed::Sealed for SetOpThread {} + impl State for SetOpThread { + type OpThread = Set; + type Post = S::Post; + type MoreParents = S::MoreParents; + type MoreReplies = S::MoreReplies; + type HiddenByThreadgate = S::HiddenByThreadgate; + type MutedByViewer = S::MutedByViewer; + } ///State transition - sets the `post` field to Set pub struct SetPost(PhantomData S>); impl sealed::Sealed for SetPost {} impl State for SetPost { + type OpThread = S::OpThread; type Post = Set; type MoreParents = S::MoreParents; type MoreReplies = S::MoreReplies; - type OpThread = S::OpThread; type HiddenByThreadgate = S::HiddenByThreadgate; type MutedByViewer = S::MutedByViewer; } @@ -2355,10 +2366,10 @@ pub mod thread_item_post_state { pub struct SetMoreParents(PhantomData S>); impl sealed::Sealed for SetMoreParents {} impl State for SetMoreParents { + type OpThread = S::OpThread; type Post = S::Post; type MoreParents = Set; type MoreReplies = S::MoreReplies; - type OpThread = S::OpThread; type HiddenByThreadgate = S::HiddenByThreadgate; type MutedByViewer = S::MutedByViewer; } @@ -2366,21 +2377,10 @@ pub mod thread_item_post_state { pub struct SetMoreReplies(PhantomData S>); impl sealed::Sealed for SetMoreReplies {} impl State for SetMoreReplies { - type Post = S::Post; - type MoreParents = S::MoreParents; - type MoreReplies = Set; type OpThread = S::OpThread; - type HiddenByThreadgate = S::HiddenByThreadgate; - type MutedByViewer = S::MutedByViewer; - } - ///State transition - sets the `op_thread` field to Set - pub struct SetOpThread(PhantomData S>); - impl sealed::Sealed for SetOpThread {} - impl State for SetOpThread { type Post = S::Post; type MoreParents = S::MoreParents; - type MoreReplies = S::MoreReplies; - type OpThread = Set; + type MoreReplies = Set; type HiddenByThreadgate = S::HiddenByThreadgate; type MutedByViewer = S::MutedByViewer; } @@ -2388,10 +2388,10 @@ pub mod thread_item_post_state { pub struct SetHiddenByThreadgate(PhantomData S>); impl sealed::Sealed for SetHiddenByThreadgate {} impl State for SetHiddenByThreadgate { + type OpThread = S::OpThread; type Post = S::Post; type MoreParents = S::MoreParents; type MoreReplies = S::MoreReplies; - type OpThread = S::OpThread; type HiddenByThreadgate = Set; type MutedByViewer = S::MutedByViewer; } @@ -2399,24 +2399,24 @@ pub mod thread_item_post_state { pub struct SetMutedByViewer(PhantomData S>); impl sealed::Sealed for SetMutedByViewer {} impl State for SetMutedByViewer { + type OpThread = S::OpThread; type Post = S::Post; type MoreParents = S::MoreParents; type MoreReplies = S::MoreReplies; - type OpThread = S::OpThread; type HiddenByThreadgate = S::HiddenByThreadgate; type MutedByViewer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `op_thread` field + pub struct op_thread(()); ///Marker type for the `post` field pub struct post(()); ///Marker type for the `more_parents` field pub struct more_parents(()); ///Marker type for the `more_replies` field pub struct more_replies(()); - ///Marker type for the `op_thread` field - pub struct op_thread(()); ///Marker type for the `hidden_by_threadgate` field pub struct hidden_by_threadgate(()); ///Marker type for the `muted_by_viewer` field @@ -2573,10 +2573,10 @@ where impl<'a, S> ThreadItemPostBuilder<'a, S> where S: thread_item_post_state::State, + S::OpThread: thread_item_post_state::IsSet, S::Post: thread_item_post_state::IsSet, S::MoreParents: thread_item_post_state::IsSet, S::MoreReplies: thread_item_post_state::IsSet, - S::OpThread: thread_item_post_state::IsSet, S::HiddenByThreadgate: thread_item_post_state::IsSet, S::MutedByViewer: thread_item_post_state::IsSet, { @@ -2669,105 +2669,105 @@ pub mod trend_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Topic; - type DisplayName; - type Link; type StartedAt; + type Link; type PostCount; type Actors; + type Topic; + type DisplayName; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Topic = Unset; - type DisplayName = Unset; - type Link = Unset; type StartedAt = Unset; + type Link = Unset; type PostCount = Unset; type Actors = Unset; + type Topic = Unset; + type DisplayName = 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 DisplayName = S::DisplayName; + ///State transition - sets the `started_at` field to Set + pub struct SetStartedAt(PhantomData S>); + impl sealed::Sealed for SetStartedAt {} + impl State for SetStartedAt { + type StartedAt = Set; type Link = S::Link; - type StartedAt = S::StartedAt; type PostCount = S::PostCount; type Actors = S::Actors; - } - ///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 DisplayName = Set; - type Link = S::Link; - type StartedAt = S::StartedAt; - type PostCount = S::PostCount; - type Actors = S::Actors; + type DisplayName = S::DisplayName; } ///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 DisplayName = S::DisplayName; - type Link = Set; type StartedAt = S::StartedAt; + type Link = Set; type PostCount = S::PostCount; 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 Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; - type StartedAt = Set; - type PostCount = S::PostCount; - type Actors = S::Actors; } ///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 DisplayName = S::DisplayName; - type Link = S::Link; type StartedAt = S::StartedAt; + type Link = S::Link; type PostCount = Set; type Actors = S::Actors; + type Topic = S::Topic; + type DisplayName = S::DisplayName; } ///State transition - sets the `actors` field to Set pub struct SetActors(PhantomData S>); impl sealed::Sealed for SetActors {} impl State for SetActors { + type StartedAt = S::StartedAt; + type Link = S::Link; + type PostCount = S::PostCount; + type Actors = 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 StartedAt = S::StartedAt; type Link = S::Link; + type PostCount = S::PostCount; + type Actors = S::Actors; + 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 StartedAt = S::StartedAt; + type Link = S::Link; type PostCount = S::PostCount; - type Actors = Set; + type Actors = S::Actors; + 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 `display_name` field - pub struct display_name(()); - ///Marker type for the `link` field - pub struct link(()); ///Marker type for the `started_at` field pub struct started_at(()); + ///Marker type for the `link` field + pub struct link(()); ///Marker type for the `post_count` field pub struct post_count(()); ///Marker type for the `actors` field pub struct actors(()); + ///Marker type for the `topic` field + pub struct topic(()); + ///Marker type for the `display_name` field + pub struct display_name(()); } } @@ -2954,12 +2954,12 @@ where impl<'a, S> TrendViewBuilder<'a, S> where S: trend_view_state::State, - S::Topic: trend_view_state::IsSet, - S::DisplayName: trend_view_state::IsSet, - S::Link: trend_view_state::IsSet, S::StartedAt: trend_view_state::IsSet, + S::Link: trend_view_state::IsSet, S::PostCount: trend_view_state::IsSet, S::Actors: trend_view_state::IsSet, + S::Topic: trend_view_state::IsSet, + S::DisplayName: 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_post_thread_other_v2.rs b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs index 691dc9b..b572674 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs @@ -189,51 +189,51 @@ pub mod thread_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; - type Depth; type Value; + type Depth; + 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 Depth = Unset; type Value = Unset; + type Depth = Unset; + type Uri = 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 `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Value = Set; type Depth = S::Depth; - type Value = S::Value; + type Uri = S::Uri; } ///State transition - sets the `depth` field to Set pub struct SetDepth(PhantomData S>); impl sealed::Sealed for SetDepth {} impl State for SetDepth { - type Uri = S::Uri; - type Depth = 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 Depth = 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 Value = S::Value; type Depth = S::Depth; - type Value = Set; + 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 `depth` field - pub struct depth(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `depth` field + pub struct depth(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -326,9 +326,9 @@ where impl<'a, S> ThreadItemBuilder<'a, S> where S: thread_item_state::State, - S::Uri: thread_item_state::IsSet, - S::Depth: thread_item_state::IsSet, S::Value: thread_item_state::IsSet, + S::Depth: thread_item_state::IsSet, + S::Uri: 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 3bceb81..e8fa283 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 @@ -91,50 +91,50 @@ 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 SubjectType; } /// 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 SubjectType = 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 SubjectType = S::SubjectType; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { type Tag = S::Tag; - type SubjectType = S::SubjectType; type Subject = Set; + type SubjectType = S::SubjectType; + } + ///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 Subject = S::Subject; + type SubjectType = 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 `subject_type` field + pub struct subject_type(()); } } @@ -228,8 +228,8 @@ 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::SubjectType: suggestion_state::IsSet, { /// Build the final struct pub fn build(self) -> Suggestion<'a> { diff --git a/crates/weaver-api/src/app_bsky/video.rs b/crates/weaver-api/src/app_bsky/video.rs index 582ebf2..a2657ef 100644 --- a/crates/weaver-api/src/app_bsky/video.rs +++ b/crates/weaver-api/src/app_bsky/video.rs @@ -52,49 +52,49 @@ pub mod job_status_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type JobId; type Did; + type JobId; type State; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type JobId = Unset; type Did = Unset; + type JobId = Unset; type State = Unset; } - ///State transition - sets the `job_id` field to Set - pub struct SetJobId(PhantomData S>); - impl sealed::Sealed for SetJobId {} - impl State for SetJobId { - type JobId = Set; - type Did = S::Did; - type State = S::State; - } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type JobId = S::JobId; type Did = Set; + type JobId = S::JobId; + type State = S::State; + } + ///State transition - sets the `job_id` field to Set + pub struct SetJobId(PhantomData S>); + impl sealed::Sealed for SetJobId {} + impl State for SetJobId { + type Did = S::Did; + type JobId = Set; type State = S::State; } ///State transition - sets the `state` field to Set pub struct SetState(PhantomData S>); impl sealed::Sealed for SetState {} impl State for SetState { - type JobId = S::JobId; type Did = S::Did; + type JobId = S::JobId; type State = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `job_id` field - pub struct job_id(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `job_id` field + pub struct job_id(()); ///Marker type for the `state` field pub struct state(()); } @@ -257,8 +257,8 @@ where impl<'a, S> JobStatusBuilder<'a, S> where S: job_status_state::State, - S::JobId: job_status_state::IsSet, S::Did: job_status_state::IsSet, + S::JobId: job_status_state::IsSet, S::State: job_status_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/chat_bsky/actor.rs b/crates/weaver-api/src/chat_bsky/actor.rs index ced6c00..0f2ca23 100644 --- a/crates/weaver-api/src/chat_bsky/actor.rs +++ b/crates/weaver-api/src/chat_bsky/actor.rs @@ -58,37 +58,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(()); } } @@ -305,8 +305,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> { diff --git a/crates/weaver-api/src/chat_bsky/convo.rs b/crates/weaver-api/src/chat_bsky/convo.rs index 811a304..0c84473 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 Id; type Rev; + type Id; type Members; - type Muted; type UnreadCount; + type Muted; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; type Rev = Unset; + type Id = Unset; type Members = Unset; - type Muted = Unset; type UnreadCount = 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 Rev = S::Rev; - type Members = S::Members; - type Muted = S::Muted; - type UnreadCount = S::UnreadCount; + type Muted = Unset; } ///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 Id = S::Id; type Members = S::Members; + type UnreadCount = S::UnreadCount; type Muted = S::Muted; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Rev = S::Rev; + type Id = Set; + type Members = S::Members; type UnreadCount = S::UnreadCount; + type Muted = S::Muted; } ///State transition - sets the `members` field to Set pub struct SetMembers(PhantomData S>); impl sealed::Sealed for SetMembers {} impl State for SetMembers { - type Id = S::Id; type Rev = S::Rev; - type Members = Set; - type Muted = S::Muted; - type UnreadCount = S::UnreadCount; - } - ///State transition - sets the `muted` field to Set - pub struct SetMuted(PhantomData S>); - impl sealed::Sealed for SetMuted {} - impl State for SetMuted { type Id = S::Id; - type Rev = S::Rev; - type Members = S::Members; - type Muted = Set; + type Members = Set; type UnreadCount = S::UnreadCount; + type Muted = S::Muted; } ///State transition - sets the `unread_count` field to Set pub struct SetUnreadCount(PhantomData S>); impl sealed::Sealed for SetUnreadCount {} impl State for SetUnreadCount { - type Id = S::Id; type Rev = S::Rev; + type Id = S::Id; type Members = S::Members; - type Muted = S::Muted; type UnreadCount = Set; + type Muted = S::Muted; + } + ///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 Id = S::Id; + type Members = S::Members; + type UnreadCount = S::UnreadCount; + type Muted = 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 `rev` field pub struct rev(()); + ///Marker type for the `id` field + pub struct id(()); ///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 `muted` field + pub struct muted(()); } } @@ -334,11 +334,11 @@ where impl<'a, S> ConvoViewBuilder<'a, S> where S: convo_view_state::State, - S::Id: convo_view_state::IsSet, S::Rev: convo_view_state::IsSet, + S::Id: convo_view_state::IsSet, S::Members: convo_view_state::IsSet, - S::Muted: convo_view_state::IsSet, S::UnreadCount: convo_view_state::IsSet, + S::Muted: convo_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ConvoView<'a> { @@ -1649,66 +1649,66 @@ 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 Sender; type SentAt; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Id = Unset; - type Rev = Unset; type Sender = Unset; type SentAt = Unset; + type Rev = 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 Rev = S::Rev; - type Sender = S::Sender; - type SentAt = S::SentAt; - } - ///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 Sender = S::Sender; type SentAt = S::SentAt; + type Rev = S::Rev; } ///State transition - sets the `sender` field to Set pub struct SetSender(PhantomData S>); impl sealed::Sealed for SetSender {} impl State for SetSender { type Id = S::Id; - type Rev = S::Rev; type Sender = Set; type SentAt = S::SentAt; + type Rev = S::Rev; } ///State transition - sets the `sent_at` field to Set pub struct SetSentAt(PhantomData S>); impl sealed::Sealed for SetSentAt {} impl State for SetSentAt { type Id = S::Id; - type Rev = S::Rev; type Sender = S::Sender; type SentAt = 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 Id = S::Id; + type Sender = S::Sender; + type SentAt = S::SentAt; + type Rev = 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 `rev` field - pub struct rev(()); ///Marker type for the `sender` field pub struct sender(()); ///Marker type for the `sent_at` field pub struct sent_at(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -1822,9 +1822,9 @@ 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::Sender: deleted_message_view_state::IsSet, S::SentAt: deleted_message_view_state::IsSet, + S::Rev: deleted_message_view_state::IsSet, { /// Build the final struct pub fn build(self) -> DeletedMessageView<'a> { @@ -1939,67 +1939,67 @@ pub mod log_add_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; - type ConvoId; type Message; + type Rev; type Reaction; + type ConvoId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; - type ConvoId = Unset; type Message = Unset; + type Rev = Unset; type Reaction = 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 ConvoId = S::ConvoId; - type Message = S::Message; - type Reaction = S::Reaction; - } - ///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; - type Reaction = S::Reaction; + 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 Reaction = S::Reaction; type ConvoId = S::ConvoId; - type Message = Set; + } + ///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 Reaction = S::Reaction; + type ConvoId = S::ConvoId; } ///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 Rev = S::Rev; + type Reaction = 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 Reaction = Set; + type Rev = S::Rev; + type Reaction = S::Reaction; + type ConvoId = 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 `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(()); ///Marker type for the `reaction` field pub struct reaction(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); } } @@ -2112,10 +2112,10 @@ where impl<'a, S> LogAddReactionBuilder<'a, S> where S: log_add_reaction_state::State, - S::Rev: log_add_reaction_state::IsSet, - S::ConvoId: log_add_reaction_state::IsSet, S::Message: log_add_reaction_state::IsSet, + S::Rev: log_add_reaction_state::IsSet, S::Reaction: log_add_reaction_state::IsSet, + S::ConvoId: log_add_reaction_state::IsSet, { /// Build the final struct pub fn build(self) -> LogAddReaction<'a> { @@ -2247,51 +2247,51 @@ 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 ConvoId; - type Message; } /// 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 ConvoId = Unset; - type Message = 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 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 Rev = S::Rev; - type ConvoId = S::ConvoId; - type Message = Set; + 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 `convo_id` field pub struct convo_id(()); - ///Marker type for the `message` field - pub struct message(()); } } @@ -2384,9 +2384,9 @@ 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::ConvoId: log_create_message_state::IsSet, - S::Message: log_create_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogCreateMessage<'a> { @@ -2480,51 +2480,51 @@ pub mod log_delete_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; 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 ConvoId = Unset; type Message = 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 ConvoId = S::ConvoId; - type Message = S::Message; + type Rev = 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 Rev = S::Rev; 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 Rev = S::Rev; 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 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 `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(()); } } @@ -2617,9 +2617,9 @@ where impl<'a, S> LogDeleteMessageBuilder<'a, S> where S: log_delete_message_state::State, - S::Rev: log_delete_message_state::IsSet, S::ConvoId: log_delete_message_state::IsSet, S::Message: log_delete_message_state::IsSet, + S::Rev: log_delete_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogDeleteMessage<'a> { @@ -2785,51 +2785,51 @@ pub mod log_read_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Message; 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 Message = Unset; type Rev = Unset; type ConvoId = Unset; - type Message = 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 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 Rev = S::Rev; - type ConvoId = S::ConvoId; - type Message = Set; + 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 `convo_id` field pub struct convo_id(()); - ///Marker type for the `message` field - pub struct message(()); } } @@ -2922,9 +2922,9 @@ where impl<'a, S> LogReadMessageBuilder<'a, S> where S: log_read_message_state::State, + S::Message: log_read_message_state::IsSet, S::Rev: log_read_message_state::IsSet, S::ConvoId: log_read_message_state::IsSet, - S::Message: log_read_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogReadMessage<'a> { @@ -3020,67 +3020,67 @@ pub mod log_remove_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; type ConvoId; type Message; type Reaction; + 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 ConvoId = Unset; type Message = Unset; type Reaction = 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 ConvoId = S::ConvoId; - type Message = S::Message; - type Reaction = S::Reaction; + type Rev = 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 Rev = S::Rev; type ConvoId = Set; type Message = S::Message; type Reaction = S::Reaction; + 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 Rev = S::Rev; type ConvoId = S::ConvoId; type Message = Set; type Reaction = S::Reaction; + type Rev = S::Rev; } ///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 ConvoId = S::ConvoId; type Message = S::Message; type Reaction = 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 ConvoId = S::ConvoId; + type Message = S::Message; + type Reaction = S::Reaction; + 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 `convo_id` field pub struct convo_id(()); ///Marker type for the `message` field pub struct message(()); ///Marker type for the `reaction` field pub struct reaction(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -3193,10 +3193,10 @@ where impl<'a, S> LogRemoveReactionBuilder<'a, S> where S: log_remove_reaction_state::State, - S::Rev: log_remove_reaction_state::IsSet, S::ConvoId: log_remove_reaction_state::IsSet, S::Message: log_remove_reaction_state::IsSet, S::Reaction: log_remove_reaction_state::IsSet, + S::Rev: log_remove_reaction_state::IsSet, { /// Build the final struct pub fn build(self) -> LogRemoveReaction<'a> { @@ -3326,37 +3326,37 @@ pub mod message_and_reaction_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Message; type Reaction; + type Message; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Message = Unset; 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 Message = Set; - type Reaction = S::Reaction; + 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 Message = S::Message; type Reaction = 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 Reaction = S::Reaction; + type Message = 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 `reaction` field pub struct reaction(()); + ///Marker type for the `message` field + pub struct message(()); } } @@ -3438,8 +3438,8 @@ where impl<'a, S> MessageAndReactionViewBuilder<'a, S> where S: message_and_reaction_view_state::State, - S::Message: message_and_reaction_view_state::IsSet, S::Reaction: message_and_reaction_view_state::IsSet, + S::Message: message_and_reaction_view_state::IsSet, { /// Build the final struct pub fn build(self) -> MessageAndReactionView<'a> { @@ -3585,49 +3585,49 @@ pub mod message_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type MessageId; + type Did; type ConvoId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type MessageId = Unset; + type Did = Unset; type ConvoId = 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 MessageId = S::MessageId; - type ConvoId = S::ConvoId; - } ///State transition - sets the `message_id` field to Set pub struct SetMessageId(PhantomData S>); impl sealed::Sealed for SetMessageId {} impl State for SetMessageId { - type Did = S::Did; type MessageId = Set; + type Did = S::Did; + type ConvoId = S::ConvoId; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type MessageId = S::MessageId; + type Did = 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 Did = S::Did; type MessageId = S::MessageId; + type Did = S::Did; type ConvoId = 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 `message_id` field pub struct message_id(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `convo_id` field pub struct convo_id(()); } @@ -3722,8 +3722,8 @@ where impl<'a, S> MessageRefBuilder<'a, S> where S: message_ref_state::State, - S::Did: message_ref_state::IsSet, S::MessageId: message_ref_state::IsSet, + S::Did: message_ref_state::IsSet, S::ConvoId: message_ref_state::IsSet, { /// Build the final struct @@ -3813,83 +3813,83 @@ pub mod message_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; type Rev; type Text; type Sender; + type Id; type SentAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; type Rev = Unset; type Text = Unset; type Sender = Unset; + type Id = Unset; type SentAt = 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 Rev = S::Rev; - type Text = S::Text; - type Sender = S::Sender; - type SentAt = S::SentAt; - } ///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 Text = S::Text; type Sender = S::Sender; + type Id = S::Id; 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 Id = S::Id; type Rev = S::Rev; type Text = Set; type Sender = S::Sender; + type Id = S::Id; type SentAt = S::SentAt; } ///State transition - sets the `sender` field to Set pub struct SetSender(PhantomData S>); impl sealed::Sealed for SetSender {} impl State for SetSender { - type Id = S::Id; type Rev = S::Rev; type Text = S::Text; type Sender = Set; + type Id = S::Id; + type SentAt = S::SentAt; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Rev = S::Rev; + type Text = S::Text; + type Sender = S::Sender; + type Id = Set; type SentAt = S::SentAt; } ///State transition - sets the `sent_at` field to Set pub struct SetSentAt(PhantomData S>); impl sealed::Sealed for SetSentAt {} impl State for SetSentAt { - type Id = S::Id; type Rev = S::Rev; type Text = S::Text; type Sender = S::Sender; + type Id = S::Id; type SentAt = 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 `rev` field pub struct rev(()); ///Marker type for the `text` field pub struct text(()); ///Marker type for the `sender` field pub struct sender(()); + ///Marker type for the `id` field + pub struct id(()); ///Marker type for the `sent_at` field pub struct sent_at(()); } @@ -4084,10 +4084,10 @@ where impl<'a, S> MessageViewBuilder<'a, S> where S: message_view_state::State, - S::Id: message_view_state::IsSet, S::Rev: message_view_state::IsSet, S::Text: message_view_state::IsSet, S::Sender: message_view_state::IsSet, + S::Id: message_view_state::IsSet, S::SentAt: message_view_state::IsSet, { /// Build the final struct @@ -4342,51 +4342,51 @@ pub mod reaction_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedAt; type Value; type Sender; - 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 Value = Unset; type Sender = 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 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; - type CreatedAt = S::CreatedAt; } ///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 Sender = 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 Value = S::Value; - type Sender = S::Sender; - type CreatedAt = Set; + type Sender = 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 `value` field pub struct value(()); ///Marker type for the `sender` field pub struct sender(()); - ///Marker type for the `created_at` field - pub struct created_at(()); } } @@ -4479,9 +4479,9 @@ where impl<'a, S> ReactionViewBuilder<'a, S> where S: reaction_view_state::State, + S::CreatedAt: reaction_view_state::IsSet, S::Value: reaction_view_state::IsSet, S::Sender: reaction_view_state::IsSet, - S::CreatedAt: reaction_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ReactionView<'a> { diff --git a/crates/weaver-api/src/chat_bsky/convo/send_message.rs b/crates/weaver-api/src/chat_bsky/convo/send_message.rs index 5950b13..a6b37be 100644 --- a/crates/weaver-api/src/chat_bsky/convo/send_message.rs +++ b/crates/weaver-api/src/chat_bsky/convo/send_message.rs @@ -33,37 +33,37 @@ pub mod send_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; type Message; + 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 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 Message = S::Message; + 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 ConvoId = S::ConvoId; 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 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 `message` field pub struct message(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> SendMessageBuilder<'a, S> where S: send_message_state::State, - S::ConvoId: send_message_state::IsSet, S::Message: send_message_state::IsSet, + S::ConvoId: send_message_state::IsSet, { /// Build the final struct pub fn build(self) -> SendMessage<'a> { 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 509ee39..e1744a5 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,65 +185,65 @@ pub mod metadata_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type MessagesSent; - type MessagesReceived; type Convos; + type MessagesReceived; + type MessagesSent; type ConvosStarted; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type MessagesSent = Unset; - type MessagesReceived = Unset; type Convos = Unset; + type MessagesReceived = Unset; + type MessagesSent = Unset; type ConvosStarted = Unset; } - ///State transition - sets the `messages_sent` field to Set - pub struct SetMessagesSent(PhantomData S>); - impl sealed::Sealed for SetMessagesSent {} - impl State for SetMessagesSent { - type MessagesSent = Set; + ///State transition - sets the `convos` field to Set + pub struct SetConvos(PhantomData S>); + impl sealed::Sealed for SetConvos {} + impl State for SetConvos { + type Convos = Set; type MessagesReceived = S::MessagesReceived; - type Convos = S::Convos; + type MessagesSent = S::MessagesSent; type ConvosStarted = S::ConvosStarted; } ///State transition - sets the `messages_received` field to Set pub struct SetMessagesReceived(PhantomData S>); impl sealed::Sealed for SetMessagesReceived {} impl State for SetMessagesReceived { - type MessagesSent = S::MessagesSent; - type MessagesReceived = Set; type Convos = S::Convos; + type MessagesReceived = Set; + type MessagesSent = S::MessagesSent; type ConvosStarted = S::ConvosStarted; } - ///State transition - sets the `convos` field to Set - pub struct SetConvos(PhantomData S>); - impl sealed::Sealed for SetConvos {} - impl State for SetConvos { - type MessagesSent = S::MessagesSent; + ///State transition - sets the `messages_sent` field to Set + pub struct SetMessagesSent(PhantomData S>); + impl sealed::Sealed for SetMessagesSent {} + impl State for SetMessagesSent { + type Convos = S::Convos; type MessagesReceived = S::MessagesReceived; - type Convos = Set; + type MessagesSent = Set; type ConvosStarted = S::ConvosStarted; } ///State transition - sets the `convos_started` field to Set pub struct SetConvosStarted(PhantomData S>); impl sealed::Sealed for SetConvosStarted {} impl State for SetConvosStarted { - type MessagesSent = S::MessagesSent; - type MessagesReceived = S::MessagesReceived; type Convos = S::Convos; + type MessagesReceived = S::MessagesReceived; + type MessagesSent = S::MessagesSent; type ConvosStarted = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///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(()); + ///Marker type for the `messages_received` field + pub struct messages_received(()); + ///Marker type for the `messages_sent` field + pub struct messages_sent(()); ///Marker type for the `convos_started` field pub struct convos_started(()); } @@ -358,9 +358,9 @@ where impl<'a, S> MetadataBuilder<'a, S> where S: metadata_state::State, - S::MessagesSent: metadata_state::IsSet, - S::MessagesReceived: metadata_state::IsSet, S::Convos: metadata_state::IsSet, + S::MessagesReceived: metadata_state::IsSet, + S::MessagesSent: metadata_state::IsSet, S::ConvosStarted: metadata_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/com_atproto/admin.rs b/crates/weaver-api/src/com_atproto/admin.rs index 722a361..af3a0ef 100644 --- a/crates/weaver-api/src/com_atproto/admin.rs +++ b/crates/weaver-api/src/com_atproto/admin.rs @@ -80,51 +80,51 @@ 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 IndexedAt; } /// 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 IndexedAt = 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 IndexedAt = S::IndexedAt; } ///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 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 Did = S::Did; - type Handle = S::Handle; - type IndexedAt = Set; + type Handle = 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 `indexed_at` field - pub struct indexed_at(()); } } @@ -401,9 +401,9 @@ impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { 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::IndexedAt: 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 47b3dfe..b386221 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; - type SenderDid = 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; } ///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 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; + type Content = 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_password.rs b/crates/weaver-api/src/com_atproto/admin/update_account_password.rs index fdf105f..47c11d7 100644 --- a/crates/weaver-api/src/com_atproto/admin/update_account_password.rs +++ b/crates/weaver-api/src/com_atproto/admin/update_account_password.rs @@ -33,37 +33,37 @@ pub mod update_account_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Password; + 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 Password = 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 Password = S::Password; + type Did = Unset; } ///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 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 Password = S::Password; + 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 `password` field pub struct password(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -142,8 +142,8 @@ where impl<'a, S> UpdateAccountPasswordBuilder<'a, S> where S: update_account_password_state::State, - S::Did: update_account_password_state::IsSet, S::Password: update_account_password_state::IsSet, + S::Did: update_account_password_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateAccountPassword<'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/label.rs b/crates/weaver-api/src/com_atproto/label.rs index e2665e4..9a76e15 100644 --- a/crates/weaver-api/src/com_atproto/label.rs +++ b/crates/weaver-api/src/com_atproto/label.rs @@ -37,6 +37,7 @@ pub struct Label<'a> { pub neg: std::option::Option, /// Signature of dag-cbor encoded label. #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")] pub sig: std::option::Option, /// DID of the actor who created this label. #[serde(borrow)] @@ -62,67 +63,67 @@ pub mod label_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Src; - type Uri; type Val; + type Uri; type Cts; + type Src; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Src = Unset; - type Uri = Unset; type Val = Unset; + type Uri = Unset; type Cts = Unset; + type Src = Unset; } - ///State transition - sets the `src` field to Set - pub struct SetSrc(PhantomData S>); - impl sealed::Sealed for SetSrc {} - impl State for SetSrc { - type Src = Set; + ///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 Uri = S::Uri; - type Val = S::Val; type Cts = S::Cts; + 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 Src = S::Src; - type Uri = Set; type Val = S::Val; + type Uri = Set; type Cts = S::Cts; - } - ///State transition - sets the `val` field to Set - pub struct SetVal(PhantomData S>); - impl sealed::Sealed for SetVal {} - impl State for SetVal { type Src = S::Src; - type Uri = S::Uri; - type Val = Set; - type Cts = S::Cts; } ///State transition - sets the `cts` field to Set pub struct SetCts(PhantomData S>); impl sealed::Sealed for SetCts {} impl State for SetCts { - type Src = S::Src; - type Uri = S::Uri; type Val = S::Val; + type Uri = S::Uri; type Cts = Set; + type Src = S::Src; + } + ///State transition - sets the `src` field to Set + pub struct SetSrc(PhantomData S>); + impl sealed::Sealed for SetSrc {} + impl State for SetSrc { + type Val = S::Val; + type Uri = S::Uri; + type Cts = S::Cts; + type Src = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `src` field - pub struct src(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `val` field pub struct val(()); + ///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(()); } } @@ -327,10 +328,10 @@ impl<'a, S: label_state::State> LabelBuilder<'a, S> { impl<'a, S> LabelBuilder<'a, S> where S: label_state::State, - S::Src: label_state::IsSet, - S::Uri: label_state::IsSet, S::Val: label_state::IsSet, + S::Uri: label_state::IsSet, S::Cts: label_state::IsSet, + S::Src: label_state::IsSet, { /// Build the final struct pub fn build(self) -> Label<'a> { @@ -1052,65 +1053,65 @@ pub mod label_value_definition_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Identifier; type Severity; type Blurs; + type Identifier; type Locales; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Identifier = Unset; type Severity = Unset; type Blurs = Unset; + type Identifier = Unset; type Locales = Unset; } - ///State transition - sets the `identifier` field to Set - pub struct SetIdentifier(PhantomData S>); - impl sealed::Sealed for SetIdentifier {} - impl State for SetIdentifier { - type Identifier = Set; - type Severity = S::Severity; - type Blurs = S::Blurs; - type Locales = S::Locales; - } ///State transition - sets the `severity` field to Set pub struct SetSeverity(PhantomData S>); impl sealed::Sealed for SetSeverity {} impl State for SetSeverity { - type Identifier = S::Identifier; type Severity = Set; type Blurs = S::Blurs; + type Identifier = S::Identifier; type Locales = S::Locales; } ///State transition - sets the `blurs` field to Set pub struct SetBlurs(PhantomData S>); impl sealed::Sealed for SetBlurs {} impl State for SetBlurs { - type Identifier = S::Identifier; type Severity = S::Severity; type Blurs = Set; + type Identifier = S::Identifier; + 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 Severity = S::Severity; + type Blurs = S::Blurs; + type Identifier = Set; type Locales = S::Locales; } ///State transition - sets the `locales` field to Set pub struct SetLocales(PhantomData S>); impl sealed::Sealed for SetLocales {} impl State for SetLocales { - type Identifier = S::Identifier; type Severity = S::Severity; type Blurs = S::Blurs; + type Identifier = S::Identifier; type Locales = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///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 `identifier` field + pub struct identifier(()); ///Marker type for the `locales` field pub struct locales(()); } @@ -1267,9 +1268,9 @@ where impl<'a, S> LabelValueDefinitionBuilder<'a, S> where S: label_value_definition_state::State, - S::Identifier: label_value_definition_state::IsSet, S::Severity: label_value_definition_state::IsSet, S::Blurs: label_value_definition_state::IsSet, + S::Identifier: label_value_definition_state::IsSet, S::Locales: label_value_definition_state::IsSet, { /// Build the final struct @@ -1387,50 +1388,50 @@ pub mod label_value_definition_strings_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Lang; - type Name; type Description; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Lang = Unset; - type Name = Unset; type Description = Unset; + type Name = Unset; } ///State transition - sets the `lang` field to Set pub struct SetLang(PhantomData S>); impl sealed::Sealed for SetLang {} impl State for SetLang { type Lang = Set; - type Name = S::Name; - type Description = S::Description; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Lang = S::Lang; - type Name = Set; type Description = S::Description; + type Name = S::Name; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData S>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { type Lang = S::Lang; - type Name = S::Name; type Description = 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 Lang = S::Lang; + type Description = S::Description; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `lang` field pub struct lang(()); - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `description` field pub struct description(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -1541,8 +1542,8 @@ impl<'a, S> LabelValueDefinitionStringsBuilder<'a, S> where S: label_value_definition_strings_state::State, S::Lang: label_value_definition_strings_state::IsSet, - S::Name: label_value_definition_strings_state::IsSet, S::Description: label_value_definition_strings_state::IsSet, + S::Name: label_value_definition_strings_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelValueDefinitionStrings<'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 6ae8520..77ad97f 100644 --- a/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs +++ b/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs @@ -203,37 +203,37 @@ pub mod labels_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Seq; type Labels; + 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 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 Seq = Set; - type Labels = S::Labels; + 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 Seq = S::Seq; type Labels = 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 Labels = S::Labels; + type Seq = 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 `labels` field pub struct labels(()); + ///Marker type for the `seq` field + pub struct seq(()); } } @@ -306,8 +306,8 @@ where impl<'a, S> LabelsBuilder<'a, S> where S: labels_state::State, - S::Seq: labels_state::IsSet, S::Labels: labels_state::IsSet, + S::Seq: labels_state::IsSet, { /// Build the final struct pub fn build(self) -> Labels<'a> { diff --git a/crates/weaver-api/src/com_atproto/moderation/create_report.rs b/crates/weaver-api/src/com_atproto/moderation/create_report.rs index bdf6181..a782470 100644 --- a/crates/weaver-api/src/com_atproto/moderation/create_report.rs +++ b/crates/weaver-api/src/com_atproto/moderation/create_report.rs @@ -43,37 +43,37 @@ pub mod create_report_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ReasonType; type Subject; + type ReasonType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ReasonType = Unset; type Subject = Unset; - } - ///State transition - sets the `reason_type` field to Set - pub struct SetReasonType(PhantomData S>); - impl sealed::Sealed for SetReasonType {} - impl State for SetReasonType { - type ReasonType = Set; - type Subject = S::Subject; + type ReasonType = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type ReasonType = S::ReasonType; type Subject = Set; + type ReasonType = S::ReasonType; + } + ///State transition - sets the `reason_type` field to Set + pub struct SetReasonType(PhantomData S>); + impl sealed::Sealed for SetReasonType {} + impl State for SetReasonType { + type Subject = S::Subject; + type ReasonType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reason_type` field - pub struct reason_type(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `reason_type` field + pub struct reason_type(()); } } @@ -187,8 +187,8 @@ where impl<'a, S> CreateReportBuilder<'a, S> where S: create_report_state::State, - S::ReasonType: create_report_state::IsSet, S::Subject: create_report_state::IsSet, + S::ReasonType: create_report_state::IsSet, { /// Build the final struct pub fn build(self) -> CreateReport<'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 16632c8..2607e33 100644 --- a/crates/weaver-api/src/com_atproto/repo/apply_writes.rs +++ b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs @@ -42,37 +42,37 @@ pub mod create_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; type Value; + 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; - } - ///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 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 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 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 `collection` field + pub struct collection(()); } } @@ -179,8 +179,8 @@ where impl<'a, S> CreateBuilder<'a, S> where S: create_state::State, - S::Collection: create_state::IsSet, S::Value: create_state::IsSet, + S::Collection: create_state::IsSet, { /// Build the final struct pub fn build(self) -> Create<'a> { @@ -728,37 +728,37 @@ pub mod create_result_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Cid; + 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 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 Cid = S::Cid; + 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 Uri = S::Uri; type Cid = 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 Cid = S::Cid; + 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 `cid` field pub struct cid(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -851,8 +851,8 @@ impl<'a, S: create_result_state::State> CreateResultBuilder<'a, S> { impl<'a, S> CreateResultBuilder<'a, S> where S: create_result_state::State, - S::Uri: create_result_state::IsSet, S::Cid: create_result_state::IsSet, + S::Uri: create_result_state::IsSet, { /// Build the final struct pub fn build(self) -> CreateResult<'a> { @@ -1149,37 +1149,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(()); } } @@ -1286,8 +1286,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> { @@ -1476,51 +1476,51 @@ pub mod update_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; - type Rkey; 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 Rkey = Unset; type Value = Unset; + type Rkey = Unset; + type Collection = 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; + ///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 Rkey = S::Rkey; - type Value = S::Value; + 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 Rkey = 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 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 Value = Set; + 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 `value` field pub struct value(()); + ///Marker type for the `rkey` field + pub struct rkey(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -1621,9 +1621,9 @@ where impl<'a, S> UpdateBuilder<'a, S> where S: update_state::State, - S::Collection: update_state::IsSet, - S::Rkey: 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> { 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 6e91b26..0bebd18 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 Repo; - type Collection; type Record; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Repo = Unset; - type Collection = Unset; type Record = Unset; + 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 Repo = Set; - type Collection = S::Collection; - 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 { - type Repo = S::Repo; - type Collection = Set; type Record = S::Record; + type Collection = S::Collection; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Repo = S::Repo; - type Collection = S::Collection; type Record = 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 Record = S::Record; + type Collection = 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 `collection` field - pub struct collection(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -259,8 +259,8 @@ impl<'a, S> CreateRecordBuilder<'a, S> where S: create_record_state::State, S::Repo: create_record_state::IsSet, - S::Collection: create_record_state::IsSet, S::Record: create_record_state::IsSet, + S::Collection: 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 b546dff..c8c24c6 100644 --- a/crates/weaver-api/src/com_atproto/repo/delete_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/delete_record.rs @@ -48,49 +48,49 @@ pub mod delete_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Repo; type Collection; + type Repo; type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Repo = Unset; type Collection = Unset; + type Repo = Unset; type Rkey = 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 Collection = S::Collection; - type Rkey = S::Rkey; - } ///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; + 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; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Repo = S::Repo; type Collection = S::Collection; + type Repo = S::Repo; type Rkey = 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 `collection` field pub struct collection(()); + ///Marker type for the `repo` field + pub struct repo(()); ///Marker type for the `rkey` field pub struct rkey(()); } @@ -233,8 +233,8 @@ impl<'a, S: delete_record_state::State> DeleteRecordBuilder<'a, S> { impl<'a, S> DeleteRecordBuilder<'a, S> where S: delete_record_state::State, - S::Repo: delete_record_state::IsSet, S::Collection: delete_record_state::IsSet, + S::Repo: delete_record_state::IsSet, S::Rkey: delete_record_state::IsSet, { /// Build the final struct 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 827955a..7cc233f 100644 --- a/crates/weaver-api/src/com_atproto/repo/get_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/get_record.rs @@ -39,49 +39,49 @@ pub mod get_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Repo; type Collection; + type Repo; type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Repo = Unset; type Collection = Unset; + type Repo = Unset; type Rkey = 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 Collection = S::Collection; - type Rkey = S::Rkey; - } ///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; + 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; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Repo = S::Repo; type Collection = S::Collection; + type Repo = S::Repo; type Rkey = 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 `collection` field pub struct collection(()); + ///Marker type for the `repo` field + pub struct repo(()); ///Marker type for the `rkey` field pub struct rkey(()); } @@ -204,8 +204,8 @@ where impl<'a, S> GetRecordBuilder<'a, S> where S: get_record_state::State, - S::Repo: get_record_state::IsSet, S::Collection: get_record_state::IsSet, + S::Repo: get_record_state::IsSet, S::Rkey: get_record_state::IsSet, { /// Build the final struct 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 9bed001..16572ca 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 Repo; type Collection; + 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 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 Repo = Set; - type Collection = S::Collection; + 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 Repo = S::Repo; type Collection = 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 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 `collection` field pub struct collection(()); + ///Marker type for the `repo` field + pub struct repo(()); } } @@ -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::Repo: list_records_state::IsSet, S::Collection: list_records_state::IsSet, + S::Repo: 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 Cid; + type Uri; type Value; } /// 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 Uri = Unset; type Value = 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 Cid = S::Cid; - type Value = S::Value; - } ///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 Uri = S::Uri; + type Value = S::Value; + } + ///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 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 Cid = S::Cid; + type Uri = S::Uri; type Value = 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 `uri` field + pub struct uri(()); ///Marker type for the `value` field pub struct value(()); } @@ -415,8 +415,8 @@ where impl<'a, S> RecordBuilder<'a, S> where S: record_state::State, - S::Uri: record_state::IsSet, S::Cid: record_state::IsSet, + S::Uri: record_state::IsSet, S::Value: 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 318e40e..a98f2a6 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 Repo; + type Record; type Collection; type Rkey; - type Record; + 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 Record = Unset; type Collection = Unset; type Rkey = Unset; - type Record = Unset; + type Repo = 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; + ///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 Collection = S::Collection; type Rkey = S::Rkey; - type Record = S::Record; + 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 Repo = S::Repo; + type Record = S::Record; type Collection = Set; type Rkey = S::Rkey; - type Record = S::Record; + 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 Repo = S::Repo; + type Record = S::Record; type Collection = S::Collection; type Rkey = 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 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 Record = S::Record; type Collection = S::Collection; type Rkey = S::Rkey; - type Record = Set; + 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 `record` field + pub struct record(()); ///Marker type for the `collection` field pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); - ///Marker type for the `record` field - pub struct record(()); + ///Marker type for the `repo` field + pub struct repo(()); } } @@ -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::Repo: put_record_state::IsSet, + S::Record: put_record_state::IsSet, S::Collection: put_record_state::IsSet, S::Rkey: put_record_state::IsSet, - S::Record: put_record_state::IsSet, + S::Repo: put_record_state::IsSet, { /// Build the final struct pub fn build(self) -> PutRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/server.rs b/crates/weaver-api/src/com_atproto/server.rs index 0665603..a62e43f 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 Code; - type Available; type Disabled; - type ForAccount; type CreatedBy; - type CreatedAt; type Uses; + type CreatedAt; + type Code; + type Available; + type ForAccount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Code = Unset; - type Available = Unset; type Disabled = Unset; - type ForAccount = Unset; type CreatedBy = Unset; - type CreatedAt = Unset; type Uses = Unset; - } - ///State transition - sets the `code` field to Set - pub struct SetCode(PhantomData S>); - impl sealed::Sealed for SetCode {} - impl State for SetCode { - type Code = Set; - type Available = S::Available; - type Disabled = S::Disabled; - type ForAccount = S::ForAccount; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Uses = S::Uses; - } - ///State transition - sets the `available` field to Set - pub struct SetAvailable(PhantomData S>); - impl sealed::Sealed for SetAvailable {} - impl State for SetAvailable { - type Code = S::Code; - type Available = Set; - type Disabled = S::Disabled; - type ForAccount = S::ForAccount; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Uses = S::Uses; + type CreatedAt = Unset; + type Code = Unset; + type Available = Unset; + type ForAccount = Unset; } ///State transition - sets the `disabled` field to Set pub struct SetDisabled(PhantomData S>); impl sealed::Sealed for SetDisabled {} impl State for SetDisabled { - type Code = S::Code; - type Available = S::Available; type Disabled = Set; - type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; type Uses = S::Uses; - } - ///State transition - sets the `for_account` field to Set - pub struct SetForAccount(PhantomData S>); - impl sealed::Sealed for SetForAccount {} - impl State for SetForAccount { + type CreatedAt = S::CreatedAt; type Code = S::Code; type Available = S::Available; - type Disabled = S::Disabled; - type ForAccount = Set; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Uses = S::Uses; + type ForAccount = S::ForAccount; } ///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 CreatedBy = Set; + type Uses = S::Uses; + type CreatedAt = S::CreatedAt; type Code = S::Code; type Available = S::Available; - type Disabled = S::Disabled; type ForAccount = S::ForAccount; - type CreatedBy = Set; + } + ///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 CreatedBy = S::CreatedBy; + type Uses = Set; type CreatedAt = S::CreatedAt; - type Uses = S::Uses; + type Code = S::Code; + type Available = S::Available; + type ForAccount = S::ForAccount; } ///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 CreatedBy = S::CreatedBy; + type Uses = S::Uses; + type CreatedAt = Set; type Code = S::Code; type Available = S::Available; - type Disabled = S::Disabled; type ForAccount = S::ForAccount; + } + ///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 CreatedBy = S::CreatedBy; - type CreatedAt = Set; type Uses = S::Uses; - } - ///State transition - sets the `uses` field to Set - pub struct SetUses(PhantomData S>); - impl sealed::Sealed for SetUses {} - impl State for SetUses { - type Code = S::Code; + type CreatedAt = S::CreatedAt; + type Code = Set; type Available = S::Available; + type ForAccount = S::ForAccount; + } + ///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 CreatedBy = S::CreatedBy; + type Uses = S::Uses; + type CreatedAt = S::CreatedAt; + type Code = S::Code; + type Available = Set; type ForAccount = S::ForAccount; + } + ///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 CreatedBy = S::CreatedBy; + type Uses = S::Uses; type CreatedAt = S::CreatedAt; - type Uses = Set; + type Code = S::Code; + type Available = S::Available; + type ForAccount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `code` field - pub struct code(()); - ///Marker type for the `available` field - pub struct available(()); ///Marker type for the `disabled` field pub struct disabled(()); - ///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 `created_at` field - pub struct created_at(()); ///Marker type for the `uses` field pub struct uses(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `code` field + pub struct code(()); + ///Marker type for the `available` field + pub struct available(()); + ///Marker type for the `for_account` field + pub struct for_account(()); } } @@ -359,13 +359,13 @@ where impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, - S::Code: invite_code_state::IsSet, - S::Available: invite_code_state::IsSet, S::Disabled: invite_code_state::IsSet, - S::ForAccount: invite_code_state::IsSet, S::CreatedBy: invite_code_state::IsSet, - S::CreatedAt: invite_code_state::IsSet, S::Uses: invite_code_state::IsSet, + S::CreatedAt: invite_code_state::IsSet, + S::Code: invite_code_state::IsSet, + S::Available: invite_code_state::IsSet, + S::ForAccount: invite_code_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteCode<'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 5c2d7aa..aa77ef4 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 4eb9651..a9b68c2 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 Account; type Codes; + type Account; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Account = Unset; 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 Account = Set; - type Codes = S::Codes; + 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 Account = S::Account; type Codes = Set; + type Account = S::Account; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `account` field - pub struct account(()); ///Marker type for the `codes` field pub struct codes(()); + ///Marker type for the `account` field + pub struct account(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> AccountCodesBuilder<'a, S> where S: account_codes_state::State, - S::Account: account_codes_state::IsSet, S::Codes: account_codes_state::IsSet, + S::Account: account_codes_state::IsSet, { /// Build the final struct pub fn build(self) -> AccountCodes<'a> { 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 0500c91..905d864 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_record.rs b/crates/weaver-api/src/com_atproto/sync/get_record.rs index 6706fc9..03e0cca 100644 --- a/crates/weaver-api/src/com_atproto/sync/get_record.rs +++ b/crates/weaver-api/src/com_atproto/sync/get_record.rs @@ -36,51 +36,51 @@ pub mod get_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; - type Collection; type Rkey; + type Collection; + 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 Collection = Unset; type Rkey = Unset; + type Collection = 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 `rkey` field to Set + pub struct SetRkey(PhantomData S>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Rkey = Set; type Collection = S::Collection; - type Rkey = S::Rkey; + type Did = S::Did; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { - type Did = S::Did; - type Collection = Set; type Rkey = S::Rkey; - } - ///State transition - sets the `rkey` field to Set - pub struct SetRkey(PhantomData S>); - impl sealed::Sealed for SetRkey {} - impl State for SetRkey { + type Collection = 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 Rkey = S::Rkey; type Collection = S::Collection; - type Rkey = 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 `collection` field - pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); + ///Marker type for the `collection` field + pub struct collection(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -181,9 +181,9 @@ where impl<'a, S> GetRecordBuilder<'a, S> where S: get_record_state::State, - S::Did: get_record_state::IsSet, - S::Collection: get_record_state::IsSet, S::Rkey: get_record_state::IsSet, + S::Collection: get_record_state::IsSet, + S::Did: get_record_state::IsSet, { /// Build the final struct pub fn build(self) -> GetRecord<'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 5c811d4..650410a 100644 --- a/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs +++ b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs @@ -41,66 +41,66 @@ pub mod account_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Seq; + type Active; type Did; type Time; - type Active; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Seq = Unset; + type Active = Unset; type Did = Unset; type Time = Unset; - type Active = 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 Active = S::Active; + type Did = S::Did; + type Time = S::Time; + } + ///State transition - sets the `active` field to Set + pub struct SetActive(PhantomData S>); + impl sealed::Sealed for SetActive {} + impl State for SetActive { + type Seq = S::Seq; + type Active = Set; type Did = S::Did; type Time = S::Time; - type Active = S::Active; } ///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 Active = S::Active; type Did = Set; type Time = S::Time; - type Active = S::Active; } ///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 Did = S::Did; - type Time = Set; type Active = S::Active; - } - ///State transition - sets the `active` field to Set - pub struct SetActive(PhantomData S>); - impl sealed::Sealed for SetActive {} - impl State for SetActive { - type Seq = S::Seq; type Did = S::Did; - type Time = S::Time; - type Active = 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 `active` field + pub struct active(()); ///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(()); } } @@ -231,9 +231,9 @@ impl<'a, S> AccountBuilder<'a, S> where S: account_state::State, S::Seq: account_state::IsSet, + S::Active: account_state::IsSet, S::Did: account_state::IsSet, S::Time: account_state::IsSet, - S::Active: account_state::IsSet, { /// Build the final struct pub fn build(self) -> Account<'a> { @@ -929,6 +929,7 @@ pub struct Commit<'a> { #[serde(borrow)] pub blobs: Vec>, /// CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list. + #[serde(with = "jacquard_common::serde_bytes_helper")] pub blocks: bytes::Bytes, /// Repo commit object CID. #[serde(borrow)] @@ -949,7 +950,7 @@ pub struct Commit<'a> { /// The stream sequence number of this message. pub seq: i64, /// The rev of the last emitted commit from this repo (if any). - pub since: jacquard_common::types::string::Tid, + pub since: std::option::Option, /// Timestamp of when this message was originally broadcast. pub time: jacquard_common::types::string::Datetime, /// DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. @@ -967,234 +968,204 @@ pub mod commit_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Seq; - type Rebase; type TooBig; - type Repo; - type Commit; - type Rev; - type Since; - type Blocks; type Ops; type Blobs; + type Blocks; + type Rev; type Time; + type Rebase; + type Repo; + type Commit; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Seq = Unset; - type Rebase = Unset; type TooBig = Unset; - type Repo = Unset; - type Commit = Unset; - type Rev = Unset; - type Since = Unset; - type Blocks = Unset; type Ops = Unset; type Blobs = Unset; + type Blocks = Unset; + type Rev = Unset; type Time = Unset; + type Rebase = Unset; + type Repo = Unset; + type Commit = 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 Rebase = S::Rebase; type TooBig = S::TooBig; - type Repo = S::Repo; - type Commit = S::Commit; - type Rev = S::Rev; - type Since = S::Since; - type Blocks = S::Blocks; type Ops = S::Ops; type Blobs = S::Blobs; + type Blocks = S::Blocks; + type Rev = S::Rev; type Time = S::Time; - } - ///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 Rebase = Set; - type TooBig = S::TooBig; + type Rebase = S::Rebase; type Repo = S::Repo; type Commit = S::Commit; - type Rev = S::Rev; - type Since = S::Since; - type Blocks = S::Blocks; - type Ops = S::Ops; - type Blobs = S::Blobs; - type Time = S::Time; } ///State transition - sets the `too_big` field to Set pub struct SetTooBig(PhantomData S>); impl sealed::Sealed for SetTooBig {} impl State for SetTooBig { type Seq = S::Seq; - type Rebase = S::Rebase; type TooBig = Set; - type Repo = S::Repo; - type Commit = S::Commit; - type Rev = S::Rev; - type Since = S::Since; - type Blocks = S::Blocks; type Ops = S::Ops; type Blobs = S::Blobs; + type Blocks = S::Blocks; + type Rev = S::Rev; type Time = S::Time; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { - type Seq = S::Seq; type Rebase = S::Rebase; - type TooBig = S::TooBig; - type Repo = Set; + type Repo = S::Repo; type Commit = S::Commit; - type Rev = S::Rev; - type Since = S::Since; - type Blocks = S::Blocks; - type Ops = S::Ops; - type Blobs = S::Blobs; - type Time = S::Time; } - ///State transition - sets the `commit` field to Set - pub struct SetCommit(PhantomData S>); - impl sealed::Sealed for SetCommit {} - impl State for SetCommit { + ///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 Rebase = S::Rebase; type TooBig = S::TooBig; - type Repo = S::Repo; - type Commit = Set; - type Rev = S::Rev; - type Since = S::Since; - type Blocks = S::Blocks; - type Ops = S::Ops; + type Ops = Set; type Blobs = S::Blobs; + type Blocks = S::Blocks; + type Rev = S::Rev; type Time = S::Time; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Seq = S::Seq; type Rebase = S::Rebase; - type TooBig = S::TooBig; type Repo = S::Repo; type Commit = S::Commit; - type Rev = Set; - type Since = S::Since; - type Blocks = S::Blocks; - type Ops = S::Ops; - type Blobs = S::Blobs; - type Time = S::Time; } - ///State transition - sets the `since` field to Set - pub struct SetSince(PhantomData S>); - impl sealed::Sealed for SetSince {} - impl State for SetSince { + ///State transition - sets the `blobs` field to Set + pub struct SetBlobs(PhantomData S>); + impl sealed::Sealed for SetBlobs {} + impl State for SetBlobs { type Seq = S::Seq; - type Rebase = S::Rebase; type TooBig = S::TooBig; - type Repo = S::Repo; - type Commit = S::Commit; - type Rev = S::Rev; - type Since = Set; - type Blocks = S::Blocks; type Ops = S::Ops; - type Blobs = S::Blobs; + type Blobs = Set; + type Blocks = S::Blocks; + type Rev = S::Rev; type Time = S::Time; + type Rebase = S::Rebase; + type Repo = S::Repo; + type Commit = S::Commit; } ///State transition - sets the `blocks` field to Set pub struct SetBlocks(PhantomData S>); impl sealed::Sealed for SetBlocks {} impl State for SetBlocks { type Seq = S::Seq; - type Rebase = S::Rebase; type TooBig = S::TooBig; - type Repo = S::Repo; - type Commit = S::Commit; - type Rev = S::Rev; - type Since = S::Since; - type Blocks = Set; type Ops = S::Ops; type Blobs = S::Blobs; + type Blocks = Set; + type Rev = S::Rev; 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 Seq = S::Seq; type Rebase = S::Rebase; - type TooBig = S::TooBig; type Repo = S::Repo; type Commit = S::Commit; - type Rev = S::Rev; - type Since = S::Since; - type Blocks = S::Blocks; - type Ops = Set; - type Blobs = S::Blobs; - type Time = S::Time; } - ///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 `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { type Seq = S::Seq; - type Rebase = S::Rebase; type TooBig = S::TooBig; - type Repo = S::Repo; - type Commit = S::Commit; - type Rev = S::Rev; - type Since = S::Since; - type Blocks = S::Blocks; type Ops = S::Ops; - type Blobs = Set; + type Blobs = S::Blobs; + type Blocks = S::Blocks; + type Rev = Set; type Time = S::Time; + type Rebase = S::Rebase; + type Repo = S::Repo; + type Commit = S::Commit; } ///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 Rebase = S::Rebase; type TooBig = S::TooBig; + type Ops = S::Ops; + type Blobs = S::Blobs; + type Blocks = S::Blocks; + type Rev = S::Rev; + type Time = Set; + type Rebase = S::Rebase; type Repo = S::Repo; type Commit = S::Commit; + } + ///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 TooBig = S::TooBig; + type Ops = S::Ops; + type Blobs = S::Blobs; + type Blocks = S::Blocks; type Rev = S::Rev; - type Since = S::Since; + type Time = S::Time; + type Rebase = Set; + type Repo = S::Repo; + type Commit = S::Commit; + } + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Seq = S::Seq; + type TooBig = S::TooBig; + type Ops = S::Ops; + type Blobs = S::Blobs; type Blocks = S::Blocks; + type Rev = S::Rev; + type Time = S::Time; + type Rebase = S::Rebase; + type Repo = Set; + type Commit = S::Commit; + } + ///State transition - sets the `commit` field to Set + pub struct SetCommit(PhantomData S>); + impl sealed::Sealed for SetCommit {} + impl State for SetCommit { + type Seq = S::Seq; + type TooBig = S::TooBig; type Ops = S::Ops; type Blobs = S::Blobs; - type Time = Set; + type Blocks = S::Blocks; + type Rev = S::Rev; + type Time = S::Time; + type Rebase = S::Rebase; + type Repo = S::Repo; + type Commit = 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 `rebase` field - pub struct rebase(()); ///Marker type for the `too_big` field pub struct too_big(()); - ///Marker type for the `repo` field - pub struct repo(()); - ///Marker type for the `commit` field - pub struct commit(()); - ///Marker type for the `rev` field - pub struct rev(()); - ///Marker type for the `since` field - pub struct since(()); - ///Marker type for the `blocks` field - pub struct blocks(()); ///Marker type for the `ops` field pub struct ops(()); ///Marker type for the `blobs` field pub struct blobs(()); + ///Marker type for the `blocks` field + pub struct blocks(()); + ///Marker type for the `rev` field + pub struct rev(()); ///Marker type for the `time` field pub struct time(()); + ///Marker type for the `rebase` field + pub struct rebase(()); + ///Marker type for the `repo` field + pub struct repo(()); + ///Marker type for the `commit` field + pub struct commit(()); } } @@ -1422,22 +1393,22 @@ where } } -impl<'a, S> CommitBuilder<'a, S> -where - S: commit_state::State, - S::Since: commit_state::IsUnset, -{ - /// Set the `since` field (required) +impl<'a, S: commit_state::State> CommitBuilder<'a, S> { + /// Set the `since` field (optional) pub fn since( mut self, - value: impl Into, - ) -> CommitBuilder<'a, commit_state::SetSince> { - self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); - CommitBuilder { - _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: self.__unsafe_private_named, - _phantom: ::core::marker::PhantomData, - } + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `since` field to an Option value (optional) + pub fn maybe_since( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.9 = value; + self } } @@ -1483,16 +1454,15 @@ impl<'a, S> CommitBuilder<'a, S> where S: commit_state::State, S::Seq: commit_state::IsSet, - S::Rebase: commit_state::IsSet, S::TooBig: commit_state::IsSet, - S::Repo: commit_state::IsSet, - S::Commit: commit_state::IsSet, - S::Rev: commit_state::IsSet, - S::Since: commit_state::IsSet, - S::Blocks: commit_state::IsSet, S::Ops: commit_state::IsSet, S::Blobs: commit_state::IsSet, + S::Blocks: commit_state::IsSet, + S::Rev: commit_state::IsSet, S::Time: commit_state::IsSet, + S::Rebase: commit_state::IsSet, + S::Repo: commit_state::IsSet, + S::Commit: commit_state::IsSet, { /// Build the final struct pub fn build(self) -> Commit<'a> { @@ -1506,7 +1476,7 @@ where repo: self.__unsafe_private_named.6.unwrap(), rev: self.__unsafe_private_named.7.unwrap(), seq: self.__unsafe_private_named.8.unwrap(), - since: self.__unsafe_private_named.9.unwrap(), + since: self.__unsafe_private_named.9, time: self.__unsafe_private_named.10.unwrap(), too_big: self.__unsafe_private_named.11.unwrap(), extra_data: Default::default(), @@ -1530,7 +1500,7 @@ where repo: self.__unsafe_private_named.6.unwrap(), rev: self.__unsafe_private_named.7.unwrap(), seq: self.__unsafe_private_named.8.unwrap(), - since: self.__unsafe_private_named.9.unwrap(), + since: self.__unsafe_private_named.9, time: self.__unsafe_private_named.10.unwrap(), too_big: self.__unsafe_private_named.11.unwrap(), extra_data: Some(extra_data), @@ -1601,51 +1571,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; - } - ///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; + type Seq = Unset; } ///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 Seq = S::Seq; 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; } /// 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(()); } } @@ -1758,9 +1728,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> { @@ -2079,7 +2049,7 @@ pub struct RepoOp<'a> { pub action: jacquard_common::CowStr<'a>, /// For creates and updates, the new record CID. For deletions, null. #[serde(borrow)] - pub cid: jacquard_common::types::cid::CidLink<'a>, + pub cid: std::option::Option>, #[serde(borrow)] pub path: jacquard_common::CowStr<'a>, /// For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. @@ -2098,51 +2068,37 @@ pub mod repo_op_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Action; type Path; - type Cid; + type Action; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Action = Unset; type Path = Unset; - type Cid = Unset; - } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Action = Set; - type Path = S::Path; - type Cid = S::Cid; + 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 Action = S::Action; type Path = 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 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 Path = S::Path; - type Cid = Set; + type Action = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `action` field - pub struct action(()); ///Marker type for the `path` field pub struct path(()); - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `action` field + pub struct action(()); } } @@ -2195,22 +2151,22 @@ where } } -impl<'a, S> RepoOpBuilder<'a, S> -where - S: repo_op_state::State, - S::Cid: repo_op_state::IsUnset, -{ - /// Set the `cid` field (required) +impl<'a, S: repo_op_state::State> RepoOpBuilder<'a, S> { + /// Set the `cid` field (optional) pub fn cid( mut self, - value: impl Into>, - ) -> RepoOpBuilder<'a, repo_op_state::SetCid> { - self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); - RepoOpBuilder { - _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: self.__unsafe_private_named, - _phantom: ::core::marker::PhantomData, - } + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self } } @@ -2255,15 +2211,14 @@ impl<'a, S: repo_op_state::State> RepoOpBuilder<'a, S> { impl<'a, S> RepoOpBuilder<'a, S> where S: repo_op_state::State, - S::Action: repo_op_state::IsSet, S::Path: repo_op_state::IsSet, - S::Cid: repo_op_state::IsSet, + S::Action: repo_op_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoOp<'a> { RepoOp { action: self.__unsafe_private_named.0.unwrap(), - cid: self.__unsafe_private_named.1.unwrap(), + cid: self.__unsafe_private_named.1, path: self.__unsafe_private_named.2.unwrap(), prev: self.__unsafe_private_named.3, extra_data: Default::default(), @@ -2279,7 +2234,7 @@ where ) -> RepoOp<'a> { RepoOp { action: self.__unsafe_private_named.0.unwrap(), - cid: self.__unsafe_private_named.1.unwrap(), + cid: self.__unsafe_private_named.1, path: self.__unsafe_private_named.2.unwrap(), prev: self.__unsafe_private_named.3, extra_data: Some(extra_data), @@ -2318,6 +2273,7 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RepoOp<'a> { #[serde(rename_all = "camelCase")] pub struct Sync<'a> { /// CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. + #[serde(with = "jacquard_common::serde_bytes_helper")] pub blocks: bytes::Bytes, /// The account this repo event corresponds to. Must match that in the commit object. #[serde(borrow)] @@ -2341,85 +2297,85 @@ pub mod sync_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Rev; + type Time; type Seq; type Did; type Blocks; - type Rev; - type Time; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Rev = Unset; + type Time = Unset; type Seq = Unset; type Did = Unset; type Blocks = Unset; - type Rev = Unset; - type Time = 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 Time = S::Time; + type Seq = S::Seq; + type Did = S::Did; + 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 Rev = S::Rev; + type Time = Set; + type Seq = S::Seq; + type Did = S::Did; + 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 Rev = S::Rev; + type Time = S::Time; type Seq = Set; type Did = S::Did; type Blocks = S::Blocks; - type Rev = S::Rev; - 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 Rev = S::Rev; + type Time = S::Time; type Seq = S::Seq; type Did = Set; type Blocks = S::Blocks; - type Rev = S::Rev; - 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 Seq = S::Seq; - type Did = S::Did; - type Blocks = Set; type Rev = S::Rev; type Time = S::Time; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Seq = S::Seq; - type Did = S::Did; - type Blocks = S::Blocks; - type Rev = Set; - type Time = S::Time; - } - ///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 Did = S::Did; - type Blocks = S::Blocks; - type Rev = S::Rev; - type Time = Set; + type Blocks = 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 `time` field + pub struct time(()); ///Marker type for the `seq` field pub struct seq(()); ///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 `time` field - pub struct time(()); } } @@ -2552,11 +2508,11 @@ where impl<'a, S> SyncBuilder<'a, S> where S: sync_state::State, + S::Rev: sync_state::IsSet, + S::Time: sync_state::IsSet, S::Seq: sync_state::IsSet, S::Did: sync_state::IsSet, S::Blocks: sync_state::IsSet, - S::Rev: sync_state::IsSet, - S::Time: sync_state::IsSet, { /// Build the final struct pub fn build(self) -> Sync<'a> { diff --git a/crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs b/crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs index 6590cd1..3a09b2d 100644 --- a/crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs +++ b/crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs @@ -692,37 +692,37 @@ pub mod suggestion_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Handle; type Method; + 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 Method = 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 Method = S::Method; + type Handle = Unset; } ///State transition - sets the `method` field to Set pub struct SetMethod(PhantomData S>); impl sealed::Sealed for SetMethod {} impl State for SetMethod { - type Handle = S::Handle; type Method = 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 Method = S::Method; + 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 `method` field pub struct method(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -795,8 +795,8 @@ where impl<'a, S> SuggestionBuilder<'a, S> where S: suggestion_state::State, - S::Handle: suggestion_state::IsSet, S::Method: suggestion_state::IsSet, + S::Handle: suggestion_state::IsSet, { /// Build the final struct pub fn build(self) -> Suggestion<'a> { diff --git a/crates/weaver-api/src/sh_weaver/actor.rs b/crates/weaver-api/src/sh_weaver/actor.rs index 97b6cc2..bc114f0 100644 --- a/crates/weaver-api/src/sh_weaver/actor.rs +++ b/crates/weaver-api/src/sh_weaver/actor.rs @@ -25,6 +25,7 @@ pub struct Author<'a> { pub did: jacquard_common::types::string::Did<'a>, /// signed bytes of the corresponding notebook record in the author's repo #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")] pub signature: std::option::Option, } @@ -1961,37 +1962,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(()); } } @@ -2184,8 +2185,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> { @@ -2321,49 +2322,49 @@ pub mod tangled_profile_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Bluesky; type Did; + type Bluesky; type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Bluesky = Unset; type Did = Unset; + type Bluesky = Unset; type Handle = Unset; } - ///State transition - sets the `bluesky` field to Set - pub struct SetBluesky(PhantomData S>); - impl sealed::Sealed for SetBluesky {} - impl State for SetBluesky { - type Bluesky = 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 Bluesky = S::Bluesky; type Did = Set; + type Bluesky = S::Bluesky; + type Handle = S::Handle; + } + ///State transition - sets the `bluesky` field to Set + pub struct SetBluesky(PhantomData S>); + impl sealed::Sealed for SetBluesky {} + impl State for SetBluesky { + type Did = S::Did; + type Bluesky = 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 Bluesky = S::Bluesky; type Did = S::Did; + type Bluesky = S::Bluesky; type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `bluesky` field - pub struct bluesky(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `bluesky` field + pub struct bluesky(()); ///Marker type for the `handle` field pub struct handle(()); } @@ -2555,8 +2556,8 @@ impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> impl<'a, S> TangledProfileViewBuilder<'a, S> where S: tangled_profile_view_state::State, - S::Bluesky: tangled_profile_view_state::IsSet, S::Did: tangled_profile_view_state::IsSet, + S::Bluesky: tangled_profile_view_state::IsSet, S::Handle: tangled_profile_view_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/collab/invite.rs b/crates/weaver-api/src/sh_weaver/collab/invite.rs index 549f9fd..ec74351 100644 --- a/crates/weaver-api/src/sh_weaver/collab/invite.rs +++ b/crates/weaver-api/src/sh_weaver/collab/invite.rs @@ -134,51 +134,51 @@ pub mod invite_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedAt; type Resource; type Invitee; - 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 Resource = Unset; type Invitee = 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 Resource = S::Resource; + type Invitee = S::Invitee; } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { + type CreatedAt = S::CreatedAt; type Resource = Set; type Invitee = S::Invitee; - 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 Resource = S::Resource; - type Invitee = 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 Resource = S::Resource; - type Invitee = S::Invitee; - type CreatedAt = Set; + type Invitee = 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 `resource` field pub struct resource(()); ///Marker type for the `invitee` field pub struct invitee(()); - ///Marker type for the `created_at` field - pub struct created_at(()); } } @@ -328,9 +328,9 @@ impl<'a, S: invite_state::State> InviteBuilder<'a, S> { impl<'a, S> InviteBuilder<'a, S> where S: invite_state::State, + S::CreatedAt: invite_state::IsSet, S::Resource: invite_state::IsSet, S::Invitee: invite_state::IsSet, - S::CreatedAt: invite_state::IsSet, { /// Build the final struct pub fn build(self) -> Invite<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit.rs b/crates/weaver-api/src/sh_weaver/edit.rs index 9f6ddc9..4a15301 100644 --- a/crates/weaver-api/src/sh_weaver/edit.rs +++ b/crates/weaver-api/src/sh_weaver/edit.rs @@ -193,7 +193,7 @@ fn lexicon_doc_sh_weaver_edit_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< description: None, required: Some( vec![ - ::jacquard_common::smol_str::SmolStr::new_static("draft_key") + ::jacquard_common::smol_str::SmolStr::new_static("draftKey") ], ), nullable: None, @@ -201,9 +201,7 @@ fn lexicon_doc_sh_weaver_edit_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< #[allow(unused_mut)] let mut map = ::std::collections::BTreeMap::new(); map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "draft_key", - ), + ::jacquard_common::smol_str::SmolStr::new_static("draftKey"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, diff --git a/crates/weaver-api/src/sh_weaver/edit/cursor.rs b/crates/weaver-api/src/sh_weaver/edit/cursor.rs index 676a9dd..00f070f 100644 --- a/crates/weaver-api/src/sh_weaver/edit/cursor.rs +++ b/crates/weaver-api/src/sh_weaver/edit/cursor.rs @@ -759,37 +759,37 @@ pub mod cursor_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Container; type Id; + type Container; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Container = Unset; 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 Container = Set; - type Id = S::Id; + 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 Container = S::Container; type Id = Set; + type Container = S::Container; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `container` field - pub struct container(()); ///Marker type for the `id` field pub struct id(()); + ///Marker type for the `container` field + pub struct container(()); } } @@ -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::Container: cursor_state::IsSet, S::Id: cursor_state::IsSet, + S::Container: cursor_state::IsSet, { /// Build the final struct pub fn build(self) -> Cursor<'a> { @@ -1017,49 +1017,49 @@ 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 Peer; type ContainerType; } /// 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 Peer = 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; - } ///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; + type ContainerType = S::ContainerType; + } + ///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; type ContainerType = S::ContainerType; } ///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 Peer = S::Peer; type ContainerType = 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(()); ///Marker type for the `container_type` field pub struct container_type(()); } @@ -1154,8 +1154,8 @@ 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::Peer: normal_container_id_state::IsSet, S::ContainerType: normal_container_id_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/edit/diff.rs b/crates/weaver-api/src/sh_weaver/edit/diff.rs index cce32ea..fcd059f 100644 --- a/crates/weaver-api/src/sh_weaver/edit/diff.rs +++ b/crates/weaver-api/src/sh_weaver/edit/diff.rs @@ -8,13 +8,7 @@ /// An edit record for a notebook. #[jacquard_derive::lexicon] #[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] pub struct Diff<'a> { @@ -24,6 +18,7 @@ pub struct Diff<'a> { pub doc: crate::sh_weaver::edit::DocRef<'a>, /// An inline diff for for small edit batches. Either this or snapshot must be present to be valid #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")] pub inline_diff: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] @@ -38,7 +33,7 @@ pub struct Diff<'a> { pub mod diff_state { - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -46,37 +41,37 @@ pub mod diff_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Root; type Doc; + type Root; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Root = Unset; type Doc = Unset; - } - ///State transition - sets the `root` field to Set - pub struct SetRoot(PhantomData S>); - impl sealed::Sealed for SetRoot {} - impl State for SetRoot { - type Root = Set; - type Doc = S::Doc; + type Root = Unset; } ///State transition - sets the `doc` field to Set pub struct SetDoc(PhantomData S>); impl sealed::Sealed for SetDoc {} impl State for SetDoc { - type Root = S::Root; type Doc = Set; + type Root = S::Root; + } + ///State transition - sets the `root` field to Set + pub struct SetRoot(PhantomData S>); + impl sealed::Sealed for SetRoot {} + impl State for SetRoot { + type Doc = S::Doc; + type Root = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `root` field - pub struct root(()); ///Marker type for the `doc` field pub struct doc(()); + ///Marker type for the `root` field + pub struct root(()); } } @@ -223,8 +218,8 @@ impl<'a, S: diff_state::State> DiffBuilder<'a, S> { impl<'a, S> DiffBuilder<'a, S> where S: diff_state::State, - S::Root: diff_state::IsSet, S::Doc: diff_state::IsSet, + S::Root: diff_state::IsSet, { /// Build the final struct pub fn build(self) -> Diff<'a> { @@ -273,13 +268,7 @@ impl<'a> Diff<'a> { /// Typed wrapper for GetRecord response with this collection's record type. #[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] pub struct DiffGetRecordOutput<'a> { @@ -336,9 +325,7 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Diff<'a> { } } -fn lexicon_doc_sh_weaver_edit_diff() -> ::jacquard_lexicon::lexicon::LexiconDoc< - 'static, -> { +fn lexicon_doc_sh_weaver_edit_diff() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("sh.weaver.edit.diff"), @@ -441,4 +428,4 @@ fn lexicon_doc_sh_weaver_edit_diff() -> ::jacquard_lexicon::lexicon::LexiconDoc< map }, } -} \ No newline at end of file +} diff --git a/crates/weaver-api/src/sh_weaver/embed.rs b/crates/weaver-api/src/sh_weaver/embed.rs index d831cf2..c63b4e7 100644 --- a/crates/weaver-api/src/sh_weaver/embed.rs +++ b/crates/weaver-api/src/sh_weaver/embed.rs @@ -312,37 +312,37 @@ pub mod pixel_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(()); } } @@ -412,8 +412,8 @@ where impl<'a, S> PixelSizeBuilder<'a, S> where S: pixel_size_state::State, - S::Width: pixel_size_state::IsSet, S::Height: pixel_size_state::IsSet, + S::Width: pixel_size_state::IsSet, { /// Build the final struct pub fn build(self) -> PixelSize<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/external.rs b/crates/weaver-api/src/sh_weaver/embed/external.rs index b8ec638..cf98ddf 100644 --- a/crates/weaver-api/src/sh_weaver/embed/external.rs +++ b/crates/weaver-api/src/sh_weaver/embed/external.rs @@ -38,51 +38,51 @@ pub mod external_embed_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(()); } } @@ -195,9 +195,9 @@ where impl<'a, S> ExternalEmbedBuilder<'a, S> where S: external_embed_state::State, + S::Description: external_embed_state::IsSet, S::Uri: external_embed_state::IsSet, S::Title: external_embed_state::IsSet, - S::Description: external_embed_state::IsSet, { /// Build the final struct pub fn build(self) -> ExternalEmbed<'a> { @@ -817,51 +817,51 @@ 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; + 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 Title = Unset; type Description = Unset; + type Title = Unset; + type Uri = 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 `description` field to Set + pub struct SetDescription(PhantomData S>); + impl sealed::Sealed for SetDescription {} + impl State for SetDescription { + type Description = Set; type Title = S::Title; - type Description = S::Description; + 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 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 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 Description = S::Description; type Title = S::Title; - type Description = Set; + 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 `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(()); } } @@ -974,9 +974,9 @@ where 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, + S::Uri: 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 aa61830..9c425fb 100644 --- a/crates/weaver-api/src/sh_weaver/embed/images.rs +++ b/crates/weaver-api/src/sh_weaver/embed/images.rs @@ -44,37 +44,37 @@ pub mod image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Image; type Alt; + type Image; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Image = Unset; type Alt = Unset; - } - ///State transition - sets the `image` field to Set - pub struct SetImage(PhantomData S>); - impl sealed::Sealed for SetImage {} - impl State for SetImage { - type Image = Set; - type Alt = S::Alt; + type Image = Unset; } ///State transition - sets the `alt` field to Set pub struct SetAlt(PhantomData S>); impl sealed::Sealed for SetAlt {} impl State for SetAlt { - type Image = S::Image; type Alt = Set; + type Image = S::Image; + } + ///State transition - sets the `image` field to Set + pub struct SetImage(PhantomData S>); + impl sealed::Sealed for SetImage {} + impl State for SetImage { + type Alt = S::Alt; + type Image = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `image` field - pub struct image(()); ///Marker type for the `alt` field pub struct alt(()); + ///Marker type for the `image` field + pub struct image(()); } } @@ -195,8 +195,8 @@ impl<'a, S: image_state::State> ImageBuilder<'a, S> { impl<'a, S> ImageBuilder<'a, S> where S: image_state::State, - S::Image: image_state::IsSet, S::Alt: image_state::IsSet, + S::Image: image_state::IsSet, { /// Build the final struct pub fn build(self) -> Image<'a> { @@ -902,51 +902,51 @@ 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 Thumb; } /// 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; - } - ///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; + type Thumb = Unset; } ///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 Thumb = S::Thumb; } ///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 Thumb = S::Thumb; + } + ///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 Alt = S::Alt; + type Thumb = 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 `thumb` field + pub struct thumb(()); } } @@ -1073,9 +1073,9 @@ 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::Alt: view_image_state::IsSet, + S::Thumb: 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 710b339..a286344 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 Records; type Media; + type Records; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Records = Unset; 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 Records = Set; - type Media = S::Media; + 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 Records = S::Records; type Media = Set; + type Records = S::Records; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `records` field - pub struct records(()); ///Marker type for the `media` field pub struct media(()); + ///Marker type for the `records` field + pub struct records(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> RecordWithMediaBuilder<'a, S> where S: record_with_media_state::State, - S::Records: record_with_media_state::IsSet, S::Media: record_with_media_state::IsSet, + S::Records: record_with_media_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordWithMedia<'a> { @@ -323,37 +323,37 @@ pub mod view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; type Media; + 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 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 Record = Set; - type Media = S::Media; + 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 Record = S::Record; type Media = 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 Media = S::Media; + 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 `media` field pub struct media(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -426,8 +426,8 @@ impl<'a, S: view_state::State> ViewBuilder<'a, S> { impl<'a, S> ViewBuilder<'a, S> where S: view_state::State, - S::Record: view_state::IsSet, S::Media: view_state::IsSet, + S::Record: view_state::IsSet, { /// Build the final struct pub fn build(self) -> View<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/records.rs b/crates/weaver-api/src/sh_weaver/embed/records.rs index 209ca2b..6039d3b 100644 --- a/crates/weaver-api/src/sh_weaver/embed/records.rs +++ b/crates/weaver-api/src/sh_weaver/embed/records.rs @@ -1187,51 +1187,51 @@ pub mod view_blocked_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Blocked; type Author; + 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 Blocked = Unset; type Author = 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 Blocked = S::Blocked; - type Author = S::Author; + type Uri = Unset; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Uri = S::Uri; type Blocked = Set; type Author = S::Author; + type Uri = S::Uri; } ///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 Blocked = S::Blocked; type Author = 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 Blocked = S::Blocked; + type Author = S::Author; + 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 `blocked` field pub struct blocked(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1324,9 +1324,9 @@ where impl<'a, S> ViewBlockedBuilder<'a, S> where S: view_blocked_state::State, - S::Uri: view_blocked_state::IsSet, S::Blocked: view_blocked_state::IsSet, S::Author: view_blocked_state::IsSet, + S::Uri: view_blocked_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewBlocked<'a> { @@ -1398,37 +1398,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(()); } } @@ -1501,8 +1501,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> { @@ -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 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(()); } } @@ -1675,8 +1675,8 @@ where impl<'a, S> ViewNotFoundBuilder<'a, S> where S: view_not_found_state::State, - S::Uri: view_not_found_state::IsSet, S::NotFound: view_not_found_state::IsSet, + S::Uri: view_not_found_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewNotFound<'a> { @@ -1769,85 +1769,85 @@ pub mod view_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Cid; type Author; - type Value; type IndexedAt; + type Value; + 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 Cid = Unset; type Author = Unset; - type Value = 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; - type Cid = S::Cid; - type Author = S::Author; - type Value = S::Value; - type IndexedAt = S::IndexedAt; + type Value = 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 Uri = S::Uri; type Cid = Set; type Author = S::Author; - type Value = S::Value; type IndexedAt = S::IndexedAt; + type Value = S::Value; + type Uri = S::Uri; } ///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 Author = Set; - type Value = S::Value; type IndexedAt = S::IndexedAt; + 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 Cid = S::Cid; + type Author = S::Author; + type IndexedAt = 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 Uri = S::Uri; type Cid = S::Cid; type Author = S::Author; - type Value = 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 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 { type Cid = S::Cid; type Author = S::Author; + type IndexedAt = S::IndexedAt; type Value = S::Value; - type IndexedAt = Set; + 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 `cid` field pub struct cid(()); ///Marker type for the `author` field pub struct author(()); - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `value` field + pub struct value(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -2092,11 +2092,11 @@ where impl<'a, S> ViewRecordBuilder<'a, S> where S: view_record_state::State, - S::Uri: view_record_state::IsSet, S::Cid: view_record_state::IsSet, S::Author: view_record_state::IsSet, - S::Value: view_record_state::IsSet, S::IndexedAt: view_record_state::IsSet, + S::Value: view_record_state::IsSet, + S::Uri: view_record_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewRecord<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/video.rs b/crates/weaver-api/src/sh_weaver/embed/video.rs index c81e035..a621183 100644 --- a/crates/weaver-api/src/sh_weaver/embed/video.rs +++ b/crates/weaver-api/src/sh_weaver/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 Lang; type File; + type Lang; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Lang = Unset; 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 Lang = Set; - type File = S::File; + 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 Lang = S::Lang; type File = Set; + type Lang = S::Lang; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `lang` field - pub struct lang(()); ///Marker type for the `file` field pub struct file(()); + ///Marker type for the `lang` field + pub struct lang(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> CaptionBuilder<'a, S> where S: caption_state::State, - S::Lang: caption_state::IsSet, S::File: caption_state::IsSet, + S::Lang: caption_state::IsSet, { /// Build the final struct pub fn build(self) -> Caption<'a> { @@ -940,37 +940,37 @@ pub mod view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Playlist; + 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 Playlist = 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 Playlist = S::Playlist; + type Cid = Unset; } ///State transition - sets the `playlist` field to Set pub struct SetPlaylist(PhantomData S>); impl sealed::Sealed for SetPlaylist {} impl State for SetPlaylist { - type Cid = S::Cid; type Playlist = 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 Playlist = S::Playlist; + 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 `playlist` field pub struct playlist(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1108,8 +1108,8 @@ impl<'a, S: view_state::State> ViewBuilder<'a, S> { impl<'a, S> ViewBuilder<'a, S> where S: view_state::State, - S::Cid: view_state::IsSet, S::Playlist: view_state::IsSet, + S::Cid: view_state::IsSet, { /// Build the final struct pub fn build(self) -> View<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/like.rs b/crates/weaver-api/src/sh_weaver/graph/like.rs index 0b7c5e1..775fef7 100644 --- a/crates/weaver-api/src/sh_weaver/graph/like.rs +++ b/crates/weaver-api/src/sh_weaver/graph/like.rs @@ -34,37 +34,37 @@ pub mod like_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> LikeBuilder<'a, S> where S: like_state::State, - S::Subject: like_state::IsSet, S::CreatedAt: like_state::IsSet, + S::Subject: like_state::IsSet, { /// Build the final struct pub fn build(self) -> Like<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/listitem.rs b/crates/weaver-api/src/sh_weaver/graph/listitem.rs index 114f355..dbd9686 100644 --- a/crates/weaver-api/src/sh_weaver/graph/listitem.rs +++ b/crates/weaver-api/src/sh_weaver/graph/listitem.rs @@ -38,50 +38,50 @@ pub mod listitem_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Subject; - type List; type CreatedAt; + type List; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Subject = Unset; - type List = Unset; type CreatedAt = Unset; + type List = 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 List = S::List; - type CreatedAt = S::CreatedAt; - } - ///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 List = 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 List = S::List; 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; } /// 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 `list` field - pub struct list(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `list` field + pub struct list(()); } } @@ -175,8 +175,8 @@ impl<'a, S> ListitemBuilder<'a, S> where S: listitem_state::State, S::Subject: listitem_state::IsSet, - S::List: 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_accept.rs b/crates/weaver-api/src/sh_weaver/graph/subscribe_accept.rs index 0062a2b..79682a6 100644 --- a/crates/weaver-api/src/sh_weaver/graph/subscribe_accept.rs +++ b/crates/weaver-api/src/sh_weaver/graph/subscribe_accept.rs @@ -34,37 +34,37 @@ pub mod subscribe_accept_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subscribe; type CreatedAt; + type Subscribe; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subscribe = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `subscribe` field to Set - pub struct SetSubscribe(PhantomData S>); - impl sealed::Sealed for SetSubscribe {} - impl State for SetSubscribe { - type Subscribe = Set; - type CreatedAt = S::CreatedAt; + type Subscribe = 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 Subscribe = S::Subscribe; type CreatedAt = Set; + type Subscribe = S::Subscribe; + } + ///State transition - sets the `subscribe` field to Set + pub struct SetSubscribe(PhantomData S>); + impl sealed::Sealed for SetSubscribe {} + impl State for SetSubscribe { + type CreatedAt = S::CreatedAt; + type Subscribe = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subscribe` field - pub struct subscribe(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `subscribe` field + pub struct subscribe(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> SubscribeAcceptBuilder<'a, S> where S: subscribe_accept_state::State, - S::Subscribe: subscribe_accept_state::IsSet, S::CreatedAt: subscribe_accept_state::IsSet, + S::Subscribe: subscribe_accept_state::IsSet, { /// Build the final struct pub fn build(self) -> SubscribeAccept<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook.rs b/crates/weaver-api/src/sh_weaver/notebook.rs index 37c5345..4777f1e 100644 --- a/crates/weaver-api/src/sh_weaver/notebook.rs +++ b/crates/weaver-api/src/sh_weaver/notebook.rs @@ -1367,77 +1367,75 @@ pub mod entry_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Cid; type Authors; type Record; type IndexedAt; + 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 Cid = Unset; type Authors = Unset; type Record = 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; - type Cid = S::Cid; - type Authors = S::Authors; - type Record = S::Record; - type IndexedAt = S::IndexedAt; + 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 Uri = S::Uri; type Cid = Set; type Authors = S::Authors; type Record = S::Record; type IndexedAt = S::IndexedAt; + type Uri = S::Uri; } ///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 Authors = Set; type Record = S::Record; type IndexedAt = S::IndexedAt; + type Uri = S::Uri; } ///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 Authors = S::Authors; type Record = 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 Uri = S::Uri; type Cid = S::Cid; type Authors = S::Authors; type Record = S::Record; type IndexedAt = 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 Cid = S::Cid; + type Authors = S::Authors; + type Record = S::Record; + type IndexedAt = S::IndexedAt; + 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 `cid` field pub struct cid(()); ///Marker type for the `authors` field @@ -1446,6 +1444,8 @@ pub mod entry_view_state { pub struct record(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1689,11 +1689,11 @@ where 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::Authors: entry_view_state::IsSet, S::Record: entry_view_state::IsSet, S::IndexedAt: entry_view_state::IsSet, + S::Uri: entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> EntryView<'a> { @@ -1799,83 +1799,83 @@ pub mod notebook_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; + type Record; type Cid; + type Uri; type Authors; - type Record; 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 Record = Unset; type Cid = Unset; + type Uri = Unset; type Authors = Unset; - type Record = 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 Uri = S::Uri; type Authors = S::Authors; - type Record = S::Record; 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 Record = S::Record; type Cid = Set; + type Uri = S::Uri; type Authors = S::Authors; + 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 Record = S::Record; + 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 Authors = Set; 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 Uri = S::Uri; type Cid = S::Cid; - type Authors = S::Authors; - type Record = Set; + 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 Uri = S::Uri; + type Record = S::Record; type Cid = S::Cid; + type Uri = S::Uri; type Authors = S::Authors; - type Record = S::Record; 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 `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 `authors` field pub struct authors(()); - ///Marker type for the `record` field - pub struct record(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } @@ -2100,10 +2100,10 @@ where impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, - S::Uri: notebook_view_state::IsSet, + S::Record: notebook_view_state::IsSet, S::Cid: notebook_view_state::IsSet, + S::Uri: notebook_view_state::IsSet, S::Authors: notebook_view_state::IsSet, - S::Record: notebook_view_state::IsSet, S::IndexedAt: notebook_view_state::IsSet, { /// Build the final struct @@ -2198,67 +2198,67 @@ pub mod permission_grant_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; + type GrantedAt; type Scope; + type Did; type Source; - type GrantedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; + type GrantedAt = Unset; type Scope = Unset; + type Did = Unset; type Source = Unset; - type GrantedAt = 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 `granted_at` field to Set + pub struct SetGrantedAt(PhantomData S>); + impl sealed::Sealed for SetGrantedAt {} + impl State for SetGrantedAt { + type GrantedAt = Set; type Scope = S::Scope; + type Did = S::Did; type Source = S::Source; - type GrantedAt = S::GrantedAt; } ///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 Scope = Set; + type Did = S::Did; type Source = S::Source; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { type GrantedAt = S::GrantedAt; + type Scope = S::Scope; + type Did = Set; + type Source = S::Source; } ///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 Source = Set; type GrantedAt = S::GrantedAt; - } - ///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 Source = S::Source; - type GrantedAt = Set; + type Did = S::Did; + type Source = 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 `granted_at` field + pub struct granted_at(()); ///Marker type for the `scope` field pub struct scope(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `source` field pub struct source(()); - ///Marker type for the `granted_at` field - pub struct granted_at(()); } } @@ -2371,10 +2371,10 @@ where impl<'a, S> PermissionGrantBuilder<'a, S> where S: permission_grant_state::State, - S::Did: permission_grant_state::IsSet, + S::GrantedAt: permission_grant_state::IsSet, S::Scope: permission_grant_state::IsSet, + S::Did: permission_grant_state::IsSet, S::Source: permission_grant_state::IsSet, - S::GrantedAt: permission_grant_state::IsSet, { /// Build the final struct pub fn build(self) -> PermissionGrant<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/book.rs b/crates/weaver-api/src/sh_weaver/notebook/book.rs index 43ffe38..db8537a 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/book.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/book.rs @@ -52,37 +52,37 @@ pub mod book_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Authors; type EntryList; + 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; - } - ///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 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 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 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 `authors` field + pub struct authors(()); } } @@ -275,8 +275,8 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { impl<'a, S> BookBuilder<'a, S> where S: book_state::State, - S::Authors: book_state::IsSet, S::EntryList: book_state::IsSet, + S::Authors: book_state::IsSet, { /// Build the final struct pub fn build(self) -> Book<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs b/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs index bdd7df2..1f3bee8 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs @@ -38,51 +38,51 @@ pub mod colour_scheme_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; type Variant; type Colours; + 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 Variant = Unset; type Colours = 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 Variant = S::Variant; - type Colours = S::Colours; + type Name = Unset; } ///State transition - sets the `variant` field to Set pub struct SetVariant(PhantomData S>); impl sealed::Sealed for SetVariant {} impl State for SetVariant { - type Name = S::Name; type Variant = Set; type Colours = S::Colours; + type Name = S::Name; } ///State transition - sets the `colours` field to Set pub struct SetColours(PhantomData S>); impl sealed::Sealed for SetColours {} impl State for SetColours { - type Name = S::Name; type Variant = S::Variant; type Colours = 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 Variant = S::Variant; + type Colours = S::Colours; + 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 `variant` field pub struct variant(()); ///Marker type for the `colours` field pub struct colours(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -175,9 +175,9 @@ where impl<'a, S> ColourSchemeBuilder<'a, S> where S: colour_scheme_state::State, - S::Name: colour_scheme_state::IsSet, S::Variant: colour_scheme_state::IsSet, S::Colours: colour_scheme_state::IsSet, + S::Name: colour_scheme_state::IsSet, { /// Build the final struct pub fn build(self) -> ColourScheme<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/entry.rs b/crates/weaver-api/src/sh_weaver/notebook/entry.rs index a5c1e9e..5d23323 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/entry.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/entry.rs @@ -53,66 +53,66 @@ pub mod entry_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Content; - type Title; - type Path; type CreatedAt; + type Path; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Content = Unset; - type Title = Unset; - type Path = Unset; type CreatedAt = Unset; + type Path = Unset; + type Title = 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 Title = S::Title; - type Path = S::Path; type CreatedAt = S::CreatedAt; + 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 { + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { type Content = S::Content; - type Title = Set; + type CreatedAt = Set; type Path = S::Path; - type CreatedAt = S::CreatedAt; + 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 Content = S::Content; - type Title = S::Title; - type Path = Set; type CreatedAt = S::CreatedAt; + type Path = Set; + 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 { + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { type Content = S::Content; - type Title = S::Title; + type CreatedAt = S::CreatedAt; type Path = S::Path; - type CreatedAt = Set; + type Title = 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 `title` field - pub struct title(()); - ///Marker type for the `path` field - pub struct path(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `path` field + pub struct path(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -300,9 +300,9 @@ impl<'a, S> EntryBuilder<'a, S> where S: entry_state::State, S::Content: entry_state::IsSet, - S::Title: entry_state::IsSet, - S::Path: entry_state::IsSet, S::CreatedAt: entry_state::IsSet, + S::Path: entry_state::IsSet, + S::Title: 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 28de921..8f82bfb 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 Actor; type Title; + type Actor; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Actor = Unset; 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 Actor = Set; - type Title = S::Title; + 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 Actor = S::Actor; type Title = Set; + type Actor = S::Actor; + } + ///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; } /// 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 `title` field pub struct title(()); + ///Marker type for the `actor` field + pub struct actor(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetNotebookByTitleBuilder<'a, S> where S: get_notebook_by_title_state::State, - S::Actor: get_notebook_by_title_state::IsSet, S::Title: get_notebook_by_title_state::IsSet, + S::Actor: 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/page.rs b/crates/weaver-api/src/sh_weaver/notebook/page.rs index 3b4752c..f59c364 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 Notebook; type Authors; type EntryList; + type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Notebook = Unset; type Authors = Unset; type EntryList = 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 Authors = S::Authors; - type EntryList = S::EntryList; + 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 Notebook = S::Notebook; type Authors = Set; type EntryList = S::EntryList; + type Notebook = S::Notebook; } ///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 Authors = S::Authors; type EntryList = 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 Authors = S::Authors; + type EntryList = S::EntryList; + type Notebook = 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 `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(()); } } @@ -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::Notebook: page_state::IsSet, S::Authors: page_state::IsSet, S::EntryList: page_state::IsSet, + S::Notebook: page_state::IsSet, { /// Build the final struct pub fn build(self) -> Page<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/theme.rs b/crates/weaver-api/src/sh_weaver/notebook/theme.rs index b56e739..49f0ce6 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 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; - } - ///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; + type Name = Unset; } ///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 Name = S::Name; 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; } /// 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(()); } } @@ -173,9 +173,9 @@ where impl<'a, S> CodeThemeFileBuilder<'a, S> where S: code_theme_file_state::State, - S::Name: code_theme_file_state::IsSet, S::Did: code_theme_file_state::IsSet, S::Content: code_theme_file_state::IsSet, + S::Name: code_theme_file_state::IsSet, { /// Build the final struct pub fn build(self) -> CodeThemeFile<'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 Fonts; + type LightCodeTheme; + type LightScheme; type Spacing; type DarkCodeTheme; - type LightCodeTheme; + type DarkScheme; } /// 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 Fonts = Unset; + type LightCodeTheme = Unset; + type LightScheme = Unset; type Spacing = Unset; type DarkCodeTheme = Unset; - type LightCodeTheme = Unset; + type DarkScheme = 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; + ///State transition - sets the `fonts` field to Set + pub struct SetFonts(PhantomData S>); + impl sealed::Sealed for SetFonts {} + impl State for SetFonts { + type Fonts = Set; + type LightCodeTheme = S::LightCodeTheme; type LightScheme = S::LightScheme; + type Spacing = S::Spacing; + type DarkCodeTheme = S::DarkCodeTheme; + type DarkScheme = S::DarkScheme; + } + ///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 Fonts = S::Fonts; + type LightCodeTheme = Set; + type LightScheme = S::LightScheme; type Spacing = S::Spacing; type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = S::LightCodeTheme; + type DarkScheme = S::DarkScheme; } ///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 Fonts = S::Fonts; - type Spacing = S::Spacing; - type DarkCodeTheme = S::DarkCodeTheme; type LightCodeTheme = S::LightCodeTheme; - } - ///State transition - sets the `fonts` field to Set - pub struct SetFonts(PhantomData S>); - impl sealed::Sealed for SetFonts {} - impl State for SetFonts { - type DarkScheme = S::DarkScheme; - type LightScheme = S::LightScheme; - type Fonts = Set; + type LightScheme = Set; type Spacing = S::Spacing; type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = S::LightCodeTheme; + type DarkScheme = S::DarkScheme; } ///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 Fonts = S::Fonts; + type LightCodeTheme = S::LightCodeTheme; + type LightScheme = S::LightScheme; type Spacing = Set; type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = S::LightCodeTheme; + type DarkScheme = S::DarkScheme; } ///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 Fonts = S::Fonts; + type LightCodeTheme = S::LightCodeTheme; + type LightScheme = S::LightScheme; type Spacing = S::Spacing; type DarkCodeTheme = Set; - type LightCodeTheme = S::LightCodeTheme; - } - ///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; + } + ///State transition - sets the `dark_scheme` field to Set + pub struct SetDarkScheme(PhantomData S>); + impl sealed::Sealed for SetDarkScheme {} + impl State for SetDarkScheme { type Fonts = S::Fonts; + type LightCodeTheme = S::LightCodeTheme; + type LightScheme = S::LightScheme; type Spacing = S::Spacing; type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = Set; + type DarkScheme = 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 `fonts` field pub struct fonts(()); + ///Marker type for the `light_code_theme` field + pub struct light_code_theme(()); + ///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_scheme` field + pub struct dark_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::Fonts: theme_state::IsSet, + S::LightCodeTheme: theme_state::IsSet, + S::LightScheme: theme_state::IsSet, S::Spacing: theme_state::IsSet, S::DarkCodeTheme: theme_state::IsSet, - S::LightCodeTheme: theme_state::IsSet, + S::DarkScheme: theme_state::IsSet, { /// Build the final struct pub fn build(self) -> Theme<'a> { diff --git a/crates/weaver-api/src/tools_ozone/communication.rs b/crates/weaver-api/src/tools_ozone/communication.rs index 149bb7f..e6468a3 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 Id; - type Name; type ContentMarkdown; + type Id; type Disabled; - type LastUpdatedBy; type CreatedAt; type UpdatedAt; + type Name; + type LastUpdatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type Name = Unset; type ContentMarkdown = Unset; + type Id = Unset; type Disabled = Unset; - type LastUpdatedBy = Unset; type CreatedAt = Unset; type UpdatedAt = Unset; + type Name = Unset; + type LastUpdatedBy = 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 Name = S::Name; - type ContentMarkdown = S::ContentMarkdown; + ///State transition - sets the `content_markdown` field to Set + pub struct SetContentMarkdown(PhantomData S>); + impl sealed::Sealed for SetContentMarkdown {} + impl State for SetContentMarkdown { + type ContentMarkdown = Set; + type Id = S::Id; type Disabled = S::Disabled; - type LastUpdatedBy = S::LastUpdatedBy; type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; + type Name = S::Name; + type LastUpdatedBy = S::LastUpdatedBy; } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Id = S::Id; - type Name = Set; + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { type ContentMarkdown = S::ContentMarkdown; + type Id = Set; type Disabled = S::Disabled; - type LastUpdatedBy = S::LastUpdatedBy; type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; - } - ///State transition - sets the `content_markdown` field to Set - pub struct SetContentMarkdown(PhantomData S>); - impl sealed::Sealed for SetContentMarkdown {} - impl State for SetContentMarkdown { - type Id = S::Id; type Name = S::Name; - type ContentMarkdown = Set; - type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; - type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; } ///State transition - sets the `disabled` field to Set pub struct SetDisabled(PhantomData S>); impl sealed::Sealed for SetDisabled {} impl State for SetDisabled { - type Id = S::Id; - type Name = S::Name; type ContentMarkdown = S::ContentMarkdown; + type Id = S::Id; type Disabled = Set; - type LastUpdatedBy = S::LastUpdatedBy; type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; - } - ///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 Id = S::Id; type Name = S::Name; - type ContentMarkdown = S::ContentMarkdown; - type Disabled = S::Disabled; - type LastUpdatedBy = Set; - type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; + 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 Id = S::Id; - type Name = S::Name; type ContentMarkdown = S::ContentMarkdown; + type Id = S::Id; type Disabled = S::Disabled; - type LastUpdatedBy = S::LastUpdatedBy; type CreatedAt = Set; type UpdatedAt = S::UpdatedAt; + type Name = S::Name; + type LastUpdatedBy = S::LastUpdatedBy; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { + type ContentMarkdown = S::ContentMarkdown; type Id = S::Id; + type Disabled = S::Disabled; + type CreatedAt = S::CreatedAt; + type UpdatedAt = Set; type Name = S::Name; + type LastUpdatedBy = S::LastUpdatedBy; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { type ContentMarkdown = S::ContentMarkdown; + type Id = S::Id; type Disabled = S::Disabled; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + type Name = Set; type LastUpdatedBy = S::LastUpdatedBy; + } + ///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 ContentMarkdown = S::ContentMarkdown; + type Id = S::Id; + type Disabled = S::Disabled; type CreatedAt = S::CreatedAt; - type UpdatedAt = Set; + type UpdatedAt = S::UpdatedAt; + type Name = S::Name; + type LastUpdatedBy = 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 `name` field - pub struct name(()); ///Marker type for the `content_markdown` field pub struct content_markdown(()); + ///Marker type for the `id` field + pub struct id(()); ///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 `created_at` field pub struct created_at(()); ///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(()); } } @@ -395,13 +395,13 @@ where impl<'a, S> TemplateViewBuilder<'a, S> where S: template_view_state::State, - S::Id: template_view_state::IsSet, - S::Name: template_view_state::IsSet, S::ContentMarkdown: template_view_state::IsSet, + S::Id: template_view_state::IsSet, S::Disabled: template_view_state::IsSet, - S::LastUpdatedBy: template_view_state::IsSet, S::CreatedAt: template_view_state::IsSet, S::UpdatedAt: template_view_state::IsSet, + S::Name: template_view_state::IsSet, + S::LastUpdatedBy: 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 68a3969..c2d93fa 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 CreatedAt; type Details; type CreatedBy; - 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 Details = Unset; type CreatedBy = 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 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 CreatedAt = S::CreatedAt; type Details = 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 Details = S::Details; - 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 Details = S::Details; - type CreatedBy = S::CreatedBy; - type CreatedAt = Set; + type CreatedBy = 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 `details` field pub struct details(()); ///Marker type for the `created_by` field pub struct created_by(()); - ///Marker type for the `created_at` field - pub struct created_at(()); } } @@ -599,9 +599,9 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, + S::CreatedAt: event_state::IsSet, S::Details: event_state::IsSet, S::CreatedBy: event_state::IsSet, - S::CreatedAt: 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 ebb4afd..2759242 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(()); } } @@ -192,8 +192,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> { @@ -5097,51 +5097,51 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Status; type AttemptId; + 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 AttemptId = 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 AttemptId = S::AttemptId; + type CreatedAt = Unset; } ///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; + type CreatedAt = S::CreatedAt; } ///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 Status = S::Status; type AttemptId = 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 AttemptId = S::AttemptId; + 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 `status` field pub struct status(()); ///Marker type for the `attempt_id` field pub struct attempt_id(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -5379,9 +5379,9 @@ where impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, - S::CreatedAt: age_assurance_event_state::IsSet, S::Status: age_assurance_event_state::IsSet, S::AttemptId: age_assurance_event_state::IsSet, + S::CreatedAt: age_assurance_event_state::IsSet, { /// Build the final struct pub fn build(self) -> AgeAssuranceEvent<'a> { @@ -5518,67 +5518,67 @@ pub mod blob_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type MimeType; type Size; type CreatedAt; + 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 MimeType = Unset; type Size = Unset; type CreatedAt = 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 MimeType = S::MimeType; - type Size = S::Size; - type CreatedAt = S::CreatedAt; + type Cid = Unset; } ///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 MimeType = Set; type Size = S::Size; type CreatedAt = S::CreatedAt; + type Cid = S::Cid; } ///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 = S::MimeType; type Size = Set; type CreatedAt = S::CreatedAt; + type Cid = S::Cid; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Cid = S::Cid; type MimeType = S::MimeType; type Size = S::Size; type CreatedAt = 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 MimeType = S::MimeType; + type Size = S::Size; + type CreatedAt = S::CreatedAt; + 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 `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 `cid` field + pub struct cid(()); } } @@ -5725,10 +5725,10 @@ where impl<'a, S> BlobViewBuilder<'a, S> where S: blob_view_state::State, - 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::Cid: blob_view_state::IsSet, { /// Build the final struct pub fn build(self) -> BlobView<'a> { @@ -7725,104 +7725,104 @@ pub mod mod_event_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Id; - type Event; - type Subject; - type SubjectBlobCids; type CreatedBy; type CreatedAt; + type Subject; + type SubjectBlobCids; + type Event; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Id = Unset; - type Event = Unset; - type Subject = Unset; - type SubjectBlobCids = Unset; type CreatedBy = Unset; type CreatedAt = Unset; + type Subject = Unset; + type SubjectBlobCids = Unset; + type Event = 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 Event = S::Event; - type Subject = S::Subject; - type SubjectBlobCids = S::SubjectBlobCids; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; + type Subject = S::Subject; + type SubjectBlobCids = S::SubjectBlobCids; + type Event = S::Event; } - ///State transition - sets the `event` field to Set - pub struct SetEvent(PhantomData S>); - impl sealed::Sealed for SetEvent {} - impl State for SetEvent { + ///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 Event = Set; + type CreatedBy = Set; + type CreatedAt = S::CreatedAt; type Subject = S::Subject; type SubjectBlobCids = S::SubjectBlobCids; + type Event = S::Event; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Id = S::Id; type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; + type CreatedAt = Set; + type Subject = S::Subject; + type SubjectBlobCids = S::SubjectBlobCids; + 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 Id = S::Id; - type Event = S::Event; - type Subject = Set; - type SubjectBlobCids = S::SubjectBlobCids; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; + type Subject = Set; + type SubjectBlobCids = S::SubjectBlobCids; + type Event = S::Event; } ///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 Id = S::Id; - type Event = S::Event; - type Subject = S::Subject; - type SubjectBlobCids = 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 Id = S::Id; - type Event = S::Event; type Subject = S::Subject; - type SubjectBlobCids = S::SubjectBlobCids; - type CreatedBy = Set; - type CreatedAt = S::CreatedAt; + type SubjectBlobCids = Set; + type Event = S::Event; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + ///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 Event = S::Event; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; type Subject = S::Subject; type SubjectBlobCids = S::SubjectBlobCids; - type CreatedBy = S::CreatedBy; - type CreatedAt = Set; + type Event = 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 `event` field - pub struct event(()); - ///Marker type for the `subject` field - pub struct subject(()); - ///Marker type for the `subject_blob_cids` field - pub struct subject_blob_cids(()); ///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 `subject` field + pub struct subject(()); + ///Marker type for the `subject_blob_cids` field + pub struct subject_blob_cids(()); + ///Marker type for the `event` field + pub struct event(()); } } @@ -8046,11 +8046,11 @@ impl<'a, S> ModEventViewBuilder<'a, S> where S: mod_event_view_state::State, S::Id: mod_event_view_state::IsSet, - S::Event: mod_event_view_state::IsSet, - S::Subject: mod_event_view_state::IsSet, - S::SubjectBlobCids: mod_event_view_state::IsSet, S::CreatedBy: mod_event_view_state::IsSet, S::CreatedAt: mod_event_view_state::IsSet, + S::Subject: mod_event_view_state::IsSet, + S::SubjectBlobCids: mod_event_view_state::IsSet, + S::Event: mod_event_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventView<'a> { @@ -8244,105 +8244,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 Event; - type Subject; type SubjectBlobs; type CreatedBy; type CreatedAt; + type Id; + type Subject; + type Event; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type Event = Unset; - type Subject = Unset; type SubjectBlobs = Unset; type CreatedBy = Unset; type CreatedAt = 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 Event = S::Event; - type Subject = S::Subject; - type SubjectBlobs = S::SubjectBlobs; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - } - ///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 Event = Set; - type Subject = S::Subject; - type SubjectBlobs = S::SubjectBlobs; - type CreatedBy = S::CreatedBy; - 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 Id = S::Id; - type Event = S::Event; - type Subject = Set; - type SubjectBlobs = S::SubjectBlobs; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; + type Id = Unset; + type Subject = Unset; + type Event = Unset; } ///State transition - sets the `subject_blobs` field to Set pub struct SetSubjectBlobs(PhantomData S>); impl sealed::Sealed for SetSubjectBlobs {} impl State for SetSubjectBlobs { - type Id = S::Id; - type Event = S::Event; - type Subject = S::Subject; type SubjectBlobs = Set; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; + type Id = S::Id; + type Subject = S::Subject; + type Event = S::Event; } ///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 Event = S::Event; - type Subject = S::Subject; type SubjectBlobs = S::SubjectBlobs; type CreatedBy = Set; type CreatedAt = S::CreatedAt; + type Id = S::Id; + type Subject = S::Subject; + type Event = S::Event; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { + type SubjectBlobs = S::SubjectBlobs; + type CreatedBy = S::CreatedBy; + type CreatedAt = Set; type Id = S::Id; - type Event = S::Event; type Subject = S::Subject; + type Event = S::Event; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { type SubjectBlobs = S::SubjectBlobs; type CreatedBy = S::CreatedBy; - type CreatedAt = Set; + type CreatedAt = S::CreatedAt; + type Id = Set; + type Subject = S::Subject; + type Event = S::Event; } - /// Marker types for field names + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type SubjectBlobs = S::SubjectBlobs; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Id = S::Id; + type Subject = Set; + type Event = S::Event; + } + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData S>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { + type SubjectBlobs = S::SubjectBlobs; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Id = S::Id; + type Subject = S::Subject; + type Event = 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 `event` field - pub struct event(()); - ///Marker type for the `subject` field - pub struct subject(()); ///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 `id` field + pub struct id(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `event` field + pub struct event(()); } } @@ -8515,12 +8515,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::Event: mod_event_view_detail_state::IsSet, - S::Subject: 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::Id: mod_event_view_detail_state::IsSet, + S::Subject: mod_event_view_detail_state::IsSet, + S::Event: mod_event_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventViewDetail<'a> { @@ -9088,127 +9088,127 @@ pub mod record_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Cid; - type Value; type BlobCids; - type IndexedAt; type Moderation; + type Value; + type Uri; type Repo; + 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 Value = Unset; type BlobCids = Unset; - type IndexedAt = Unset; type Moderation = Unset; + type Value = Unset; + type Uri = Unset; type Repo = 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 Cid = S::Cid; - type Value = S::Value; - type BlobCids = S::BlobCids; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - type Repo = S::Repo; + 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 Uri = S::Uri; type Cid = Set; - type Value = S::Value; type BlobCids = S::BlobCids; - type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; - type Repo = S::Repo; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { + type Value = S::Value; type Uri = S::Uri; - type Cid = S::Cid; - type Value = Set; - type BlobCids = S::BlobCids; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; type Repo = S::Repo; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `blob_cids` field to Set pub struct SetBlobCids(PhantomData S>); impl sealed::Sealed for SetBlobCids {} impl State for SetBlobCids { - type Uri = S::Uri; type Cid = S::Cid; - type Value = S::Value; type BlobCids = Set; - type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; - type Repo = S::Repo; - } - ///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 Value = S::Value; - type BlobCids = S::BlobCids; - type IndexedAt = Set; - type Moderation = S::Moderation; + type Uri = S::Uri; 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 Cid = S::Cid; + type BlobCids = S::BlobCids; + type Moderation = Set; type Value = S::Value; + type Uri = S::Uri; + type Repo = S::Repo; + 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 BlobCids = S::BlobCids; + type Moderation = S::Moderation; + type Value = Set; + type Uri = S::Uri; + type Repo = S::Repo; type IndexedAt = S::IndexedAt; - type Moderation = Set; + } + ///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 BlobCids = S::BlobCids; + type Moderation = S::Moderation; + type Value = S::Value; + type Uri = Set; type Repo = S::Repo; + type IndexedAt = S::IndexedAt; } ///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 Cid = S::Cid; - type Value = S::Value; type BlobCids = S::BlobCids; - type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; + type Value = S::Value; + type Uri = S::Uri; type Repo = 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 BlobCids = S::BlobCids; + type Moderation = S::Moderation; + type Value = S::Value; + type Uri = S::Uri; + type Repo = S::Repo; + 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 `value` field - pub struct value(()); ///Marker type for the `blob_cids` field pub struct blob_cids(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `moderation` field pub struct moderation(()); + ///Marker type for the `value` field + pub struct value(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -9381,13 +9381,13 @@ where impl<'a, S> RecordViewBuilder<'a, S> where S: record_view_state::State, - S::Uri: record_view_state::IsSet, S::Cid: record_view_state::IsSet, - S::Value: record_view_state::IsSet, S::BlobCids: record_view_state::IsSet, - S::IndexedAt: record_view_state::IsSet, S::Moderation: record_view_state::IsSet, + S::Value: record_view_state::IsSet, + S::Uri: record_view_state::IsSet, S::Repo: record_view_state::IsSet, + S::IndexedAt: record_view_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordView<'a> { @@ -9480,127 +9480,127 @@ pub mod record_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; - type Cid; type Value; - type Blobs; + type Uri; type IndexedAt; + type Blobs; type Moderation; type Repo; + 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 Cid = Unset; type Value = Unset; - type Blobs = Unset; + type Uri = Unset; type IndexedAt = Unset; + type Blobs = Unset; type Moderation = Unset; type Repo = Unset; + type Cid = 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 Blobs = S::Blobs; + type Moderation = S::Moderation; + type Repo = S::Repo; + 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 Cid = S::Cid; type Value = S::Value; - type Blobs = S::Blobs; + type Uri = Set; 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 Uri = S::Uri; - type Cid = Set; - type Value = S::Value; type Blobs = S::Blobs; - type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; type Repo = S::Repo; + 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 { + ///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 Cid = S::Cid; - type Value = Set; + type IndexedAt = Set; type Blobs = S::Blobs; - type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; type Repo = S::Repo; + type Cid = S::Cid; } ///State transition - sets the `blobs` field to Set pub struct SetBlobs(PhantomData S>); impl sealed::Sealed for SetBlobs {} impl State for SetBlobs { - type Uri = S::Uri; - type Cid = S::Cid; type Value = S::Value; - type Blobs = Set; + type Uri = S::Uri; type IndexedAt = S::IndexedAt; + type Blobs = Set; type Moderation = S::Moderation; type Repo = S::Repo; - } - ///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 Value = S::Value; - type Blobs = S::Blobs; - type IndexedAt = Set; - type Moderation = S::Moderation; - type Repo = S::Repo; } ///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 Cid = S::Cid; type Value = S::Value; - type Blobs = S::Blobs; + type Uri = S::Uri; type IndexedAt = S::IndexedAt; + type Blobs = S::Blobs; type Moderation = Set; type Repo = S::Repo; + 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 Value = S::Value; type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Blobs = S::Blobs; + type Moderation = S::Moderation; + type Repo = 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 Value = S::Value; - type Blobs = S::Blobs; + type Uri = S::Uri; type IndexedAt = S::IndexedAt; + type Blobs = S::Blobs; type Moderation = S::Moderation; - type Repo = Set; + type Repo = S::Repo; + 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 `cid` field - pub struct cid(()); ///Marker type for the `value` field pub struct value(()); - ///Marker type for the `blobs` field - pub struct blobs(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `blobs` field + pub struct blobs(()); ///Marker type for the `moderation` field pub struct moderation(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -9793,13 +9793,13 @@ where impl<'a, S> RecordViewDetailBuilder<'a, S> where S: record_view_detail_state::State, - S::Uri: record_view_detail_state::IsSet, - S::Cid: record_view_detail_state::IsSet, S::Value: record_view_detail_state::IsSet, - S::Blobs: record_view_detail_state::IsSet, + S::Uri: record_view_detail_state::IsSet, S::IndexedAt: record_view_detail_state::IsSet, + S::Blobs: record_view_detail_state::IsSet, S::Moderation: record_view_detail_state::IsSet, S::Repo: record_view_detail_state::IsSet, + S::Cid: record_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordViewDetail<'a> { @@ -10100,83 +10100,83 @@ pub mod repo_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; + type IndexedAt; type Handle; + type Did; type RelatedRecords; - type IndexedAt; type Moderation; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; + type IndexedAt = Unset; type Handle = Unset; + type Did = Unset; type RelatedRecords = Unset; - type IndexedAt = Unset; type Moderation = 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 `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; type Handle = S::Handle; + type Did = S::Did; type RelatedRecords = S::RelatedRecords; - type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; } ///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 IndexedAt = S::IndexedAt; type Handle = Set; + type Did = S::Did; type RelatedRecords = S::RelatedRecords; + type Moderation = S::Moderation; + } + ///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; + type RelatedRecords = S::RelatedRecords; type Moderation = S::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 Did = S::Did; - type Handle = S::Handle; - type RelatedRecords = Set; type IndexedAt = S::IndexedAt; - 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 Did = S::Did; type Handle = S::Handle; - type RelatedRecords = S::RelatedRecords; - type IndexedAt = Set; + type Did = S::Did; + type RelatedRecords = Set; type Moderation = S::Moderation; } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData S>); impl sealed::Sealed for SetModeration {} impl State for SetModeration { - type Did = S::Did; + type IndexedAt = S::IndexedAt; type Handle = S::Handle; + type Did = S::Did; type RelatedRecords = S::RelatedRecords; - type IndexedAt = S::IndexedAt; type Moderation = 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 `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did` field + pub struct did(()); ///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(()); } @@ -10434,10 +10434,10 @@ impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> { impl<'a, S> RepoViewBuilder<'a, S> where S: repo_view_state::State, - S::Did: repo_view_state::IsSet, + S::IndexedAt: repo_view_state::IsSet, S::Handle: repo_view_state::IsSet, + S::Did: repo_view_state::IsSet, S::RelatedRecords: repo_view_state::IsSet, - S::IndexedAt: repo_view_state::IsSet, S::Moderation: repo_view_state::IsSet, { /// Build the final struct @@ -10561,9 +10561,9 @@ pub mod repo_view_detail_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; - type Handle; type RelatedRecords; type IndexedAt; + type Handle; type Moderation; } /// Empty state - all required fields are unset @@ -10571,9 +10571,9 @@ pub mod repo_view_detail_state { impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; - type Handle = Unset; type RelatedRecords = Unset; type IndexedAt = Unset; + type Handle = Unset; type Moderation = Unset; } ///State transition - sets the `did` field to Set @@ -10581,19 +10581,9 @@ pub mod repo_view_detail_state { impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; - type Handle = S::Handle; - type RelatedRecords = S::RelatedRecords; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - } - ///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 RelatedRecords = S::RelatedRecords; type IndexedAt = S::IndexedAt; + type Handle = S::Handle; type Moderation = S::Moderation; } ///State transition - sets the `related_records` field to Set @@ -10601,9 +10591,9 @@ pub mod repo_view_detail_state { impl sealed::Sealed for SetRelatedRecords {} impl State for SetRelatedRecords { type Did = S::Did; - type Handle = S::Handle; type RelatedRecords = Set; type IndexedAt = S::IndexedAt; + type Handle = S::Handle; type Moderation = S::Moderation; } ///State transition - sets the `indexed_at` field to Set @@ -10611,9 +10601,19 @@ pub mod repo_view_detail_state { impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Did = S::Did; - type Handle = S::Handle; type RelatedRecords = S::RelatedRecords; type IndexedAt = Set; + type Handle = S::Handle; + type Moderation = S::Moderation; + } + ///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 RelatedRecords = S::RelatedRecords; + type IndexedAt = S::IndexedAt; + type Handle = Set; type Moderation = S::Moderation; } ///State transition - sets the `moderation` field to Set @@ -10621,9 +10621,9 @@ pub mod repo_view_detail_state { impl sealed::Sealed for SetModeration {} impl State for SetModeration { type Did = S::Did; - type Handle = S::Handle; type RelatedRecords = S::RelatedRecords; type IndexedAt = S::IndexedAt; + type Handle = S::Handle; type Moderation = Set; } /// Marker types for field names @@ -10631,12 +10631,12 @@ pub mod repo_view_detail_state { 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 `related_records` field pub struct related_records(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `handle` field + pub struct handle(()); ///Marker type for the `moderation` field pub struct moderation(()); } @@ -10958,9 +10958,9 @@ impl<'a, S> RepoViewDetailBuilder<'a, S> where S: repo_view_detail_state::State, S::Did: repo_view_detail_state::IsSet, - S::Handle: repo_view_detail_state::IsSet, S::RelatedRecords: repo_view_detail_state::IsSet, S::IndexedAt: repo_view_detail_state::IsSet, + S::Handle: repo_view_detail_state::IsSet, S::Moderation: repo_view_detail_state::IsSet, { /// Build the final struct @@ -11208,177 +11208,177 @@ pub mod reporter_stats_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type AccountReportCount; type RecordReportCount; type ReportedAccountCount; - type ReportedRecordCount; - type TakendownAccountCount; - type TakendownRecordCount; type LabeledAccountCount; + type TakendownAccountCount; type LabeledRecordCount; + type Did; + type TakendownRecordCount; + type ReportedRecordCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type AccountReportCount = Unset; type RecordReportCount = Unset; type ReportedAccountCount = Unset; - type ReportedRecordCount = Unset; - type TakendownAccountCount = Unset; - type TakendownRecordCount = Unset; type LabeledAccountCount = Unset; + type TakendownAccountCount = Unset; type LabeledRecordCount = 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 AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; - type ReportedAccountCount = S::ReportedAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; - type LabeledRecordCount = S::LabeledRecordCount; + type Did = Unset; + type TakendownRecordCount = Unset; + type ReportedRecordCount = Unset; } ///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 Did = S::Did; type AccountReportCount = Set; type RecordReportCount = S::RecordReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; type LabeledAccountCount = S::LabeledAccountCount; + type TakendownAccountCount = S::TakendownAccountCount; type LabeledRecordCount = S::LabeledRecordCount; + type Did = S::Did; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; } ///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 Did = S::Did; type AccountReportCount = S::AccountReportCount; type RecordReportCount = Set; type ReportedAccountCount = S::ReportedAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; type LabeledAccountCount = S::LabeledAccountCount; + type TakendownAccountCount = S::TakendownAccountCount; type LabeledRecordCount = S::LabeledRecordCount; + type Did = S::Did; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; } ///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 Did = S::Did; type AccountReportCount = S::AccountReportCount; type RecordReportCount = S::RecordReportCount; type ReportedAccountCount = Set; - type ReportedRecordCount = S::ReportedRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; type LabeledAccountCount = S::LabeledAccountCount; + type TakendownAccountCount = S::TakendownAccountCount; type LabeledRecordCount = S::LabeledRecordCount; - } - ///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 Did = S::Did; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; + } + ///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 AccountReportCount = S::AccountReportCount; type RecordReportCount = S::RecordReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type ReportedRecordCount = Set; + type LabeledAccountCount = Set; type TakendownAccountCount = S::TakendownAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; type LabeledRecordCount = S::LabeledRecordCount; + type Did = S::Did; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; } ///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 Did = S::Did; type AccountReportCount = S::AccountReportCount; type RecordReportCount = S::RecordReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; - type TakendownAccountCount = Set; - type TakendownRecordCount = S::TakendownRecordCount; type LabeledAccountCount = S::LabeledAccountCount; + type TakendownAccountCount = Set; type LabeledRecordCount = S::LabeledRecordCount; - } - ///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 Did = S::Did; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; + } + ///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 AccountReportCount = S::AccountReportCount; type RecordReportCount = S::RecordReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; type TakendownAccountCount = S::TakendownAccountCount; - type TakendownRecordCount = Set; + type LabeledRecordCount = Set; + type Did = S::Did; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type AccountReportCount = S::AccountReportCount; + type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; type LabeledAccountCount = S::LabeledAccountCount; + type TakendownAccountCount = S::TakendownAccountCount; type LabeledRecordCount = S::LabeledRecordCount; + type Did = Set; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; } - ///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 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 AccountReportCount = S::AccountReportCount; type RecordReportCount = S::RecordReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; type TakendownAccountCount = S::TakendownAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; - type LabeledAccountCount = Set; type LabeledRecordCount = S::LabeledRecordCount; - } - ///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 Did = S::Did; + type TakendownRecordCount = Set; + type ReportedRecordCount = S::ReportedRecordCount; + } + ///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 AccountReportCount = S::AccountReportCount; type RecordReportCount = S::RecordReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type ReportedRecordCount = S::ReportedRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; type TakendownAccountCount = S::TakendownAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + type Did = S::Did; type TakendownRecordCount = S::TakendownRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; - type LabeledRecordCount = Set; + type ReportedRecordCount = 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 `account_report_count` field pub struct account_report_count(()); ///Marker type for the `record_report_count` field pub struct record_report_count(()); ///Marker type for the `reported_account_count` field pub struct reported_account_count(()); - ///Marker type for the `reported_record_count` field - pub struct reported_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 `labeled_account_count` field pub struct labeled_account_count(()); + ///Marker type for the `takendown_account_count` field + pub struct takendown_account_count(()); ///Marker type for the `labeled_record_count` field pub struct labeled_record_count(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `takendown_record_count` field + pub struct takendown_record_count(()); + ///Marker type for the `reported_record_count` field + pub struct reported_record_count(()); } } @@ -11601,15 +11601,15 @@ where impl<'a, S> ReporterStatsBuilder<'a, S> where S: reporter_stats_state::State, - S::Did: reporter_stats_state::IsSet, S::AccountReportCount: reporter_stats_state::IsSet, S::RecordReportCount: reporter_stats_state::IsSet, S::ReportedAccountCount: reporter_stats_state::IsSet, - S::ReportedRecordCount: reporter_stats_state::IsSet, - S::TakendownAccountCount: reporter_stats_state::IsSet, - S::TakendownRecordCount: reporter_stats_state::IsSet, S::LabeledAccountCount: reporter_stats_state::IsSet, + S::TakendownAccountCount: reporter_stats_state::IsSet, S::LabeledRecordCount: reporter_stats_state::IsSet, + S::Did: reporter_stats_state::IsSet, + S::TakendownRecordCount: reporter_stats_state::IsSet, + S::ReportedRecordCount: reporter_stats_state::IsSet, { /// Build the final struct pub fn build(self) -> ReporterStats<'a> { @@ -11888,104 +11888,104 @@ pub mod scheduled_action_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Id; - type Action; - type Did; + type Status; type CreatedBy; + type Action; type CreatedAt; - type Status; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Id = Unset; - type Action = Unset; - type Did = Unset; + type Status = Unset; type CreatedBy = Unset; + type Action = Unset; type CreatedAt = Unset; - type Status = Unset; + type Did = 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 Action = S::Action; - type Did = S::Did; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; type Status = S::Status; - } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Id = S::Id; - type Action = Set; - type Did = S::Did; type CreatedBy = S::CreatedBy; + type Action = S::Action; type CreatedAt = S::CreatedAt; - type Status = S::Status; + 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 { + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { type Id = S::Id; - type Action = S::Action; - type Did = Set; + type Status = Set; type CreatedBy = S::CreatedBy; + type Action = S::Action; type CreatedAt = S::CreatedAt; - type Status = S::Status; + type Did = S::Did; } ///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 Action = S::Action; - type Did = S::Did; + type Status = S::Status; type CreatedBy = Set; + type Action = S::Action; type CreatedAt = S::CreatedAt; + type Did = S::Did; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData S>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { + type Id = S::Id; type Status = S::Status; + type CreatedBy = S::CreatedBy; + type Action = Set; + type CreatedAt = S::CreatedAt; + type Did = S::Did; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Id = S::Id; - type Action = S::Action; - type Did = S::Did; + type Status = S::Status; type CreatedBy = S::CreatedBy; + type Action = S::Action; type CreatedAt = Set; - type Status = S::Status; + type Did = S::Did; } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { type Id = S::Id; - type Action = S::Action; - type Did = S::Did; + type Status = S::Status; type CreatedBy = S::CreatedBy; + type Action = S::Action; type CreatedAt = S::CreatedAt; - type Status = Set; + type Did = 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 `action` field - pub struct action(()); - ///Marker type for the `did` field - pub struct did(()); + ///Marker type for the `status` field + pub struct status(()); ///Marker type for the `created_by` field pub struct created_by(()); + ///Marker type for the `action` field + pub struct action(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `status` field - pub struct status(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -12323,11 +12323,11 @@ impl<'a, S> ScheduledActionViewBuilder<'a, S> where S: scheduled_action_view_state::State, S::Id: scheduled_action_view_state::IsSet, - S::Action: scheduled_action_view_state::IsSet, - S::Did: scheduled_action_view_state::IsSet, + S::Status: scheduled_action_view_state::IsSet, S::CreatedBy: scheduled_action_view_state::IsSet, + S::Action: scheduled_action_view_state::IsSet, S::CreatedAt: scheduled_action_view_state::IsSet, - S::Status: scheduled_action_view_state::IsSet, + S::Did: scheduled_action_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ScheduledActionView<'a> { @@ -12617,85 +12617,85 @@ pub mod subject_status_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; - type Subject; - type CreatedAt; type UpdatedAt; type ReviewState; + type Id; + type CreatedAt; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type Subject = Unset; - type CreatedAt = Unset; type UpdatedAt = Unset; type ReviewState = Unset; + type Id = Unset; + type CreatedAt = Unset; + type Subject = 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 ReviewState = S::ReviewState; + type Id = S::Id; + type CreatedAt = S::CreatedAt; + 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 UpdatedAt = S::UpdatedAt; + type ReviewState = Set; + type Id = S::Id; + type CreatedAt = S::CreatedAt; + 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 Id = Set; - type Subject = S::Subject; - type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; type ReviewState = S::ReviewState; - } - ///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 Subject = Set; + type Id = Set; type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; - type ReviewState = S::ReviewState; + 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 Id = S::Id; - type Subject = S::Subject; - type CreatedAt = Set; type UpdatedAt = S::UpdatedAt; type ReviewState = S::ReviewState; - } - ///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 = Set; type Subject = S::Subject; - type CreatedAt = S::CreatedAt; - type UpdatedAt = Set; - type ReviewState = S::ReviewState; } - ///State transition - sets the `review_state` field to Set - pub struct SetReviewState(PhantomData S>); - impl sealed::Sealed for SetReviewState {} - impl State for SetReviewState { + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type UpdatedAt = S::UpdatedAt; + type ReviewState = S::ReviewState; type Id = S::Id; - type Subject = S::Subject; type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; - type ReviewState = Set; + type Subject = 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` field - pub struct subject(()); - ///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 `review_state` field pub struct review_state(()); + ///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(()); } } @@ -13230,11 +13230,11 @@ where impl<'a, S> SubjectStatusViewBuilder<'a, S> where S: subject_status_view_state::State, - S::Id: subject_status_view_state::IsSet, - S::Subject: subject_status_view_state::IsSet, - S::CreatedAt: subject_status_view_state::IsSet, S::UpdatedAt: subject_status_view_state::IsSet, S::ReviewState: subject_status_view_state::IsSet, + S::Id: subject_status_view_state::IsSet, + S::CreatedAt: subject_status_view_state::IsSet, + S::Subject: subject_status_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SubjectStatusView<'a> { @@ -13746,49 +13746,49 @@ pub mod video_details_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Width; type Height; + type Width; type Length; } /// 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; + type Width = Unset; type Length = 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 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 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 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 Width = S::Width; type Height = S::Height; + type Width = S::Width; type Length = 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(()); ///Marker type for the `length` field pub struct length(()); } @@ -13883,8 +13883,8 @@ where impl<'a, S> VideoDetailsBuilder<'a, S> where S: video_details_state::State, - S::Width: video_details_state::IsSet, S::Height: video_details_state::IsSet, + S::Width: video_details_state::IsSet, S::Length: video_details_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs b/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs index 43a4388..9017601 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs @@ -37,37 +37,37 @@ pub mod cancellation_results_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Succeeded; type Failed; + type Succeeded; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Succeeded = Unset; type Failed = Unset; - } - ///State transition - sets the `succeeded` field to Set - pub struct SetSucceeded(PhantomData S>); - impl sealed::Sealed for SetSucceeded {} - impl State for SetSucceeded { - type Succeeded = Set; - type Failed = S::Failed; + type Succeeded = Unset; } ///State transition - sets the `failed` field to Set pub struct SetFailed(PhantomData S>); impl sealed::Sealed for SetFailed {} impl State for SetFailed { - type Succeeded = S::Succeeded; type Failed = Set; + type Succeeded = S::Succeeded; + } + ///State transition - sets the `succeeded` field to Set + pub struct SetSucceeded(PhantomData S>); + impl sealed::Sealed for SetSucceeded {} + impl State for SetSucceeded { + type Failed = S::Failed; + type Succeeded = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `succeeded` field - pub struct succeeded(()); ///Marker type for the `failed` field pub struct failed(()); + ///Marker type for the `succeeded` field + pub struct succeeded(()); } } @@ -152,8 +152,8 @@ where impl<'a, S> CancellationResultsBuilder<'a, S> where S: cancellation_results_state::State, - S::Succeeded: cancellation_results_state::IsSet, S::Failed: cancellation_results_state::IsSet, + S::Succeeded: cancellation_results_state::IsSet, { /// Build the final struct pub fn build(self) -> CancellationResults<'a> { diff --git a/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs b/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs index 4e31137..47944b9 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs @@ -47,51 +47,51 @@ pub mod emit_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Event; - type Subject; type CreatedBy; + type Subject; + type Event; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Event = Unset; - type Subject = Unset; type CreatedBy = Unset; + type Subject = Unset; + type Event = Unset; } - ///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; + ///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 Subject = S::Subject; - type CreatedBy = S::CreatedBy; + 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 Event = S::Event; - type Subject = 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 Subject = Set; type Event = S::Event; + } + ///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 Subject = S::Subject; - type CreatedBy = Set; + type Event = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `event` field - pub struct event(()); - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `created_by` field pub struct created_by(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `event` field + pub struct event(()); } } @@ -244,9 +244,9 @@ impl<'a, S: emit_event_state::State> EmitEventBuilder<'a, S> { impl<'a, S> EmitEventBuilder<'a, S> where S: emit_event_state::State, - S::Event: emit_event_state::IsSet, - S::Subject: emit_event_state::IsSet, S::CreatedBy: emit_event_state::IsSet, + S::Subject: emit_event_state::IsSet, + S::Event: emit_event_state::IsSet, { /// Build the final struct pub fn build(self) -> EmitEvent<'a> { 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 919c99c..3d0ed8f 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 @@ -575,51 +575,51 @@ pub mod timeline_item_summary_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Count; type EventSubjectType; type EventType; - 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 EventSubjectType = Unset; type EventType = Unset; - type Count = 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 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; - type Count = S::Count; } ///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 EventType = 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 EventSubjectType = S::EventSubjectType; - type EventType = S::EventType; - type Count = Set; + type EventType = 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 `event_subject_type` field pub struct event_subject_type(()); ///Marker type for the `event_type` field pub struct event_type(()); - ///Marker type for the `count` field - pub struct count(()); } } @@ -715,9 +715,9 @@ where impl<'a, S> TimelineItemSummaryBuilder<'a, S> where S: timeline_item_summary_state::State, + S::Count: timeline_item_summary_state::IsSet, S::EventSubjectType: timeline_item_summary_state::IsSet, S::EventType: timeline_item_summary_state::IsSet, - S::Count: timeline_item_summary_state::IsSet, { /// Build the final struct pub fn build(self) -> TimelineItemSummary<'a> { 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 4370e3b..0d6f9e2 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs @@ -762,66 +762,66 @@ pub mod schedule_action_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Action; - type Subjects; type CreatedBy; type Scheduling; + type Subjects; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Action = Unset; - type Subjects = Unset; type CreatedBy = Unset; type Scheduling = Unset; + type Subjects = Unset; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { type Action = Set; - type Subjects = S::Subjects; - type CreatedBy = S::CreatedBy; - type Scheduling = S::Scheduling; - } - ///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 Subjects = Set; type CreatedBy = S::CreatedBy; type Scheduling = S::Scheduling; + type Subjects = S::Subjects; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { type Action = S::Action; - type Subjects = S::Subjects; type CreatedBy = Set; type Scheduling = S::Scheduling; + type Subjects = S::Subjects; } ///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; + 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 CreatedBy = S::CreatedBy; + type Scheduling = S::Scheduling; + type Subjects = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `action` field pub struct action(()); - ///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(()); + ///Marker type for the `subjects` field + pub struct subjects(()); } } @@ -961,9 +961,9 @@ impl<'a, S> ScheduleActionBuilder<'a, S> where S: schedule_action_state::State, S::Action: schedule_action_state::IsSet, - S::Subjects: schedule_action_state::IsSet, S::CreatedBy: schedule_action_state::IsSet, S::Scheduling: schedule_action_state::IsSet, + S::Subjects: 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 eeae0ca..86c00f4 100644 --- a/crates/weaver-api/src/tools_ozone/safelink.rs +++ b/crates/weaver-api/src/tools_ozone/safelink.rs @@ -138,151 +138,151 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; type EventType; + type Id; type Url; - type Pattern; - type Action; type Reason; + type Pattern; type CreatedBy; type CreatedAt; + type Action; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; type EventType = Unset; + type Id = Unset; type Url = Unset; - type Pattern = Unset; - type Action = Unset; type Reason = Unset; + type Pattern = Unset; type CreatedBy = Unset; type CreatedAt = 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 EventType = S::EventType; - type Url = S::Url; - type Pattern = S::Pattern; - type Action = S::Action; - type Reason = S::Reason; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; + type Action = Unset; } ///State transition - sets the `event_type` field to Set pub struct SetEventType(PhantomData S>); impl sealed::Sealed for SetEventType {} impl State for SetEventType { - type Id = S::Id; type EventType = Set; + type Id = S::Id; type Url = S::Url; + type Reason = S::Reason; type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; type Action = S::Action; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type EventType = S::EventType; + type Id = Set; + type Url = S::Url; type Reason = S::Reason; + type Pattern = S::Pattern; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; + type Action = S::Action; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { - type Id = S::Id; type EventType = S::EventType; + type Id = S::Id; type Url = Set; + type Reason = S::Reason; type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; type Action = S::Action; - 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 EventType = S::EventType; + type Id = S::Id; + type Url = S::Url; + type Reason = Set; + type Pattern = S::Pattern; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; + 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 Id = S::Id; type EventType = S::EventType; - type Url = S::Url; - type Pattern = Set; - type Action = S::Action; - type Reason = S::Reason; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { type Id = S::Id; - type EventType = S::EventType; type Url = S::Url; - type Pattern = S::Pattern; - type Action = Set; type Reason = S::Reason; + type Pattern = Set; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Id = S::Id; - type EventType = S::EventType; - type Url = S::Url; - type Pattern = S::Pattern; type Action = S::Action; - type Reason = 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 Id = S::Id; type EventType = S::EventType; + type Id = S::Id; type Url = S::Url; - type Pattern = S::Pattern; - type Action = S::Action; type Reason = S::Reason; + type Pattern = S::Pattern; type CreatedBy = Set; type CreatedAt = S::CreatedAt; + 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 Id = S::Id; type EventType = S::EventType; + type Id = S::Id; type Url = S::Url; + type Reason = S::Reason; type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; + type CreatedAt = 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 EventType = S::EventType; + type Id = S::Id; + type Url = S::Url; type Reason = S::Reason; + type Pattern = S::Pattern; type CreatedBy = S::CreatedBy; - type CreatedAt = Set; + type CreatedAt = S::CreatedAt; + type Action = 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 `event_type` field pub struct event_type(()); + ///Marker type for the `id` field + pub struct id(()); ///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(()); ///Marker type for the `reason` field pub struct reason(()); + ///Marker type for the `pattern` field + pub struct pattern(()); ///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 `action` field + pub struct action(()); } } @@ -502,14 +502,14 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, - S::Id: event_state::IsSet, S::EventType: event_state::IsSet, + S::Id: event_state::IsSet, S::Url: event_state::IsSet, - S::Pattern: event_state::IsSet, - S::Action: event_state::IsSet, S::Reason: event_state::IsSet, + S::Pattern: event_state::IsSet, S::CreatedBy: event_state::IsSet, S::CreatedAt: event_state::IsSet, + S::Action: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { @@ -1233,127 +1233,127 @@ pub mod url_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Url; - type Pattern; - type Action; type Reason; + type Url; type CreatedBy; type CreatedAt; + type Action; type UpdatedAt; + type Pattern; } /// 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; - type Action = Unset; type Reason = Unset; + type Url = Unset; type CreatedBy = Unset; type CreatedAt = Unset; + type Action = Unset; type UpdatedAt = 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 Action = S::Action; - type Reason = S::Reason; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - 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 { + ///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 = Set; - type Action = S::Action; - type Reason = S::Reason; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; + type Action = S::Action; 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 Url = S::Url; type Pattern = S::Pattern; - type Action = 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 CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Url = S::Url; - type Pattern = S::Pattern; type Action = S::Action; - type Reason = Set; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; + type Pattern = S::Pattern; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type Url = S::Url; - type Pattern = S::Pattern; - type Action = S::Action; type Reason = S::Reason; + type Url = S::Url; type CreatedBy = Set; type CreatedAt = S::CreatedAt; + type Action = S::Action; type UpdatedAt = S::UpdatedAt; + type Pattern = S::Pattern; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { + type Reason = S::Reason; type Url = S::Url; - type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; + type CreatedAt = Set; type Action = S::Action; + type UpdatedAt = S::UpdatedAt; + 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 Reason = S::Reason; + type Url = S::Url; type CreatedBy = S::CreatedBy; - type CreatedAt = Set; + type CreatedAt = S::CreatedAt; + type Action = Set; type UpdatedAt = S::UpdatedAt; + type Pattern = S::Pattern; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { + type Reason = S::Reason; type Url = S::Url; - type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; type Action = S::Action; + type UpdatedAt = 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 Reason = S::Reason; + type Url = S::Url; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; - type UpdatedAt = Set; + type Action = S::Action; + type UpdatedAt = S::UpdatedAt; + type Pattern = 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 `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 `created_by` field pub struct created_by(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `action` field + pub struct action(()); ///Marker type for the `updated_at` field pub struct updated_at(()); + ///Marker type for the `pattern` field + pub struct pattern(()); } } @@ -1543,13 +1543,13 @@ where impl<'a, S> UrlRuleBuilder<'a, S> where S: url_rule_state::State, - S::Url: url_rule_state::IsSet, - S::Pattern: url_rule_state::IsSet, - S::Action: url_rule_state::IsSet, S::Reason: url_rule_state::IsSet, + S::Url: url_rule_state::IsSet, S::CreatedBy: url_rule_state::IsSet, S::CreatedAt: url_rule_state::IsSet, + S::Action: url_rule_state::IsSet, S::UpdatedAt: url_rule_state::IsSet, + S::Pattern: 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 168971d..40e4f54 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs @@ -48,8 +48,8 @@ pub mod add_rule_state { pub trait State: sealed::Sealed { type Url; type Pattern; - type Action; type Reason; + type Action; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -57,8 +57,8 @@ pub mod add_rule_state { impl State for Empty { type Url = Unset; type Pattern = Unset; - type Action = Unset; type Reason = Unset; + type Action = Unset; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); @@ -66,8 +66,8 @@ pub mod add_rule_state { impl State for SetUrl { type Url = Set; type Pattern = S::Pattern; - type Action = S::Action; type Reason = S::Reason; + type Action = S::Action; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); @@ -75,17 +75,8 @@ pub mod add_rule_state { impl State for SetPattern { type Url = S::Url; type Pattern = Set; - type Action = S::Action; - type Reason = S::Reason; - } - ///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 Pattern = S::Pattern; - type Action = Set; type Reason = S::Reason; + type Action = S::Action; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); @@ -93,8 +84,17 @@ pub mod add_rule_state { impl State for SetReason { type Url = S::Url; type Pattern = S::Pattern; - type Action = S::Action; type Reason = 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 Url = S::Url; + type Pattern = S::Pattern; + type Reason = S::Reason; + type Action = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -103,10 +103,10 @@ pub mod add_rule_state { pub struct url(()); ///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 `action` field + pub struct action(()); } } @@ -258,8 +258,8 @@ where S: add_rule_state::State, S::Url: add_rule_state::IsSet, S::Pattern: add_rule_state::IsSet, - S::Action: add_rule_state::IsSet, S::Reason: 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 2fc4176..c7be4c7 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 fd668e2..bb789d4 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs @@ -48,8 +48,8 @@ pub mod update_rule_state { pub trait State: sealed::Sealed { type Url; type Pattern; - type Action; type Reason; + type Action; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -57,8 +57,8 @@ pub mod update_rule_state { impl State for Empty { type Url = Unset; type Pattern = Unset; - type Action = Unset; type Reason = Unset; + type Action = Unset; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); @@ -66,8 +66,8 @@ pub mod update_rule_state { impl State for SetUrl { type Url = Set; type Pattern = S::Pattern; - type Action = S::Action; type Reason = S::Reason; + type Action = S::Action; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); @@ -75,17 +75,8 @@ pub mod update_rule_state { impl State for SetPattern { type Url = S::Url; type Pattern = Set; - type Action = S::Action; - type Reason = S::Reason; - } - ///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 Pattern = S::Pattern; - type Action = Set; type Reason = S::Reason; + type Action = S::Action; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); @@ -93,8 +84,17 @@ pub mod update_rule_state { impl State for SetReason { type Url = S::Url; type Pattern = S::Pattern; - type Action = S::Action; type Reason = 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 Url = S::Url; + type Pattern = S::Pattern; + type Reason = S::Reason; + type Action = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -103,10 +103,10 @@ pub mod update_rule_state { pub struct url(()); ///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 `action` field + pub struct action(()); } } @@ -258,8 +258,8 @@ where S: update_rule_state::State, S::Url: update_rule_state::IsSet, S::Pattern: update_rule_state::IsSet, - S::Action: update_rule_state::IsSet, S::Reason: update_rule_state::IsSet, + S::Action: 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 d282a64..e29b9bc 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 CreatedAt; type UpdatedAt; + type Name; + type CreatedAt; } /// 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 CreatedAt = Unset; type UpdatedAt = 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 SetSize = S::SetSize; - type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; + type Name = Unset; + type CreatedAt = Unset; } ///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; type SetSize = Set; - type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; - } - ///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 CreatedAt = Set; - type UpdatedAt = S::UpdatedAt; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { + type SetSize = S::SetSize; + type UpdatedAt = Set; type Name = S::Name; + type CreatedAt = S::CreatedAt; + } + ///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 Name = Set; type CreatedAt = S::CreatedAt; - type UpdatedAt = 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 SetSize = S::SetSize; + type UpdatedAt = S::UpdatedAt; + type Name = S::Name; + 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 `set_size` field pub struct set_size(()); - ///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 `name` field + pub struct name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -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::CreatedAt: set_view_state::IsSet, S::UpdatedAt: set_view_state::IsSet, + S::Name: set_view_state::IsSet, + S::CreatedAt: 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 06c548b..426fd0d 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 Name; type Values; + 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 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 Name = Set; - type Values = S::Values; + 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 Name = S::Name; type Values = 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 Values = S::Values; + 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 `values` field pub struct values(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -138,8 +138,8 @@ where impl<'a, S> AddValuesBuilder<'a, S> where S: add_values_state::State, - S::Name: add_values_state::IsSet, S::Values: add_values_state::IsSet, + S::Name: 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 87b1eed..d6cf5a6 100644 --- a/crates/weaver-api/src/tools_ozone/setting.rs +++ b/crates/weaver-api/src/tools_ozone/setting.rs @@ -55,105 +55,105 @@ pub mod defs_option_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Key; - type Value; type Did; + type Value; type Scope; type CreatedBy; type LastUpdatedBy; + 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 Value = Unset; type Did = Unset; + type Value = Unset; type Scope = Unset; type CreatedBy = Unset; type LastUpdatedBy = 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; + ///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 Value = S::Value; - type Did = S::Did; type Scope = S::Scope; type CreatedBy = S::CreatedBy; type LastUpdatedBy = S::LastUpdatedBy; + 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 Key = S::Key; - type Value = Set; type Did = S::Did; + type Value = Set; type Scope = S::Scope; type CreatedBy = S::CreatedBy; type LastUpdatedBy = S::LastUpdatedBy; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { type Key = S::Key; - type Value = S::Value; - type Did = Set; - type Scope = S::Scope; - type CreatedBy = S::CreatedBy; - type LastUpdatedBy = S::LastUpdatedBy; } ///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 Value = S::Value; type Did = S::Did; + type Value = S::Value; type Scope = Set; type CreatedBy = S::CreatedBy; type LastUpdatedBy = S::LastUpdatedBy; + type Key = S::Key; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type Key = S::Key; - type Value = S::Value; type Did = S::Did; + type Value = S::Value; type Scope = S::Scope; type CreatedBy = Set; type LastUpdatedBy = S::LastUpdatedBy; + type Key = S::Key; } ///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 Key = S::Key; - type Value = S::Value; type Did = S::Did; + type Value = S::Value; type Scope = S::Scope; type CreatedBy = S::CreatedBy; type LastUpdatedBy = 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 Did = S::Did; + type Value = S::Value; + type Scope = S::Scope; + type CreatedBy = S::CreatedBy; + type LastUpdatedBy = S::LastUpdatedBy; + type Key = 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 `value` field - pub struct value(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `scope` field pub struct scope(()); ///Marker type for the `created_by` field pub struct created_by(()); ///Marker type for the `last_updated_by` field pub struct last_updated_by(()); + ///Marker type for the `key` field + pub struct key(()); } } @@ -397,12 +397,12 @@ where impl<'a, S> DefsOptionBuilder<'a, S> where S: defs_option_state::State, - S::Key: defs_option_state::IsSet, - S::Value: defs_option_state::IsSet, S::Did: defs_option_state::IsSet, + S::Value: defs_option_state::IsSet, S::Scope: defs_option_state::IsSet, S::CreatedBy: defs_option_state::IsSet, S::LastUpdatedBy: defs_option_state::IsSet, + S::Key: defs_option_state::IsSet, { /// Build the final struct pub fn build(self) -> DefsOption<'a> { 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 131b34c..ea2fbd5 100644 --- a/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs +++ b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs @@ -42,50 +42,50 @@ 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 Scope; } /// 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 Scope = 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 Scope = S::Scope; } ///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 Scope = S::Scope; type Value = 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 Key = S::Key; + type Value = S::Value; + type Scope = 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 `scope` field + pub struct scope(()); } } @@ -219,8 +219,8 @@ 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::Scope: upsert_option_state::IsSet, { /// Build the final struct pub fn build(self) -> UpsertOption<'a> { diff --git a/crates/weaver-api/src/tools_ozone/verification.rs b/crates/weaver-api/src/tools_ozone/verification.rs index c468a41..e577793 100644 --- a/crates/weaver-api/src/tools_ozone/verification.rs +++ b/crates/weaver-api/src/tools_ozone/verification.rs @@ -74,103 +74,103 @@ pub mod verification_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Issuer; - type Uri; type Subject; - type Handle; + type Uri; type DisplayName; + type Issuer; + type Handle; type CreatedAt; } /// 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 Subject = Unset; - type Handle = Unset; + type Uri = Unset; type DisplayName = Unset; + type Issuer = Unset; + type Handle = 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; + ///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 = S::Subject; - type Handle = S::Handle; type DisplayName = S::DisplayName; + type Issuer = S::Issuer; + type Handle = S::Handle; 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 Subject = S::Subject; - type Handle = S::Handle; + type Uri = Set; type DisplayName = S::DisplayName; + type Issuer = S::Issuer; + type Handle = S::Handle; 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 Issuer = S::Issuer; + ///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 Uri = S::Uri; - type Subject = Set; + type DisplayName = Set; + type Issuer = S::Issuer; type Handle = S::Handle; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `issuer` field to Set + pub struct SetIssuer(PhantomData S>); + impl sealed::Sealed for SetIssuer {} + impl State for SetIssuer { + type Subject = S::Subject; + type Uri = S::Uri; type DisplayName = S::DisplayName; + type Issuer = Set; + type Handle = S::Handle; type CreatedAt = S::CreatedAt; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Issuer = S::Issuer; - type Uri = S::Uri; type Subject = S::Subject; - type Handle = Set; + type Uri = S::Uri; type DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; - } - ///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 Subject = S::Subject; - type Handle = S::Handle; - type DisplayName = Set; + type Handle = 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 Issuer = S::Issuer; - type Uri = S::Uri; type Subject = S::Subject; - type Handle = S::Handle; + type Uri = S::Uri; type DisplayName = S::DisplayName; + type Issuer = S::Issuer; + type Handle = S::Handle; type CreatedAt = 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 `subject` field pub struct subject(()); - ///Marker type for the `handle` field - pub struct handle(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `display_name` field pub struct display_name(()); + ///Marker type for the `issuer` field + pub struct issuer(()); + ///Marker type for the `handle` field + pub struct handle(()); ///Marker type for the `created_at` field pub struct created_at(()); } @@ -479,11 +479,11 @@ 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::Subject: verification_view_state::IsSet, - S::Handle: verification_view_state::IsSet, + S::Uri: verification_view_state::IsSet, S::DisplayName: verification_view_state::IsSet, + S::Issuer: verification_view_state::IsSet, + S::Handle: verification_view_state::IsSet, S::CreatedAt: verification_view_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs b/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs index 107233c..85f9888 100644 --- a/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs +++ b/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs @@ -236,37 +236,37 @@ pub mod revoke_error_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Error; + 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 Error = 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 Error = S::Error; + type Uri = Unset; } ///State transition - sets the `error` field to Set pub struct SetError(PhantomData S>); impl sealed::Sealed for SetError {} impl State for SetError { - type Uri = S::Uri; type Error = 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 Error = S::Error; + 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 `error` field pub struct error(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -339,8 +339,8 @@ where impl<'a, S> RevokeErrorBuilder<'a, S> where S: revoke_error_state::State, - S::Uri: revoke_error_state::IsSet, S::Error: revoke_error_state::IsSet, + S::Uri: revoke_error_state::IsSet, { /// Build the final struct pub fn build(self) -> RevokeError<'a> { diff --git a/crates/weaver-app/Cargo.toml b/crates/weaver-app/Cargo.toml index 84e6f3f..e984fc2 100644 --- a/crates/weaver-app/Cargo.toml +++ b/crates/weaver-app/Cargo.toml @@ -55,6 +55,7 @@ markdown-weaver-escape = { workspace = true } web-time = "1.1" urlencoding = "2.1" tracing-subscriber = { version = "0.3", default-features = false, features = ["std", "registry"] } +dioxus-sdk = { version = "0.7", features = ["time"] } # OG image generation (server-only) resvg = { version = "0.44", optional = true } @@ -82,6 +83,7 @@ web-sys = { version = "0.3", features = ["ServiceWorkerContainer", "ServiceWorke js-sys = "0.3" gloo-storage = "0.3" gloo-timers = "0.3" + lol_alloc = "0.4.1" [build-dependencies] diff --git a/crates/weaver-app/assets/styling/editor.css b/crates/weaver-app/assets/styling/editor.css index 281ccbf..2376bb8 100644 --- a/crates/weaver-app/assets/styling/editor.css +++ b/crates/weaver-app/assets/styling/editor.css @@ -727,6 +727,17 @@ li:has(.md-syntax-block:not(.hidden)) { color: var(--color-warning); } +/* Remote changes available - collaborator updates */ +.sync-status.remote-changes { + background: color-mix(in srgb, var(--color-primary) 20%, transparent); + color: var(--color-primary); + animation: pulse-subtle 2s ease-in-out infinite; +} + +.sync-status.remote-changes:hover { + animation: none; +} + /* Error state */ .sync-status.error { background: color-mix(in srgb, var(--color-error) 15%, transparent); @@ -745,6 +756,16 @@ li:has(.md-syntax-block:not(.hidden)) { opacity: 0.6; } +@keyframes pulse-subtle { + 0%, + 100% { + opacity: 1; + } + 50% { + opacity: 0.7; + } +} + /* ========================================================================== COLLABORATORS ========================================================================== */ @@ -764,10 +785,10 @@ li:has(.md-syntax-block:not(.hidden)) { .collab-avatar { width: 24px; height: 24px; - border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-muted); display: flex; + border-radius: 4px; align-items: center; justify-content: center; font-size: 11px; @@ -776,7 +797,14 @@ li:has(.md-syntax-block:not(.hidden)) { text-transform: uppercase; margin-left: -6px; position: relative; - transition: border-color 0.15s ease; + overflow: hidden; +} + +.collab-avatar-img { + width: 100%; + height: 100%; + + object-fit: cover; } .collab-avatar:first-child { @@ -791,7 +819,7 @@ li:has(.md-syntax-block:not(.hidden)) { .collab-avatar.collab-add { background: transparent; - border-style: dashed; + border: 1px solid var(--color-border); color: var(--color-muted); font-size: 14px; } diff --git a/crates/weaver-app/public/sw.js b/crates/weaver-app/public/sw.js index 879cfc7..c6c0160 100644 --- a/crates/weaver-app/public/sw.js +++ b/crates/weaver-app/public/sw.js @@ -23,14 +23,16 @@ self.addEventListener("activate", (event) => { Promise.all([ clients.claim(), // Clean up old cache versions - caches.keys().then((names) => - Promise.all( - names - .filter((name) => name.startsWith("weaver-blobs-") && name !== CACHE_NAME) - .map((name) => caches.delete(name)) - ) - ), - ]) + caches + .keys() + .then((names) => + Promise.all( + names + .filter((name) => name.startsWith("weaver-blobs-") && name !== CACHE_NAME) + .map((name) => caches.delete(name)), + ), + ), + ]), ); }); @@ -44,6 +46,15 @@ self.addEventListener("message", (event) => { urlMappings.set(key, url); } } + if (event.data.type === "register_rkey_mappings") { + const rkey = event.data.rkey; + const ident = event.data.ident; + // Store blob URL mappings + for (const [name, url] of Object.entries(event.data.blobs)) { + const key = `/image/${ident}/${rkey}/${name}`; + urlMappings.set(key, url); + } + } }); // Check if a path is an image request we should cache @@ -89,6 +100,14 @@ self.addEventListener("fetch", (event) => { return; } } + if (pathParts.length >= 4 && pathParts[0] === "image") { + const legacyKey = pathParts.join("/"); + const mapping = urlMappings.get(legacyKey); + if (mapping) { + event.respondWith(handleBlobRequest(mapping, cacheKey)); + return; + } + } // For new /image/... routes, cache the response from our server event.respondWith(handleImageRequest(event.request, cacheKey)); diff --git a/crates/weaver-app/src/components/collab/api.rs b/crates/weaver-app/src/components/collab/api.rs index 2f45614..35c2d2e 100644 --- a/crates/weaver-app/src/components/collab/api.rs +++ b/crates/weaver-app/src/components/collab/api.rs @@ -4,12 +4,14 @@ use crate::fetch::Fetcher; use jacquard::IntoStatic; use jacquard::prelude::*; use jacquard::types::collection::Collection; -use jacquard::types::string::{AtUri, Cid, Datetime, Did, Nsid}; +use jacquard::types::string::{AtUri, Cid, Datetime, Did, Nsid, RecordKey}; use jacquard::types::uri::Uri; use reqwest::Url; +use std::collections::HashSet; use weaver_api::com_atproto::repo::list_records::ListRecords; use weaver_api::com_atproto::repo::strong_ref::StrongRef; use weaver_api::sh_weaver::collab::{accept::Accept, invite::Invite}; +use weaver_api::sh_weaver::notebook::entry::Entry; use weaver_common::WeaverError; use weaver_common::constellation::GetBacklinksQuery; @@ -243,3 +245,81 @@ pub async fn fetch_received_invites(fetcher: &Fetcher) -> Result, +) -> Result>, WeaverError> { + let Some(rkey) = resource_uri.rkey() else { + return Ok(vec![]); + }; + + let constellation_url = Url::parse(CONSTELLATION_URL) + .map_err(|e| WeaverError::InvalidNotebook(format!("Invalid constellation URL: {}", e)))?; + + // Query for all invite records that reference entries with this rkey + // We search for invites where resource.uri contains the rkey + // The source pattern matches the JSON path in the invite record + let query = GetBacklinksQuery { + subject: Uri::At(resource_uri.clone().into_static()), + source: format!("{}:resource.uri", Invite::NSID).into(), + cursor: None, + did: vec![], + limit: 100, + }; + + let mut participants: HashSet> = HashSet::new(); + + // First try with the exact URI + if let Ok(response) = fetcher.client.xrpc(constellation_url.clone()).send(&query).await { + if let Ok(output) = response.into_output() { + for record_id in &output.records { + // The inviter (owner) is the DID that created the invite + participants.insert(record_id.did.clone().into_static()); + + // Now we need to fetch the invite to get the invitee + let uri_string = format!( + "at://{}/{}/{}", + record_id.did, + Invite::NSID, + record_id.rkey.as_ref() + ); + if let Ok(invite_uri) = AtUri::new(&uri_string) { + if let Ok(response) = fetcher.get_record::(&invite_uri).await { + if let Ok(record) = response.into_output() { + let invite = &record.value; + // Check if this invite was accepted + if check_invite_accepted(fetcher, &invite_uri.into_static()).await { + participants.insert(invite.invitee.clone().into_static()); + } + } + } + } + } + } + } + + // Also try querying with the owner's URI if we can determine it + // This handles the case where we're viewing from a collaborator's copy + let authority_did = match resource_uri.authority() { + jacquard::types::ident::AtIdentifier::Did(d) => Some(d.clone().into_static()), + _ => None, + }; + + if let Some(ref did) = authority_did { + participants.insert(did.clone()); + } + + // If no participants found via invites, return just the current entry's authority + if participants.is_empty() { + if let Some(did) = authority_did { + return Ok(vec![did]); + } + } + + Ok(participants.into_iter().collect()) +} diff --git a/crates/weaver-app/src/components/collab/avatars.rs b/crates/weaver-app/src/components/collab/avatars.rs index dfc4a78..237b3f5 100644 --- a/crates/weaver-app/src/components/collab/avatars.rs +++ b/crates/weaver-app/src/components/collab/avatars.rs @@ -1,11 +1,15 @@ //! Collaborator avatars display for the editor meta row. +use std::sync::Arc; + use crate::auth::AuthState; use crate::fetch::Fetcher; use dioxus::prelude::*; +use jacquard::types::ident::AtIdentifier; use jacquard::types::string::AtUri; +use weaver_api::sh_weaver::actor::{ProfileDataView, ProfileDataViewInner}; -use super::api::{fetch_sent_invites, SentInvite}; +use super::api::find_all_participants; use super::CollaboratorsPanel; /// Props for the CollaboratorAvatars component. @@ -21,6 +25,8 @@ pub struct CollaboratorAvatarsProps { } /// Shows collaborator avatars with a button to manage collaborators. +/// Displays all participants (collaborators with accepted invites) regardless of +/// whether you're the owner or a collaborator. #[component] pub fn CollaboratorAvatars(props: CollaboratorAvatarsProps) -> Element { let auth_state = use_context::>(); @@ -29,27 +35,33 @@ pub fn CollaboratorAvatars(props: CollaboratorAvatarsProps) -> Element { let resource_uri = props.resource_uri.clone(); - // Fetch collaborators for this resource + // Fetch all participants (owner + collaborators) with their profiles let collaborators = { let fetcher = fetcher.clone(); let resource_uri = resource_uri.clone(); use_resource(move || { let fetcher = fetcher.clone(); let resource_uri = resource_uri.clone(); - let _auth = auth_state.read().did.clone(); + let _auth = auth_state.read().did.clone(); // Reactivity trigger async move { - fetch_sent_invites(&fetcher) + let dids = find_all_participants(&fetcher, &resource_uri) .await - .ok() - .unwrap_or_default() - .into_iter() - .filter(|i| i.resource_uri == resource_uri && i.accepted) - .collect::>() + .unwrap_or_default(); + + // Fetch profile for each participant + let mut profiles = Vec::new(); + for did in dids { + let ident = AtIdentifier::Did(did); + if let Ok(profile) = fetcher.fetch_profile(&ident).await { + profiles.push(profile); + } + } + profiles } }) }; - let collabs: Vec = collaborators().unwrap_or_default(); + let collabs: Vec>> = collaborators().unwrap_or_default(); let collab_count = collabs.len(); rsx! { @@ -57,13 +69,46 @@ pub fn CollaboratorAvatars(props: CollaboratorAvatarsProps) -> Element { onclick: move |_| show_panel.set(true), // Show up to 3 avatar circles - for (i, collab) in collabs.iter().take(3).enumerate() { - div { - class: "collab-avatar", - style: "z-index: {3 - i}", - title: "{collab.invitee}", - // First letter of DID as placeholder - {collab.invitee.as_ref().chars().last().unwrap_or('?').to_string()} + for (i, profile) in collabs.iter().take(3).enumerate() { + { + let (avatar, display_name, handle) = match &profile.inner { + ProfileDataViewInner::ProfileView(p) => ( + p.avatar.as_ref(), + p.display_name.as_ref().map(|s| s.as_ref()), + p.handle.as_ref(), + ), + ProfileDataViewInner::ProfileViewDetailed(p) => ( + p.avatar.as_ref(), + p.display_name.as_ref().map(|s| s.as_ref()), + p.handle.as_ref(), + ), + ProfileDataViewInner::TangledProfileView(p) => ( + None, + None, + p.handle.as_ref(), + ), + _ => (None, None, "unknown"), + }; + let title = display_name.unwrap_or(handle); + let initials = get_initials(display_name, handle); + + rsx! { + div { + class: "collab-avatar", + style: "z-index: {3 - i}", + title: "{title}", + + if let Some(avatar_url) = avatar { + img { + class: "collab-avatar-img", + src: avatar_url.as_ref(), + alt: "{title}", + } + } else { + "{initials}" + } + } + } } } @@ -91,3 +136,16 @@ pub fn CollaboratorAvatars(props: CollaboratorAvatarsProps) -> Element { } } } + +/// Get initials from display name or handle. +fn get_initials(display_name: Option<&str>, handle: &str) -> String { + if let Some(name) = display_name { + name.split_whitespace() + .take(2) + .filter_map(|w| w.chars().next()) + .collect::() + .to_uppercase() + } else { + handle.chars().next().unwrap_or('?').to_uppercase().to_string() + } +} diff --git a/crates/weaver-app/src/components/editor/component.rs b/crates/weaver-app/src/components/editor/component.rs index 77e4073..0be4ddd 100644 --- a/crates/weaver-app/src/components/editor/component.rs +++ b/crates/weaver-app/src/components/editor/component.rs @@ -5,6 +5,7 @@ use jacquard::IntoStatic; use jacquard::cowstr::ToCowStr; use jacquard::identity::resolver::IdentityResolver; use jacquard::smol_str::SmolStr; +use jacquard::types::aturi::AtUri; use jacquard::types::blob::BlobRef; use jacquard::types::ident::AtIdentifier; use weaver_api::sh_weaver::embed::images::Image; @@ -150,7 +151,10 @@ pub fn MarkdownEditor( // Restore images if let Some(ref images) = embeds.images { let images_list = embeds_map - .get_or_create_container("images", loro::LoroList::new()) + .get_or_create_container( + "images", + loro::LoroList::new(), + ) .expect("images list"); for image in &images.images { // Serialize image to JSON and add to list @@ -164,7 +168,10 @@ pub fn MarkdownEditor( // Restore record embeds if let Some(ref records) = embeds.records { let records_list = embeds_map - .get_or_create_container("records", loro::LoroList::new()) + .get_or_create_container( + "records", + loro::LoroList::new(), + ) .expect("records list"); for record in &records.records { let json = serde_json::to_value(record) @@ -176,12 +183,123 @@ pub fn MarkdownEditor( doc.commit(); + // Pre-warm blob cache for images + if let Some(ref embeds) = loaded.entry.embeds { + if let Some(ref images) = embeds.images { + let ident: &str = match uri.authority() { + AtIdentifier::Did(d) => d.as_ref(), + AtIdentifier::Handle(h) => h.as_ref(), + }; + for image in &images.images { + let cid = image.image.blob().cid(); + let name = image.name.as_ref().map(|n| n.as_ref()); + if let Err(e) = crate::data::cache_blob( + ident.into(), + cid.as_ref().into(), + name.map(|n| n.into()), + ) + .await + { + tracing::warn!( + "Failed to pre-warm blob cache for {}: {}", + cid, + e + ); + } + } + } + } + + // Pre-fetch embeds for initial render + let mut resolved_content = + weaver_common::ResolvedContent::default(); + if let Some(ref embeds) = loaded.entry.embeds { + if let Some(ref records) = embeds.records { + for record in &records.records { + // name is the key used in markdown, fallback to record.uri + let key_uri = if let Some(ref name) = record.name { + match jacquard::types::string::AtUri::new( + name.as_ref(), + ) { + Ok(uri) => uri.into_static(), + Err(_) => continue, + } + } else { + record.record.uri.clone().into_static() + }; + + match weaver_renderer::atproto::fetch_and_render( + &record.record.uri, + &fetcher, + ) + .await + { + Ok(html) => { + resolved_content.add_embed(key_uri, html, None); + } + Err(e) => { + tracing::warn!( + "Failed to pre-fetch embed {}: {}", + record.record.uri, + e + ); + } + } + } + } + } + if resolved_content.embed_content.is_empty() { + use weaver_common::{ExtractedRef, collect_refs_from_markdown}; + + let text = doc.get_text("content"); + let markdown = text.to_string(); + + if !markdown.is_empty() { + tracing::debug!( + "Falling back to markdown parsing for embeds" + ); + let refs = collect_refs_from_markdown(&markdown); + + for extracted in refs { + if let ExtractedRef::AtEmbed { uri, .. } = extracted { + let key_uri = match AtUri::new(&uri) { + Ok(u) => u.into_static(), + Err(_) => continue, + }; + + match weaver_renderer::atproto::fetch_and_render( + &key_uri, &fetcher, + ) + .await + { + Ok(html) => { + tracing::debug!( + "Pre-fetched embed from markdown: {}", + uri + ); + resolved_content + .add_embed(key_uri, html, None); + } + Err(e) => { + tracing::warn!( + "Failed to pre-fetch embed {}: {}", + uri, + e + ); + } + } + } + } + } + } + return LoadResult::Loaded(LoadedDocState { doc, entry_ref: Some(loaded.entry_ref), edit_root: None, last_diff: None, synced_version: None, // Fresh from entry, never synced + resolved_content, }); } Err(e) => { @@ -205,6 +323,7 @@ pub fn MarkdownEditor( edit_root: None, last_diff: None, synced_version: None, // New doc, never synced + resolved_content: weaver_common::ResolvedContent::default(), }) } Err(e) => { @@ -300,22 +419,29 @@ fn MarkdownEditorInner( EditorImageResolver::default() } }); - let resolved_content = use_signal(weaver_common::ResolvedContent::default); + // Use pre-resolved content from loaded state (avoids embed pop-in) + let resolved_content = use_signal(|| loaded_state.resolved_content.clone()); let doc_for_memo = document.clone(); let doc_for_refs = document.clone(); - let paragraphs = use_memo(move || { + let entry_index_for_memo = entry_index.clone(); + let mut paragraphs = use_memo(move || { let edit = doc_for_memo.last_edit(); let cache = render_cache.peek(); let resolver = image_resolver(); let resolved = resolved_content(); + tracing::debug!( + "Rendering with {} pre-resolved embeds", + resolved.embed_content.len() + ); + let (paras, new_cache, refs) = render::render_paragraphs_incremental( doc_for_memo.loro_text(), Some(&cache), edit.as_ref(), Some(&resolver), - entry_index.as_ref(), + entry_index_for_memo.as_ref(), &resolved, ); let mut doc_for_spawn = doc_for_refs.clone(); @@ -364,13 +490,10 @@ fn MarkdownEditorInner( continue; }; - match weaver_renderer::atproto::fetch_and_render(&at_uri, &fetcher) - .await - { + match weaver_renderer::atproto::fetch_and_render(&at_uri, &fetcher).await { Ok(html) => { - resolved_content_for_fetch.with_mut(|rc| { - rc.add_embed(at_uri.into_static(), html, None); - }); + let mut rc = resolved_content_for_fetch.write(); + rc.add_embed(at_uri.into_static(), html, None); } Err(e) => { tracing::warn!("failed to fetch embed {}: {}", uri_str, e); @@ -430,7 +553,8 @@ fn MarkdownEditorInner( // Use peek() to avoid creating reactive dependency on cached_paragraphs let prev = cached_paragraphs.peek().clone(); - let cursor_para_updated = update_paragraph_dom(editor_id, &prev, &new_paras, cursor_offset); + let cursor_para_updated = + update_paragraph_dom(editor_id, &prev, &new_paras, cursor_offset, false); // Only restore cursor if we actually re-rendered the paragraph it's in if cursor_para_updated { @@ -726,9 +850,53 @@ fn MarkdownEditorInner( } } - SyncStatus { - document: document.clone(), - draft_key: draft_key.to_string(), + { + // Enable collaborative sync for any published entry (both owners and collaborators) + let is_published = document.entry_ref().is_some(); + + // Refresh callback: fetch and merge collaborator changes + let on_refresh = if is_published { + let fetcher_for_refresh = fetcher.clone(); + let mut doc_for_refresh = document.clone(); + let entry_uri = document.entry_ref().map(|r| r.uri.clone().into_static()); + + Some(EventHandler::new(move |_| { + let fetcher = fetcher_for_refresh.clone(); + let mut doc = doc_for_refresh.clone(); + let uri = entry_uri.clone(); + + spawn(async move { + if let Some(uri) = uri { + match super::sync::load_all_edit_states_from_pds(&fetcher, &uri).await { + Ok(Some(pds_state)) => { + if let Err(e) = doc.import_updates(&pds_state.root_snapshot) { + tracing::error!("Failed to import collaborator updates: {:?}", e); + } else { + tracing::info!("Successfully merged collaborator updates"); + } + } + Ok(None) => { + tracing::debug!("No collaborator updates found"); + } + Err(e) => { + tracing::error!("Failed to fetch collaborator updates: {}", e); + } + } + } + }); + })) + } else { + None + }; + + rsx! { + SyncStatus { + document: document.clone(), + draft_key: draft_key.to_string(), + on_refresh, + is_collaborative: is_published, + } + } } PublishButton { diff --git a/crates/weaver-app/src/components/editor/document.rs b/crates/weaver-app/src/components/editor/document.rs index 7d54eb4..4310a12 100644 --- a/crates/weaver-app/src/components/editor/document.rs +++ b/crates/weaver-app/src/components/editor/document.rs @@ -104,7 +104,8 @@ pub struct EditorDocument { /// Version vector at the time of last sync to PDS. /// Used to export only changes since last sync. /// None if never synced. - last_synced_version: Option, + /// Signal so cloned docs share the same sync state. + last_synced_version: Signal>, // --- Editor state (non-reactive) --- /// Undo manager for the document. @@ -176,7 +177,7 @@ pub struct CompositionState { /// Information about the most recent edit, used for incremental rendering optimization. /// Derives PartialEq so it can be used with Dioxus memos for change detection. -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub struct EditInfo { /// Character offset where the edit occurred pub edit_char_pos: usize, @@ -193,6 +194,8 @@ pub struct EditInfo { /// Used to detect stale edit info - if current doc length doesn't match, /// the edit info is from a previous render cycle and shouldn't be used. pub doc_len_after: usize, + /// When this edit occurred. Used for idle detection in collaborative sync. + pub timestamp: web_time::Instant, } /// Max distance from line start where block syntax can appear. @@ -202,7 +205,7 @@ const BLOCK_SYNTAX_ZONE: usize = 6; /// Pre-loaded document state that can be created outside of reactive context. /// /// This struct holds the raw LoroDoc (which is safe outside reactive context) -/// along with sync state metadata. Use `EditorDocument::from_loaded_state()` +/// along with sync state metadata. Use `EditorDocument::from_loaded_state()` /// inside a `use_hook` to convert this into a reactive EditorDocument. /// /// Note: Clone is a shallow/reference clone for LoroDoc (Arc-backed). @@ -221,6 +224,9 @@ pub struct LoadedDocState { /// Used to determine what changes need to be synced. /// None if never synced to PDS. pub synced_version: Option, + /// Pre-resolved embed content fetched during load. + /// Avoids embed pop-in on initial render. + pub resolved_content: weaver_common::ResolvedContent, } impl PartialEq for LoadedDocState { @@ -304,7 +310,7 @@ impl EditorDocument { entry_ref: Signal::new(None), edit_root: Signal::new(None), last_diff: Signal::new(None), - last_synced_version: None, + last_synced_version: Signal::new(None), undo_mgr: Rc::new(RefCell::new(undo_mgr)), loro_cursor, // Reactive editor state - wrapped in Signals @@ -347,6 +353,12 @@ impl EditorDocument { doc.add_image(&img.clone().into_static(), None); } } + + if let Some(ref records) = embeds.records { + for record in &records.records { + doc.add_record(&record.clone().into_static()); + } + } } // Set the entry_ref so subsequent publishes update this record @@ -580,6 +592,22 @@ impl EditorDocument { images_list.push(json).ok(); } + pub fn add_record(&mut self, record: &RecordEmbed<'_>) { + // Serialize the Record embed to serde_json::Value + let json = serde_json::to_value(record).expect("Record serializes"); + + // Insert into the record list + let record_list = self.get_records_list(); + record_list.push(json).ok(); + } + + pub fn remove_record(&mut self, index: usize) { + let record_list = self.get_records_list(); + if index < record_list.len() { + record_list.delete(index, 1).ok(); + } + } + /// Remove an image by index. pub fn remove_image(&mut self, index: usize) { let images_list = self.get_images_list(); @@ -639,11 +667,17 @@ impl EditorDocument { } /// Convert a LoroValue at the given index to a RecordEmbed. - fn loro_value_to_record_embed(&self, list: &LoroList, index: usize) -> Option> { + fn loro_value_to_record_embed( + &self, + list: &LoroList, + index: usize, + ) -> Option> { let value = list.get(index)?; let loro_value = value.as_value()?; let json = loro_value.to_json_value(); - from_json_value::(json).ok().map(|r| r.into_static()) + from_json_value::(json) + .ok() + .map(|r| r.into_static()) } /// Insert text into content and record edit info for incremental rendering. @@ -659,6 +693,7 @@ impl EditorDocument { contains_newline: text.contains('\n'), in_block_syntax_zone, doc_len_after: len_after, + timestamp: web_time::Instant::now(), })); result } @@ -676,6 +711,7 @@ impl EditorDocument { contains_newline: text.contains('\n'), in_block_syntax_zone, doc_len_after: len_after, + timestamp: web_time::Instant::now(), })); result } @@ -694,6 +730,7 @@ impl EditorDocument { contains_newline, in_block_syntax_zone, doc_len_after: self.content.len_unicode(), + timestamp: web_time::Instant::now(), })); result } @@ -720,6 +757,7 @@ impl EditorDocument { contains_newline: delete_has_newline || text.contains('\n'), in_block_syntax_zone, doc_len_after: len_after, + timestamp: web_time::Instant::now(), })); Ok(()) } @@ -873,7 +911,7 @@ impl EditorDocument { /// Check if there are unsynced changes since the last PDS sync. pub fn has_unsynced_changes(&self) -> bool { - match &self.last_synced_version { + match &*self.last_synced_version.read() { Some(synced_vv) => self.doc.oplog_vv() != *synced_vv, None => true, // Never synced, so there are changes } @@ -883,7 +921,7 @@ impl EditorDocument { /// Returns None if there are no changes to export. /// After successful upload, call `mark_synced()` to update the sync marker. pub fn export_updates_since_sync(&self) -> Option> { - let from_vv = self.last_synced_version.clone().unwrap_or_default(); + let from_vv = self.last_synced_version.read().clone().unwrap_or_default(); let current_vv = self.doc.oplog_vv(); // No changes since last sync @@ -909,7 +947,7 @@ impl EditorDocument { /// Mark the current state as synced. /// Call this after successfully uploading a diff to the PDS. pub fn mark_synced(&mut self) { - self.last_synced_version = Some(self.doc.oplog_vv()); + self.last_synced_version.set(Some(self.doc.oplog_vv())); } /// Import updates from a PDS diff blob. @@ -929,7 +967,7 @@ impl EditorDocument { ) { self.edit_root.set(Some(edit_root)); self.last_diff.set(last_diff); - self.last_synced_version = Some(self.doc.oplog_vv()); + self.last_synced_version.set(Some(self.doc.oplog_vv())); } /// Create a new EditorDocument from a binary snapshot. @@ -1001,7 +1039,7 @@ impl EditorDocument { entry_ref: Signal::new(None), edit_root: Signal::new(None), last_diff: Signal::new(None), - last_synced_version: None, + last_synced_version: Signal::new(None), undo_mgr: Rc::new(RefCell::new(undo_mgr)), loro_cursor, // Reactive editor state - wrapped in Signals @@ -1047,9 +1085,6 @@ impl EditorDocument { }; let loro_cursor = content.get_cursor(cursor_offset, Side::default()); - // Use the synced version from state (tracks the PDS version vector) - let last_synced_version = state.synced_version; - Self { doc, content, @@ -1061,7 +1096,8 @@ impl EditorDocument { entry_ref: Signal::new(state.entry_ref), edit_root: Signal::new(state.edit_root), last_diff: Signal::new(state.last_diff), - last_synced_version, + // Use the synced version from state (tracks the PDS version vector) + last_synced_version: Signal::new(state.synced_version), undo_mgr: Rc::new(RefCell::new(undo_mgr)), loro_cursor, cursor: Signal::new(cursor_state), diff --git a/crates/weaver-app/src/components/editor/dom_sync.rs b/crates/weaver-app/src/components/editor/dom_sync.rs index 4de29fe..8a32b45 100644 --- a/crates/weaver-app/src/components/editor/dom_sync.rs +++ b/crates/weaver-app/src/components/editor/dom_sync.rs @@ -279,6 +279,7 @@ pub fn update_paragraph_dom( old_paragraphs: &[ParagraphRender], new_paragraphs: &[ParagraphRender], cursor_offset: usize, + force: bool, ) -> bool { use wasm_bindgen::JsCast; @@ -311,17 +312,24 @@ pub fn update_paragraph_dom( let para_id = format!("para-{}", idx); if let Some(old_para) = old_paragraphs.get(idx) { - if new_para.source_hash != old_para.source_hash { + if force || new_para.source_hash != old_para.source_hash { // Changed - clear and update innerHTML // We clear first to ensure any browser-added content (from IME composition, // contenteditable quirks, etc.) is fully removed before setting new content if let Some(elem) = document.get_element_by_id(¶_id) { - elem.set_text_content(None); // Clear completely - elem.set_inner_html(&new_para.html); + if force && cursor_para_idx.is_some() { + // skip re-rendering where the cursor is if we're forcing it + // we don't want to fuck up what the user is doing + } else { + elem.set_text_content(None); // Clear completely + elem.set_inner_html(&new_para.html); + } } - if Some(idx) == cursor_para_idx { - cursor_para_updated = true; + if !force { + if Some(idx) == cursor_para_idx { + cursor_para_updated = true; + } } } } else { @@ -342,6 +350,7 @@ pub fn update_paragraph_dom( if new_paragraphs.len() < old_paragraphs.len() { cursor_para_updated = true; } + // TODO: i think this is the cause of a number of bits of cursor jank for idx in new_paragraphs.len()..old_paragraphs.len() { let para_id = format!("para-{}", idx); if let Some(elem) = document.get_element_by_id(¶_id) { @@ -358,7 +367,7 @@ pub fn update_paragraph_dom( _old_paragraphs: &[ParagraphRender], _new_paragraphs: &[ParagraphRender], _cursor_offset: usize, + _force: bool, ) -> bool { false } - diff --git a/crates/weaver-app/src/components/editor/publish.rs b/crates/weaver-app/src/components/editor/publish.rs index c4652ba..76c232d 100644 --- a/crates/weaver-app/src/components/editor/publish.rs +++ b/crates/weaver-app/src/components/editor/publish.rs @@ -274,8 +274,8 @@ pub async fn publish_entry( PublishResult::Updated(uri) } } else if let Some(existing_ref) = doc.entry_ref() { - // Update existing free-floating entry - use existing rkey for path rewriting - let did = fetcher + // Update existing entry (either owner or collaborator) + let current_did = fetcher .current_did() .await .ok_or_else(|| WeaverError::InvalidNotebook("Not authenticated".into()))?; @@ -285,6 +285,17 @@ pub async fn publish_entry( .rkey() .ok_or_else(|| WeaverError::InvalidNotebook("Entry URI missing rkey".into()))?; + // Check if we're the owner or a collaborator + let owner_did = match existing_ref.uri.authority() { + AtIdentifier::Did(d) => d.clone(), + AtIdentifier::Handle(h) => fetcher + .client + .resolve_handle(h) + .await + .map_err(|e| WeaverError::InvalidNotebook(format!("Failed to resolve handle: {}", e)))?, + }; + let is_collaborator = owner_did != current_did; + // Rewrite draft image paths to published paths let content = rewrite_draft_paths(&doc.content(), rkey.0.as_str()); @@ -300,8 +311,10 @@ pub async fn publish_entry( let collection = Nsid::new(ENTRY_NSID).map_err(|e| WeaverError::AtprotoString(e))?; + // Collaborator: create/update in THEIR repo with SAME rkey + // Owner: update in their own repo let request = PutRecord::new() - .repo(AtIdentifier::Did(did)) + .repo(AtIdentifier::Did(current_did.clone())) .collection(collection) .rkey(rkey.clone()) .record(entry_data) @@ -315,14 +328,24 @@ pub async fn publish_entry( .into_output() .map_err(|e| WeaverError::InvalidNotebook(e.to_string()))?; - // Update entry_ref with new CID - let updated_ref = StrongRef::new() - .uri(output.uri.clone().into_static()) - .cid(output.cid.into_static()) - .build(); - doc.set_entry_ref(Some(updated_ref)); - - PublishResult::Updated(output.uri.into_static()) + if is_collaborator { + // Collaborator: don't update doc.entry_ref() - it still points to original + // Their version is a parallel record at at://{collab_did}/sh.weaver.notebook.entry/{same_rkey} + tracing::info!( + "Collaborator published version: {} (original: {})", + output.uri, + existing_ref.uri + ); + PublishResult::Created(output.uri.into_static()) + } else { + // Owner: update entry_ref with new CID + let updated_ref = StrongRef::new() + .uri(output.uri.clone().into_static()) + .cid(output.cid.into_static()) + .build(); + doc.set_entry_ref(Some(updated_ref)); + PublishResult::Updated(output.uri.into_static()) + } } else { // Create new free-floating entry - pre-generate rkey for path rewriting let did = fetcher @@ -457,6 +480,21 @@ pub fn PublishButton(props: PublishButtonProps) -> Element { // Check if we're editing an existing entry let is_editing_existing = doc.entry_ref().is_some(); + // Check if we're publishing as a collaborator (editing someone else's entry) + let is_collaborator = { + let entry_ref = doc.entry_ref(); + let current_did = auth_state.read().did.clone(); + match (entry_ref, current_did) { + (Some(ref r), Some(ref current)) => { + match r.uri.authority() { + AtIdentifier::Did(owner_did) => owner_did != current, + AtIdentifier::Handle(_) => false, // Can't determine without async resolve + } + } + _ => false, + } + }; + // Validate that we have required fields let can_publish = !doc.title().trim().is_empty() && !doc.content().trim().is_empty(); @@ -558,7 +596,14 @@ pub fn PublishButton(props: PublishButtonProps) -> Element { } } else { div { class: "publish-form", - if is_editing_existing { + if is_collaborator { + div { class: "publish-info publish-collab-info", + p { "Publishing as collaborator" } + p { class: "publish-collab-detail", + "This creates a version in your repository." + } + } + } else if is_editing_existing { div { class: "publish-info", p { "Updating existing entry" } } diff --git a/crates/weaver-app/src/components/editor/render.rs b/crates/weaver-app/src/components/editor/render.rs index d5fce66..79c6282 100644 --- a/crates/weaver-app/src/components/editor/render.rs +++ b/crates/weaver-app/src/components/editor/render.rs @@ -72,37 +72,6 @@ fn apply_delta(val: usize, delta: isize) -> usize { } } -/// Adjust a cached paragraph's positions after an earlier edit. -fn adjust_paragraph_positions( - cached: &CachedParagraph, - char_delta: isize, - byte_delta: isize, -) -> ParagraphRender { - let mut adjusted_map = cached.offset_map.clone(); - for mapping in &mut adjusted_map { - mapping.char_range.start = apply_delta(mapping.char_range.start, char_delta); - mapping.char_range.end = apply_delta(mapping.char_range.end, char_delta); - mapping.byte_range.start = apply_delta(mapping.byte_range.start, byte_delta); - mapping.byte_range.end = apply_delta(mapping.byte_range.end, byte_delta); - } - - let mut adjusted_syntax = cached.syntax_spans.clone(); - for span in &mut adjusted_syntax { - span.adjust_positions(char_delta); - } - - ParagraphRender { - byte_range: apply_delta(cached.byte_range.start, byte_delta) - ..apply_delta(cached.byte_range.end, byte_delta), - char_range: apply_delta(cached.char_range.start, char_delta) - ..apply_delta(cached.char_range.end, char_delta), - html: cached.html.clone(), - offset_map: adjusted_map, - syntax_spans: adjusted_syntax, - source_hash: cached.source_hash, - } -} - /// Render markdown with incremental caching. /// /// Uses cached paragraph renders when possible, only re-rendering changed paragraphs. @@ -163,9 +132,7 @@ pub fn render_paragraphs_incremental( // Need cache and non-boundary-affecting edit info (for edit position) let current_len = text.len_unicode(); - let use_fast_path = cache.is_some() - && edit.is_some() - && !is_boundary_affecting(edit.unwrap()); + let use_fast_path = cache.is_some() && edit.is_some() && !is_boundary_affecting(edit.unwrap()); tracing::debug!( target: "weaver::render", @@ -320,7 +287,12 @@ pub fn render_paragraphs_incremental( // Include cached refs in all_refs all_refs.extend(cached.collected_refs.clone()); - (cached.html.clone(), adjusted_map, adjusted_syntax, cached.collected_refs.clone()) + ( + cached.html.clone(), + adjusted_map, + adjusted_syntax, + cached.collected_refs.clone(), + ) } else { // Fresh render needed - create detached LoroDoc for this paragraph let para_doc = loro::LoroDoc::new(); diff --git a/crates/weaver-app/src/components/editor/sync.rs b/crates/weaver-app/src/components/editor/sync.rs index 7908453..15358f0 100644 --- a/crates/weaver-app/src/components/editor/sync.rs +++ b/crates/weaver-app/src/components/editor/sync.rs @@ -18,6 +18,8 @@ use std::collections::BTreeMap; +use super::document::{EditorDocument, LoadedDocState}; +use crate::fetch::Fetcher; use jacquard::bytes::Bytes; use jacquard::cowstr::ToCowStr; use jacquard::prelude::*; @@ -30,6 +32,8 @@ use jacquard::types::tid::Ticker; use jacquard::types::uri::Uri; use jacquard::url::Url; use jacquard::{CowStr, IntoStatic, to_data}; +use loro::LoroDoc; +use loro::ToJson; use weaver_api::com_atproto::repo::create_record::CreateRecord; use weaver_api::com_atproto::repo::strong_ref::StrongRef; use weaver_api::com_atproto::sync::get_blob::GetBlob; @@ -40,16 +44,143 @@ use weaver_api::sh_weaver::edit::{DocRef, DocRefValue, DraftRef, EntryRef}; use weaver_common::constellation::{GetBacklinksQuery, RecordId}; use weaver_common::{WeaverError, WeaverExt}; -use crate::fetch::Fetcher; - -use super::document::{EditorDocument, LoadedDocState}; -use loro::LoroDoc; - const ROOT_NSID: &str = "sh.weaver.edit.root"; const DIFF_NSID: &str = "sh.weaver.edit.diff"; const DRAFT_NSID: &str = "sh.weaver.edit.draft"; const CONSTELLATION_URL: &str = "https://constellation.microcosm.blue"; +/// Extract record embeds from a LoroDoc and pre-fetch their rendered content. +/// +/// Reads the embeds.records list from the document, extracts RecordEmbed entries, +/// and fetches/renders each one to populate a ResolvedContent map. +/// Also pre-warms the blob cache for images if `owner_ident` is provided. +async fn prefetch_embeds_from_doc( + doc: &LoroDoc, + fetcher: &Fetcher, + owner_ident: Option<&str>, +) -> weaver_common::ResolvedContent { + use weaver_api::sh_weaver::embed::images::Image; + use weaver_api::sh_weaver::embed::records::RecordEmbed; + + let mut resolved = weaver_common::ResolvedContent::default(); + + let embeds_map = doc.get_map("embeds"); + + // Pre-warm blob cache for images + if let Some(ident) = owner_ident { + if let Ok(images_container) = + embeds_map.get_or_create_container("images", loro::LoroList::new()) + { + for i in 0..images_container.len() { + let Some(value) = images_container.get(i) else { + continue; + }; + let Some(loro_value) = value.as_value() else { + continue; + }; + let json = loro_value.to_json_value(); + let Ok(image) = jacquard::from_json_value::(json) else { + continue; + }; + + let cid = image.image.blob().cid(); + let name = image.name.as_ref().map(|n| n.as_ref()); + if let Err(e) = crate::data::cache_blob( + ident.into(), + cid.as_ref().into(), + name.map(|n| n.into()), + ) + .await + { + tracing::warn!("Failed to pre-warm blob cache for {}: {}", cid, e); + } + } + } + } + + // Strategy 1: Get embeds from Loro embeds map -> records list + + if let Ok(records_container) = + embeds_map.get_or_create_container("records", loro::LoroList::new()) + { + tracing::debug!("Loro embeds map records len: {}", records_container.len()); + + for i in 0..records_container.len() { + let Some(value) = records_container.get(i) else { + continue; + }; + let Some(loro_value) = value.as_value() else { + continue; + }; + let json = loro_value.to_json_value(); + let Ok(record_embed) = jacquard::from_json_value::(json) else { + continue; + }; + + // name is the key used in markdown, fallback to record.uri + let key_uri = if let Some(ref name) = record_embed.name { + match AtUri::new(name.as_ref()) { + Ok(uri) => uri.into_static(), + Err(_) => continue, + } + } else { + record_embed.record.uri.clone().into_static() + }; + + // Fetch and render + match weaver_renderer::atproto::fetch_and_render(&record_embed.record.uri, fetcher) + .await + { + Ok(html) => { + tracing::debug!("Pre-fetched embed from Loro map: {}", key_uri); + resolved.add_embed(key_uri, html, None); + } + Err(e) => { + tracing::warn!( + "Failed to pre-fetch embed {}: {}", + record_embed.record.uri, + e + ); + } + } + } + } + + // Strategy 2: If no embeds found in Loro map, parse markdown text + if resolved.embed_content.is_empty() { + use weaver_common::{collect_refs_from_markdown, ExtractedRef}; + + let text = doc.get_text("content"); + let markdown = text.to_string(); + + if !markdown.is_empty() { + tracing::debug!("Falling back to markdown parsing for embeds"); + let refs = collect_refs_from_markdown(&markdown); + + for extracted in refs { + if let ExtractedRef::AtEmbed { uri, .. } = extracted { + let key_uri = match AtUri::new(&uri) { + Ok(u) => u.into_static(), + Err(_) => continue, + }; + + match weaver_renderer::atproto::fetch_and_render(&key_uri, fetcher).await { + Ok(html) => { + tracing::debug!("Pre-fetched embed from markdown: {}", uri); + resolved.add_embed(key_uri, html, None); + } + Err(e) => { + tracing::warn!("Failed to pre-fetch embed {}: {}", uri, e); + } + } + } + } + } + } + + resolved +} + /// Build a DocRef for either a published entry or an unpublished draft. /// /// If entry_uri and entry_cid are provided, creates an EntryRef. @@ -82,11 +213,7 @@ fn build_doc_ref( tid.to_string() } else if draft_key.starts_with("at://") { // Editing existing entry: use the entry's rkey - draft_key - .split('/') - .last() - .unwrap_or(draft_key) - .to_string() + draft_key.split('/').last().unwrap_or(draft_key).to_string() } else if draft_key.starts_with("did:") && draft_key.contains(':') { // Old canonical format "did:xxx:rkey" - extract rkey draft_key @@ -158,7 +285,7 @@ pub async fn find_edit_root_for_entry( let query = GetBacklinksQuery { subject: Uri::At(entry_uri.clone().into_static()), - source: format!("{}:.doc.value.entry.uri", ROOT_NSID).into(), + source: format!("{}:doc.value.entry.uri", ROOT_NSID).into(), cursor: None, did: vec![], limit: 1, @@ -178,6 +305,76 @@ pub async fn find_edit_root_for_entry( Ok(output.records.into_iter().next().map(|r| r.into_static())) } +/// Find ALL edit.root records across collaborators for an entry. +/// +/// 1. Gets list of collaborators via permissions +/// 2. Queries Constellation for edit.root in each collaborator's repo +/// 3. Returns all found roots for CRDT merge +pub async fn find_all_edit_roots_for_entry( + fetcher: &Fetcher, + entry_uri: &AtUri<'_>, +) -> Result>, WeaverError> { + // Get collaborators from permissions + let collaborators = fetcher + .get_client() + .find_collaborators_for_resource(entry_uri) + .await + .unwrap_or_default(); + + // Include the entry owner + let owner_did = match entry_uri.authority() { + AtIdentifier::Did(d) => d.clone().into_static(), + AtIdentifier::Handle(h) => fetcher + .client + .resolve_handle(h) + .await + .map_err(|e| WeaverError::InvalidNotebook(format!("Failed to resolve handle: {}", e)))? + .into_static(), + }; + + let all_dids: Vec> = std::iter::once(owner_did) + .chain(collaborators.into_iter()) + .collect(); + + let constellation_url = Url::parse(CONSTELLATION_URL) + .map_err(|e| WeaverError::InvalidNotebook(format!("Invalid constellation URL: {}", e)))?; + + let mut all_roots = Vec::new(); + + // Query for edit.root records from this DID that reference entry_uri + let query = GetBacklinksQuery { + subject: Uri::At(entry_uri.clone().into_static()), + source: format!("{}:doc.value.entry.uri", ROOT_NSID).into(), + cursor: None, + did: all_dids.clone(), + limit: 10, + }; + + let response = fetcher + .get_client() + .xrpc(constellation_url.clone()) + .send(&query) + .await; + + if let Ok(response) = response { + if let Ok(output) = response.into_output() { + all_roots.extend(output.records.into_iter().map(|r| r.into_static())); + } else { + tracing::warn!("Failed to parse response for edit root query"); + } + } else { + tracing::warn!("Failed to fetch edit root query"); + } + + tracing::debug!( + "find_all_edit_roots_for_entry: found {} roots across {} collaborators", + all_roots.len(), + all_dids.len() + ); + + Ok(all_roots) +} + /// Find the edit root for a draft using constellation backlinks. /// /// Queries constellation for `sh.weaver.edit.root` records that reference @@ -193,7 +390,7 @@ pub async fn find_edit_root_for_draft( let query = GetBacklinksQuery { subject: Uri::At(draft_uri.clone().into_static()), - source: format!("{}:.doc.value.draft_key", ROOT_NSID).into(), + source: format!("{}:doc.value.draft_key", ROOT_NSID).into(), cursor: None, did: vec![], limit: 1, @@ -221,11 +418,7 @@ pub fn build_draft_uri(did: &Did<'_>, draft_key: &str) -> AtUri<'static> { let rkey = if let Some(tid) = draft_key.strip_prefix("new:") { tid.to_string() } else if draft_key.starts_with("at://") { - draft_key - .split('/') - .last() - .unwrap_or(draft_key) - .to_string() + draft_key.split('/').last().unwrap_or(draft_key).to_string() } else { draft_key.to_string() }; @@ -240,11 +433,7 @@ fn extract_draft_rkey(draft_key: &str) -> String { if let Some(tid) = draft_key.strip_prefix("new:") { tid.to_string() } else if draft_key.starts_with("at://") { - draft_key - .split('/') - .last() - .unwrap_or(draft_key) - .to_string() + draft_key.split('/').last().unwrap_or(draft_key).to_string() } else { draft_key.to_string() } @@ -267,8 +456,8 @@ async fn create_draft_stub( let draft_data = to_data(&draft) .map_err(|e| WeaverError::InvalidNotebook(format!("Failed to serialize draft: {}", e)))?; - let record_key = RecordKey::any(rkey) - .map_err(|e| WeaverError::InvalidNotebook(e.to_string()))?; + let record_key = + RecordKey::any(rkey).map_err(|e| WeaverError::InvalidNotebook(e.to_string()))?; let collection = Nsid::new(DRAFT_NSID).map_err(WeaverError::AtprotoString)?; @@ -331,7 +520,10 @@ pub async fn list_drafts_from_pds(fetcher: &Fetcher) -> Result, WeaverError::InvalidNotebook(format!("Failed to parse list records response: {}", e)) })?; - tracing::debug!("list_drafts_from_pds: found {} records", output.records.len()); + tracing::debug!( + "list_drafts_from_pds: found {} records", + output.records.len() + ); let mut drafts = Vec::new(); for record in output.records { @@ -344,9 +536,10 @@ pub async fn list_drafts_from_pds(fetcher: &Fetcher) -> Result, tracing::debug!(" Draft record: uri={}, rkey={}", record.uri, rkey); // Parse the draft record to get createdAt - let created_at = jacquard::from_data::(&record.value) - .map(|d| d.created_at.to_string()) - .unwrap_or_default(); + let created_at = + jacquard::from_data::(&record.value) + .map(|d| d.created_at.to_string()) + .unwrap_or_default(); drafts.push(RemoteDraft { uri: record.uri.into_static(), @@ -373,7 +566,7 @@ pub async fn find_diffs_for_root( loop { let query = GetBacklinksQuery { subject: Uri::At(root_uri.clone().into_static()), - source: format!("{}:.root.uri", DIFF_NSID).into(), + source: format!("{}:root.uri", DIFF_NSID).into(), cursor: cursor.map(Into::into), did: vec![], limit: 100, @@ -733,6 +926,88 @@ pub async fn load_edit_state_from_draft( load_edit_state_from_root_id(fetcher, root_id).await } +/// Load edit state from ALL collaborator repos for an entry, returning merged state. +/// +/// For each edit.root found across collaborators: +/// - Fetches the root snapshot +/// - Finds and fetches all diffs for that root +/// - Merges all Loro states into one unified document +/// +/// Returns merged state suitable for CRDT collaboration. +pub async fn load_all_edit_states_from_pds( + fetcher: &Fetcher, + entry_uri: &AtUri<'_>, +) -> Result, WeaverError> { + let all_roots = find_all_edit_roots_for_entry(fetcher, entry_uri).await?; + + if all_roots.is_empty() { + return Ok(None); + } + + // We'll merge all snapshots and diffs into one unified LoroDoc + let merged_doc = LoroDoc::new(); + let mut our_root_ref: Option> = None; + let mut our_last_diff_ref: Option> = None; + + // Get current user's DID to identify "our" root for sync state tracking + let current_did = fetcher.current_did().await; + + for root_id in all_roots { + // Save the DID before consuming root_id + let root_did = root_id.did.clone(); + + // Load state from this root + if let Some(pds_state) = load_edit_state_from_root_id(fetcher, root_id).await? { + // Import root snapshot into merged doc + if let Err(e) = merged_doc.import(&pds_state.root_snapshot) { + tracing::warn!("Failed to import root snapshot from {}: {:?}", root_did, e); + continue; + } + + // Import all diffs + for diff in &pds_state.diff_updates { + if let Err(e) = merged_doc.import(diff) { + tracing::warn!("Failed to import diff from {}: {:?}", root_did, e); + } + } + + // Track "our" root/diff refs for sync state (used when syncing back) + // We want to track our own edit.root so subsequent diffs go to the right place + let is_our_root = current_did.as_ref().is_some_and(|did| root_did == *did); + + if is_our_root { + // This is our own root - use it for sync state + our_root_ref = Some(pds_state.root_ref); + our_last_diff_ref = pds_state.last_diff_ref; + } else if our_root_ref.is_none() { + // We don't have our own root yet - use the first one we find + // (this handles the case where we're a new collaborator with no edit state) + our_root_ref = Some(pds_state.root_ref); + our_last_diff_ref = pds_state.last_diff_ref; + } + } + } + + // Export merged state as new snapshot + let merged_snapshot = merged_doc.export(loro::ExportMode::Snapshot).map_err(|e| { + WeaverError::InvalidNotebook(format!("Failed to export merged snapshot: {}", e)) + })?; + + tracing::debug!( + "load_all_edit_states_from_pds: merged document, snapshot size = {} bytes", + merged_snapshot.len() + ); + + // If we found any roots, return the merged state + // Note: our_root_ref might be from another collaborator if we haven't created our own yet + Ok(our_root_ref.map(|root_ref| PdsEditState { + root_ref, + last_diff_ref: our_last_diff_ref, + root_snapshot: merged_snapshot.into(), + diff_updates: vec![], // Already merged into snapshot + })) +} + /// Internal helper to load edit state given a root record ID. async fn load_edit_state_from_root_id( fetcher: &Fetcher, @@ -797,14 +1072,9 @@ async fn load_edit_state_from_root_id( for diff_id in &diff_ids { let rkey_str: &str = diff_id.rkey.as_ref(); - let diff_uri = AtUri::new(&format!( - "at://{}/{}/{}", - diff_id.did, - DIFF_NSID, - rkey_str - )) - .map_err(|e| WeaverError::InvalidNotebook(format!("Invalid diff URI: {}", e)))? - .into_static(); + let diff_uri = AtUri::new(&format!("at://{}/{}/{}", diff_id.did, DIFF_NSID, rkey_str)) + .map_err(|e| WeaverError::InvalidNotebook(format!("Invalid diff URI: {}", e)))? + .into_static(); let diff_response = fetcher .client @@ -878,12 +1148,14 @@ pub async fn load_and_merge_document( // Load snapshot + entry_ref from localStorage let local_data = load_snapshot_from_storage(draft_key); - // Load from PDS - try entry URI first, then draft discovery + // Load from PDS - for entries use multi-repo loading (all collaborators), + // for drafts use single-repo loading (draft sharing requires knowing the URI) let pds_state = if let Some(uri) = entry_uri { - // Published entry: query by entry URI - load_edit_state_from_pds(fetcher, uri).await? + // Published entry: load from ALL collaborators (multi-repo CRDT merge) + load_all_edit_states_from_pds(fetcher, uri).await? } else if let Some(did) = fetcher.current_did().await { - // Unpublished draft: try to discover via draft URI + // Unpublished draft: single-repo for now + // (draft sharing would require collaborator to know the draft URI) let draft_uri = build_draft_uri(&did, draft_key); load_edit_state_from_draft(fetcher, &draft_uri).await? } else { @@ -891,6 +1163,12 @@ pub async fn load_and_merge_document( None }; + // Extract owner identity from entry URI for blob cache warming + let owner_ident: Option = entry_uri.map(|uri| match uri.authority() { + AtIdentifier::Did(d) => d.as_ref().to_string(), + AtIdentifier::Handle(h) => h.as_ref().to_string(), + }); + match (local_data, pds_state) { (None, None) => Ok(None), @@ -902,12 +1180,16 @@ pub async fn load_and_merge_document( tracing::warn!("Failed to import local snapshot: {:?}", e); } + let resolved_content = + prefetch_embeds_from_doc(&doc, fetcher, owner_ident.as_deref()).await; + Ok(Some(LoadedDocState { doc, entry_ref: local.entry_ref, // Restored from localStorage edit_root: None, last_diff: None, synced_version: None, // Local-only, never synced to PDS + resolved_content, })) } @@ -931,12 +1213,16 @@ pub async fn load_and_merge_document( // Capture the version after loading all PDS state - this is our sync baseline let synced_version = Some(doc.oplog_vv()); + let resolved_content = + prefetch_embeds_from_doc(&doc, fetcher, owner_ident.as_deref()).await; + Ok(Some(LoadedDocState { doc, entry_ref: None, // Entry ref comes from the entry itself, not edit state edit_root: Some(pds.root_ref), last_diff: pds.last_diff_ref, synced_version, // Just loaded from PDS, fully synced + resolved_content, })) } @@ -978,12 +1264,16 @@ pub async fn load_and_merge_document( // Use the PDS version as our sync baseline - any local changes // beyond this will be detected as unsynced + let resolved_content = + prefetch_embeds_from_doc(&doc, fetcher, owner_ident.as_deref()).await; + Ok(Some(LoadedDocState { doc, entry_ref: local.entry_ref, // Restored from localStorage edit_root: Some(pds.root_ref), last_diff: pds.last_diff_ref, synced_version: Some(pds_version), + resolved_content, })) } } @@ -1005,6 +1295,8 @@ pub enum SyncState { Syncing, /// Has local changes not yet synced Unsynced, + /// Remote collaborator changes available + RemoteChanges, /// Last sync failed Error, /// Not authenticated or sync disabled @@ -1021,6 +1313,12 @@ pub struct SyncStatusProps { /// Auto-sync interval in milliseconds (0 to disable) #[props(default = 30_000)] pub auto_sync_interval_ms: u32, + /// Callback to refresh/reload document from collaborators + #[props(default)] + pub on_refresh: Option>, + /// Whether this is a collaborative document (has collaborators) + #[props(default = false)] + pub is_collaborative: bool, } /// Sync status indicator with auto-sync functionality. @@ -1050,34 +1348,59 @@ pub fn SyncStatus(props: SyncStatusProps) -> Element { // Auto-sync trigger signal - set to true to trigger a sync let mut trigger_sync = use_signal(|| false); - // Auto-sync timer (WASM only) - just sets the trigger, doesn't access signals directly - #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] + // Auto-sync timer - triggers sync when there are unsynced changes { - let auto_sync_interval = props.auto_sync_interval_ms; + let auto_sync_interval_ms = props.auto_sync_interval_ms; let doc_for_check = doc.clone(); - use_effect(move || { - if auto_sync_interval == 0 { + dioxus_sdk::time::use_interval( + std::time::Duration::from_millis(auto_sync_interval_ms as u64), + move |_| { + if auto_sync_interval_ms == 0 { + return; + } + // Only trigger if there are unsynced changes + if doc_for_check.has_unsynced_changes() { + trigger_sync.set(true); + } + }, + ); + } + + // Collaborator poll timer - checks for collaborator updates periodically + // For collaborative documents, poll every 60s + // - If user has been idle ≥30s: auto-trigger refresh + // - If user is actively editing: show RemoteChanges state + { + let is_collaborative = props.is_collaborative; + let on_refresh = props.on_refresh.clone(); + let doc_for_idle = doc.clone(); + + dioxus_sdk::time::use_interval(std::time::Duration::from_secs(60), move |_| { + if !is_collaborative { return; } - let doc = doc_for_check.clone(); + let idle_threshold = std::time::Duration::from_secs(30); - let interval = gloo_timers::callback::Interval::new(auto_sync_interval, move || { - // Only trigger if there are unsynced changes and we're not already syncing - if doc.has_unsynced_changes() { - // This just sets a signal - the actual sync happens in use_future below - trigger_sync.set(true); - } - }); + // Check time since last edit + let is_idle = match doc_for_idle.last_edit() { + Some(edit_info) => edit_info.timestamp.elapsed() >= idle_threshold, + None => true, // No edits yet = idle + }; - interval.forget(); + if is_idle { + // User is idle - safe to auto-refresh + if let Some(ref handler) = on_refresh { + handler.call(()); + } + } else { + // User is actively editing - show remote changes indicator + sync_state.set(SyncState::RemoteChanges); + } }); } - #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] - let mut trigger_sync = use_signal(|| false); - // Update sync state when document changes // Note: We use peek() to avoid creating a reactive dependency on sync_state let doc_for_effect = doc.clone(); @@ -1157,20 +1480,6 @@ pub fn SyncStatus(props: SyncStatusProps) -> Element { }); }); - // Manual sync handler - just sets the trigger if there are changes - let doc_for_manual = doc.clone(); - let on_manual_sync = move |_| { - if *sync_state.peek() == SyncState::Syncing { - return; // Already syncing - } - if !doc_for_manual.has_unsynced_changes() { - // Already synced - sync_state.set(SyncState::Synced); - return; - } - trigger_sync.set(true); - }; - // Determine display state (drafts can sync too via DraftRef) let display_state = if !is_authenticated { SyncState::Disabled @@ -1182,15 +1491,40 @@ pub fn SyncStatus(props: SyncStatusProps) -> Element { SyncState::Synced => ("✓", "Synced", "sync-status synced"), SyncState::Syncing => ("◌", "Syncing...", "sync-status syncing"), SyncState::Unsynced => ("●", "Unsynced", "sync-status unsynced"), + SyncState::RemoteChanges => ("↓", "Updates", "sync-status remote-changes"), SyncState::Error => ("✕", "Sync error", "sync-status error"), SyncState::Disabled => ("○", "Sync disabled", "sync-status disabled"), }; + // Combined sync handler - pulls remote changes first if needed, then pushes local + let doc_for_sync = doc.clone(); + let on_sync_click = { + let on_refresh = props.on_refresh.clone(); + let current_state = display_state; + move |_: dioxus::events::MouseEvent| { + if *sync_state.peek() == SyncState::Syncing { + return; // Already syncing + } + // If there are remote changes, pull them first + if current_state == SyncState::RemoteChanges { + if let Some(ref handler) = on_refresh { + handler.call(()); + } + } + // Trigger sync if there are local changes + if doc_for_sync.has_unsynced_changes() { + trigger_sync.set(true); + } else if current_state != SyncState::RemoteChanges { + sync_state.set(SyncState::Synced); + } + } + }; + rsx! { div { class: "{class}", title: if let Some(ref err) = *last_error.read() { err.clone() } else { label.to_string() }, - onclick: on_manual_sync, + onclick: on_sync_click, span { class: "sync-icon", "{icon}" } span { class: "sync-label", "{label}" } diff --git a/crates/weaver-app/src/components/editor/writer.rs b/crates/weaver-app/src/components/editor/writer.rs index d876d5f..9b72a68 100644 --- a/crates/weaver-app/src/components/editor/writer.rs +++ b/crates/weaver-app/src/components/editor/writer.rs @@ -6,6 +6,8 @@ //! Uses Parser::into_offset_iter() to track gaps between events, which //! represent consumed formatting characters. +use crate::data::cache_blob; + use super::offset_map::{OffsetMapping, RenderResult}; use jacquard::types::{ident::AtIdentifier, string::Rkey}; use loro::LoroText; diff --git a/crates/weaver-app/src/components/entry.rs b/crates/weaver-app/src/components/entry.rs index 93e02d4..95e08d3 100644 --- a/crates/weaver-app/src/components/entry.rs +++ b/crates/weaver-app/src/components/entry.rs @@ -3,10 +3,7 @@ use crate::Route; #[cfg(feature = "server")] use crate::blobcache::BlobCache; -use crate::{ - components::EntryActions, - data::use_handle, -}; +use crate::{components::EntryActions, data::use_handle}; use dioxus::prelude::*; use jacquard::types::aturi::AtUri; use jacquard::{IntoStatic, types::string::Handle}; @@ -577,7 +574,11 @@ pub fn FeedEntryCard( let formatted_date = entry.created_at.as_ref().format("%B %d, %Y").to_string(); // Get first author if we're showing it - let first_author = if show_author { entry_view.authors.first() } else { None }; + let first_author = if show_author { + entry_view.authors.first() + } else { + None + }; // Check edit access via permissions let auth_state = use_context::>(); @@ -771,7 +772,7 @@ pub fn EntryMetadata( if !entry_view.authors.is_empty() { div { class: "entry-authors", for (i, author) in entry_view.authors.iter().enumerate() { - if i > 0 { span { ", " } } + if i > 0 { span { " " } } { use weaver_api::sh_weaver::actor::ProfileDataViewInner; diff --git a/crates/weaver-app/src/data.rs b/crates/weaver-app/src/data.rs index 9abe232..4433d57 100644 --- a/crates/weaver-app/src/data.rs +++ b/crates/weaver-app/src/data.rs @@ -126,11 +126,7 @@ pub fn use_entry_data( let (_book_entry_view, entry_record) = (&entry.0, &entry.1); if let Some(embeds) = &entry_record.embeds { if let Some(images) = &embeds.images { - #[cfg(all( - target_family = "wasm", - target_os = "unknown", - not(feature = "fullstack-server") - ))] + #[cfg(all(target_family = "wasm", target_os = "unknown",))] { let _ = crate::service_worker::register_entry_blobs( &ident(), @@ -899,17 +895,29 @@ pub fn use_entries_from_ufos() -> ( use jacquard::types::aturi::AtUri; // Extract ident from the entry's at-uri if let Ok(at_uri) = AtUri::new(view.uri.as_ref()) { - let ident = at_uri.authority().to_smolstr(); + let ident = at_uri.authority(); for image in &images.images { let cid = image.image.blob().cid(); cache_blob( - ident.clone(), + ident.clone().to_smolstr(), cid.to_smolstr(), image.name.as_ref().map(|n| n.to_smolstr()), ) .await .ok(); } + #[cfg(all(target_family = "wasm", target_os = "unknown",))] + { + tracing::info!("Registering standalone entry blobs"); + let _ = + crate::service_worker::register_standalone_entry_blobs( + &ident, + at_uri.rkey().unwrap().0.as_str(), + images, + &fetcher, + ) + .await; + } } } } @@ -1205,9 +1213,7 @@ pub fn extract_did_from_author(author: &AuthorListView<'_>) -> Option>>, -) -> Memo> { +pub fn use_can_edit(permissions: Memo>>) -> Memo> { let auth_state = use_context::>(); use_memo(move || { @@ -1215,10 +1221,7 @@ pub fn use_can_edit( let perms = permissions()?; // Check if current user's DID is in the editors list - let can_edit = perms - .editors - .iter() - .any(|grant| grant.did == current_did); + let can_edit = perms.editors.iter().any(|grant| grant.did == current_did); Some(can_edit) }) @@ -1250,9 +1253,7 @@ pub fn use_can_edit_from_authors( /// /// This performs an async check that queries Constellation for collaboration records. /// Use this when you have a resource URI but not the pre-populated authors list. -pub fn use_can_edit_resource( - resource_uri: ReadSignal>, -) -> Resource> { +pub fn use_can_edit_resource(resource_uri: ReadSignal>) -> Resource> { let auth_state = use_context::>(); let fetcher = use_context::(); @@ -1316,6 +1317,17 @@ pub fn use_standalone_entry_data( use jacquard::types::aturi::AtUri; if let Ok(at_uri) = AtUri::new(data.entry_view.uri.as_ref()) { let ident_str = at_uri.authority().to_smolstr(); + #[cfg(all(target_family = "wasm", target_os = "unknown"))] + { + tracing::debug!("Registering standalone entry blobs"); + let _ = crate::service_worker::register_standalone_entry_blobs( + &ident(), + rkey().as_str(), + images, + &fetcher, + ) + .await; + } for image in &images.images { let cid = image.image.blob().cid(); cache_blob( diff --git a/crates/weaver-app/src/main.rs b/crates/weaver-app/src/main.rs index 856d552..661d7bf 100644 --- a/crates/weaver-app/src/main.rs +++ b/crates/weaver-app/src/main.rs @@ -105,17 +105,16 @@ enum Route { const FAVICON: Asset = asset!("/assets/weaver_photo_sm.jpg"); const MAIN_CSS: Asset = asset!("/assets/styling/main.css"); -#[cfg(not(feature = "fullstack-server"))] -#[cfg(feature = "server")] -async fn serve_sw() -> impl axum::response::IntoResponse { - use axum::response::IntoResponse; - let sw_js = include_str!("../assets/sw.js"); - ( - [(axum::http::header::CONTENT_TYPE, "application/javascript")], - sw_js, - ) - .into_response() -} +// #[cfg(all(feature = "fullstack-server", feature = "server"))] +// async fn serve_sw() -> axum::response::Response { +// use axum::response::IntoResponse; +// let sw_js = include_bytes!("../public/sw.js"); +// ( +// [(axum::http::header::CONTENT_TYPE, "application/javascript")], +// sw_js, +// ) +// .into_response() +// } pub static CONFIG: LazyLock = LazyLock::new(|| Config { oauth: OAuthConfig::from_env().as_metadata(), @@ -188,6 +187,7 @@ fn main() { let blob_cache = Arc::new(BlobCache::new(fetcher.clone())); axum::Router::new() .route("/favicon.ico", get(favicon)) + //.route("/sw.js", get(serve_sw)) // Server side render the application, serve static assets, and register server functions .serve_dioxus_application( ServeConfig::builder(), // Enable incremental rendering @@ -264,11 +264,7 @@ fn App() -> Element { #[cfg(not(all(target_family = "wasm", target_os = "unknown")))] let restore_result: Option = None; - #[cfg(all( - target_family = "wasm", - target_os = "unknown", - not(feature = "fullstack-server") - ))] + #[cfg(all(target_family = "wasm", target_os = "unknown",))] { use_effect(move || { let fetcher = fetcher.clone(); @@ -325,8 +321,9 @@ fn ErrorLayout() -> Element { #[cfg(all(feature = "fullstack-server", feature = "server"))] pub async fn favicon() -> axum::response::Response { use axum::{http::header::CONTENT_TYPE, response::IntoResponse}; - let bytes = include_bytes!("../assets/weaver_photo_sm.jpg"); - ([(CONTENT_TYPE, "image/jpg")], bytes).into_response() + let favicon_bytes = include_bytes!("../assets/weaver_photo_sm.jpg"); + + ([(CONTENT_TYPE, "image/jpg")], favicon_bytes).into_response() } // #[server(endpoint = "static_routes", output = server_fn::codec::Json)] diff --git a/crates/weaver-app/src/service_worker.rs b/crates/weaver-app/src/service_worker.rs index 41fe09e..ab1b795 100644 --- a/crates/weaver-app/src/service_worker.rs +++ b/crates/weaver-app/src/service_worker.rs @@ -74,6 +74,60 @@ pub async fn register_entry_blobs( Ok(()) } +/// Register blob mappings from entry images with the service worker +#[cfg(all(target_family = "wasm", target_os = "unknown"))] +pub async fn register_standalone_entry_blobs( + ident: &jacquard::types::ident::AtIdentifier<'_>, + rkey: &str, + images: &weaver_api::sh_weaver::embed::images::Images<'_>, + fetcher: &crate::fetch::Fetcher, +) -> Result<(), JsValue> { + use jacquard::prelude::IdentityResolver; + use std::collections::HashMap; + + tracing::debug!("registering blobs for {}", rkey); + let mut blob_mappings = HashMap::new(); + + // Resolve DID and PDS URL + let (did, pds_url) = match ident { + jacquard::types::ident::AtIdentifier::Did(d) => { + let pds = fetcher.client.pds_for_did(d).await.ok(); + (d.clone(), pds) + } + jacquard::types::ident::AtIdentifier::Handle(h) => { + if let Ok((did, pds)) = fetcher.client.pds_for_handle(h).await { + (did, Some(pds)) + } else { + return Ok(()); + } + } + }; + + if let Some(pds_url) = pds_url { + for image in &images.images { + let cid = image.image.blob().cid(); + + if let Some(name) = &image.name { + let blob_url = format!( + "{}xrpc/com.atproto.sync.getBlob?did={}&cid={}", + pds_url.as_str(), + did.as_ref(), + cid.as_ref() + ); + blob_mappings.insert(name.as_ref().to_string(), blob_url); + } + } + } + + // Send mappings to service worker + if !blob_mappings.is_empty() { + send_blob_rkey_mappings(rkey, ident.as_str(), blob_mappings)?; + } + //} + + Ok(()) +} + #[cfg(all(target_family = "wasm", target_os = "unknown"))] fn send_blob_mappings( notebook: &str, @@ -106,6 +160,40 @@ fn send_blob_mappings( Ok(()) } +#[cfg(all(target_family = "wasm", target_os = "unknown"))] +fn send_blob_rkey_mappings( + rkey: &str, + ident: &str, + mappings: std::collections::HashMap, +) -> Result<(), JsValue> { + let window = web_sys::window().ok_or_else(|| JsValue::from_str("no window"))?; + let navigator = window.navigator(); + let sw_container = navigator.service_worker(); + + tracing::debug!("sending blob mappings for {}", rkey); + let controller = sw_container + .controller() + .ok_or_else(|| JsValue::from_str("no service worker controller"))?; + + // Build message object + let msg = js_sys::Object::new(); + js_sys::Reflect::set(&msg, &"type".into(), &"register_rkey_mappings".into())?; + js_sys::Reflect::set(&msg, &"rkey".into(), &rkey.into())?; + js_sys::Reflect::set(&msg, &"ident".into(), &ident.into())?; + + // Convert HashMap to JS Object + let blobs_obj = js_sys::Object::new(); + for (name, url) in mappings { + js_sys::Reflect::set(&blobs_obj, &name.into(), &url.into())?; + } + js_sys::Reflect::set(&msg, &"blobs".into(), &blobs_obj)?; + + controller.post_message(&msg)?; + tracing::debug!("sent blob mappings for {}", rkey); + + Ok(()) +} + #[allow(unused)] #[cfg(not(all(target_family = "wasm", target_os = "unknown")))] pub async fn register_service_worker() -> Result<(), String> { diff --git a/crates/weaver-common/src/agent.rs b/crates/weaver-common/src/agent.rs index d0158c7..399af90 100644 --- a/crates/weaver-common/src/agent.rs +++ b/crates/weaver-common/src/agent.rs @@ -1,4 +1,3 @@ -use weaver_api::app_bsky::actor::get_profile::GetProfile; // Re-export view types for use elsewhere pub use weaver_api::sh_weaver::notebook::{ AuthorListView, BookEntryRef, BookEntryView, EntryView, NotebookView, PermissionGrant, @@ -18,11 +17,9 @@ use jacquard::types::string::{AtUri, Did, RecordKey, Rkey}; use jacquard::types::tid::Tid; use jacquard::types::uri::Uri; use jacquard::url::Url; -use jacquard::xrpc::Response; -use jacquard::{CowStr, IntoStatic, xrpc}; +use jacquard::{CowStr, IntoStatic}; use mime_sniffer::MimeTypeSniffer; use std::path::Path; -use weaver_api::com_atproto::repo::get_record::GetRecordResponse; use weaver_api::com_atproto::repo::strong_ref::StrongRef; use weaver_api::sh_weaver::notebook::entry; use weaver_api::sh_weaver::publish::blob::Blob as PublishedBlob; @@ -67,7 +64,6 @@ fn title_matches(value: &str, search: &str) -> bool { /// - `agent.upload_blob()` - Upload a single blob /// /// This trait is for multi-step workflows that coordinate between multiple operations. -//#[cfg_attr(not(target_arch = "wasm32"), trait_variant::make(Send))] pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { /// Publish a blob to the user's PDS /// @@ -112,63 +108,14 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { uri: &'a AtUri<'a>, ) -> impl Future, WeaverError>> + 'a { async move { - let rkey = uri.rkey().ok_or_else(|| { - AgentError::from( - ClientError::invalid_request("AtUri missing rkey") - .with_help("ensure the URI includes a record key after the collection"), - ) + let record = self.fetch_record_slingshot(uri).await?; + let cid = record.cid.ok_or_else(|| { + AgentError::from(ClientError::invalid_request("Record missing CID")) })?; - - // Resolve authority (DID or handle) to get DID and PDS - use jacquard::types::ident::AtIdentifier; - let (repo_did, pds_url) = match uri.authority() { - AtIdentifier::Did(did) => { - let pds = - self.pds_for_did(did).await.map_err(|e| { - AgentError::from(ClientError::from(e).with_context( - "DID document resolution failed during record retrieval", - )) - })?; - (did.clone(), pds) - } - AtIdentifier::Handle(handle) => self.pds_for_handle(handle).await.map_err(|e| { - AgentError::from( - ClientError::from(e) - .with_context("handle resolution failed during record retrieval"), - ) - })?, - }; - - // Make stateless XRPC call to that PDS (no auth required for public records) - use weaver_api::com_atproto::repo::get_record::GetRecord; - let request = GetRecord::new() - .repo(AtIdentifier::Did(repo_did)) - .collection( - uri.collection() - .expect("collection should exist if rkey does") - .clone(), - ) - .rkey(rkey.clone()) - .build(); - - let response: Response = { - let http_request = xrpc::build_http_request(&pds_url, &request, &self.opts().await) - .map_err(|e| AgentError::from(ClientError::transport(e)))?; - - let http_response = self - .send_http(http_request) - .await - .map_err(|e| AgentError::from(ClientError::transport(e)))?; - - xrpc::process_response(http_response) - } - .map_err(|e| AgentError::new(AgentErrorKind::Client, Some(e.into())))?; - let record = response.parse().map_err(|e| AgentError::xrpc(e))?; - let strong_ref = StrongRef::new() - .uri(record.uri) - .cid(record.cid.expect("when does this NOT have a CID?")) - .build(); - Ok(strong_ref.into_static()) + Ok(StrongRef::new() + .uri(record.uri.into_static()) + .cid(cid.into_static()) + .build()) } } @@ -504,15 +451,71 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { let entry_uri = Entry::uri(entry_ref.uri.clone()) .map_err(|_| AgentError::from(ClientError::invalid_request("Invalid entry URI")))?; - let entry = self.fetch_record(&entry_uri).await?; - let title = entry.value.title.clone(); - let path = entry.value.path.clone(); - let tags = entry.value.tags.clone(); + // Get the rkey for version lookup + let rkey = entry_uri.rkey().ok_or_else(|| { + AgentError::from(ClientError::invalid_request("Entry URI missing rkey")) + })?; // Fetch permissions for this entry (includes inherited notebook permissions) let permissions = self.get_permissions_for_resource(&entry_uri).await?; + // Get all collaborators (owner + invited) + let owner_did = match entry_uri.authority() { + jacquard::types::ident::AtIdentifier::Did(d) => d.clone().into_static(), + jacquard::types::ident::AtIdentifier::Handle(h) => { + let (did, _) = self.pds_for_handle(h).await.map_err(|e| { + AgentError::from( + ClientError::from(e).with_context("Failed to resolve handle"), + ) + })?; + did.into_static() + } + }; + let collaborators = self + .find_collaborators_for_resource(&entry_uri) + .await + .unwrap_or_default(); + let all_dids: Vec> = std::iter::once(owner_did) + .chain(collaborators.into_iter()) + .collect(); + + // Find all versions across collaborators, get latest by updatedAt + let versions = self + .find_all_versions( + ::NSID, + rkey.0.as_str(), + &all_dids, + ) + .await + .unwrap_or_default(); + + // Use latest version if found, otherwise fall back to original entry_ref + let (entry_data, final_uri, final_cid) = if let Some(latest) = versions.first() { + // Deserialize from the latest version's value + let entry: Entry = jacquard::from_data(&latest.value).map_err(|_| { + AgentError::from(ClientError::invalid_request( + "Failed to deserialize latest entry", + )) + })?; + (entry.into_static(), latest.uri.clone(), latest.cid.clone()) + } else { + // No versions found via find_all_versions, fetch directly + let entry = self.fetch_record(&entry_uri).await?; + let cid = entry.cid.ok_or_else(|| { + AgentError::from(ClientError::invalid_request("Entry missing CID")) + })?; + ( + entry.value.into_static(), + entry.uri.into_static(), + cid.into_static(), + ) + }; + + let title = entry_data.title.clone(); + let path = entry_data.path.clone(); + let tags = entry_data.tags.clone(); + // Fetch contributors (evidence-based authors) for this entry let contributor_dids = self.find_contributors_for_resource(&entry_uri).await?; let mut authors = Vec::new(); @@ -528,12 +531,10 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { } Ok(EntryView::new() - .cid(entry.cid.ok_or_else(|| { - AgentError::from(ClientError::invalid_request("Entry missing CID")) - })?) - .uri(entry.uri) + .cid(final_cid) + .uri(final_uri) .indexed_at(jacquard::types::string::Datetime::now()) - .record(to_data(&entry.value).map_err(|_| { + .record(to_data(&entry_data).map_err(|_| { AgentError::from(ClientError::invalid_request("Failed to serialize entry")) })?) .maybe_tags(tags) @@ -975,18 +976,73 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { use jacquard::to_data; use weaver_api::sh_weaver::notebook::page::Page; - let entry_uri = Page::uri(entry_ref.uri.clone()) + let page_uri = Page::uri(entry_ref.uri.clone()) .map_err(|_| AgentError::from(ClientError::invalid_request("Invalid page URI")))?; - let entry = self.fetch_record(&entry_uri).await?; - let title = entry.value.title.clone(); - let tags = entry.value.tags.clone(); + // Get the rkey for version lookup + let rkey = page_uri.rkey().ok_or_else(|| { + AgentError::from(ClientError::invalid_request("Page URI missing rkey")) + })?; // Fetch permissions for this page (includes inherited notebook permissions) - let permissions = self.get_permissions_for_resource(&entry_uri).await?; + let permissions = self.get_permissions_for_resource(&page_uri).await?; + + // Get all collaborators (owner + invited) + let owner_did = match page_uri.authority() { + jacquard::types::ident::AtIdentifier::Did(d) => d.clone().into_static(), + jacquard::types::ident::AtIdentifier::Handle(h) => { + let (did, _) = self.pds_for_handle(h).await.map_err(|e| { + AgentError::from( + ClientError::from(e).with_context("Failed to resolve handle"), + ) + })?; + did.into_static() + } + }; + let collaborators = self + .find_collaborators_for_resource(&page_uri) + .await + .unwrap_or_default(); + let all_dids: Vec> = std::iter::once(owner_did) + .chain(collaborators.into_iter()) + .collect(); + + // Find all versions across collaborators, get latest by updatedAt + let versions = self + .find_all_versions( + ::NSID, + rkey.0.as_str(), + &all_dids, + ) + .await + .unwrap_or_default(); + + // Use latest version if found, otherwise fall back to direct fetch + let (page_data, final_uri, final_cid) = if let Some(latest) = versions.first() { + let page: Page = jacquard::from_data(&latest.value).map_err(|_| { + AgentError::from(ClientError::invalid_request( + "Failed to deserialize latest page", + )) + })?; + (page.into_static(), latest.uri.clone(), latest.cid.clone()) + } else { + // No versions found, fetch directly from PDS + let page = self.fetch_record(&page_uri).await?; + let cid = page.cid.ok_or_else(|| { + AgentError::from(ClientError::invalid_request("Page missing CID")) + })?; + ( + page.value.into_static(), + page.uri.into_static(), + cid.into_static(), + ) + }; + + let title = page_data.title.clone(); + let tags = page_data.tags.clone(); // Fetch contributors (evidence-based authors) for this page - let contributor_dids = self.find_contributors_for_resource(&entry_uri).await?; + let contributor_dids = self.find_contributors_for_resource(&page_uri).await?; let mut authors = Vec::new(); for (index, did) in contributor_dids.iter().enumerate() { let (profile_uri, profile_view) = self.hydrate_profile_view(did).await?; @@ -1000,12 +1056,10 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { } Ok(EntryView::new() - .cid(entry.cid.ok_or_else(|| { - AgentError::from(ClientError::invalid_request("Page missing CID")) - })?) - .uri(entry.uri) + .cid(final_cid) + .uri(final_uri) .indexed_at(jacquard::types::string::Datetime::now()) - .record(to_data(&entry.value).map_err(|_| { + .record(to_data(&page_data).map_err(|_| { AgentError::from(ClientError::invalid_request("Failed to serialize page")) })?) .maybe_tags(tags) @@ -1102,65 +1156,71 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { async move { use jacquard::to_data; use jacquard::types::collection::Collection; - use weaver_api::com_atproto::repo::get_record::GetRecord; - // Resolve DID and PDS from ident - let (repo_did, pds_url) = match ident { - jacquard::types::ident::AtIdentifier::Did(did) => { - let pds = self.pds_for_did(did).await.map_err(|e| { - AgentError::from( - ClientError::from(e).with_context("Failed to resolve PDS for DID"), - ) - })?; - (did.clone(), pds) - } + // Resolve DID from ident + let repo_did = match ident { + jacquard::types::ident::AtIdentifier::Did(did) => did.clone(), jacquard::types::ident::AtIdentifier::Handle(handle) => { - self.pds_for_handle(handle).await.map_err(|e| { + let (did, _pds) = self.pds_for_handle(handle).await.map_err(|e| { AgentError::from( ClientError::from(e).with_context("Failed to resolve handle"), ) - })? + })?; + did } }; - // Fetch the entry record - let request = GetRecord::new() - .repo(jacquard::types::ident::AtIdentifier::Did(repo_did.clone())) - .collection(jacquard::types::nsid::Nsid::raw(entry::Entry::NSID)) - .rkey(RecordKey::any(rkey)?) - .build(); + // Build entry URI for contributor/permission queries + let entry_uri_str = format!("at://{}/{}/{}", repo_did, entry::Entry::NSID, rkey); + let entry_uri = AtUri::new(&entry_uri_str) + .map_err(|_| AgentError::from(ClientError::invalid_request("Invalid entry URI")))? + .into_static(); - let response: Response = { - let http_request = xrpc::build_http_request(&pds_url, &request, &self.opts().await) - .map_err(|e| AgentError::from(ClientError::transport(e)))?; + // Get collaborators for version lookup + let collaborators = self + .find_collaborators_for_resource(&entry_uri) + .await + .unwrap_or_default(); + let all_dids: Vec> = std::iter::once(repo_did.clone().into_static()) + .chain(collaborators.into_iter()) + .collect(); - let http_response = self - .send_http(http_request) - .await - .map_err(|e| AgentError::from(ClientError::transport(e)))?; + // Find all versions across collaborators, get latest by updatedAt + let versions = self + .find_all_versions(entry::Entry::NSID, rkey, &all_dids) + .await + .unwrap_or_default(); - xrpc::process_response(http_response) - } - .map_err(|e| AgentError::new(AgentErrorKind::Client, Some(e.into())))?; + // Use latest version if found, otherwise fetch directly from original ident + let (entry_value, final_uri, final_cid) = if let Some(latest) = versions.first() { + let entry: entry::Entry = jacquard::from_data(&latest.value).map_err(|e| { + AgentError::from(ClientError::invalid_request(format!( + "Failed to deserialize latest entry: {}", + e + ))) + })?; + (entry.into_static(), latest.uri.clone(), latest.cid.clone()) + } else { + // Fallback: fetch directly via slingshot + let record = self.fetch_record_slingshot(&entry_uri).await?; - let record = response.into_output().map_err(|e| { - AgentError::from(ClientError::invalid_request(format!( - "Failed to parse entry record: {}", - e - ))) - })?; + let entry: entry::Entry = jacquard::from_data(&record.value).map_err(|e| { + AgentError::from(ClientError::invalid_request(format!( + "Failed to deserialize entry: {}", + e + ))) + })?; - // Parse the entry value - let entry_value: entry::Entry = jacquard::from_data(&record.value).map_err(|e| { - AgentError::from(ClientError::invalid_request(format!( - "Failed to deserialize entry: {}", - e - ))) - })?; + let cid = record.cid.ok_or_else(|| { + AgentError::from(ClientError::invalid_request("Entry missing CID")) + })?; - // Build entry URI for contributor/permission queries - let entry_uri = entry::Entry::uri(record.uri.clone()) - .map_err(|_| AgentError::from(ClientError::invalid_request("Invalid entry URI")))?; + ( + entry.into_static(), + record.uri.into_static(), + cid.into_static(), + ) + }; // Fetch contributors (evidence-based authors) let contributor_dids = self.find_contributors_for_resource(&entry_uri).await?; @@ -1180,10 +1240,8 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { let permissions = self.get_permissions_for_resource(&entry_uri).await?; let entry_view = EntryView::new() - .cid(record.cid.ok_or_else(|| { - AgentError::from(ClientError::invalid_request("Entry missing CID")) - })?) - .uri(record.uri) + .cid(final_cid) + .uri(final_uri) .indexed_at(jacquard::types::string::Datetime::now()) .record(to_data(&entry_value).map_err(|_| { AgentError::from(ClientError::invalid_request("Failed to serialize entry")) @@ -1385,43 +1443,18 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { { async move { use jacquard::Data; - use weaver_api::com_atproto::repo::get_record::GetRecord; let mut versions = Vec::new(); for collab_did in collaborators { - let Ok(pds_url) = self.pds_for_did(collab_did).await else { - continue; - }; - - let Ok(record_key) = RecordKey::any(rkey) else { - continue; - }; - let request = GetRecord::new() - .repo(jacquard::types::ident::AtIdentifier::Did( - collab_did.clone(), - )) - .collection(jacquard::types::nsid::Nsid::raw(collection)) - .rkey(record_key) - .build(); - - let Ok(http_request) = - xrpc::build_http_request(&pds_url, &request, &self.opts().await) - else { - continue; - }; - - let Ok(http_response) = self.send_http(http_request).await else { + // Build URI for this collaborator's version + let uri_str = format!("at://{}/{}/{}", collab_did, collection, rkey); + let Ok(uri) = AtUri::new(&uri_str) else { continue; }; - let response: Response = - match xrpc::process_response(http_response) { - Ok(r) => r, - Err(_) => continue, - }; - - let Ok(record) = response.into_output() else { + // Fetch via slingshot (handles cross-PDS routing) + let Ok(record) = self.fetch_record_slingshot(&uri).await else { continue; }; @@ -1916,7 +1949,7 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { if let (Some(rkey), Some(collection)) = (rkey, collection) { for collab_did in collaborators { - // Try to fetch their version of the record + // Try to fetch their version of the record via slingshot let collab_uri_str = format!( "at://{}/{}/{}", collab_did.as_ref(), @@ -1924,16 +1957,9 @@ pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { rkey.as_ref() ); if let Ok(collab_uri) = AtUri::new(&collab_uri_str) { - // Check if record actually exists (200 = found, 400 = not found) - if let Ok(response) = self - .get_record::( - &collab_uri, - ) - .await - { - if response.status().is_success() { - contributors.insert(collab_did); - } + // Check if record actually exists + if self.fetch_record_slingshot(&collab_uri).await.is_ok() { + contributors.insert(collab_did); } } } diff --git a/crates/weaver-common/src/lib.rs b/crates/weaver-common/src/lib.rs index e01999f..bf45db5 100644 --- a/crates/weaver-common/src/lib.rs +++ b/crates/weaver-common/src/lib.rs @@ -10,8 +10,7 @@ pub mod worker_rt; pub use agent::WeaverExt; pub use error::WeaverError; pub use resolve::{EntryIndex, ExtractedRef, RefCollector, ResolvedContent, ResolvedEntry}; -#[cfg(any(test, feature = "standalone-collection"))] -pub use resolve::collect_refs_from_markdown; + pub use jacquard; use jacquard::CowStr; use jacquard::client::{Agent, AgentSession}; @@ -19,6 +18,7 @@ use jacquard::prelude::*; use jacquard::types::ident::AtIdentifier; use jacquard::types::string::{AtUri, Cid, Did, Handle}; use jacquard::types::tid::Ticker; +pub use resolve::collect_refs_from_markdown; use std::sync::LazyLock; use tokio::sync::Mutex; use weaver_api::com_atproto::repo::strong_ref::StrongRef; diff --git a/crates/weaver-common/src/resolve.rs b/crates/weaver-common/src/resolve.rs index 8dd6d45..8bc4fbb 100644 --- a/crates/weaver-common/src/resolve.rs +++ b/crates/weaver-common/src/resolve.rs @@ -252,7 +252,6 @@ impl RefCollector { /// **Note:** This does a separate parsing pass. For production use, prefer /// passing a `RefCollector` to the renderer to collect during the render pass. /// This function is primarily useful for testing or quick analysis. -#[cfg(any(test, feature = "standalone-collection"))] pub fn collect_refs_from_markdown(markdown: &str) -> Vec { use markdown_weaver::{Event, LinkType, Options, Parser, Tag}; diff --git a/lexicons/edit/defs.json b/lexicons/edit/defs.json index 1ceba81..73e80af 100644 --- a/lexicons/edit/defs.json +++ b/lexicons/edit/defs.json @@ -35,9 +35,9 @@ "draftRef": { "type": "object", - "required": ["draft_key"], + "required": ["draftKey"], "properties": { - "draft_key": { + "draftKey": { "type": "string", "maxLength": 200 }