atproto blogging

lexicon updates, async collab basically works

Orual 839fea53 d4a64dcb

+5046 -4202
+25
Cargo.lock
··· 2649 2649 ] 2650 2650 2651 2651 [[package]] 2652 + name = "dioxus-sdk" 2653 + version = "0.7.0" 2654 + source = "registry+https://github.com/rust-lang/crates.io-index" 2655 + checksum = "79a653986dc3151f00a2be4cf04f83ec6c2af24b600ab926d5fcbcd159c6dadf" 2656 + dependencies = [ 2657 + "dioxus-sdk-time", 2658 + ] 2659 + 2660 + [[package]] 2661 + name = "dioxus-sdk-time" 2662 + version = "0.7.0" 2663 + source = "registry+https://github.com/rust-lang/crates.io-index" 2664 + checksum = "80c25ae93a3f72e734873b97fbd09d9b1b6adff97205fb0ffd8543e3564fb78e" 2665 + dependencies = [ 2666 + "dioxus 0.7.1", 2667 + "futures", 2668 + "gloo-timers", 2669 + "tokio", 2670 + ] 2671 + 2672 + [[package]] 2652 2673 name = "dioxus-server" 2653 2674 version = "0.7.1" 2654 2675 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4839 4860 "miette 7.6.0", 4840 4861 "rustversion", 4841 4862 "serde", 4863 + "serde_bytes", 4842 4864 "serde_ipld_dagcbor", 4843 4865 "thiserror 2.0.17", 4844 4866 "unicode-segmentation", ··· 4894 4916 "regex-lite", 4895 4917 "reqwest", 4896 4918 "serde", 4919 + "serde_bytes", 4897 4920 "serde_html_form", 4898 4921 "serde_ipld_dagcbor", 4899 4922 "serde_json", ··· 10282 10305 "miette 7.6.0", 10283 10306 "rustversion", 10284 10307 "serde", 10308 + "serde_bytes", 10285 10309 "serde_ipld_dagcbor", 10286 10310 "thiserror 2.0.17", 10287 10311 "unicode-segmentation", ··· 10300 10324 "dioxus 0.7.1", 10301 10325 "dioxus-free-icons", 10302 10326 "dioxus-primitives", 10327 + "dioxus-sdk", 10303 10328 "dotenvy", 10304 10329 "fontdb", 10305 10330 "gloo-storage",
+1 -1
crates/weaver-api/Cargo.toml
··· 16 16 serde_ipld_dagcbor = { version = "0.6", optional = true } 17 17 thiserror.workspace = true 18 18 unicode-segmentation = "1.12" 19 - 19 + serde_bytes = "0.11" 20 20 21 21 [lints.rust] 22 22 # just so that my rust-analyzer shuts up about the module name for 2048.blue's namespace
+2 -2
crates/weaver-api/lexicons/sh_weaver_edit_defs.json
··· 21 21 "draftRef": { 22 22 "type": "object", 23 23 "required": [ 24 - "draft_key" 24 + "draftKey" 25 25 ], 26 26 "properties": { 27 - "draft_key": { 27 + "draftKey": { 28 28 "type": "string", 29 29 "maxLength": 200 30 30 }
+97 -97
crates/weaver-api/src/app_bsky/actor.rs
··· 3037 3037 } 3038 3038 /// State trait tracking which required fields have been set 3039 3039 pub trait State: sealed::Sealed { 3040 - type Count; 3041 3040 type Followers; 3041 + type Count; 3042 3042 } 3043 3043 /// Empty state - all required fields are unset 3044 3044 pub struct Empty(()); 3045 3045 impl sealed::Sealed for Empty {} 3046 3046 impl State for Empty { 3047 - type Count = Unset; 3048 3047 type Followers = Unset; 3049 - } 3050 - ///State transition - sets the `count` field to Set 3051 - pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 3052 - impl<S: State> sealed::Sealed for SetCount<S> {} 3053 - impl<S: State> State for SetCount<S> { 3054 - type Count = Set<members::count>; 3055 - type Followers = S::Followers; 3048 + type Count = Unset; 3056 3049 } 3057 3050 ///State transition - sets the `followers` field to Set 3058 3051 pub struct SetFollowers<S: State = Empty>(PhantomData<fn() -> S>); 3059 3052 impl<S: State> sealed::Sealed for SetFollowers<S> {} 3060 3053 impl<S: State> State for SetFollowers<S> { 3061 - type Count = S::Count; 3062 3054 type Followers = Set<members::followers>; 3055 + type Count = S::Count; 3056 + } 3057 + ///State transition - sets the `count` field to Set 3058 + pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 3059 + impl<S: State> sealed::Sealed for SetCount<S> {} 3060 + impl<S: State> State for SetCount<S> { 3061 + type Followers = S::Followers; 3062 + type Count = Set<members::count>; 3063 3063 } 3064 3064 /// Marker types for field names 3065 3065 #[allow(non_camel_case_types)] 3066 3066 pub mod members { 3067 - ///Marker type for the `count` field 3068 - pub struct count(()); 3069 3067 ///Marker type for the `followers` field 3070 3068 pub struct followers(()); 3069 + ///Marker type for the `count` field 3070 + pub struct count(()); 3071 3071 } 3072 3072 } 3073 3073 ··· 3140 3140 impl<'a, S> KnownFollowersBuilder<'a, S> 3141 3141 where 3142 3142 S: known_followers_state::State, 3143 - S::Count: known_followers_state::IsSet, 3144 3143 S::Followers: known_followers_state::IsSet, 3144 + S::Count: known_followers_state::IsSet, 3145 3145 { 3146 3146 /// Build the final struct 3147 3147 pub fn build(self) -> KnownFollowers<'a> { ··· 4600 4600 } 4601 4601 /// State trait tracking which required fields have been set 4602 4602 pub trait State: sealed::Sealed { 4603 - type Did; 4604 4603 type Handle; 4604 + type Did; 4605 4605 } 4606 4606 /// Empty state - all required fields are unset 4607 4607 pub struct Empty(()); 4608 4608 impl sealed::Sealed for Empty {} 4609 4609 impl State for Empty { 4610 - type Did = Unset; 4611 4610 type Handle = Unset; 4611 + type Did = Unset; 4612 + } 4613 + ///State transition - sets the `handle` field to Set 4614 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 4615 + impl<S: State> sealed::Sealed for SetHandle<S> {} 4616 + impl<S: State> State for SetHandle<S> { 4617 + type Handle = Set<members::handle>; 4618 + type Did = S::Did; 4612 4619 } 4613 4620 ///State transition - sets the `did` field to Set 4614 4621 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 4615 4622 impl<S: State> sealed::Sealed for SetDid<S> {} 4616 4623 impl<S: State> State for SetDid<S> { 4624 + type Handle = S::Handle; 4617 4625 type Did = Set<members::did>; 4618 - type Handle = S::Handle; 4619 - } 4620 - ///State transition - sets the `handle` field to Set 4621 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 4622 - impl<S: State> sealed::Sealed for SetHandle<S> {} 4623 - impl<S: State> State for SetHandle<S> { 4624 - type Did = S::Did; 4625 - type Handle = Set<members::handle>; 4626 4626 } 4627 4627 /// Marker types for field names 4628 4628 #[allow(non_camel_case_types)] 4629 4629 pub mod members { 4630 + ///Marker type for the `handle` field 4631 + pub struct handle(()); 4630 4632 ///Marker type for the `did` field 4631 4633 pub struct did(()); 4632 - ///Marker type for the `handle` field 4633 - pub struct handle(()); 4634 4634 } 4635 4635 } 4636 4636 ··· 4955 4955 impl<'a, S> ProfileViewBuilder<'a, S> 4956 4956 where 4957 4957 S: profile_view_state::State, 4958 - S::Did: profile_view_state::IsSet, 4959 4958 S::Handle: profile_view_state::IsSet, 4959 + S::Did: profile_view_state::IsSet, 4960 4960 { 4961 4961 /// Build the final struct 4962 4962 pub fn build(self) -> ProfileView<'a> { ··· 6290 6290 } 6291 6291 /// State trait tracking which required fields have been set 6292 6292 pub trait State: sealed::Sealed { 6293 + type Value; 6293 6294 type Id; 6294 - type Type; 6295 - type Value; 6296 6295 type Pinned; 6296 + type Type; 6297 6297 } 6298 6298 /// Empty state - all required fields are unset 6299 6299 pub struct Empty(()); 6300 6300 impl sealed::Sealed for Empty {} 6301 6301 impl State for Empty { 6302 + type Value = Unset; 6302 6303 type Id = Unset; 6304 + type Pinned = Unset; 6303 6305 type Type = Unset; 6304 - type Value = Unset; 6305 - type Pinned = Unset; 6306 + } 6307 + ///State transition - sets the `value` field to Set 6308 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 6309 + impl<S: State> sealed::Sealed for SetValue<S> {} 6310 + impl<S: State> State for SetValue<S> { 6311 + type Value = Set<members::value>; 6312 + type Id = S::Id; 6313 + type Pinned = S::Pinned; 6314 + type Type = S::Type; 6306 6315 } 6307 6316 ///State transition - sets the `id` field to Set 6308 6317 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 6309 6318 impl<S: State> sealed::Sealed for SetId<S> {} 6310 6319 impl<S: State> State for SetId<S> { 6320 + type Value = S::Value; 6311 6321 type Id = Set<members::id>; 6312 - type Type = S::Type; 6313 - type Value = S::Value; 6314 6322 type Pinned = S::Pinned; 6315 - } 6316 - ///State transition - sets the `type` field to Set 6317 - pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 6318 - impl<S: State> sealed::Sealed for SetType<S> {} 6319 - impl<S: State> State for SetType<S> { 6320 - type Id = S::Id; 6321 - type Type = Set<members::r#type>; 6322 - type Value = S::Value; 6323 - type Pinned = S::Pinned; 6324 - } 6325 - ///State transition - sets the `value` field to Set 6326 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 6327 - impl<S: State> sealed::Sealed for SetValue<S> {} 6328 - impl<S: State> State for SetValue<S> { 6329 - type Id = S::Id; 6330 6323 type Type = S::Type; 6331 - type Value = Set<members::value>; 6332 - type Pinned = S::Pinned; 6333 6324 } 6334 6325 ///State transition - sets the `pinned` field to Set 6335 6326 pub struct SetPinned<S: State = Empty>(PhantomData<fn() -> S>); 6336 6327 impl<S: State> sealed::Sealed for SetPinned<S> {} 6337 6328 impl<S: State> State for SetPinned<S> { 6329 + type Value = S::Value; 6338 6330 type Id = S::Id; 6331 + type Pinned = Set<members::pinned>; 6339 6332 type Type = S::Type; 6333 + } 6334 + ///State transition - sets the `type` field to Set 6335 + pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 6336 + impl<S: State> sealed::Sealed for SetType<S> {} 6337 + impl<S: State> State for SetType<S> { 6340 6338 type Value = S::Value; 6341 - type Pinned = Set<members::pinned>; 6339 + type Id = S::Id; 6340 + type Pinned = S::Pinned; 6341 + type Type = Set<members::r#type>; 6342 6342 } 6343 6343 /// Marker types for field names 6344 6344 #[allow(non_camel_case_types)] 6345 6345 pub mod members { 6346 + ///Marker type for the `value` field 6347 + pub struct value(()); 6346 6348 ///Marker type for the `id` field 6347 6349 pub struct id(()); 6350 + ///Marker type for the `pinned` field 6351 + pub struct pinned(()); 6348 6352 ///Marker type for the `type` field 6349 6353 pub struct r#type(()); 6350 - ///Marker type for the `value` field 6351 - pub struct value(()); 6352 - ///Marker type for the `pinned` field 6353 - pub struct pinned(()); 6354 6354 } 6355 6355 } 6356 6356 ··· 6463 6463 impl<'a, S> SavedFeedBuilder<'a, S> 6464 6464 where 6465 6465 S: saved_feed_state::State, 6466 - S::Id: saved_feed_state::IsSet, 6467 - S::Type: saved_feed_state::IsSet, 6468 6466 S::Value: saved_feed_state::IsSet, 6467 + S::Id: saved_feed_state::IsSet, 6469 6468 S::Pinned: saved_feed_state::IsSet, 6469 + S::Type: saved_feed_state::IsSet, 6470 6470 { 6471 6471 /// Build the final struct 6472 6472 pub fn build(self) -> SavedFeed<'a> { ··· 6543 6543 } 6544 6544 /// State trait tracking which required fields have been set 6545 6545 pub trait State: sealed::Sealed { 6546 - type Pinned; 6547 6546 type Saved; 6547 + type Pinned; 6548 6548 } 6549 6549 /// Empty state - all required fields are unset 6550 6550 pub struct Empty(()); 6551 6551 impl sealed::Sealed for Empty {} 6552 6552 impl State for Empty { 6553 + type Saved = Unset; 6553 6554 type Pinned = Unset; 6554 - type Saved = Unset; 6555 + } 6556 + ///State transition - sets the `saved` field to Set 6557 + pub struct SetSaved<S: State = Empty>(PhantomData<fn() -> S>); 6558 + impl<S: State> sealed::Sealed for SetSaved<S> {} 6559 + impl<S: State> State for SetSaved<S> { 6560 + type Saved = Set<members::saved>; 6561 + type Pinned = S::Pinned; 6555 6562 } 6556 6563 ///State transition - sets the `pinned` field to Set 6557 6564 pub struct SetPinned<S: State = Empty>(PhantomData<fn() -> S>); 6558 6565 impl<S: State> sealed::Sealed for SetPinned<S> {} 6559 6566 impl<S: State> State for SetPinned<S> { 6560 - type Pinned = Set<members::pinned>; 6561 6567 type Saved = S::Saved; 6562 - } 6563 - ///State transition - sets the `saved` field to Set 6564 - pub struct SetSaved<S: State = Empty>(PhantomData<fn() -> S>); 6565 - impl<S: State> sealed::Sealed for SetSaved<S> {} 6566 - impl<S: State> State for SetSaved<S> { 6567 - type Pinned = S::Pinned; 6568 - type Saved = Set<members::saved>; 6568 + type Pinned = Set<members::pinned>; 6569 6569 } 6570 6570 /// Marker types for field names 6571 6571 #[allow(non_camel_case_types)] 6572 6572 pub mod members { 6573 + ///Marker type for the `saved` field 6574 + pub struct saved(()); 6573 6575 ///Marker type for the `pinned` field 6574 6576 pub struct pinned(()); 6575 - ///Marker type for the `saved` field 6576 - pub struct saved(()); 6577 6577 } 6578 6578 } 6579 6579 ··· 6660 6660 impl<'a, S> SavedFeedsPrefBuilder<'a, S> 6661 6661 where 6662 6662 S: saved_feeds_pref_state::State, 6663 - S::Pinned: saved_feeds_pref_state::IsSet, 6664 6663 S::Saved: saved_feeds_pref_state::IsSet, 6664 + S::Pinned: saved_feeds_pref_state::IsSet, 6665 6665 { 6666 6666 /// Build the final struct 6667 6667 pub fn build(self) -> SavedFeedsPref<'a> { ··· 6883 6883 } 6884 6884 /// State trait tracking which required fields have been set 6885 6885 pub trait State: sealed::Sealed { 6886 - type Status; 6887 6886 type Record; 6887 + type Status; 6888 6888 } 6889 6889 /// Empty state - all required fields are unset 6890 6890 pub struct Empty(()); 6891 6891 impl sealed::Sealed for Empty {} 6892 6892 impl State for Empty { 6893 + type Record = Unset; 6893 6894 type Status = Unset; 6894 - type Record = Unset; 6895 + } 6896 + ///State transition - sets the `record` field to Set 6897 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 6898 + impl<S: State> sealed::Sealed for SetRecord<S> {} 6899 + impl<S: State> State for SetRecord<S> { 6900 + type Record = Set<members::record>; 6901 + type Status = S::Status; 6895 6902 } 6896 6903 ///State transition - sets the `status` field to Set 6897 6904 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 6898 6905 impl<S: State> sealed::Sealed for SetStatus<S> {} 6899 6906 impl<S: State> State for SetStatus<S> { 6900 - type Status = Set<members::status>; 6901 6907 type Record = S::Record; 6902 - } 6903 - ///State transition - sets the `record` field to Set 6904 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 6905 - impl<S: State> sealed::Sealed for SetRecord<S> {} 6906 - impl<S: State> State for SetRecord<S> { 6907 - type Status = S::Status; 6908 - type Record = Set<members::record>; 6908 + type Status = Set<members::status>; 6909 6909 } 6910 6910 /// Marker types for field names 6911 6911 #[allow(non_camel_case_types)] 6912 6912 pub mod members { 6913 + ///Marker type for the `record` field 6914 + pub struct record(()); 6913 6915 ///Marker type for the `status` field 6914 6916 pub struct status(()); 6915 - ///Marker type for the `record` field 6916 - pub struct record(()); 6917 6917 } 6918 6918 } 6919 6919 ··· 7040 7040 impl<'a, S> StatusViewBuilder<'a, S> 7041 7041 where 7042 7042 S: status_view_state::State, 7043 - S::Status: status_view_state::IsSet, 7044 7043 S::Record: status_view_state::IsSet, 7044 + S::Status: status_view_state::IsSet, 7045 7045 { 7046 7046 /// Build the final struct 7047 7047 pub fn build(self) -> StatusView<'a> { ··· 7196 7196 } 7197 7197 /// State trait tracking which required fields have been set 7198 7198 pub trait State: sealed::Sealed { 7199 - type Verifications; 7200 7199 type VerifiedStatus; 7200 + type Verifications; 7201 7201 type TrustedVerifierStatus; 7202 7202 } 7203 7203 /// Empty state - all required fields are unset 7204 7204 pub struct Empty(()); 7205 7205 impl sealed::Sealed for Empty {} 7206 7206 impl State for Empty { 7207 - type Verifications = Unset; 7208 7207 type VerifiedStatus = Unset; 7208 + type Verifications = Unset; 7209 7209 type TrustedVerifierStatus = Unset; 7210 7210 } 7211 - ///State transition - sets the `verifications` field to Set 7212 - pub struct SetVerifications<S: State = Empty>(PhantomData<fn() -> S>); 7213 - impl<S: State> sealed::Sealed for SetVerifications<S> {} 7214 - impl<S: State> State for SetVerifications<S> { 7215 - type Verifications = Set<members::verifications>; 7216 - type VerifiedStatus = S::VerifiedStatus; 7217 - type TrustedVerifierStatus = S::TrustedVerifierStatus; 7218 - } 7219 7211 ///State transition - sets the `verified_status` field to Set 7220 7212 pub struct SetVerifiedStatus<S: State = Empty>(PhantomData<fn() -> S>); 7221 7213 impl<S: State> sealed::Sealed for SetVerifiedStatus<S> {} 7222 7214 impl<S: State> State for SetVerifiedStatus<S> { 7223 - type Verifications = S::Verifications; 7224 7215 type VerifiedStatus = Set<members::verified_status>; 7216 + type Verifications = S::Verifications; 7217 + type TrustedVerifierStatus = S::TrustedVerifierStatus; 7218 + } 7219 + ///State transition - sets the `verifications` field to Set 7220 + pub struct SetVerifications<S: State = Empty>(PhantomData<fn() -> S>); 7221 + impl<S: State> sealed::Sealed for SetVerifications<S> {} 7222 + impl<S: State> State for SetVerifications<S> { 7223 + type VerifiedStatus = S::VerifiedStatus; 7224 + type Verifications = Set<members::verifications>; 7225 7225 type TrustedVerifierStatus = S::TrustedVerifierStatus; 7226 7226 } 7227 7227 ///State transition - sets the `trusted_verifier_status` field to Set 7228 7228 pub struct SetTrustedVerifierStatus<S: State = Empty>(PhantomData<fn() -> S>); 7229 7229 impl<S: State> sealed::Sealed for SetTrustedVerifierStatus<S> {} 7230 7230 impl<S: State> State for SetTrustedVerifierStatus<S> { 7231 + type VerifiedStatus = S::VerifiedStatus; 7231 7232 type Verifications = S::Verifications; 7232 - type VerifiedStatus = S::VerifiedStatus; 7233 7233 type TrustedVerifierStatus = Set<members::trusted_verifier_status>; 7234 7234 } 7235 7235 /// Marker types for field names 7236 7236 #[allow(non_camel_case_types)] 7237 7237 pub mod members { 7238 + ///Marker type for the `verified_status` field 7239 + pub struct verified_status(()); 7238 7240 ///Marker type for the `verifications` field 7239 7241 pub struct verifications(()); 7240 - ///Marker type for the `verified_status` field 7241 - pub struct verified_status(()); 7242 7242 ///Marker type for the `trusted_verifier_status` field 7243 7243 pub struct trusted_verifier_status(()); 7244 7244 } ··· 7336 7336 impl<'a, S> VerificationStateBuilder<'a, S> 7337 7337 where 7338 7338 S: verification_state_state::State, 7339 - S::Verifications: verification_state_state::IsSet, 7340 7339 S::VerifiedStatus: verification_state_state::IsSet, 7340 + S::Verifications: verification_state_state::IsSet, 7341 7341 S::TrustedVerifierStatus: verification_state_state::IsSet, 7342 7342 { 7343 7343 /// Build the final struct
+13 -13
crates/weaver-api/src/app_bsky/actor/status.rs
··· 59 59 } 60 60 /// State trait tracking which required fields have been set 61 61 pub trait State: sealed::Sealed { 62 - type Status; 63 62 type CreatedAt; 63 + type Status; 64 64 } 65 65 /// Empty state - all required fields are unset 66 66 pub struct Empty(()); 67 67 impl sealed::Sealed for Empty {} 68 68 impl State for Empty { 69 - type Status = Unset; 70 69 type CreatedAt = Unset; 71 - } 72 - ///State transition - sets the `status` field to Set 73 - pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 74 - impl<S: State> sealed::Sealed for SetStatus<S> {} 75 - impl<S: State> State for SetStatus<S> { 76 - type Status = Set<members::status>; 77 - type CreatedAt = S::CreatedAt; 70 + type Status = Unset; 78 71 } 79 72 ///State transition - sets the `created_at` field to Set 80 73 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 81 74 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 82 75 impl<S: State> State for SetCreatedAt<S> { 83 - type Status = S::Status; 84 76 type CreatedAt = Set<members::created_at>; 77 + type Status = S::Status; 78 + } 79 + ///State transition - sets the `status` field to Set 80 + pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 81 + impl<S: State> sealed::Sealed for SetStatus<S> {} 82 + impl<S: State> State for SetStatus<S> { 83 + type CreatedAt = S::CreatedAt; 84 + type Status = Set<members::status>; 85 85 } 86 86 /// Marker types for field names 87 87 #[allow(non_camel_case_types)] 88 88 pub mod members { 89 - ///Marker type for the `status` field 90 - pub struct status(()); 91 89 ///Marker type for the `created_at` field 92 90 pub struct created_at(()); 91 + ///Marker type for the `status` field 92 + pub struct status(()); 93 93 } 94 94 } 95 95 ··· 196 196 impl<'a, S> StatusBuilder<'a, S> 197 197 where 198 198 S: status_state::State, 199 - S::Status: status_state::IsSet, 200 199 S::CreatedAt: status_state::IsSet, 200 + S::Status: status_state::IsSet, 201 201 { 202 202 /// Build the final struct 203 203 pub fn build(self) -> Status<'a> {
+113 -113
crates/weaver-api/src/app_bsky/ageassurance.rs
··· 1111 1111 } 1112 1112 /// State trait tracking which required fields have been set 1113 1113 pub trait State: sealed::Sealed { 1114 - type CountryCode; 1115 1114 type Rules; 1115 + type CountryCode; 1116 1116 } 1117 1117 /// Empty state - all required fields are unset 1118 1118 pub struct Empty(()); 1119 1119 impl sealed::Sealed for Empty {} 1120 1120 impl State for Empty { 1121 - type CountryCode = Unset; 1122 1121 type Rules = Unset; 1123 - } 1124 - ///State transition - sets the `country_code` field to Set 1125 - pub struct SetCountryCode<S: State = Empty>(PhantomData<fn() -> S>); 1126 - impl<S: State> sealed::Sealed for SetCountryCode<S> {} 1127 - impl<S: State> State for SetCountryCode<S> { 1128 - type CountryCode = Set<members::country_code>; 1129 - type Rules = S::Rules; 1122 + type CountryCode = Unset; 1130 1123 } 1131 1124 ///State transition - sets the `rules` field to Set 1132 1125 pub struct SetRules<S: State = Empty>(PhantomData<fn() -> S>); 1133 1126 impl<S: State> sealed::Sealed for SetRules<S> {} 1134 1127 impl<S: State> State for SetRules<S> { 1135 - type CountryCode = S::CountryCode; 1136 1128 type Rules = Set<members::rules>; 1129 + type CountryCode = S::CountryCode; 1130 + } 1131 + ///State transition - sets the `country_code` field to Set 1132 + pub struct SetCountryCode<S: State = Empty>(PhantomData<fn() -> S>); 1133 + impl<S: State> sealed::Sealed for SetCountryCode<S> {} 1134 + impl<S: State> State for SetCountryCode<S> { 1135 + type Rules = S::Rules; 1136 + type CountryCode = Set<members::country_code>; 1137 1137 } 1138 1138 /// Marker types for field names 1139 1139 #[allow(non_camel_case_types)] 1140 1140 pub mod members { 1141 - ///Marker type for the `country_code` field 1142 - pub struct country_code(()); 1143 1141 ///Marker type for the `rules` field 1144 1142 pub struct rules(()); 1143 + ///Marker type for the `country_code` field 1144 + pub struct country_code(()); 1145 1145 } 1146 1146 } 1147 1147 ··· 1234 1234 impl<'a, S> ConfigRegionBuilder<'a, S> 1235 1235 where 1236 1236 S: config_region_state::State, 1237 - S::CountryCode: config_region_state::IsSet, 1238 1237 S::Rules: config_region_state::IsSet, 1238 + S::CountryCode: config_region_state::IsSet, 1239 1239 { 1240 1240 /// Build the final struct 1241 1241 pub fn build(self) -> ConfigRegion<'a> { ··· 1888 1888 } 1889 1889 /// State trait tracking which required fields have been set 1890 1890 pub trait State: sealed::Sealed { 1891 - type Age; 1892 1891 type Access; 1892 + type Age; 1893 1893 } 1894 1894 /// Empty state - all required fields are unset 1895 1895 pub struct Empty(()); 1896 1896 impl sealed::Sealed for Empty {} 1897 1897 impl State for Empty { 1898 - type Age = Unset; 1899 1898 type Access = Unset; 1899 + type Age = Unset; 1900 + } 1901 + ///State transition - sets the `access` field to Set 1902 + pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 1903 + impl<S: State> sealed::Sealed for SetAccess<S> {} 1904 + impl<S: State> State for SetAccess<S> { 1905 + type Access = Set<members::access>; 1906 + type Age = S::Age; 1900 1907 } 1901 1908 ///State transition - sets the `age` field to Set 1902 1909 pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 1903 1910 impl<S: State> sealed::Sealed for SetAge<S> {} 1904 1911 impl<S: State> State for SetAge<S> { 1905 - type Age = Set<members::age>; 1906 1912 type Access = S::Access; 1907 - } 1908 - ///State transition - sets the `access` field to Set 1909 - pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 1910 - impl<S: State> sealed::Sealed for SetAccess<S> {} 1911 - impl<S: State> State for SetAccess<S> { 1912 - type Age = S::Age; 1913 - type Access = Set<members::access>; 1913 + type Age = Set<members::age>; 1914 1914 } 1915 1915 /// Marker types for field names 1916 1916 #[allow(non_camel_case_types)] 1917 1917 pub mod members { 1918 + ///Marker type for the `access` field 1919 + pub struct access(()); 1918 1920 ///Marker type for the `age` field 1919 1921 pub struct age(()); 1920 - ///Marker type for the `access` field 1921 - pub struct access(()); 1922 1922 } 1923 1923 } 1924 1924 ··· 2008 2008 impl<'a, S> ConfigRegionRuleIfAssuredOverAgeBuilder<'a, S> 2009 2009 where 2010 2010 S: config_region_rule_if_assured_over_age_state::State, 2011 - S::Age: config_region_rule_if_assured_over_age_state::IsSet, 2012 2011 S::Access: config_region_rule_if_assured_over_age_state::IsSet, 2012 + S::Age: config_region_rule_if_assured_over_age_state::IsSet, 2013 2013 { 2014 2014 /// Build the final struct 2015 2015 pub fn build(self) -> ConfigRegionRuleIfAssuredOverAge<'a> { ··· 2082 2082 } 2083 2083 /// State trait tracking which required fields have been set 2084 2084 pub trait State: sealed::Sealed { 2085 - type Age; 2086 2085 type Access; 2086 + type Age; 2087 2087 } 2088 2088 /// Empty state - all required fields are unset 2089 2089 pub struct Empty(()); 2090 2090 impl sealed::Sealed for Empty {} 2091 2091 impl State for Empty { 2092 + type Access = Unset; 2092 2093 type Age = Unset; 2093 - type Access = Unset; 2094 + } 2095 + ///State transition - sets the `access` field to Set 2096 + pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2097 + impl<S: State> sealed::Sealed for SetAccess<S> {} 2098 + impl<S: State> State for SetAccess<S> { 2099 + type Access = Set<members::access>; 2100 + type Age = S::Age; 2094 2101 } 2095 2102 ///State transition - sets the `age` field to Set 2096 2103 pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2097 2104 impl<S: State> sealed::Sealed for SetAge<S> {} 2098 2105 impl<S: State> State for SetAge<S> { 2099 - type Age = Set<members::age>; 2100 2106 type Access = S::Access; 2101 - } 2102 - ///State transition - sets the `access` field to Set 2103 - pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2104 - impl<S: State> sealed::Sealed for SetAccess<S> {} 2105 - impl<S: State> State for SetAccess<S> { 2106 - type Age = S::Age; 2107 - type Access = Set<members::access>; 2107 + type Age = Set<members::age>; 2108 2108 } 2109 2109 /// Marker types for field names 2110 2110 #[allow(non_camel_case_types)] 2111 2111 pub mod members { 2112 + ///Marker type for the `access` field 2113 + pub struct access(()); 2112 2114 ///Marker type for the `age` field 2113 2115 pub struct age(()); 2114 - ///Marker type for the `access` field 2115 - pub struct access(()); 2116 2116 } 2117 2117 } 2118 2118 ··· 2202 2202 impl<'a, S> ConfigRegionRuleIfAssuredUnderAgeBuilder<'a, S> 2203 2203 where 2204 2204 S: config_region_rule_if_assured_under_age_state::State, 2205 - S::Age: config_region_rule_if_assured_under_age_state::IsSet, 2206 2205 S::Access: config_region_rule_if_assured_under_age_state::IsSet, 2206 + S::Age: config_region_rule_if_assured_under_age_state::IsSet, 2207 2207 { 2208 2208 /// Build the final struct 2209 2209 pub fn build(self) -> ConfigRegionRuleIfAssuredUnderAge<'a> { ··· 2276 2276 } 2277 2277 /// State trait tracking which required fields have been set 2278 2278 pub trait State: sealed::Sealed { 2279 - type Age; 2280 2279 type Access; 2280 + type Age; 2281 2281 } 2282 2282 /// Empty state - all required fields are unset 2283 2283 pub struct Empty(()); 2284 2284 impl sealed::Sealed for Empty {} 2285 2285 impl State for Empty { 2286 - type Age = Unset; 2287 2286 type Access = Unset; 2288 - } 2289 - ///State transition - sets the `age` field to Set 2290 - pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2291 - impl<S: State> sealed::Sealed for SetAge<S> {} 2292 - impl<S: State> State for SetAge<S> { 2293 - type Age = Set<members::age>; 2294 - type Access = S::Access; 2287 + type Age = Unset; 2295 2288 } 2296 2289 ///State transition - sets the `access` field to Set 2297 2290 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2298 2291 impl<S: State> sealed::Sealed for SetAccess<S> {} 2299 2292 impl<S: State> State for SetAccess<S> { 2300 - type Age = S::Age; 2301 2293 type Access = Set<members::access>; 2294 + type Age = S::Age; 2295 + } 2296 + ///State transition - sets the `age` field to Set 2297 + pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2298 + impl<S: State> sealed::Sealed for SetAge<S> {} 2299 + impl<S: State> State for SetAge<S> { 2300 + type Access = S::Access; 2301 + type Age = Set<members::age>; 2302 2302 } 2303 2303 /// Marker types for field names 2304 2304 #[allow(non_camel_case_types)] 2305 2305 pub mod members { 2306 - ///Marker type for the `age` field 2307 - pub struct age(()); 2308 2306 ///Marker type for the `access` field 2309 2307 pub struct access(()); 2308 + ///Marker type for the `age` field 2309 + pub struct age(()); 2310 2310 } 2311 2311 } 2312 2312 ··· 2396 2396 impl<'a, S> ConfigRegionRuleIfDeclaredOverAgeBuilder<'a, S> 2397 2397 where 2398 2398 S: config_region_rule_if_declared_over_age_state::State, 2399 - S::Age: config_region_rule_if_declared_over_age_state::IsSet, 2400 2399 S::Access: config_region_rule_if_declared_over_age_state::IsSet, 2400 + S::Age: config_region_rule_if_declared_over_age_state::IsSet, 2401 2401 { 2402 2402 /// Build the final struct 2403 2403 pub fn build(self) -> ConfigRegionRuleIfDeclaredOverAge<'a> { ··· 2470 2470 } 2471 2471 /// State trait tracking which required fields have been set 2472 2472 pub trait State: sealed::Sealed { 2473 - type Age; 2474 2473 type Access; 2474 + type Age; 2475 2475 } 2476 2476 /// Empty state - all required fields are unset 2477 2477 pub struct Empty(()); 2478 2478 impl sealed::Sealed for Empty {} 2479 2479 impl State for Empty { 2480 - type Age = Unset; 2481 2480 type Access = Unset; 2482 - } 2483 - ///State transition - sets the `age` field to Set 2484 - pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2485 - impl<S: State> sealed::Sealed for SetAge<S> {} 2486 - impl<S: State> State for SetAge<S> { 2487 - type Age = Set<members::age>; 2488 - type Access = S::Access; 2481 + type Age = Unset; 2489 2482 } 2490 2483 ///State transition - sets the `access` field to Set 2491 2484 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2492 2485 impl<S: State> sealed::Sealed for SetAccess<S> {} 2493 2486 impl<S: State> State for SetAccess<S> { 2487 + type Access = Set<members::access>; 2494 2488 type Age = S::Age; 2495 - type Access = Set<members::access>; 2489 + } 2490 + ///State transition - sets the `age` field to Set 2491 + pub struct SetAge<S: State = Empty>(PhantomData<fn() -> S>); 2492 + impl<S: State> sealed::Sealed for SetAge<S> {} 2493 + impl<S: State> State for SetAge<S> { 2494 + type Access = S::Access; 2495 + type Age = Set<members::age>; 2496 2496 } 2497 2497 /// Marker types for field names 2498 2498 #[allow(non_camel_case_types)] 2499 2499 pub mod members { 2500 + ///Marker type for the `access` field 2501 + pub struct access(()); 2500 2502 ///Marker type for the `age` field 2501 2503 pub struct age(()); 2502 - ///Marker type for the `access` field 2503 - pub struct access(()); 2504 2504 } 2505 2505 } 2506 2506 ··· 2590 2590 impl<'a, S> ConfigRegionRuleIfDeclaredUnderAgeBuilder<'a, S> 2591 2591 where 2592 2592 S: config_region_rule_if_declared_under_age_state::State, 2593 - S::Age: config_region_rule_if_declared_under_age_state::IsSet, 2594 2593 S::Access: config_region_rule_if_declared_under_age_state::IsSet, 2594 + S::Age: config_region_rule_if_declared_under_age_state::IsSet, 2595 2595 { 2596 2596 /// Build the final struct 2597 2597 pub fn build(self) -> ConfigRegionRuleIfDeclaredUnderAge<'a> { ··· 2698 2698 } 2699 2699 /// State trait tracking which required fields have been set 2700 2700 pub trait State: sealed::Sealed { 2701 - type CreatedAt; 2702 2701 type Status; 2702 + type AttemptId; 2703 2703 type Access; 2704 - type AttemptId; 2705 2704 type CountryCode; 2705 + type CreatedAt; 2706 2706 } 2707 2707 /// Empty state - all required fields are unset 2708 2708 pub struct Empty(()); 2709 2709 impl sealed::Sealed for Empty {} 2710 2710 impl State for Empty { 2711 - type CreatedAt = Unset; 2712 2711 type Status = Unset; 2713 - type Access = Unset; 2714 2712 type AttemptId = Unset; 2713 + type Access = Unset; 2715 2714 type CountryCode = Unset; 2716 - } 2717 - ///State transition - sets the `created_at` field to Set 2718 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 2719 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 2720 - impl<S: State> State for SetCreatedAt<S> { 2721 - type CreatedAt = Set<members::created_at>; 2722 - type Status = S::Status; 2723 - type Access = S::Access; 2724 - type AttemptId = S::AttemptId; 2725 - type CountryCode = S::CountryCode; 2715 + type CreatedAt = Unset; 2726 2716 } 2727 2717 ///State transition - sets the `status` field to Set 2728 2718 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 2729 2719 impl<S: State> sealed::Sealed for SetStatus<S> {} 2730 2720 impl<S: State> State for SetStatus<S> { 2731 - type CreatedAt = S::CreatedAt; 2732 2721 type Status = Set<members::status>; 2733 - type Access = S::Access; 2734 2722 type AttemptId = S::AttemptId; 2723 + type Access = S::Access; 2735 2724 type CountryCode = S::CountryCode; 2725 + type CreatedAt = S::CreatedAt; 2726 + } 2727 + ///State transition - sets the `attempt_id` field to Set 2728 + pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 2729 + impl<S: State> sealed::Sealed for SetAttemptId<S> {} 2730 + impl<S: State> State for SetAttemptId<S> { 2731 + type Status = S::Status; 2732 + type AttemptId = Set<members::attempt_id>; 2733 + type Access = S::Access; 2734 + type CountryCode = S::CountryCode; 2735 + type CreatedAt = S::CreatedAt; 2736 2736 } 2737 2737 ///State transition - sets the `access` field to Set 2738 2738 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 2739 2739 impl<S: State> sealed::Sealed for SetAccess<S> {} 2740 2740 impl<S: State> State for SetAccess<S> { 2741 - type CreatedAt = S::CreatedAt; 2742 2741 type Status = S::Status; 2743 - type Access = Set<members::access>; 2744 2742 type AttemptId = S::AttemptId; 2743 + type Access = Set<members::access>; 2745 2744 type CountryCode = S::CountryCode; 2746 - } 2747 - ///State transition - sets the `attempt_id` field to Set 2748 - pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 2749 - impl<S: State> sealed::Sealed for SetAttemptId<S> {} 2750 - impl<S: State> State for SetAttemptId<S> { 2751 2745 type CreatedAt = S::CreatedAt; 2752 - type Status = S::Status; 2753 - type Access = S::Access; 2754 - type AttemptId = Set<members::attempt_id>; 2755 - type CountryCode = S::CountryCode; 2756 2746 } 2757 2747 ///State transition - sets the `country_code` field to Set 2758 2748 pub struct SetCountryCode<S: State = Empty>(PhantomData<fn() -> S>); 2759 2749 impl<S: State> sealed::Sealed for SetCountryCode<S> {} 2760 2750 impl<S: State> State for SetCountryCode<S> { 2761 - type CreatedAt = S::CreatedAt; 2762 2751 type Status = S::Status; 2752 + type AttemptId = S::AttemptId; 2763 2753 type Access = S::Access; 2764 - type AttemptId = S::AttemptId; 2765 2754 type CountryCode = Set<members::country_code>; 2755 + type CreatedAt = S::CreatedAt; 2756 + } 2757 + ///State transition - sets the `created_at` field to Set 2758 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 2759 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 2760 + impl<S: State> State for SetCreatedAt<S> { 2761 + type Status = S::Status; 2762 + type AttemptId = S::AttemptId; 2763 + type Access = S::Access; 2764 + type CountryCode = S::CountryCode; 2765 + type CreatedAt = Set<members::created_at>; 2766 2766 } 2767 2767 /// Marker types for field names 2768 2768 #[allow(non_camel_case_types)] 2769 2769 pub mod members { 2770 - ///Marker type for the `created_at` field 2771 - pub struct created_at(()); 2772 2770 ///Marker type for the `status` field 2773 2771 pub struct status(()); 2774 - ///Marker type for the `access` field 2775 - pub struct access(()); 2776 2772 ///Marker type for the `attempt_id` field 2777 2773 pub struct attempt_id(()); 2774 + ///Marker type for the `access` field 2775 + pub struct access(()); 2778 2776 ///Marker type for the `country_code` field 2779 2777 pub struct country_code(()); 2778 + ///Marker type for the `created_at` field 2779 + pub struct created_at(()); 2780 2780 } 2781 2781 } 2782 2782 ··· 3032 3032 impl<'a, S> EventBuilder<'a, S> 3033 3033 where 3034 3034 S: event_state::State, 3035 - S::CreatedAt: event_state::IsSet, 3036 3035 S::Status: event_state::IsSet, 3037 - S::Access: event_state::IsSet, 3038 3036 S::AttemptId: event_state::IsSet, 3037 + S::Access: event_state::IsSet, 3039 3038 S::CountryCode: event_state::IsSet, 3039 + S::CreatedAt: event_state::IsSet, 3040 3040 { 3041 3041 /// Build the final struct 3042 3042 pub fn build(self) -> Event<'a> { ··· 3129 3129 } 3130 3130 /// State trait tracking which required fields have been set 3131 3131 pub trait State: sealed::Sealed { 3132 - type Status; 3133 3132 type Access; 3133 + type Status; 3134 3134 } 3135 3135 /// Empty state - all required fields are unset 3136 3136 pub struct Empty(()); 3137 3137 impl sealed::Sealed for Empty {} 3138 3138 impl State for Empty { 3139 - type Status = Unset; 3140 3139 type Access = Unset; 3141 - } 3142 - ///State transition - sets the `status` field to Set 3143 - pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 3144 - impl<S: State> sealed::Sealed for SetStatus<S> {} 3145 - impl<S: State> State for SetStatus<S> { 3146 - type Status = Set<members::status>; 3147 - type Access = S::Access; 3140 + type Status = Unset; 3148 3141 } 3149 3142 ///State transition - sets the `access` field to Set 3150 3143 pub struct SetAccess<S: State = Empty>(PhantomData<fn() -> S>); 3151 3144 impl<S: State> sealed::Sealed for SetAccess<S> {} 3152 3145 impl<S: State> State for SetAccess<S> { 3153 - type Status = S::Status; 3154 3146 type Access = Set<members::access>; 3147 + type Status = S::Status; 3148 + } 3149 + ///State transition - sets the `status` field to Set 3150 + pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 3151 + impl<S: State> sealed::Sealed for SetStatus<S> {} 3152 + impl<S: State> State for SetStatus<S> { 3153 + type Access = S::Access; 3154 + type Status = Set<members::status>; 3155 3155 } 3156 3156 /// Marker types for field names 3157 3157 #[allow(non_camel_case_types)] 3158 3158 pub mod members { 3159 - ///Marker type for the `status` field 3160 - pub struct status(()); 3161 3159 ///Marker type for the `access` field 3162 3160 pub struct access(()); 3161 + ///Marker type for the `status` field 3162 + pub struct status(()); 3163 3163 } 3164 3164 } 3165 3165 ··· 3252 3252 impl<'a, S> StateBuilder<'a, S> 3253 3253 where 3254 3254 S: state_state::State, 3255 - S::Status: state_state::IsSet, 3256 3255 S::Access: state_state::IsSet, 3256 + S::Status: state_state::IsSet, 3257 3257 { 3258 3258 /// Build the final struct 3259 3259 pub fn build(self) -> State<'a> {
+30 -30
crates/weaver-api/src/app_bsky/embed/external.rs
··· 38 38 } 39 39 /// State trait tracking which required fields have been set 40 40 pub trait State: sealed::Sealed { 41 - type Uri; 42 41 type Title; 43 42 type Description; 43 + type Uri; 44 44 } 45 45 /// Empty state - all required fields are unset 46 46 pub struct Empty(()); 47 47 impl sealed::Sealed for Empty {} 48 48 impl State for Empty { 49 - type Uri = Unset; 50 49 type Title = Unset; 51 50 type Description = Unset; 52 - } 53 - ///State transition - sets the `uri` field to Set 54 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 55 - impl<S: State> sealed::Sealed for SetUri<S> {} 56 - impl<S: State> State for SetUri<S> { 57 - type Uri = Set<members::uri>; 58 - type Title = S::Title; 59 - type Description = S::Description; 51 + type Uri = Unset; 60 52 } 61 53 ///State transition - sets the `title` field to Set 62 54 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 63 55 impl<S: State> sealed::Sealed for SetTitle<S> {} 64 56 impl<S: State> State for SetTitle<S> { 65 - type Uri = S::Uri; 66 57 type Title = Set<members::title>; 67 58 type Description = S::Description; 59 + type Uri = S::Uri; 68 60 } 69 61 ///State transition - sets the `description` field to Set 70 62 pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 71 63 impl<S: State> sealed::Sealed for SetDescription<S> {} 72 64 impl<S: State> State for SetDescription<S> { 73 - type Uri = S::Uri; 74 65 type Title = S::Title; 75 66 type Description = Set<members::description>; 67 + type Uri = S::Uri; 68 + } 69 + ///State transition - sets the `uri` field to Set 70 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 71 + impl<S: State> sealed::Sealed for SetUri<S> {} 72 + impl<S: State> State for SetUri<S> { 73 + type Title = S::Title; 74 + type Description = S::Description; 75 + type Uri = Set<members::uri>; 76 76 } 77 77 /// Marker types for field names 78 78 #[allow(non_camel_case_types)] 79 79 pub mod members { 80 - ///Marker type for the `uri` field 81 - pub struct uri(()); 82 80 ///Marker type for the `title` field 83 81 pub struct title(()); 84 82 ///Marker type for the `description` field 85 83 pub struct description(()); 84 + ///Marker type for the `uri` field 85 + pub struct uri(()); 86 86 } 87 87 } 88 88 ··· 195 195 impl<'a, S> ExternalBuilder<'a, S> 196 196 where 197 197 S: external_state::State, 198 - S::Uri: external_state::IsSet, 199 198 S::Title: external_state::IsSet, 200 199 S::Description: external_state::IsSet, 200 + S::Uri: external_state::IsSet, 201 201 { 202 202 /// Build the final struct 203 203 pub fn build(self) -> External<'a> { ··· 785 785 /// State trait tracking which required fields have been set 786 786 pub trait State: sealed::Sealed { 787 787 type Uri; 788 - type Title; 789 788 type Description; 789 + type Title; 790 790 } 791 791 /// Empty state - all required fields are unset 792 792 pub struct Empty(()); 793 793 impl sealed::Sealed for Empty {} 794 794 impl State for Empty { 795 795 type Uri = Unset; 796 - type Title = Unset; 797 796 type Description = Unset; 797 + type Title = Unset; 798 798 } 799 799 ///State transition - sets the `uri` field to Set 800 800 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 801 801 impl<S: State> sealed::Sealed for SetUri<S> {} 802 802 impl<S: State> State for SetUri<S> { 803 803 type Uri = Set<members::uri>; 804 - type Title = S::Title; 805 804 type Description = S::Description; 806 - } 807 - ///State transition - sets the `title` field to Set 808 - pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 809 - impl<S: State> sealed::Sealed for SetTitle<S> {} 810 - impl<S: State> State for SetTitle<S> { 811 - type Uri = S::Uri; 812 - type Title = Set<members::title>; 813 - type Description = S::Description; 805 + type Title = S::Title; 814 806 } 815 807 ///State transition - sets the `description` field to Set 816 808 pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 817 809 impl<S: State> sealed::Sealed for SetDescription<S> {} 818 810 impl<S: State> State for SetDescription<S> { 819 811 type Uri = S::Uri; 820 - type Title = S::Title; 821 812 type Description = Set<members::description>; 813 + type Title = S::Title; 814 + } 815 + ///State transition - sets the `title` field to Set 816 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 817 + impl<S: State> sealed::Sealed for SetTitle<S> {} 818 + impl<S: State> State for SetTitle<S> { 819 + type Uri = S::Uri; 820 + type Description = S::Description; 821 + type Title = Set<members::title>; 822 822 } 823 823 /// Marker types for field names 824 824 #[allow(non_camel_case_types)] 825 825 pub mod members { 826 826 ///Marker type for the `uri` field 827 827 pub struct uri(()); 828 + ///Marker type for the `description` field 829 + pub struct description(()); 828 830 ///Marker type for the `title` field 829 831 pub struct title(()); 830 - ///Marker type for the `description` field 831 - pub struct description(()); 832 832 } 833 833 } 834 834 ··· 942 942 where 943 943 S: view_external_state::State, 944 944 S::Uri: view_external_state::IsSet, 945 - S::Title: view_external_state::IsSet, 946 945 S::Description: view_external_state::IsSet, 946 + S::Title: view_external_state::IsSet, 947 947 { 948 948 /// Build the final struct 949 949 pub fn build(self) -> ViewExternal<'a> {
+15 -15
crates/weaver-api/src/app_bsky/embed/images.rs
··· 760 760 } 761 761 /// State trait tracking which required fields have been set 762 762 pub trait State: sealed::Sealed { 763 + type Alt; 763 764 type Thumb; 764 765 type Fullsize; 765 - type Alt; 766 766 } 767 767 /// Empty state - all required fields are unset 768 768 pub struct Empty(()); 769 769 impl sealed::Sealed for Empty {} 770 770 impl State for Empty { 771 + type Alt = Unset; 771 772 type Thumb = Unset; 772 773 type Fullsize = Unset; 773 - type Alt = Unset; 774 + } 775 + ///State transition - sets the `alt` field to Set 776 + pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 777 + impl<S: State> sealed::Sealed for SetAlt<S> {} 778 + impl<S: State> State for SetAlt<S> { 779 + type Alt = Set<members::alt>; 780 + type Thumb = S::Thumb; 781 + type Fullsize = S::Fullsize; 774 782 } 775 783 ///State transition - sets the `thumb` field to Set 776 784 pub struct SetThumb<S: State = Empty>(PhantomData<fn() -> S>); 777 785 impl<S: State> sealed::Sealed for SetThumb<S> {} 778 786 impl<S: State> State for SetThumb<S> { 787 + type Alt = S::Alt; 779 788 type Thumb = Set<members::thumb>; 780 789 type Fullsize = S::Fullsize; 781 - type Alt = S::Alt; 782 790 } 783 791 ///State transition - sets the `fullsize` field to Set 784 792 pub struct SetFullsize<S: State = Empty>(PhantomData<fn() -> S>); 785 793 impl<S: State> sealed::Sealed for SetFullsize<S> {} 786 794 impl<S: State> State for SetFullsize<S> { 787 - type Thumb = S::Thumb; 788 - type Fullsize = Set<members::fullsize>; 789 795 type Alt = S::Alt; 790 - } 791 - ///State transition - sets the `alt` field to Set 792 - pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 793 - impl<S: State> sealed::Sealed for SetAlt<S> {} 794 - impl<S: State> State for SetAlt<S> { 795 796 type Thumb = S::Thumb; 796 - type Fullsize = S::Fullsize; 797 - type Alt = Set<members::alt>; 797 + type Fullsize = Set<members::fullsize>; 798 798 } 799 799 /// Marker types for field names 800 800 #[allow(non_camel_case_types)] 801 801 pub mod members { 802 + ///Marker type for the `alt` field 803 + pub struct alt(()); 802 804 ///Marker type for the `thumb` field 803 805 pub struct thumb(()); 804 806 ///Marker type for the `fullsize` field 805 807 pub struct fullsize(()); 806 - ///Marker type for the `alt` field 807 - pub struct alt(()); 808 808 } 809 809 } 810 810 ··· 917 917 impl<'a, S> ViewImageBuilder<'a, S> 918 918 where 919 919 S: view_image_state::State, 920 + S::Alt: view_image_state::IsSet, 920 921 S::Thumb: view_image_state::IsSet, 921 922 S::Fullsize: view_image_state::IsSet, 922 - S::Alt: view_image_state::IsSet, 923 923 { 924 924 /// Build the final struct 925 925 pub fn build(self) -> ViewImage<'a> {
+34 -34
crates/weaver-api/src/app_bsky/embed/record.rs
··· 724 724 /// State trait tracking which required fields have been set 725 725 pub trait State: sealed::Sealed { 726 726 type Uri; 727 - type Blocked; 728 727 type Author; 728 + type Blocked; 729 729 } 730 730 /// Empty state - all required fields are unset 731 731 pub struct Empty(()); 732 732 impl sealed::Sealed for Empty {} 733 733 impl State for Empty { 734 734 type Uri = Unset; 735 - type Blocked = Unset; 736 735 type Author = Unset; 736 + type Blocked = Unset; 737 737 } 738 738 ///State transition - sets the `uri` field to Set 739 739 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 740 740 impl<S: State> sealed::Sealed for SetUri<S> {} 741 741 impl<S: State> State for SetUri<S> { 742 742 type Uri = Set<members::uri>; 743 - type Blocked = S::Blocked; 744 743 type Author = S::Author; 745 - } 746 - ///State transition - sets the `blocked` field to Set 747 - pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 748 - impl<S: State> sealed::Sealed for SetBlocked<S> {} 749 - impl<S: State> State for SetBlocked<S> { 750 - type Uri = S::Uri; 751 - type Blocked = Set<members::blocked>; 752 - type Author = S::Author; 744 + type Blocked = S::Blocked; 753 745 } 754 746 ///State transition - sets the `author` field to Set 755 747 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 756 748 impl<S: State> sealed::Sealed for SetAuthor<S> {} 757 749 impl<S: State> State for SetAuthor<S> { 758 750 type Uri = S::Uri; 759 - type Blocked = S::Blocked; 760 751 type Author = Set<members::author>; 752 + type Blocked = S::Blocked; 753 + } 754 + ///State transition - sets the `blocked` field to Set 755 + pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 756 + impl<S: State> sealed::Sealed for SetBlocked<S> {} 757 + impl<S: State> State for SetBlocked<S> { 758 + type Uri = S::Uri; 759 + type Author = S::Author; 760 + type Blocked = Set<members::blocked>; 761 761 } 762 762 /// Marker types for field names 763 763 #[allow(non_camel_case_types)] 764 764 pub mod members { 765 765 ///Marker type for the `uri` field 766 766 pub struct uri(()); 767 + ///Marker type for the `author` field 768 + pub struct author(()); 767 769 ///Marker type for the `blocked` field 768 770 pub struct blocked(()); 769 - ///Marker type for the `author` field 770 - pub struct author(()); 771 771 } 772 772 } 773 773 ··· 861 861 where 862 862 S: view_blocked_state::State, 863 863 S::Uri: view_blocked_state::IsSet, 864 - S::Blocked: view_blocked_state::IsSet, 865 864 S::Author: view_blocked_state::IsSet, 865 + S::Blocked: view_blocked_state::IsSet, 866 866 { 867 867 /// Build the final struct 868 868 pub fn build(self) -> ViewBlocked<'a> { ··· 1305 1305 pub trait State: sealed::Sealed { 1306 1306 type Uri; 1307 1307 type Cid; 1308 - type Author; 1309 1308 type Value; 1309 + type Author; 1310 1310 type IndexedAt; 1311 1311 } 1312 1312 /// Empty state - all required fields are unset ··· 1315 1315 impl State for Empty { 1316 1316 type Uri = Unset; 1317 1317 type Cid = Unset; 1318 - type Author = Unset; 1319 1318 type Value = Unset; 1319 + type Author = Unset; 1320 1320 type IndexedAt = Unset; 1321 1321 } 1322 1322 ///State transition - sets the `uri` field to Set ··· 1325 1325 impl<S: State> State for SetUri<S> { 1326 1326 type Uri = Set<members::uri>; 1327 1327 type Cid = S::Cid; 1328 - type Author = S::Author; 1329 1328 type Value = S::Value; 1329 + type Author = S::Author; 1330 1330 type IndexedAt = S::IndexedAt; 1331 1331 } 1332 1332 ///State transition - sets the `cid` field to Set ··· 1335 1335 impl<S: State> State for SetCid<S> { 1336 1336 type Uri = S::Uri; 1337 1337 type Cid = Set<members::cid>; 1338 - type Author = S::Author; 1339 1338 type Value = S::Value; 1340 - type IndexedAt = S::IndexedAt; 1341 - } 1342 - ///State transition - sets the `author` field to Set 1343 - pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1344 - impl<S: State> sealed::Sealed for SetAuthor<S> {} 1345 - impl<S: State> State for SetAuthor<S> { 1346 - type Uri = S::Uri; 1347 - type Cid = S::Cid; 1348 - type Author = Set<members::author>; 1349 - type Value = S::Value; 1339 + type Author = S::Author; 1350 1340 type IndexedAt = S::IndexedAt; 1351 1341 } 1352 1342 ///State transition - sets the `value` field to Set ··· 1355 1345 impl<S: State> State for SetValue<S> { 1356 1346 type Uri = S::Uri; 1357 1347 type Cid = S::Cid; 1358 - type Author = S::Author; 1359 1348 type Value = Set<members::value>; 1349 + type Author = S::Author; 1350 + type IndexedAt = S::IndexedAt; 1351 + } 1352 + ///State transition - sets the `author` field to Set 1353 + pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1354 + impl<S: State> sealed::Sealed for SetAuthor<S> {} 1355 + impl<S: State> State for SetAuthor<S> { 1356 + type Uri = S::Uri; 1357 + type Cid = S::Cid; 1358 + type Value = S::Value; 1359 + type Author = Set<members::author>; 1360 1360 type IndexedAt = S::IndexedAt; 1361 1361 } 1362 1362 ///State transition - sets the `indexed_at` field to Set ··· 1365 1365 impl<S: State> State for SetIndexedAt<S> { 1366 1366 type Uri = S::Uri; 1367 1367 type Cid = S::Cid; 1368 - type Author = S::Author; 1369 1368 type Value = S::Value; 1369 + type Author = S::Author; 1370 1370 type IndexedAt = Set<members::indexed_at>; 1371 1371 } 1372 1372 /// Marker types for field names ··· 1376 1376 pub struct uri(()); 1377 1377 ///Marker type for the `cid` field 1378 1378 pub struct cid(()); 1379 + ///Marker type for the `value` field 1380 + pub struct value(()); 1379 1381 ///Marker type for the `author` field 1380 1382 pub struct author(()); 1381 - ///Marker type for the `value` field 1382 - pub struct value(()); 1383 1383 ///Marker type for the `indexed_at` field 1384 1384 pub struct indexed_at(()); 1385 1385 } ··· 1621 1621 S: view_record_state::State, 1622 1622 S::Uri: view_record_state::IsSet, 1623 1623 S::Cid: view_record_state::IsSet, 1624 - S::Author: view_record_state::IsSet, 1625 1624 S::Value: view_record_state::IsSet, 1625 + S::Author: view_record_state::IsSet, 1626 1626 S::IndexedAt: view_record_state::IsSet, 1627 1627 { 1628 1628 /// Build the final struct
+13 -13
crates/weaver-api/src/app_bsky/embed/video.rs
··· 32 32 } 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 - type Lang; 36 35 type File; 36 + type Lang; 37 37 } 38 38 /// Empty state - all required fields are unset 39 39 pub struct Empty(()); 40 40 impl sealed::Sealed for Empty {} 41 41 impl State for Empty { 42 - type Lang = Unset; 43 42 type File = Unset; 44 - } 45 - ///State transition - sets the `lang` field to Set 46 - pub struct SetLang<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetLang<S> {} 48 - impl<S: State> State for SetLang<S> { 49 - type Lang = Set<members::lang>; 50 - type File = S::File; 43 + type Lang = Unset; 51 44 } 52 45 ///State transition - sets the `file` field to Set 53 46 pub struct SetFile<S: State = Empty>(PhantomData<fn() -> S>); 54 47 impl<S: State> sealed::Sealed for SetFile<S> {} 55 48 impl<S: State> State for SetFile<S> { 56 - type Lang = S::Lang; 57 49 type File = Set<members::file>; 50 + type Lang = S::Lang; 51 + } 52 + ///State transition - sets the `lang` field to Set 53 + pub struct SetLang<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetLang<S> {} 55 + impl<S: State> State for SetLang<S> { 56 + type File = S::File; 57 + type Lang = Set<members::lang>; 58 58 } 59 59 /// Marker types for field names 60 60 #[allow(non_camel_case_types)] 61 61 pub mod members { 62 - ///Marker type for the `lang` field 63 - pub struct lang(()); 64 62 ///Marker type for the `file` field 65 63 pub struct file(()); 64 + ///Marker type for the `lang` field 65 + pub struct lang(()); 66 66 } 67 67 } 68 68 ··· 135 135 impl<'a, S> CaptionBuilder<'a, S> 136 136 where 137 137 S: caption_state::State, 138 - S::Lang: caption_state::IsSet, 139 138 S::File: caption_state::IsSet, 139 + S::Lang: caption_state::IsSet, 140 140 { 141 141 /// Build the final struct 142 142 pub fn build(self) -> Caption<'a> {
+97 -97
crates/weaver-api/src/app_bsky/feed.rs
··· 1609 1609 } 1610 1610 /// State trait tracking which required fields have been set 1611 1611 pub trait State: sealed::Sealed { 1612 + type Author; 1612 1613 type Uri; 1613 1614 type Blocked; 1614 - type Author; 1615 1615 } 1616 1616 /// Empty state - all required fields are unset 1617 1617 pub struct Empty(()); 1618 1618 impl sealed::Sealed for Empty {} 1619 1619 impl State for Empty { 1620 + type Author = Unset; 1620 1621 type Uri = Unset; 1621 1622 type Blocked = Unset; 1622 - type Author = Unset; 1623 + } 1624 + ///State transition - sets the `author` field to Set 1625 + pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1626 + impl<S: State> sealed::Sealed for SetAuthor<S> {} 1627 + impl<S: State> State for SetAuthor<S> { 1628 + type Author = Set<members::author>; 1629 + type Uri = S::Uri; 1630 + type Blocked = S::Blocked; 1623 1631 } 1624 1632 ///State transition - sets the `uri` field to Set 1625 1633 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1626 1634 impl<S: State> sealed::Sealed for SetUri<S> {} 1627 1635 impl<S: State> State for SetUri<S> { 1636 + type Author = S::Author; 1628 1637 type Uri = Set<members::uri>; 1629 1638 type Blocked = S::Blocked; 1630 - type Author = S::Author; 1631 1639 } 1632 1640 ///State transition - sets the `blocked` field to Set 1633 1641 pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 1634 1642 impl<S: State> sealed::Sealed for SetBlocked<S> {} 1635 1643 impl<S: State> State for SetBlocked<S> { 1636 - type Uri = S::Uri; 1637 - type Blocked = Set<members::blocked>; 1638 1644 type Author = S::Author; 1639 - } 1640 - ///State transition - sets the `author` field to Set 1641 - pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1642 - impl<S: State> sealed::Sealed for SetAuthor<S> {} 1643 - impl<S: State> State for SetAuthor<S> { 1644 1645 type Uri = S::Uri; 1645 - type Blocked = S::Blocked; 1646 - type Author = Set<members::author>; 1646 + type Blocked = Set<members::blocked>; 1647 1647 } 1648 1648 /// Marker types for field names 1649 1649 #[allow(non_camel_case_types)] 1650 1650 pub mod members { 1651 + ///Marker type for the `author` field 1652 + pub struct author(()); 1651 1653 ///Marker type for the `uri` field 1652 1654 pub struct uri(()); 1653 1655 ///Marker type for the `blocked` field 1654 1656 pub struct blocked(()); 1655 - ///Marker type for the `author` field 1656 - pub struct author(()); 1657 1657 } 1658 1658 } 1659 1659 ··· 1746 1746 impl<'a, S> BlockedPostBuilder<'a, S> 1747 1747 where 1748 1748 S: blocked_post_state::State, 1749 + S::Author: blocked_post_state::IsSet, 1749 1750 S::Uri: blocked_post_state::IsSet, 1750 1751 S::Blocked: blocked_post_state::IsSet, 1751 - S::Author: blocked_post_state::IsSet, 1752 1752 { 1753 1753 /// Build the final struct 1754 1754 pub fn build(self) -> BlockedPost<'a> { ··· 2235 2235 /// State trait tracking which required fields have been set 2236 2236 pub trait State: sealed::Sealed { 2237 2237 type Uri; 2238 + type IndexedAt; 2239 + type Creator; 2238 2240 type Cid; 2241 + type DisplayName; 2239 2242 type Did; 2240 - type Creator; 2241 - type DisplayName; 2242 - type IndexedAt; 2243 2243 } 2244 2244 /// Empty state - all required fields are unset 2245 2245 pub struct Empty(()); 2246 2246 impl sealed::Sealed for Empty {} 2247 2247 impl State for Empty { 2248 2248 type Uri = Unset; 2249 + type IndexedAt = Unset; 2250 + type Creator = Unset; 2249 2251 type Cid = Unset; 2252 + type DisplayName = Unset; 2250 2253 type Did = Unset; 2251 - type Creator = Unset; 2252 - type DisplayName = Unset; 2253 - type IndexedAt = Unset; 2254 2254 } 2255 2255 ///State transition - sets the `uri` field to Set 2256 2256 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2257 2257 impl<S: State> sealed::Sealed for SetUri<S> {} 2258 2258 impl<S: State> State for SetUri<S> { 2259 2259 type Uri = Set<members::uri>; 2260 - type Cid = S::Cid; 2261 - type Did = S::Did; 2260 + type IndexedAt = S::IndexedAt; 2262 2261 type Creator = S::Creator; 2262 + type Cid = S::Cid; 2263 2263 type DisplayName = S::DisplayName; 2264 - type IndexedAt = S::IndexedAt; 2264 + type Did = S::Did; 2265 2265 } 2266 - ///State transition - sets the `cid` field to Set 2267 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2268 - impl<S: State> sealed::Sealed for SetCid<S> {} 2269 - impl<S: State> State for SetCid<S> { 2266 + ///State transition - sets the `indexed_at` field to Set 2267 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2268 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2269 + impl<S: State> State for SetIndexedAt<S> { 2270 2270 type Uri = S::Uri; 2271 - type Cid = Set<members::cid>; 2272 - type Did = S::Did; 2271 + type IndexedAt = Set<members::indexed_at>; 2273 2272 type Creator = S::Creator; 2274 - type DisplayName = S::DisplayName; 2275 - type IndexedAt = S::IndexedAt; 2276 - } 2277 - ///State transition - sets the `did` field to Set 2278 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2279 - impl<S: State> sealed::Sealed for SetDid<S> {} 2280 - impl<S: State> State for SetDid<S> { 2281 - type Uri = S::Uri; 2282 2273 type Cid = S::Cid; 2283 - type Did = Set<members::did>; 2284 - type Creator = S::Creator; 2285 2274 type DisplayName = S::DisplayName; 2286 - type IndexedAt = S::IndexedAt; 2275 + type Did = S::Did; 2287 2276 } 2288 2277 ///State transition - sets the `creator` field to Set 2289 2278 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 2290 2279 impl<S: State> sealed::Sealed for SetCreator<S> {} 2291 2280 impl<S: State> State for SetCreator<S> { 2292 2281 type Uri = S::Uri; 2282 + type IndexedAt = S::IndexedAt; 2283 + type Creator = Set<members::creator>; 2293 2284 type Cid = S::Cid; 2285 + type DisplayName = S::DisplayName; 2294 2286 type Did = S::Did; 2295 - type Creator = Set<members::creator>; 2287 + } 2288 + ///State transition - sets the `cid` field to Set 2289 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2290 + impl<S: State> sealed::Sealed for SetCid<S> {} 2291 + impl<S: State> State for SetCid<S> { 2292 + type Uri = S::Uri; 2293 + type IndexedAt = S::IndexedAt; 2294 + type Creator = S::Creator; 2295 + type Cid = Set<members::cid>; 2296 2296 type DisplayName = S::DisplayName; 2297 - type IndexedAt = S::IndexedAt; 2297 + type Did = S::Did; 2298 2298 } 2299 2299 ///State transition - sets the `display_name` field to Set 2300 2300 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 2301 2301 impl<S: State> sealed::Sealed for SetDisplayName<S> {} 2302 2302 impl<S: State> State for SetDisplayName<S> { 2303 2303 type Uri = S::Uri; 2304 - type Cid = S::Cid; 2305 - type Did = S::Did; 2304 + type IndexedAt = S::IndexedAt; 2306 2305 type Creator = S::Creator; 2306 + type Cid = S::Cid; 2307 2307 type DisplayName = Set<members::display_name>; 2308 - type IndexedAt = S::IndexedAt; 2308 + type Did = S::Did; 2309 2309 } 2310 - ///State transition - sets the `indexed_at` field to Set 2311 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2312 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2313 - impl<S: State> State for SetIndexedAt<S> { 2310 + ///State transition - sets the `did` field to Set 2311 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2312 + impl<S: State> sealed::Sealed for SetDid<S> {} 2313 + impl<S: State> State for SetDid<S> { 2314 2314 type Uri = S::Uri; 2315 + type IndexedAt = S::IndexedAt; 2316 + type Creator = S::Creator; 2315 2317 type Cid = S::Cid; 2316 - type Did = S::Did; 2317 - type Creator = S::Creator; 2318 2318 type DisplayName = S::DisplayName; 2319 - type IndexedAt = Set<members::indexed_at>; 2319 + type Did = Set<members::did>; 2320 2320 } 2321 2321 /// Marker types for field names 2322 2322 #[allow(non_camel_case_types)] 2323 2323 pub mod members { 2324 2324 ///Marker type for the `uri` field 2325 2325 pub struct uri(()); 2326 - ///Marker type for the `cid` field 2327 - pub struct cid(()); 2328 - ///Marker type for the `did` field 2329 - pub struct did(()); 2326 + ///Marker type for the `indexed_at` field 2327 + pub struct indexed_at(()); 2330 2328 ///Marker type for the `creator` field 2331 2329 pub struct creator(()); 2330 + ///Marker type for the `cid` field 2331 + pub struct cid(()); 2332 2332 ///Marker type for the `display_name` field 2333 2333 pub struct display_name(()); 2334 - ///Marker type for the `indexed_at` field 2335 - pub struct indexed_at(()); 2334 + ///Marker type for the `did` field 2335 + pub struct did(()); 2336 2336 } 2337 2337 } 2338 2338 ··· 2649 2649 where 2650 2650 S: generator_view_state::State, 2651 2651 S::Uri: generator_view_state::IsSet, 2652 - S::Cid: generator_view_state::IsSet, 2653 - S::Did: generator_view_state::IsSet, 2652 + S::IndexedAt: generator_view_state::IsSet, 2654 2653 S::Creator: generator_view_state::IsSet, 2654 + S::Cid: generator_view_state::IsSet, 2655 2655 S::DisplayName: generator_view_state::IsSet, 2656 - S::IndexedAt: generator_view_state::IsSet, 2656 + S::Did: generator_view_state::IsSet, 2657 2657 { 2658 2658 /// Build the final struct 2659 2659 pub fn build(self) -> GeneratorView<'a> { ··· 3207 3207 } 3208 3208 /// State trait tracking which required fields have been set 3209 3209 pub trait State: sealed::Sealed { 3210 + type IndexedAt; 3210 3211 type Uri; 3212 + type Author; 3211 3213 type Cid; 3212 - type Author; 3213 3214 type Record; 3214 - type IndexedAt; 3215 3215 } 3216 3216 /// Empty state - all required fields are unset 3217 3217 pub struct Empty(()); 3218 3218 impl sealed::Sealed for Empty {} 3219 3219 impl State for Empty { 3220 + type IndexedAt = Unset; 3220 3221 type Uri = Unset; 3222 + type Author = Unset; 3221 3223 type Cid = Unset; 3222 - type Author = Unset; 3223 3224 type Record = Unset; 3224 - type IndexedAt = Unset; 3225 + } 3226 + ///State transition - sets the `indexed_at` field to Set 3227 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3228 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3229 + impl<S: State> State for SetIndexedAt<S> { 3230 + type IndexedAt = Set<members::indexed_at>; 3231 + type Uri = S::Uri; 3232 + type Author = S::Author; 3233 + type Cid = S::Cid; 3234 + type Record = S::Record; 3225 3235 } 3226 3236 ///State transition - sets the `uri` field to Set 3227 3237 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3228 3238 impl<S: State> sealed::Sealed for SetUri<S> {} 3229 3239 impl<S: State> State for SetUri<S> { 3240 + type IndexedAt = S::IndexedAt; 3230 3241 type Uri = Set<members::uri>; 3242 + type Author = S::Author; 3231 3243 type Cid = S::Cid; 3232 - type Author = S::Author; 3233 3244 type Record = S::Record; 3245 + } 3246 + ///State transition - sets the `author` field to Set 3247 + pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 3248 + impl<S: State> sealed::Sealed for SetAuthor<S> {} 3249 + impl<S: State> State for SetAuthor<S> { 3234 3250 type IndexedAt = S::IndexedAt; 3251 + type Uri = S::Uri; 3252 + type Author = Set<members::author>; 3253 + type Cid = S::Cid; 3254 + type Record = S::Record; 3235 3255 } 3236 3256 ///State transition - sets the `cid` field to Set 3237 3257 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3238 3258 impl<S: State> sealed::Sealed for SetCid<S> {} 3239 3259 impl<S: State> State for SetCid<S> { 3240 - type Uri = S::Uri; 3241 - type Cid = Set<members::cid>; 3242 - type Author = S::Author; 3243 - type Record = S::Record; 3244 3260 type IndexedAt = S::IndexedAt; 3245 - } 3246 - ///State transition - sets the `author` field to Set 3247 - pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 3248 - impl<S: State> sealed::Sealed for SetAuthor<S> {} 3249 - impl<S: State> State for SetAuthor<S> { 3250 3261 type Uri = S::Uri; 3251 - type Cid = S::Cid; 3252 - type Author = Set<members::author>; 3262 + type Author = S::Author; 3263 + type Cid = Set<members::cid>; 3253 3264 type Record = S::Record; 3254 - type IndexedAt = S::IndexedAt; 3255 3265 } 3256 3266 ///State transition - sets the `record` field to Set 3257 3267 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3258 3268 impl<S: State> sealed::Sealed for SetRecord<S> {} 3259 3269 impl<S: State> State for SetRecord<S> { 3260 - type Uri = S::Uri; 3261 - type Cid = S::Cid; 3262 - type Author = S::Author; 3263 - type Record = Set<members::record>; 3264 3270 type IndexedAt = S::IndexedAt; 3265 - } 3266 - ///State transition - sets the `indexed_at` field to Set 3267 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3268 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3269 - impl<S: State> State for SetIndexedAt<S> { 3270 3271 type Uri = S::Uri; 3271 - type Cid = S::Cid; 3272 3272 type Author = S::Author; 3273 - type Record = S::Record; 3274 - type IndexedAt = Set<members::indexed_at>; 3273 + type Cid = S::Cid; 3274 + type Record = Set<members::record>; 3275 3275 } 3276 3276 /// Marker types for field names 3277 3277 #[allow(non_camel_case_types)] 3278 3278 pub mod members { 3279 + ///Marker type for the `indexed_at` field 3280 + pub struct indexed_at(()); 3279 3281 ///Marker type for the `uri` field 3280 3282 pub struct uri(()); 3283 + ///Marker type for the `author` field 3284 + pub struct author(()); 3281 3285 ///Marker type for the `cid` field 3282 3286 pub struct cid(()); 3283 - ///Marker type for the `author` field 3284 - pub struct author(()); 3285 3287 ///Marker type for the `record` field 3286 3288 pub struct record(()); 3287 - ///Marker type for the `indexed_at` field 3288 - pub struct indexed_at(()); 3289 3289 } 3290 3290 } 3291 3291 ··· 3598 3598 impl<'a, S> PostViewBuilder<'a, S> 3599 3599 where 3600 3600 S: post_view_state::State, 3601 + S::IndexedAt: post_view_state::IsSet, 3601 3602 S::Uri: post_view_state::IsSet, 3602 - S::Cid: post_view_state::IsSet, 3603 3603 S::Author: post_view_state::IsSet, 3604 + S::Cid: post_view_state::IsSet, 3604 3605 S::Record: post_view_state::IsSet, 3605 - S::IndexedAt: post_view_state::IsSet, 3606 3606 { 3607 3607 /// Build the final struct 3608 3608 pub fn build(self) -> PostView<'a> {
+15 -15
crates/weaver-api/src/app_bsky/feed/generator.rs
··· 56 56 } 57 57 /// State trait tracking which required fields have been set 58 58 pub trait State: sealed::Sealed { 59 - type Did; 60 59 type DisplayName; 60 + type Did; 61 61 type CreatedAt; 62 62 } 63 63 /// Empty state - all required fields are unset 64 64 pub struct Empty(()); 65 65 impl sealed::Sealed for Empty {} 66 66 impl State for Empty { 67 - type Did = Unset; 68 67 type DisplayName = Unset; 68 + type Did = Unset; 69 69 type CreatedAt = Unset; 70 70 } 71 - ///State transition - sets the `did` field to Set 72 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 73 - impl<S: State> sealed::Sealed for SetDid<S> {} 74 - impl<S: State> State for SetDid<S> { 75 - type Did = Set<members::did>; 76 - type DisplayName = S::DisplayName; 77 - type CreatedAt = S::CreatedAt; 78 - } 79 71 ///State transition - sets the `display_name` field to Set 80 72 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 81 73 impl<S: State> sealed::Sealed for SetDisplayName<S> {} 82 74 impl<S: State> State for SetDisplayName<S> { 83 - type Did = S::Did; 84 75 type DisplayName = Set<members::display_name>; 76 + type Did = S::Did; 77 + type CreatedAt = S::CreatedAt; 78 + } 79 + ///State transition - sets the `did` field to Set 80 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 81 + impl<S: State> sealed::Sealed for SetDid<S> {} 82 + impl<S: State> State for SetDid<S> { 83 + type DisplayName = S::DisplayName; 84 + type Did = Set<members::did>; 85 85 type CreatedAt = S::CreatedAt; 86 86 } 87 87 ///State transition - sets the `created_at` field to Set 88 88 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 89 89 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 90 90 impl<S: State> State for SetCreatedAt<S> { 91 - type Did = S::Did; 92 91 type DisplayName = S::DisplayName; 92 + type Did = S::Did; 93 93 type CreatedAt = Set<members::created_at>; 94 94 } 95 95 /// Marker types for field names 96 96 #[allow(non_camel_case_types)] 97 97 pub mod members { 98 + ///Marker type for the `display_name` field 99 + pub struct display_name(()); 98 100 ///Marker type for the `did` field 99 101 pub struct did(()); 100 - ///Marker type for the `display_name` field 101 - pub struct display_name(()); 102 102 ///Marker type for the `created_at` field 103 103 pub struct created_at(()); 104 104 } ··· 317 317 impl<'a, S> GeneratorBuilder<'a, S> 318 318 where 319 319 S: generator_state::State, 320 - S::Did: generator_state::IsSet, 321 320 S::DisplayName: generator_state::IsSet, 321 + S::Did: generator_state::IsSet, 322 322 S::CreatedAt: generator_state::IsSet, 323 323 { 324 324 /// Build the final struct
+15 -15
crates/weaver-api/src/app_bsky/feed/get_likes.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type IndexedAt; 37 36 type CreatedAt; 37 + type IndexedAt; 38 38 type Actor; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type IndexedAt = Unset; 45 44 type CreatedAt = Unset; 45 + type IndexedAt = Unset; 46 46 type Actor = Unset; 47 47 } 48 - ///State transition - sets the `indexed_at` field to Set 49 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 51 - impl<S: State> State for SetIndexedAt<S> { 52 - type IndexedAt = Set<members::indexed_at>; 53 - type CreatedAt = S::CreatedAt; 54 - type Actor = S::Actor; 55 - } 56 48 ///State transition - sets the `created_at` field to Set 57 49 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 58 50 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 59 51 impl<S: State> State for SetCreatedAt<S> { 60 - type IndexedAt = S::IndexedAt; 61 52 type CreatedAt = Set<members::created_at>; 53 + type IndexedAt = S::IndexedAt; 54 + type Actor = S::Actor; 55 + } 56 + ///State transition - sets the `indexed_at` field to Set 57 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 59 + impl<S: State> State for SetIndexedAt<S> { 60 + type CreatedAt = S::CreatedAt; 61 + type IndexedAt = Set<members::indexed_at>; 62 62 type Actor = S::Actor; 63 63 } 64 64 ///State transition - sets the `actor` field to Set 65 65 pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 66 66 impl<S: State> sealed::Sealed for SetActor<S> {} 67 67 impl<S: State> State for SetActor<S> { 68 - type IndexedAt = S::IndexedAt; 69 68 type CreatedAt = S::CreatedAt; 69 + type IndexedAt = S::IndexedAt; 70 70 type Actor = Set<members::actor>; 71 71 } 72 72 /// Marker types for field names 73 73 #[allow(non_camel_case_types)] 74 74 pub mod members { 75 + ///Marker type for the `created_at` field 76 + pub struct created_at(()); 75 77 ///Marker type for the `indexed_at` field 76 78 pub struct indexed_at(()); 77 - ///Marker type for the `created_at` field 78 - pub struct created_at(()); 79 79 ///Marker type for the `actor` field 80 80 pub struct actor(()); 81 81 } ··· 170 170 impl<'a, S> LikeBuilder<'a, S> 171 171 where 172 172 S: like_state::State, 173 - S::IndexedAt: like_state::IsSet, 174 173 S::CreatedAt: like_state::IsSet, 174 + S::IndexedAt: like_state::IsSet, 175 175 S::Actor: like_state::IsSet, 176 176 { 177 177 /// Build the final struct
+13 -13
crates/weaver-api/src/app_bsky/feed/like.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Subject; 40 39 type CreatedAt; 40 + type Subject; 41 41 } 42 42 /// Empty state - all required fields are unset 43 43 pub struct Empty(()); 44 44 impl sealed::Sealed for Empty {} 45 45 impl State for Empty { 46 - type Subject = Unset; 47 46 type CreatedAt = Unset; 48 - } 49 - ///State transition - sets the `subject` field to Set 50 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 51 - impl<S: State> sealed::Sealed for SetSubject<S> {} 52 - impl<S: State> State for SetSubject<S> { 53 - type Subject = Set<members::subject>; 54 - type CreatedAt = S::CreatedAt; 47 + type Subject = Unset; 55 48 } 56 49 ///State transition - sets the `created_at` field to Set 57 50 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 58 51 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 59 52 impl<S: State> State for SetCreatedAt<S> { 60 - type Subject = S::Subject; 61 53 type CreatedAt = Set<members::created_at>; 54 + type Subject = S::Subject; 55 + } 56 + ///State transition - sets the `subject` field to Set 57 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetSubject<S> {} 59 + impl<S: State> State for SetSubject<S> { 60 + type CreatedAt = S::CreatedAt; 61 + type Subject = Set<members::subject>; 62 62 } 63 63 /// Marker types for field names 64 64 #[allow(non_camel_case_types)] 65 65 pub mod members { 66 - ///Marker type for the `subject` field 67 - pub struct subject(()); 68 66 ///Marker type for the `created_at` field 69 67 pub struct created_at(()); 68 + ///Marker type for the `subject` field 69 + pub struct subject(()); 70 70 } 71 71 } 72 72 ··· 159 159 impl<'a, S> LikeBuilder<'a, S> 160 160 where 161 161 S: like_state::State, 162 - S::Subject: like_state::IsSet, 163 162 S::CreatedAt: like_state::IsSet, 163 + S::Subject: like_state::IsSet, 164 164 { 165 165 /// Build the final struct 166 166 pub fn build(self) -> Like<'a> {
+13 -13
crates/weaver-api/src/app_bsky/feed/repost.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Subject; 40 39 type CreatedAt; 40 + type Subject; 41 41 } 42 42 /// Empty state - all required fields are unset 43 43 pub struct Empty(()); 44 44 impl sealed::Sealed for Empty {} 45 45 impl State for Empty { 46 - type Subject = Unset; 47 46 type CreatedAt = Unset; 48 - } 49 - ///State transition - sets the `subject` field to Set 50 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 51 - impl<S: State> sealed::Sealed for SetSubject<S> {} 52 - impl<S: State> State for SetSubject<S> { 53 - type Subject = Set<members::subject>; 54 - type CreatedAt = S::CreatedAt; 47 + type Subject = Unset; 55 48 } 56 49 ///State transition - sets the `created_at` field to Set 57 50 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 58 51 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 59 52 impl<S: State> State for SetCreatedAt<S> { 60 - type Subject = S::Subject; 61 53 type CreatedAt = Set<members::created_at>; 54 + type Subject = S::Subject; 55 + } 56 + ///State transition - sets the `subject` field to Set 57 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetSubject<S> {} 59 + impl<S: State> State for SetSubject<S> { 60 + type CreatedAt = S::CreatedAt; 61 + type Subject = Set<members::subject>; 62 62 } 63 63 /// Marker types for field names 64 64 #[allow(non_camel_case_types)] 65 65 pub mod members { 66 - ///Marker type for the `subject` field 67 - pub struct subject(()); 68 66 ///Marker type for the `created_at` field 69 67 pub struct created_at(()); 68 + ///Marker type for the `subject` field 69 + pub struct subject(()); 70 70 } 71 71 } 72 72 ··· 159 159 impl<'a, S> RepostBuilder<'a, S> 160 160 where 161 161 S: repost_state::State, 162 - S::Subject: repost_state::IsSet, 163 162 S::CreatedAt: repost_state::IsSet, 163 + S::Subject: repost_state::IsSet, 164 164 { 165 165 /// Build the final struct 166 166 pub fn build(self) -> Repost<'a> {
+13 -13
crates/weaver-api/src/app_bsky/feed/threadgate.rs
··· 463 463 } 464 464 /// State trait tracking which required fields have been set 465 465 pub trait State: sealed::Sealed { 466 - type Post; 467 466 type CreatedAt; 467 + type Post; 468 468 } 469 469 /// Empty state - all required fields are unset 470 470 pub struct Empty(()); 471 471 impl sealed::Sealed for Empty {} 472 472 impl State for Empty { 473 - type Post = Unset; 474 473 type CreatedAt = Unset; 475 - } 476 - ///State transition - sets the `post` field to Set 477 - pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 478 - impl<S: State> sealed::Sealed for SetPost<S> {} 479 - impl<S: State> State for SetPost<S> { 480 - type Post = Set<members::post>; 481 - type CreatedAt = S::CreatedAt; 474 + type Post = Unset; 482 475 } 483 476 ///State transition - sets the `created_at` field to Set 484 477 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 485 478 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 486 479 impl<S: State> State for SetCreatedAt<S> { 487 - type Post = S::Post; 488 480 type CreatedAt = Set<members::created_at>; 481 + type Post = S::Post; 482 + } 483 + ///State transition - sets the `post` field to Set 484 + pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 485 + impl<S: State> sealed::Sealed for SetPost<S> {} 486 + impl<S: State> State for SetPost<S> { 487 + type CreatedAt = S::CreatedAt; 488 + type Post = Set<members::post>; 489 489 } 490 490 /// Marker types for field names 491 491 #[allow(non_camel_case_types)] 492 492 pub mod members { 493 - ///Marker type for the `post` field 494 - pub struct post(()); 495 493 ///Marker type for the `created_at` field 496 494 pub struct created_at(()); 495 + ///Marker type for the `post` field 496 + pub struct post(()); 497 497 } 498 498 } 499 499 ··· 603 603 impl<'a, S> ThreadgateBuilder<'a, S> 604 604 where 605 605 S: threadgate_state::State, 606 - S::Post: threadgate_state::IsSet, 607 606 S::CreatedAt: threadgate_state::IsSet, 607 + S::Post: threadgate_state::IsSet, 608 608 { 609 609 /// Build the final struct 610 610 pub fn build(self) -> Threadgate<'a> {
+149 -149
crates/weaver-api/src/app_bsky/graph.rs
··· 1277 1277 } 1278 1278 /// State trait tracking which required fields have been set 1279 1279 pub trait State: sealed::Sealed { 1280 - type Uri; 1281 - type Cid; 1282 - type Creator; 1283 - type Name; 1284 1280 type Purpose; 1285 1281 type IndexedAt; 1282 + type Name; 1283 + type Cid; 1284 + type Creator; 1285 + type Uri; 1286 1286 } 1287 1287 /// Empty state - all required fields are unset 1288 1288 pub struct Empty(()); 1289 1289 impl sealed::Sealed for Empty {} 1290 1290 impl State for Empty { 1291 - type Uri = Unset; 1291 + type Purpose = Unset; 1292 + type IndexedAt = Unset; 1293 + type Name = Unset; 1292 1294 type Cid = Unset; 1293 1295 type Creator = Unset; 1294 - type Name = Unset; 1295 - type Purpose = Unset; 1296 - type IndexedAt = Unset; 1296 + type Uri = Unset; 1297 1297 } 1298 - ///State transition - sets the `uri` field to Set 1299 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1300 - impl<S: State> sealed::Sealed for SetUri<S> {} 1301 - impl<S: State> State for SetUri<S> { 1302 - type Uri = Set<members::uri>; 1298 + ///State transition - sets the `purpose` field to Set 1299 + pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1300 + impl<S: State> sealed::Sealed for SetPurpose<S> {} 1301 + impl<S: State> State for SetPurpose<S> { 1302 + type Purpose = Set<members::purpose>; 1303 + type IndexedAt = S::IndexedAt; 1304 + type Name = S::Name; 1303 1305 type Cid = S::Cid; 1304 1306 type Creator = S::Creator; 1307 + type Uri = S::Uri; 1308 + } 1309 + ///State transition - sets the `indexed_at` field to Set 1310 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1311 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1312 + impl<S: State> State for SetIndexedAt<S> { 1313 + type Purpose = S::Purpose; 1314 + type IndexedAt = Set<members::indexed_at>; 1305 1315 type Name = S::Name; 1316 + type Cid = S::Cid; 1317 + type Creator = S::Creator; 1318 + type Uri = S::Uri; 1319 + } 1320 + ///State transition - sets the `name` field to Set 1321 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1322 + impl<S: State> sealed::Sealed for SetName<S> {} 1323 + impl<S: State> State for SetName<S> { 1306 1324 type Purpose = S::Purpose; 1307 1325 type IndexedAt = S::IndexedAt; 1326 + type Name = Set<members::name>; 1327 + type Cid = S::Cid; 1328 + type Creator = S::Creator; 1329 + type Uri = S::Uri; 1308 1330 } 1309 1331 ///State transition - sets the `cid` field to Set 1310 1332 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1311 1333 impl<S: State> sealed::Sealed for SetCid<S> {} 1312 1334 impl<S: State> State for SetCid<S> { 1313 - type Uri = S::Uri; 1335 + type Purpose = S::Purpose; 1336 + type IndexedAt = S::IndexedAt; 1337 + type Name = S::Name; 1314 1338 type Cid = Set<members::cid>; 1315 1339 type Creator = S::Creator; 1316 - type Name = S::Name; 1317 - type Purpose = S::Purpose; 1318 - type IndexedAt = S::IndexedAt; 1340 + type Uri = S::Uri; 1319 1341 } 1320 1342 ///State transition - sets the `creator` field to Set 1321 1343 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1322 1344 impl<S: State> sealed::Sealed for SetCreator<S> {} 1323 1345 impl<S: State> State for SetCreator<S> { 1324 - type Uri = S::Uri; 1346 + type Purpose = S::Purpose; 1347 + type IndexedAt = S::IndexedAt; 1348 + type Name = S::Name; 1325 1349 type Cid = S::Cid; 1326 1350 type Creator = Set<members::creator>; 1327 - type Name = S::Name; 1328 - type Purpose = S::Purpose; 1329 - type IndexedAt = S::IndexedAt; 1330 - } 1331 - ///State transition - sets the `name` field to Set 1332 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1333 - impl<S: State> sealed::Sealed for SetName<S> {} 1334 - impl<S: State> State for SetName<S> { 1335 1351 type Uri = S::Uri; 1336 - type Cid = S::Cid; 1337 - type Creator = S::Creator; 1338 - type Name = Set<members::name>; 1352 + } 1353 + ///State transition - sets the `uri` field to Set 1354 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1355 + impl<S: State> sealed::Sealed for SetUri<S> {} 1356 + impl<S: State> State for SetUri<S> { 1339 1357 type Purpose = S::Purpose; 1340 1358 type IndexedAt = S::IndexedAt; 1341 - } 1342 - ///State transition - sets the `purpose` field to Set 1343 - pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1344 - impl<S: State> sealed::Sealed for SetPurpose<S> {} 1345 - impl<S: State> State for SetPurpose<S> { 1346 - type Uri = S::Uri; 1347 - type Cid = S::Cid; 1348 - type Creator = S::Creator; 1349 1359 type Name = S::Name; 1350 - type Purpose = Set<members::purpose>; 1351 - type IndexedAt = S::IndexedAt; 1352 - } 1353 - ///State transition - sets the `indexed_at` field to Set 1354 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1355 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1356 - impl<S: State> State for SetIndexedAt<S> { 1357 - type Uri = S::Uri; 1358 1360 type Cid = S::Cid; 1359 1361 type Creator = S::Creator; 1360 - type Name = S::Name; 1361 - type Purpose = S::Purpose; 1362 - type IndexedAt = Set<members::indexed_at>; 1362 + type Uri = Set<members::uri>; 1363 1363 } 1364 1364 /// Marker types for field names 1365 1365 #[allow(non_camel_case_types)] 1366 1366 pub mod members { 1367 - ///Marker type for the `uri` field 1368 - pub struct uri(()); 1369 - ///Marker type for the `cid` field 1370 - pub struct cid(()); 1371 - ///Marker type for the `creator` field 1372 - pub struct creator(()); 1373 - ///Marker type for the `name` field 1374 - pub struct name(()); 1375 1367 ///Marker type for the `purpose` field 1376 1368 pub struct purpose(()); 1377 1369 ///Marker type for the `indexed_at` field 1378 1370 pub struct indexed_at(()); 1371 + ///Marker type for the `name` field 1372 + pub struct name(()); 1373 + ///Marker type for the `cid` field 1374 + pub struct cid(()); 1375 + ///Marker type for the `creator` field 1376 + pub struct creator(()); 1377 + ///Marker type for the `uri` field 1378 + pub struct uri(()); 1379 1379 } 1380 1380 } 1381 1381 ··· 1655 1655 impl<'a, S> ListViewBuilder<'a, S> 1656 1656 where 1657 1657 S: list_view_state::State, 1658 - S::Uri: list_view_state::IsSet, 1659 - S::Cid: list_view_state::IsSet, 1660 - S::Creator: list_view_state::IsSet, 1661 - S::Name: list_view_state::IsSet, 1662 1658 S::Purpose: list_view_state::IsSet, 1663 1659 S::IndexedAt: list_view_state::IsSet, 1660 + S::Name: list_view_state::IsSet, 1661 + S::Cid: list_view_state::IsSet, 1662 + S::Creator: list_view_state::IsSet, 1663 + S::Uri: list_view_state::IsSet, 1664 1664 { 1665 1665 /// Build the final struct 1666 1666 pub fn build(self) -> ListView<'a> { ··· 1837 1837 pub trait State: sealed::Sealed { 1838 1838 type Uri; 1839 1839 type Cid; 1840 - type Name; 1841 1840 type Purpose; 1841 + type Name; 1842 1842 } 1843 1843 /// Empty state - all required fields are unset 1844 1844 pub struct Empty(()); ··· 1846 1846 impl State for Empty { 1847 1847 type Uri = Unset; 1848 1848 type Cid = Unset; 1849 - type Name = Unset; 1850 1849 type Purpose = Unset; 1850 + type Name = Unset; 1851 1851 } 1852 1852 ///State transition - sets the `uri` field to Set 1853 1853 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); ··· 1855 1855 impl<S: State> State for SetUri<S> { 1856 1856 type Uri = Set<members::uri>; 1857 1857 type Cid = S::Cid; 1858 - type Name = S::Name; 1859 1858 type Purpose = S::Purpose; 1859 + type Name = S::Name; 1860 1860 } 1861 1861 ///State transition - sets the `cid` field to Set 1862 1862 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); ··· 1864 1864 impl<S: State> State for SetCid<S> { 1865 1865 type Uri = S::Uri; 1866 1866 type Cid = Set<members::cid>; 1867 + type Purpose = S::Purpose; 1867 1868 type Name = S::Name; 1868 - type Purpose = S::Purpose; 1869 + } 1870 + ///State transition - sets the `purpose` field to Set 1871 + pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1872 + impl<S: State> sealed::Sealed for SetPurpose<S> {} 1873 + impl<S: State> State for SetPurpose<S> { 1874 + type Uri = S::Uri; 1875 + type Cid = S::Cid; 1876 + type Purpose = Set<members::purpose>; 1877 + type Name = S::Name; 1869 1878 } 1870 1879 ///State transition - sets the `name` field to Set 1871 1880 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); ··· 1873 1882 impl<S: State> State for SetName<S> { 1874 1883 type Uri = S::Uri; 1875 1884 type Cid = S::Cid; 1876 - type Name = Set<members::name>; 1877 1885 type Purpose = S::Purpose; 1878 - } 1879 - ///State transition - sets the `purpose` field to Set 1880 - pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>); 1881 - impl<S: State> sealed::Sealed for SetPurpose<S> {} 1882 - impl<S: State> State for SetPurpose<S> { 1883 - type Uri = S::Uri; 1884 - type Cid = S::Cid; 1885 - type Name = S::Name; 1886 - type Purpose = Set<members::purpose>; 1886 + type Name = Set<members::name>; 1887 1887 } 1888 1888 /// Marker types for field names 1889 1889 #[allow(non_camel_case_types)] ··· 1892 1892 pub struct uri(()); 1893 1893 ///Marker type for the `cid` field 1894 1894 pub struct cid(()); 1895 - ///Marker type for the `name` field 1896 - pub struct name(()); 1897 1895 ///Marker type for the `purpose` field 1898 1896 pub struct purpose(()); 1897 + ///Marker type for the `name` field 1898 + pub struct name(()); 1899 1899 } 1900 1900 } 1901 1901 ··· 2114 2114 S: list_view_basic_state::State, 2115 2115 S::Uri: list_view_basic_state::IsSet, 2116 2116 S::Cid: list_view_basic_state::IsSet, 2117 - S::Name: list_view_basic_state::IsSet, 2118 2117 S::Purpose: list_view_basic_state::IsSet, 2118 + S::Name: list_view_basic_state::IsSet, 2119 2119 { 2120 2120 /// Build the final struct 2121 2121 pub fn build(self) -> ListViewBasic<'a> { ··· 2292 2292 } 2293 2293 /// State trait tracking which required fields have been set 2294 2294 pub trait State: sealed::Sealed { 2295 - type Actor; 2296 2295 type NotFound; 2296 + type Actor; 2297 2297 } 2298 2298 /// Empty state - all required fields are unset 2299 2299 pub struct Empty(()); 2300 2300 impl sealed::Sealed for Empty {} 2301 2301 impl State for Empty { 2302 - type Actor = Unset; 2303 2302 type NotFound = Unset; 2304 - } 2305 - ///State transition - sets the `actor` field to Set 2306 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 2307 - impl<S: State> sealed::Sealed for SetActor<S> {} 2308 - impl<S: State> State for SetActor<S> { 2309 - type Actor = Set<members::actor>; 2310 - type NotFound = S::NotFound; 2303 + type Actor = Unset; 2311 2304 } 2312 2305 ///State transition - sets the `not_found` field to Set 2313 2306 pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>); 2314 2307 impl<S: State> sealed::Sealed for SetNotFound<S> {} 2315 2308 impl<S: State> State for SetNotFound<S> { 2316 - type Actor = S::Actor; 2317 2309 type NotFound = Set<members::not_found>; 2310 + type Actor = S::Actor; 2311 + } 2312 + ///State transition - sets the `actor` field to Set 2313 + pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 2314 + impl<S: State> sealed::Sealed for SetActor<S> {} 2315 + impl<S: State> State for SetActor<S> { 2316 + type NotFound = S::NotFound; 2317 + type Actor = Set<members::actor>; 2318 2318 } 2319 2319 /// Marker types for field names 2320 2320 #[allow(non_camel_case_types)] 2321 2321 pub mod members { 2322 + ///Marker type for the `not_found` field 2323 + pub struct not_found(()); 2322 2324 ///Marker type for the `actor` field 2323 2325 pub struct actor(()); 2324 - ///Marker type for the `not_found` field 2325 - pub struct not_found(()); 2326 2326 } 2327 2327 } 2328 2328 ··· 2395 2395 impl<'a, S> NotFoundActorBuilder<'a, S> 2396 2396 where 2397 2397 S: not_found_actor_state::State, 2398 - S::Actor: not_found_actor_state::IsSet, 2399 2398 S::NotFound: not_found_actor_state::IsSet, 2399 + S::Actor: not_found_actor_state::IsSet, 2400 2400 { 2401 2401 /// Build the final struct 2402 2402 pub fn build(self) -> NotFoundActor<'a> { ··· 2699 2699 } 2700 2700 /// State trait tracking which required fields have been set 2701 2701 pub trait State: sealed::Sealed { 2702 - type Uri; 2703 - type Cid; 2704 2702 type Record; 2703 + type Cid; 2705 2704 type Creator; 2706 2705 type IndexedAt; 2706 + type Uri; 2707 2707 } 2708 2708 /// Empty state - all required fields are unset 2709 2709 pub struct Empty(()); 2710 2710 impl sealed::Sealed for Empty {} 2711 2711 impl State for Empty { 2712 - type Uri = Unset; 2712 + type Record = Unset; 2713 2713 type Cid = Unset; 2714 - type Record = Unset; 2715 2714 type Creator = Unset; 2716 2715 type IndexedAt = Unset; 2716 + type Uri = Unset; 2717 2717 } 2718 - ///State transition - sets the `uri` field to Set 2719 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2720 - impl<S: State> sealed::Sealed for SetUri<S> {} 2721 - impl<S: State> State for SetUri<S> { 2722 - type Uri = Set<members::uri>; 2718 + ///State transition - sets the `record` field to Set 2719 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 2720 + impl<S: State> sealed::Sealed for SetRecord<S> {} 2721 + impl<S: State> State for SetRecord<S> { 2722 + type Record = Set<members::record>; 2723 2723 type Cid = S::Cid; 2724 - type Record = S::Record; 2725 2724 type Creator = S::Creator; 2726 2725 type IndexedAt = S::IndexedAt; 2726 + type Uri = S::Uri; 2727 2727 } 2728 2728 ///State transition - sets the `cid` field to Set 2729 2729 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2730 2730 impl<S: State> sealed::Sealed for SetCid<S> {} 2731 2731 impl<S: State> State for SetCid<S> { 2732 - type Uri = S::Uri; 2732 + type Record = S::Record; 2733 2733 type Cid = Set<members::cid>; 2734 - type Record = S::Record; 2735 2734 type Creator = S::Creator; 2736 2735 type IndexedAt = S::IndexedAt; 2737 - } 2738 - ///State transition - sets the `record` field to Set 2739 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 2740 - impl<S: State> sealed::Sealed for SetRecord<S> {} 2741 - impl<S: State> State for SetRecord<S> { 2742 2736 type Uri = S::Uri; 2743 - type Cid = S::Cid; 2744 - type Record = Set<members::record>; 2745 - type Creator = S::Creator; 2746 - type IndexedAt = S::IndexedAt; 2747 2737 } 2748 2738 ///State transition - sets the `creator` field to Set 2749 2739 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 2750 2740 impl<S: State> sealed::Sealed for SetCreator<S> {} 2751 2741 impl<S: State> State for SetCreator<S> { 2752 - type Uri = S::Uri; 2742 + type Record = S::Record; 2753 2743 type Cid = S::Cid; 2754 - type Record = S::Record; 2755 2744 type Creator = Set<members::creator>; 2756 2745 type IndexedAt = S::IndexedAt; 2746 + type Uri = S::Uri; 2757 2747 } 2758 2748 ///State transition - sets the `indexed_at` field to Set 2759 2749 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2760 2750 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2761 2751 impl<S: State> State for SetIndexedAt<S> { 2752 + type Record = S::Record; 2753 + type Cid = S::Cid; 2754 + type Creator = S::Creator; 2755 + type IndexedAt = Set<members::indexed_at>; 2762 2756 type Uri = S::Uri; 2763 - type Cid = S::Cid; 2757 + } 2758 + ///State transition - sets the `uri` field to Set 2759 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2760 + impl<S: State> sealed::Sealed for SetUri<S> {} 2761 + impl<S: State> State for SetUri<S> { 2764 2762 type Record = S::Record; 2763 + type Cid = S::Cid; 2765 2764 type Creator = S::Creator; 2766 - type IndexedAt = Set<members::indexed_at>; 2765 + type IndexedAt = S::IndexedAt; 2766 + type Uri = Set<members::uri>; 2767 2767 } 2768 2768 /// Marker types for field names 2769 2769 #[allow(non_camel_case_types)] 2770 2770 pub mod members { 2771 - ///Marker type for the `uri` field 2772 - pub struct uri(()); 2771 + ///Marker type for the `record` field 2772 + pub struct record(()); 2773 2773 ///Marker type for the `cid` field 2774 2774 pub struct cid(()); 2775 - ///Marker type for the `record` field 2776 - pub struct record(()); 2777 2775 ///Marker type for the `creator` field 2778 2776 pub struct creator(()); 2779 2777 ///Marker type for the `indexed_at` field 2780 2778 pub struct indexed_at(()); 2779 + ///Marker type for the `uri` field 2780 + pub struct uri(()); 2781 2781 } 2782 2782 } 2783 2783 ··· 3030 3030 impl<'a, S> StarterPackViewBuilder<'a, S> 3031 3031 where 3032 3032 S: starter_pack_view_state::State, 3033 - S::Uri: starter_pack_view_state::IsSet, 3034 - S::Cid: starter_pack_view_state::IsSet, 3035 3033 S::Record: starter_pack_view_state::IsSet, 3034 + S::Cid: starter_pack_view_state::IsSet, 3036 3035 S::Creator: starter_pack_view_state::IsSet, 3037 3036 S::IndexedAt: starter_pack_view_state::IsSet, 3037 + S::Uri: starter_pack_view_state::IsSet, 3038 3038 { 3039 3039 /// Build the final struct 3040 3040 pub fn build(self) -> StarterPackView<'a> { ··· 3183 3183 } 3184 3184 /// State trait tracking which required fields have been set 3185 3185 pub trait State: sealed::Sealed { 3186 - type Uri; 3186 + type IndexedAt; 3187 3187 type Cid; 3188 3188 type Record; 3189 3189 type Creator; 3190 - type IndexedAt; 3190 + type Uri; 3191 3191 } 3192 3192 /// Empty state - all required fields are unset 3193 3193 pub struct Empty(()); 3194 3194 impl sealed::Sealed for Empty {} 3195 3195 impl State for Empty { 3196 - type Uri = Unset; 3196 + type IndexedAt = Unset; 3197 3197 type Cid = Unset; 3198 3198 type Record = Unset; 3199 3199 type Creator = Unset; 3200 - type IndexedAt = Unset; 3200 + type Uri = Unset; 3201 3201 } 3202 - ///State transition - sets the `uri` field to Set 3203 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3204 - impl<S: State> sealed::Sealed for SetUri<S> {} 3205 - impl<S: State> State for SetUri<S> { 3206 - type Uri = Set<members::uri>; 3202 + ///State transition - sets the `indexed_at` field to Set 3203 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3204 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3205 + impl<S: State> State for SetIndexedAt<S> { 3206 + type IndexedAt = Set<members::indexed_at>; 3207 3207 type Cid = S::Cid; 3208 3208 type Record = S::Record; 3209 3209 type Creator = S::Creator; 3210 - type IndexedAt = S::IndexedAt; 3210 + type Uri = S::Uri; 3211 3211 } 3212 3212 ///State transition - sets the `cid` field to Set 3213 3213 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3214 3214 impl<S: State> sealed::Sealed for SetCid<S> {} 3215 3215 impl<S: State> State for SetCid<S> { 3216 - type Uri = S::Uri; 3216 + type IndexedAt = S::IndexedAt; 3217 3217 type Cid = Set<members::cid>; 3218 3218 type Record = S::Record; 3219 3219 type Creator = S::Creator; 3220 - type IndexedAt = S::IndexedAt; 3220 + type Uri = S::Uri; 3221 3221 } 3222 3222 ///State transition - sets the `record` field to Set 3223 3223 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3224 3224 impl<S: State> sealed::Sealed for SetRecord<S> {} 3225 3225 impl<S: State> State for SetRecord<S> { 3226 - type Uri = S::Uri; 3226 + type IndexedAt = S::IndexedAt; 3227 3227 type Cid = S::Cid; 3228 3228 type Record = Set<members::record>; 3229 3229 type Creator = S::Creator; 3230 - type IndexedAt = S::IndexedAt; 3230 + type Uri = S::Uri; 3231 3231 } 3232 3232 ///State transition - sets the `creator` field to Set 3233 3233 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 3234 3234 impl<S: State> sealed::Sealed for SetCreator<S> {} 3235 3235 impl<S: State> State for SetCreator<S> { 3236 - type Uri = S::Uri; 3236 + type IndexedAt = S::IndexedAt; 3237 3237 type Cid = S::Cid; 3238 3238 type Record = S::Record; 3239 3239 type Creator = Set<members::creator>; 3240 + type Uri = S::Uri; 3241 + } 3242 + ///State transition - sets the `uri` field to Set 3243 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3244 + impl<S: State> sealed::Sealed for SetUri<S> {} 3245 + impl<S: State> State for SetUri<S> { 3240 3246 type IndexedAt = S::IndexedAt; 3241 - } 3242 - ///State transition - sets the `indexed_at` field to Set 3243 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3244 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3245 - impl<S: State> State for SetIndexedAt<S> { 3246 - type Uri = S::Uri; 3247 3247 type Cid = S::Cid; 3248 3248 type Record = S::Record; 3249 3249 type Creator = S::Creator; 3250 - type IndexedAt = Set<members::indexed_at>; 3250 + type Uri = Set<members::uri>; 3251 3251 } 3252 3252 /// Marker types for field names 3253 3253 #[allow(non_camel_case_types)] 3254 3254 pub mod members { 3255 - ///Marker type for the `uri` field 3256 - pub struct uri(()); 3255 + ///Marker type for the `indexed_at` field 3256 + pub struct indexed_at(()); 3257 3257 ///Marker type for the `cid` field 3258 3258 pub struct cid(()); 3259 3259 ///Marker type for the `record` field 3260 3260 pub struct record(()); 3261 3261 ///Marker type for the `creator` field 3262 3262 pub struct creator(()); 3263 - ///Marker type for the `indexed_at` field 3264 - pub struct indexed_at(()); 3263 + ///Marker type for the `uri` field 3264 + pub struct uri(()); 3265 3265 } 3266 3266 } 3267 3267 ··· 3472 3472 impl<'a, S> StarterPackViewBasicBuilder<'a, S> 3473 3473 where 3474 3474 S: starter_pack_view_basic_state::State, 3475 - S::Uri: starter_pack_view_basic_state::IsSet, 3475 + S::IndexedAt: starter_pack_view_basic_state::IsSet, 3476 3476 S::Cid: starter_pack_view_basic_state::IsSet, 3477 3477 S::Record: starter_pack_view_basic_state::IsSet, 3478 3478 S::Creator: starter_pack_view_basic_state::IsSet, 3479 - S::IndexedAt: starter_pack_view_basic_state::IsSet, 3479 + S::Uri: starter_pack_view_basic_state::IsSet, 3480 3480 { 3481 3481 /// Build the final struct 3482 3482 pub fn build(self) -> StarterPackViewBasic<'a> {
+13 -13
crates/weaver-api/src/app_bsky/graph/listblock.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Subject; 38 37 type CreatedAt; 38 + type Subject; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type Subject = Unset; 45 44 type CreatedAt = Unset; 46 - } 47 - ///State transition - sets the `subject` field to Set 48 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetSubject<S> {} 50 - impl<S: State> State for SetSubject<S> { 51 - type Subject = Set<members::subject>; 52 - type CreatedAt = S::CreatedAt; 45 + type Subject = Unset; 53 46 } 54 47 ///State transition - sets the `created_at` field to Set 55 48 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 57 50 impl<S: State> State for SetCreatedAt<S> { 58 - type Subject = S::Subject; 59 51 type CreatedAt = Set<members::created_at>; 52 + type Subject = S::Subject; 53 + } 54 + ///State transition - sets the `subject` field to Set 55 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetSubject<S> {} 57 + impl<S: State> State for SetSubject<S> { 58 + type CreatedAt = S::CreatedAt; 59 + type Subject = Set<members::subject>; 60 60 } 61 61 /// Marker types for field names 62 62 #[allow(non_camel_case_types)] 63 63 pub mod members { 64 - ///Marker type for the `subject` field 65 - pub struct subject(()); 66 64 ///Marker type for the `created_at` field 67 65 pub struct created_at(()); 66 + ///Marker type for the `subject` field 67 + pub struct subject(()); 68 68 } 69 69 } 70 70 ··· 137 137 impl<'a, S> ListblockBuilder<'a, S> 138 138 where 139 139 S: listblock_state::State, 140 - S::Subject: listblock_state::IsSet, 141 140 S::CreatedAt: listblock_state::IsSet, 141 + S::Subject: listblock_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> Listblock<'a> {
+15 -15
crates/weaver-api/src/app_bsky/graph/listitem.rs
··· 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 40 type Subject; 41 - type List; 42 41 type CreatedAt; 42 + type List; 43 43 } 44 44 /// Empty state - all required fields are unset 45 45 pub struct Empty(()); 46 46 impl sealed::Sealed for Empty {} 47 47 impl State for Empty { 48 48 type Subject = Unset; 49 - type List = Unset; 50 49 type CreatedAt = Unset; 50 + type List = Unset; 51 51 } 52 52 ///State transition - sets the `subject` field to Set 53 53 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 54 54 impl<S: State> sealed::Sealed for SetSubject<S> {} 55 55 impl<S: State> State for SetSubject<S> { 56 56 type Subject = Set<members::subject>; 57 - type List = S::List; 58 57 type CreatedAt = S::CreatedAt; 59 - } 60 - ///State transition - sets the `list` field to Set 61 - pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 62 - impl<S: State> sealed::Sealed for SetList<S> {} 63 - impl<S: State> State for SetList<S> { 64 - type Subject = S::Subject; 65 - type List = Set<members::list>; 66 - type CreatedAt = S::CreatedAt; 58 + type List = S::List; 67 59 } 68 60 ///State transition - sets the `created_at` field to Set 69 61 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 70 62 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 71 63 impl<S: State> State for SetCreatedAt<S> { 72 64 type Subject = S::Subject; 73 - type List = S::List; 74 65 type CreatedAt = Set<members::created_at>; 66 + type List = S::List; 67 + } 68 + ///State transition - sets the `list` field to Set 69 + pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 70 + impl<S: State> sealed::Sealed for SetList<S> {} 71 + impl<S: State> State for SetList<S> { 72 + type Subject = S::Subject; 73 + type CreatedAt = S::CreatedAt; 74 + type List = Set<members::list>; 75 75 } 76 76 /// Marker types for field names 77 77 #[allow(non_camel_case_types)] 78 78 pub mod members { 79 79 ///Marker type for the `subject` field 80 80 pub struct subject(()); 81 + ///Marker type for the `created_at` field 82 + pub struct created_at(()); 81 83 ///Marker type for the `list` field 82 84 pub struct list(()); 83 - ///Marker type for the `created_at` field 84 - pub struct created_at(()); 85 85 } 86 86 } 87 87 ··· 175 175 where 176 176 S: listitem_state::State, 177 177 S::Subject: listitem_state::IsSet, 178 - S::List: listitem_state::IsSet, 179 178 S::CreatedAt: listitem_state::IsSet, 179 + S::List: listitem_state::IsSet, 180 180 { 181 181 /// Build the final struct 182 182 pub fn build(self) -> Listitem<'a> {
+15 -15
crates/weaver-api/src/app_bsky/graph/starterpack.rs
··· 366 366 } 367 367 /// State trait tracking which required fields have been set 368 368 pub trait State: sealed::Sealed { 369 - type Name; 370 369 type List; 371 370 type CreatedAt; 371 + type Name; 372 372 } 373 373 /// Empty state - all required fields are unset 374 374 pub struct Empty(()); 375 375 impl sealed::Sealed for Empty {} 376 376 impl State for Empty { 377 - type Name = Unset; 378 377 type List = Unset; 379 378 type CreatedAt = Unset; 380 - } 381 - ///State transition - sets the `name` field to Set 382 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 383 - impl<S: State> sealed::Sealed for SetName<S> {} 384 - impl<S: State> State for SetName<S> { 385 - type Name = Set<members::name>; 386 - type List = S::List; 387 - type CreatedAt = S::CreatedAt; 379 + type Name = Unset; 388 380 } 389 381 ///State transition - sets the `list` field to Set 390 382 pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 391 383 impl<S: State> sealed::Sealed for SetList<S> {} 392 384 impl<S: State> State for SetList<S> { 393 - type Name = S::Name; 394 385 type List = Set<members::list>; 395 386 type CreatedAt = S::CreatedAt; 387 + type Name = S::Name; 396 388 } 397 389 ///State transition - sets the `created_at` field to Set 398 390 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 399 391 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 400 392 impl<S: State> State for SetCreatedAt<S> { 401 - type Name = S::Name; 402 393 type List = S::List; 403 394 type CreatedAt = Set<members::created_at>; 395 + type Name = S::Name; 396 + } 397 + ///State transition - sets the `name` field to Set 398 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 399 + impl<S: State> sealed::Sealed for SetName<S> {} 400 + impl<S: State> State for SetName<S> { 401 + type List = S::List; 402 + type CreatedAt = S::CreatedAt; 403 + type Name = Set<members::name>; 404 404 } 405 405 /// Marker types for field names 406 406 #[allow(non_camel_case_types)] 407 407 pub mod members { 408 - ///Marker type for the `name` field 409 - pub struct name(()); 410 408 ///Marker type for the `list` field 411 409 pub struct list(()); 412 410 ///Marker type for the `created_at` field 413 411 pub struct created_at(()); 412 + ///Marker type for the `name` field 413 + pub struct name(()); 414 414 } 415 415 } 416 416 ··· 563 563 impl<'a, S> StarterpackBuilder<'a, S> 564 564 where 565 565 S: starterpack_state::State, 566 - S::Name: starterpack_state::IsSet, 567 566 S::List: starterpack_state::IsSet, 568 567 S::CreatedAt: starterpack_state::IsSet, 568 + S::Name: starterpack_state::IsSet, 569 569 { 570 570 /// Build the final struct 571 571 pub fn build(self) -> Starterpack<'a> {
+32 -32
crates/weaver-api/src/app_bsky/graph/verification.rs
··· 41 41 } 42 42 /// State trait tracking which required fields have been set 43 43 pub trait State: sealed::Sealed { 44 - type Subject; 45 - type Handle; 46 44 type DisplayName; 47 45 type CreatedAt; 46 + type Handle; 47 + type Subject; 48 48 } 49 49 /// Empty state - all required fields are unset 50 50 pub struct Empty(()); 51 51 impl sealed::Sealed for Empty {} 52 52 impl State for Empty { 53 - type Subject = Unset; 54 - type Handle = Unset; 55 53 type DisplayName = Unset; 56 54 type CreatedAt = Unset; 57 - } 58 - ///State transition - sets the `subject` field to Set 59 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 60 - impl<S: State> sealed::Sealed for SetSubject<S> {} 61 - impl<S: State> State for SetSubject<S> { 62 - type Subject = Set<members::subject>; 63 - type Handle = S::Handle; 64 - type DisplayName = S::DisplayName; 65 - type CreatedAt = S::CreatedAt; 66 - } 67 - ///State transition - sets the `handle` field to Set 68 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 69 - impl<S: State> sealed::Sealed for SetHandle<S> {} 70 - impl<S: State> State for SetHandle<S> { 71 - type Subject = S::Subject; 72 - type Handle = Set<members::handle>; 73 - type DisplayName = S::DisplayName; 74 - type CreatedAt = S::CreatedAt; 55 + type Handle = Unset; 56 + type Subject = Unset; 75 57 } 76 58 ///State transition - sets the `display_name` field to Set 77 59 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 78 60 impl<S: State> sealed::Sealed for SetDisplayName<S> {} 79 61 impl<S: State> State for SetDisplayName<S> { 80 - type Subject = S::Subject; 81 - type Handle = S::Handle; 82 62 type DisplayName = Set<members::display_name>; 83 63 type CreatedAt = S::CreatedAt; 64 + type Handle = S::Handle; 65 + type Subject = S::Subject; 84 66 } 85 67 ///State transition - sets the `created_at` field to Set 86 68 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 87 69 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 88 70 impl<S: State> State for SetCreatedAt<S> { 71 + type DisplayName = S::DisplayName; 72 + type CreatedAt = Set<members::created_at>; 73 + type Handle = S::Handle; 89 74 type Subject = S::Subject; 90 - type Handle = S::Handle; 75 + } 76 + ///State transition - sets the `handle` field to Set 77 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 78 + impl<S: State> sealed::Sealed for SetHandle<S> {} 79 + impl<S: State> State for SetHandle<S> { 91 80 type DisplayName = S::DisplayName; 92 - type CreatedAt = Set<members::created_at>; 81 + type CreatedAt = S::CreatedAt; 82 + type Handle = Set<members::handle>; 83 + type Subject = S::Subject; 84 + } 85 + ///State transition - sets the `subject` field to Set 86 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 87 + impl<S: State> sealed::Sealed for SetSubject<S> {} 88 + impl<S: State> State for SetSubject<S> { 89 + type DisplayName = S::DisplayName; 90 + type CreatedAt = S::CreatedAt; 91 + type Handle = S::Handle; 92 + type Subject = Set<members::subject>; 93 93 } 94 94 /// Marker types for field names 95 95 #[allow(non_camel_case_types)] 96 96 pub mod members { 97 - ///Marker type for the `subject` field 98 - pub struct subject(()); 99 - ///Marker type for the `handle` field 100 - pub struct handle(()); 101 97 ///Marker type for the `display_name` field 102 98 pub struct display_name(()); 103 99 ///Marker type for the `created_at` field 104 100 pub struct created_at(()); 101 + ///Marker type for the `handle` field 102 + pub struct handle(()); 103 + ///Marker type for the `subject` field 104 + pub struct subject(()); 105 105 } 106 106 } 107 107 ··· 214 214 impl<'a, S> VerificationBuilder<'a, S> 215 215 where 216 216 S: verification_state::State, 217 - S::Subject: verification_state::IsSet, 218 - S::Handle: verification_state::IsSet, 219 217 S::DisplayName: verification_state::IsSet, 220 218 S::CreatedAt: verification_state::IsSet, 219 + S::Handle: verification_state::IsSet, 220 + S::Subject: verification_state::IsSet, 221 221 { 222 222 /// Build the final struct 223 223 pub fn build(self) -> Verification<'a> {
+48 -48
crates/weaver-api/src/app_bsky/labeler.rs
··· 632 632 } 633 633 /// State trait tracking which required fields have been set 634 634 pub trait State: sealed::Sealed { 635 + type IndexedAt; 635 636 type Uri; 636 637 type Cid; 637 638 type Creator; 638 - type IndexedAt; 639 639 } 640 640 /// Empty state - all required fields are unset 641 641 pub struct Empty(()); 642 642 impl sealed::Sealed for Empty {} 643 643 impl State for Empty { 644 + type IndexedAt = Unset; 644 645 type Uri = Unset; 645 646 type Cid = Unset; 646 647 type Creator = Unset; 647 - type IndexedAt = Unset; 648 + } 649 + ///State transition - sets the `indexed_at` field to Set 650 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 651 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 652 + impl<S: State> State for SetIndexedAt<S> { 653 + type IndexedAt = Set<members::indexed_at>; 654 + type Uri = S::Uri; 655 + type Cid = S::Cid; 656 + type Creator = S::Creator; 648 657 } 649 658 ///State transition - sets the `uri` field to Set 650 659 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 651 660 impl<S: State> sealed::Sealed for SetUri<S> {} 652 661 impl<S: State> State for SetUri<S> { 662 + type IndexedAt = S::IndexedAt; 653 663 type Uri = Set<members::uri>; 654 664 type Cid = S::Cid; 655 665 type Creator = S::Creator; 656 - type IndexedAt = S::IndexedAt; 657 666 } 658 667 ///State transition - sets the `cid` field to Set 659 668 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 660 669 impl<S: State> sealed::Sealed for SetCid<S> {} 661 670 impl<S: State> State for SetCid<S> { 671 + type IndexedAt = S::IndexedAt; 662 672 type Uri = S::Uri; 663 673 type Cid = Set<members::cid>; 664 674 type Creator = S::Creator; 665 - type IndexedAt = S::IndexedAt; 666 675 } 667 676 ///State transition - sets the `creator` field to Set 668 677 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 669 678 impl<S: State> sealed::Sealed for SetCreator<S> {} 670 679 impl<S: State> State for SetCreator<S> { 671 - type Uri = S::Uri; 672 - type Cid = S::Cid; 673 - type Creator = Set<members::creator>; 674 680 type IndexedAt = S::IndexedAt; 675 - } 676 - ///State transition - sets the `indexed_at` field to Set 677 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 678 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 679 - impl<S: State> State for SetIndexedAt<S> { 680 681 type Uri = S::Uri; 681 682 type Cid = S::Cid; 682 - type Creator = S::Creator; 683 - type IndexedAt = Set<members::indexed_at>; 683 + type Creator = Set<members::creator>; 684 684 } 685 685 /// Marker types for field names 686 686 #[allow(non_camel_case_types)] 687 687 pub mod members { 688 + ///Marker type for the `indexed_at` field 689 + pub struct indexed_at(()); 688 690 ///Marker type for the `uri` field 689 691 pub struct uri(()); 690 692 ///Marker type for the `cid` field 691 693 pub struct cid(()); 692 694 ///Marker type for the `creator` field 693 695 pub struct creator(()); 694 - ///Marker type for the `indexed_at` field 695 - pub struct indexed_at(()); 696 696 } 697 697 } 698 698 ··· 859 859 impl<'a, S> LabelerViewBuilder<'a, S> 860 860 where 861 861 S: labeler_view_state::State, 862 + S::IndexedAt: labeler_view_state::IsSet, 862 863 S::Uri: labeler_view_state::IsSet, 863 864 S::Cid: labeler_view_state::IsSet, 864 865 S::Creator: labeler_view_state::IsSet, 865 - S::IndexedAt: labeler_view_state::IsSet, 866 866 { 867 867 /// Build the final struct 868 868 pub fn build(self) -> LabelerView<'a> { ··· 986 986 /// State trait tracking which required fields have been set 987 987 pub trait State: sealed::Sealed { 988 988 type Uri; 989 - type Cid; 990 989 type Creator; 991 - type Policies; 992 990 type IndexedAt; 991 + type Policies; 992 + type Cid; 993 993 } 994 994 /// Empty state - all required fields are unset 995 995 pub struct Empty(()); 996 996 impl sealed::Sealed for Empty {} 997 997 impl State for Empty { 998 998 type Uri = Unset; 999 - type Cid = Unset; 1000 999 type Creator = Unset; 1001 - type Policies = Unset; 1002 1000 type IndexedAt = Unset; 1001 + type Policies = Unset; 1002 + type Cid = Unset; 1003 1003 } 1004 1004 ///State transition - sets the `uri` field to Set 1005 1005 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1006 1006 impl<S: State> sealed::Sealed for SetUri<S> {} 1007 1007 impl<S: State> State for SetUri<S> { 1008 1008 type Uri = Set<members::uri>; 1009 - type Cid = S::Cid; 1010 1009 type Creator = S::Creator; 1011 - type Policies = S::Policies; 1012 1010 type IndexedAt = S::IndexedAt; 1013 - } 1014 - ///State transition - sets the `cid` field to Set 1015 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1016 - impl<S: State> sealed::Sealed for SetCid<S> {} 1017 - impl<S: State> State for SetCid<S> { 1018 - type Uri = S::Uri; 1019 - type Cid = Set<members::cid>; 1020 - type Creator = S::Creator; 1021 1011 type Policies = S::Policies; 1022 - type IndexedAt = S::IndexedAt; 1012 + type Cid = S::Cid; 1023 1013 } 1024 1014 ///State transition - sets the `creator` field to Set 1025 1015 pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>); 1026 1016 impl<S: State> sealed::Sealed for SetCreator<S> {} 1027 1017 impl<S: State> State for SetCreator<S> { 1028 1018 type Uri = S::Uri; 1029 - type Cid = S::Cid; 1030 1019 type Creator = Set<members::creator>; 1020 + type IndexedAt = S::IndexedAt; 1031 1021 type Policies = S::Policies; 1032 - type IndexedAt = S::IndexedAt; 1022 + type Cid = S::Cid; 1023 + } 1024 + ///State transition - sets the `indexed_at` field to Set 1025 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1026 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1027 + impl<S: State> State for SetIndexedAt<S> { 1028 + type Uri = S::Uri; 1029 + type Creator = S::Creator; 1030 + type IndexedAt = Set<members::indexed_at>; 1031 + type Policies = S::Policies; 1032 + type Cid = S::Cid; 1033 1033 } 1034 1034 ///State transition - sets the `policies` field to Set 1035 1035 pub struct SetPolicies<S: State = Empty>(PhantomData<fn() -> S>); 1036 1036 impl<S: State> sealed::Sealed for SetPolicies<S> {} 1037 1037 impl<S: State> State for SetPolicies<S> { 1038 1038 type Uri = S::Uri; 1039 - type Cid = S::Cid; 1040 1039 type Creator = S::Creator; 1041 - type Policies = Set<members::policies>; 1042 1040 type IndexedAt = S::IndexedAt; 1041 + type Policies = Set<members::policies>; 1042 + type Cid = S::Cid; 1043 1043 } 1044 - ///State transition - sets the `indexed_at` field to Set 1045 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1046 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1047 - impl<S: State> State for SetIndexedAt<S> { 1044 + ///State transition - sets the `cid` field to Set 1045 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1046 + impl<S: State> sealed::Sealed for SetCid<S> {} 1047 + impl<S: State> State for SetCid<S> { 1048 1048 type Uri = S::Uri; 1049 - type Cid = S::Cid; 1050 1049 type Creator = S::Creator; 1050 + type IndexedAt = S::IndexedAt; 1051 1051 type Policies = S::Policies; 1052 - type IndexedAt = Set<members::indexed_at>; 1052 + type Cid = Set<members::cid>; 1053 1053 } 1054 1054 /// Marker types for field names 1055 1055 #[allow(non_camel_case_types)] 1056 1056 pub mod members { 1057 1057 ///Marker type for the `uri` field 1058 1058 pub struct uri(()); 1059 - ///Marker type for the `cid` field 1060 - pub struct cid(()); 1061 1059 ///Marker type for the `creator` field 1062 1060 pub struct creator(()); 1061 + ///Marker type for the `indexed_at` field 1062 + pub struct indexed_at(()); 1063 1063 ///Marker type for the `policies` field 1064 1064 pub struct policies(()); 1065 - ///Marker type for the `indexed_at` field 1066 - pub struct indexed_at(()); 1065 + ///Marker type for the `cid` field 1066 + pub struct cid(()); 1067 1067 } 1068 1068 } 1069 1069 ··· 1323 1323 where 1324 1324 S: labeler_view_detailed_state::State, 1325 1325 S::Uri: labeler_view_detailed_state::IsSet, 1326 - S::Cid: labeler_view_detailed_state::IsSet, 1327 1326 S::Creator: labeler_view_detailed_state::IsSet, 1328 - S::Policies: labeler_view_detailed_state::IsSet, 1329 1327 S::IndexedAt: labeler_view_detailed_state::IsSet, 1328 + S::Policies: labeler_view_detailed_state::IsSet, 1329 + S::Cid: labeler_view_detailed_state::IsSet, 1330 1330 { 1331 1331 /// Build the final struct 1332 1332 pub fn build(self) -> LabelerViewDetailed<'a> {
+13 -13
crates/weaver-api/src/app_bsky/labeler/service.rs
··· 54 54 } 55 55 /// State trait tracking which required fields have been set 56 56 pub trait State: sealed::Sealed { 57 - type Policies; 58 57 type CreatedAt; 58 + type Policies; 59 59 } 60 60 /// Empty state - all required fields are unset 61 61 pub struct Empty(()); 62 62 impl sealed::Sealed for Empty {} 63 63 impl State for Empty { 64 - type Policies = Unset; 65 64 type CreatedAt = Unset; 66 - } 67 - ///State transition - sets the `policies` field to Set 68 - pub struct SetPolicies<S: State = Empty>(PhantomData<fn() -> S>); 69 - impl<S: State> sealed::Sealed for SetPolicies<S> {} 70 - impl<S: State> State for SetPolicies<S> { 71 - type Policies = Set<members::policies>; 72 - type CreatedAt = S::CreatedAt; 65 + type Policies = Unset; 73 66 } 74 67 ///State transition - sets the `created_at` field to Set 75 68 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 76 69 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 77 70 impl<S: State> State for SetCreatedAt<S> { 78 - type Policies = S::Policies; 79 71 type CreatedAt = Set<members::created_at>; 72 + type Policies = S::Policies; 73 + } 74 + ///State transition - sets the `policies` field to Set 75 + pub struct SetPolicies<S: State = Empty>(PhantomData<fn() -> S>); 76 + impl<S: State> sealed::Sealed for SetPolicies<S> {} 77 + impl<S: State> State for SetPolicies<S> { 78 + type CreatedAt = S::CreatedAt; 79 + type Policies = Set<members::policies>; 80 80 } 81 81 /// Marker types for field names 82 82 #[allow(non_camel_case_types)] 83 83 pub mod members { 84 - ///Marker type for the `policies` field 85 - pub struct policies(()); 86 84 ///Marker type for the `created_at` field 87 85 pub struct created_at(()); 86 + ///Marker type for the `policies` field 87 + pub struct policies(()); 88 88 } 89 89 } 90 90 ··· 237 237 impl<'a, S> ServiceBuilder<'a, S> 238 238 where 239 239 S: service_state::State, 240 - S::Policies: service_state::IsSet, 241 240 S::CreatedAt: service_state::IsSet, 241 + S::Policies: service_state::IsSet, 242 242 { 243 243 /// Build the final struct 244 244 pub fn build(self) -> Service<'a> {
+213 -213
crates/weaver-api/src/app_bsky/notification.rs
··· 601 601 } 602 602 /// State trait tracking which required fields have been set 603 603 pub trait State: sealed::Sealed { 604 - type Include; 605 604 type Push; 605 + type Include; 606 606 } 607 607 /// Empty state - all required fields are unset 608 608 pub struct Empty(()); 609 609 impl sealed::Sealed for Empty {} 610 610 impl State for Empty { 611 - type Include = Unset; 612 611 type Push = Unset; 612 + type Include = Unset; 613 + } 614 + ///State transition - sets the `push` field to Set 615 + pub struct SetPush<S: State = Empty>(PhantomData<fn() -> S>); 616 + impl<S: State> sealed::Sealed for SetPush<S> {} 617 + impl<S: State> State for SetPush<S> { 618 + type Push = Set<members::push>; 619 + type Include = S::Include; 613 620 } 614 621 ///State transition - sets the `include` field to Set 615 622 pub struct SetInclude<S: State = Empty>(PhantomData<fn() -> S>); 616 623 impl<S: State> sealed::Sealed for SetInclude<S> {} 617 624 impl<S: State> State for SetInclude<S> { 618 - type Include = Set<members::include>; 619 625 type Push = S::Push; 620 - } 621 - ///State transition - sets the `push` field to Set 622 - pub struct SetPush<S: State = Empty>(PhantomData<fn() -> S>); 623 - impl<S: State> sealed::Sealed for SetPush<S> {} 624 - impl<S: State> State for SetPush<S> { 625 - type Include = S::Include; 626 - type Push = Set<members::push>; 626 + type Include = Set<members::include>; 627 627 } 628 628 /// Marker types for field names 629 629 #[allow(non_camel_case_types)] 630 630 pub mod members { 631 + ///Marker type for the `push` field 632 + pub struct push(()); 631 633 ///Marker type for the `include` field 632 634 pub struct include(()); 633 - ///Marker type for the `push` field 634 - pub struct push(()); 635 635 } 636 636 } 637 637 ··· 704 704 impl<'a, S> ChatPreferenceBuilder<'a, S> 705 705 where 706 706 S: chat_preference_state::State, 707 - S::Include: chat_preference_state::IsSet, 708 707 S::Push: chat_preference_state::IsSet, 708 + S::Include: chat_preference_state::IsSet, 709 709 { 710 710 /// Build the final struct 711 711 pub fn build(self) -> ChatPreference<'a> { ··· 776 776 } 777 777 /// State trait tracking which required fields have been set 778 778 pub trait State: sealed::Sealed { 779 - type Include; 780 779 type List; 781 780 type Push; 781 + type Include; 782 782 } 783 783 /// Empty state - all required fields are unset 784 784 pub struct Empty(()); 785 785 impl sealed::Sealed for Empty {} 786 786 impl State for Empty { 787 - type Include = Unset; 788 787 type List = Unset; 789 788 type Push = Unset; 790 - } 791 - ///State transition - sets the `include` field to Set 792 - pub struct SetInclude<S: State = Empty>(PhantomData<fn() -> S>); 793 - impl<S: State> sealed::Sealed for SetInclude<S> {} 794 - impl<S: State> State for SetInclude<S> { 795 - type Include = Set<members::include>; 796 - type List = S::List; 797 - type Push = S::Push; 789 + type Include = Unset; 798 790 } 799 791 ///State transition - sets the `list` field to Set 800 792 pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 801 793 impl<S: State> sealed::Sealed for SetList<S> {} 802 794 impl<S: State> State for SetList<S> { 803 - type Include = S::Include; 804 795 type List = Set<members::list>; 805 796 type Push = S::Push; 797 + type Include = S::Include; 806 798 } 807 799 ///State transition - sets the `push` field to Set 808 800 pub struct SetPush<S: State = Empty>(PhantomData<fn() -> S>); 809 801 impl<S: State> sealed::Sealed for SetPush<S> {} 810 802 impl<S: State> State for SetPush<S> { 803 + type List = S::List; 804 + type Push = Set<members::push>; 811 805 type Include = S::Include; 806 + } 807 + ///State transition - sets the `include` field to Set 808 + pub struct SetInclude<S: State = Empty>(PhantomData<fn() -> S>); 809 + impl<S: State> sealed::Sealed for SetInclude<S> {} 810 + impl<S: State> State for SetInclude<S> { 812 811 type List = S::List; 813 - type Push = Set<members::push>; 812 + type Push = S::Push; 813 + type Include = Set<members::include>; 814 814 } 815 815 /// Marker types for field names 816 816 #[allow(non_camel_case_types)] 817 817 pub mod members { 818 - ///Marker type for the `include` field 819 - pub struct include(()); 820 818 ///Marker type for the `list` field 821 819 pub struct list(()); 822 820 ///Marker type for the `push` field 823 821 pub struct push(()); 822 + ///Marker type for the `include` field 823 + pub struct include(()); 824 824 } 825 825 } 826 826 ··· 913 913 impl<'a, S> FilterablePreferenceBuilder<'a, S> 914 914 where 915 915 S: filterable_preference_state::State, 916 - S::Include: filterable_preference_state::IsSet, 917 916 S::List: filterable_preference_state::IsSet, 918 917 S::Push: filterable_preference_state::IsSet, 918 + S::Include: filterable_preference_state::IsSet, 919 919 { 920 920 /// Build the final struct 921 921 pub fn build(self) -> FilterablePreference<'a> { ··· 1181 1181 /// State trait tracking which required fields have been set 1182 1182 pub trait State: sealed::Sealed { 1183 1183 type Chat; 1184 + type Verified; 1185 + type StarterpackJoined; 1184 1186 type Follow; 1185 - type Like; 1186 - type LikeViaRepost; 1187 - type Mention; 1187 + type Reply; 1188 1188 type Quote; 1189 - type Reply; 1190 - type Repost; 1191 - type RepostViaRepost; 1192 - type StarterpackJoined; 1193 1189 type SubscribedPost; 1190 + type Mention; 1194 1191 type Unverified; 1195 - type Verified; 1192 + type LikeViaRepost; 1193 + type Repost; 1194 + type Like; 1195 + type RepostViaRepost; 1196 1196 } 1197 1197 /// Empty state - all required fields are unset 1198 1198 pub struct Empty(()); 1199 1199 impl sealed::Sealed for Empty {} 1200 1200 impl State for Empty { 1201 1201 type Chat = Unset; 1202 + type Verified = Unset; 1203 + type StarterpackJoined = Unset; 1202 1204 type Follow = Unset; 1203 - type Like = Unset; 1204 - type LikeViaRepost = Unset; 1205 + type Reply = Unset; 1206 + type Quote = Unset; 1207 + type SubscribedPost = Unset; 1205 1208 type Mention = Unset; 1206 - type Quote = Unset; 1207 - type Reply = Unset; 1209 + type Unverified = Unset; 1210 + type LikeViaRepost = Unset; 1208 1211 type Repost = Unset; 1212 + type Like = Unset; 1209 1213 type RepostViaRepost = Unset; 1210 - type StarterpackJoined = Unset; 1211 - type SubscribedPost = Unset; 1212 - type Unverified = Unset; 1213 - type Verified = Unset; 1214 1214 } 1215 1215 ///State transition - sets the `chat` field to Set 1216 1216 pub struct SetChat<S: State = Empty>(PhantomData<fn() -> S>); 1217 1217 impl<S: State> sealed::Sealed for SetChat<S> {} 1218 1218 impl<S: State> State for SetChat<S> { 1219 1219 type Chat = Set<members::chat>; 1220 + type Verified = S::Verified; 1221 + type StarterpackJoined = S::StarterpackJoined; 1220 1222 type Follow = S::Follow; 1221 - type Like = S::Like; 1222 - type LikeViaRepost = S::LikeViaRepost; 1223 - type Mention = S::Mention; 1223 + type Reply = S::Reply; 1224 1224 type Quote = S::Quote; 1225 - type Reply = S::Reply; 1226 - type Repost = S::Repost; 1227 - type RepostViaRepost = S::RepostViaRepost; 1228 - type StarterpackJoined = S::StarterpackJoined; 1229 1225 type SubscribedPost = S::SubscribedPost; 1226 + type Mention = S::Mention; 1230 1227 type Unverified = S::Unverified; 1231 - type Verified = S::Verified; 1232 - } 1233 - ///State transition - sets the `follow` field to Set 1234 - pub struct SetFollow<S: State = Empty>(PhantomData<fn() -> S>); 1235 - impl<S: State> sealed::Sealed for SetFollow<S> {} 1236 - impl<S: State> State for SetFollow<S> { 1237 - type Chat = S::Chat; 1238 - type Follow = Set<members::follow>; 1239 - type Like = S::Like; 1240 1228 type LikeViaRepost = S::LikeViaRepost; 1241 - type Mention = S::Mention; 1242 - type Quote = S::Quote; 1243 - type Reply = S::Reply; 1244 1229 type Repost = S::Repost; 1230 + type Like = S::Like; 1245 1231 type RepostViaRepost = S::RepostViaRepost; 1232 + } 1233 + ///State transition - sets the `verified` field to Set 1234 + pub struct SetVerified<S: State = Empty>(PhantomData<fn() -> S>); 1235 + impl<S: State> sealed::Sealed for SetVerified<S> {} 1236 + impl<S: State> State for SetVerified<S> { 1237 + type Chat = S::Chat; 1238 + type Verified = Set<members::verified>; 1246 1239 type StarterpackJoined = S::StarterpackJoined; 1240 + type Follow = S::Follow; 1241 + type Reply = S::Reply; 1242 + type Quote = S::Quote; 1247 1243 type SubscribedPost = S::SubscribedPost; 1244 + type Mention = S::Mention; 1248 1245 type Unverified = S::Unverified; 1249 - type Verified = S::Verified; 1250 - } 1251 - ///State transition - sets the `like` field to Set 1252 - pub struct SetLike<S: State = Empty>(PhantomData<fn() -> S>); 1253 - impl<S: State> sealed::Sealed for SetLike<S> {} 1254 - impl<S: State> State for SetLike<S> { 1255 - type Chat = S::Chat; 1256 - type Follow = S::Follow; 1257 - type Like = Set<members::like>; 1258 1246 type LikeViaRepost = S::LikeViaRepost; 1259 - type Mention = S::Mention; 1260 - type Quote = S::Quote; 1261 - type Reply = S::Reply; 1262 1247 type Repost = S::Repost; 1248 + type Like = S::Like; 1263 1249 type RepostViaRepost = S::RepostViaRepost; 1264 - type StarterpackJoined = S::StarterpackJoined; 1265 - type SubscribedPost = S::SubscribedPost; 1266 - type Unverified = S::Unverified; 1267 - type Verified = S::Verified; 1268 1250 } 1269 - ///State transition - sets the `like_via_repost` field to Set 1270 - pub struct SetLikeViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1271 - impl<S: State> sealed::Sealed for SetLikeViaRepost<S> {} 1272 - impl<S: State> State for SetLikeViaRepost<S> { 1251 + ///State transition - sets the `starterpack_joined` field to Set 1252 + pub struct SetStarterpackJoined<S: State = Empty>(PhantomData<fn() -> S>); 1253 + impl<S: State> sealed::Sealed for SetStarterpackJoined<S> {} 1254 + impl<S: State> State for SetStarterpackJoined<S> { 1273 1255 type Chat = S::Chat; 1256 + type Verified = S::Verified; 1257 + type StarterpackJoined = Set<members::starterpack_joined>; 1274 1258 type Follow = S::Follow; 1275 - type Like = S::Like; 1276 - type LikeViaRepost = Set<members::like_via_repost>; 1277 - type Mention = S::Mention; 1259 + type Reply = S::Reply; 1278 1260 type Quote = S::Quote; 1279 - type Reply = S::Reply; 1280 - type Repost = S::Repost; 1281 - type RepostViaRepost = S::RepostViaRepost; 1282 - type StarterpackJoined = S::StarterpackJoined; 1283 1261 type SubscribedPost = S::SubscribedPost; 1262 + type Mention = S::Mention; 1284 1263 type Unverified = S::Unverified; 1285 - type Verified = S::Verified; 1286 - } 1287 - ///State transition - sets the `mention` field to Set 1288 - pub struct SetMention<S: State = Empty>(PhantomData<fn() -> S>); 1289 - impl<S: State> sealed::Sealed for SetMention<S> {} 1290 - impl<S: State> State for SetMention<S> { 1291 - type Chat = S::Chat; 1292 - type Follow = S::Follow; 1293 - type Like = S::Like; 1294 1264 type LikeViaRepost = S::LikeViaRepost; 1295 - type Mention = Set<members::mention>; 1296 - type Quote = S::Quote; 1297 - type Reply = S::Reply; 1298 1265 type Repost = S::Repost; 1266 + type Like = S::Like; 1299 1267 type RepostViaRepost = S::RepostViaRepost; 1268 + } 1269 + ///State transition - sets the `follow` field to Set 1270 + pub struct SetFollow<S: State = Empty>(PhantomData<fn() -> S>); 1271 + impl<S: State> sealed::Sealed for SetFollow<S> {} 1272 + impl<S: State> State for SetFollow<S> { 1273 + type Chat = S::Chat; 1274 + type Verified = S::Verified; 1300 1275 type StarterpackJoined = S::StarterpackJoined; 1276 + type Follow = Set<members::follow>; 1277 + type Reply = S::Reply; 1278 + type Quote = S::Quote; 1301 1279 type SubscribedPost = S::SubscribedPost; 1280 + type Mention = S::Mention; 1302 1281 type Unverified = S::Unverified; 1303 - type Verified = S::Verified; 1304 - } 1305 - ///State transition - sets the `quote` field to Set 1306 - pub struct SetQuote<S: State = Empty>(PhantomData<fn() -> S>); 1307 - impl<S: State> sealed::Sealed for SetQuote<S> {} 1308 - impl<S: State> State for SetQuote<S> { 1309 - type Chat = S::Chat; 1310 - type Follow = S::Follow; 1311 - type Like = S::Like; 1312 1282 type LikeViaRepost = S::LikeViaRepost; 1313 - type Mention = S::Mention; 1314 - type Quote = Set<members::quote>; 1315 - type Reply = S::Reply; 1316 1283 type Repost = S::Repost; 1284 + type Like = S::Like; 1317 1285 type RepostViaRepost = S::RepostViaRepost; 1318 - type StarterpackJoined = S::StarterpackJoined; 1319 - type SubscribedPost = S::SubscribedPost; 1320 - type Unverified = S::Unverified; 1321 - type Verified = S::Verified; 1322 1286 } 1323 1287 ///State transition - sets the `reply` field to Set 1324 1288 pub struct SetReply<S: State = Empty>(PhantomData<fn() -> S>); 1325 1289 impl<S: State> sealed::Sealed for SetReply<S> {} 1326 1290 impl<S: State> State for SetReply<S> { 1327 1291 type Chat = S::Chat; 1292 + type Verified = S::Verified; 1293 + type StarterpackJoined = S::StarterpackJoined; 1328 1294 type Follow = S::Follow; 1329 - type Like = S::Like; 1330 - type LikeViaRepost = S::LikeViaRepost; 1331 - type Mention = S::Mention; 1295 + type Reply = Set<members::reply>; 1332 1296 type Quote = S::Quote; 1333 - type Reply = Set<members::reply>; 1334 - type Repost = S::Repost; 1335 - type RepostViaRepost = S::RepostViaRepost; 1336 - type StarterpackJoined = S::StarterpackJoined; 1337 1297 type SubscribedPost = S::SubscribedPost; 1298 + type Mention = S::Mention; 1338 1299 type Unverified = S::Unverified; 1339 - type Verified = S::Verified; 1340 - } 1341 - ///State transition - sets the `repost` field to Set 1342 - pub struct SetRepost<S: State = Empty>(PhantomData<fn() -> S>); 1343 - impl<S: State> sealed::Sealed for SetRepost<S> {} 1344 - impl<S: State> State for SetRepost<S> { 1345 - type Chat = S::Chat; 1346 - type Follow = S::Follow; 1300 + type LikeViaRepost = S::LikeViaRepost; 1301 + type Repost = S::Repost; 1347 1302 type Like = S::Like; 1348 - type LikeViaRepost = S::LikeViaRepost; 1349 - type Mention = S::Mention; 1350 - type Quote = S::Quote; 1351 - type Reply = S::Reply; 1352 - type Repost = Set<members::repost>; 1353 1303 type RepostViaRepost = S::RepostViaRepost; 1354 - type StarterpackJoined = S::StarterpackJoined; 1355 - type SubscribedPost = S::SubscribedPost; 1356 - type Unverified = S::Unverified; 1357 - type Verified = S::Verified; 1358 1304 } 1359 - ///State transition - sets the `repost_via_repost` field to Set 1360 - pub struct SetRepostViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1361 - impl<S: State> sealed::Sealed for SetRepostViaRepost<S> {} 1362 - impl<S: State> State for SetRepostViaRepost<S> { 1305 + ///State transition - sets the `quote` field to Set 1306 + pub struct SetQuote<S: State = Empty>(PhantomData<fn() -> S>); 1307 + impl<S: State> sealed::Sealed for SetQuote<S> {} 1308 + impl<S: State> State for SetQuote<S> { 1363 1309 type Chat = S::Chat; 1310 + type Verified = S::Verified; 1311 + type StarterpackJoined = S::StarterpackJoined; 1364 1312 type Follow = S::Follow; 1365 - type Like = S::Like; 1366 - type LikeViaRepost = S::LikeViaRepost; 1367 - type Mention = S::Mention; 1368 - type Quote = S::Quote; 1369 1313 type Reply = S::Reply; 1370 - type Repost = S::Repost; 1371 - type RepostViaRepost = Set<members::repost_via_repost>; 1372 - type StarterpackJoined = S::StarterpackJoined; 1314 + type Quote = Set<members::quote>; 1373 1315 type SubscribedPost = S::SubscribedPost; 1316 + type Mention = S::Mention; 1374 1317 type Unverified = S::Unverified; 1375 - type Verified = S::Verified; 1376 - } 1377 - ///State transition - sets the `starterpack_joined` field to Set 1378 - pub struct SetStarterpackJoined<S: State = Empty>(PhantomData<fn() -> S>); 1379 - impl<S: State> sealed::Sealed for SetStarterpackJoined<S> {} 1380 - impl<S: State> State for SetStarterpackJoined<S> { 1381 - type Chat = S::Chat; 1382 - type Follow = S::Follow; 1383 - type Like = S::Like; 1384 1318 type LikeViaRepost = S::LikeViaRepost; 1385 - type Mention = S::Mention; 1386 - type Quote = S::Quote; 1387 - type Reply = S::Reply; 1388 1319 type Repost = S::Repost; 1320 + type Like = S::Like; 1389 1321 type RepostViaRepost = S::RepostViaRepost; 1390 - type StarterpackJoined = Set<members::starterpack_joined>; 1391 - type SubscribedPost = S::SubscribedPost; 1392 - type Unverified = S::Unverified; 1393 - type Verified = S::Verified; 1394 1322 } 1395 1323 ///State transition - sets the `subscribed_post` field to Set 1396 1324 pub struct SetSubscribedPost<S: State = Empty>(PhantomData<fn() -> S>); 1397 1325 impl<S: State> sealed::Sealed for SetSubscribedPost<S> {} 1398 1326 impl<S: State> State for SetSubscribedPost<S> { 1399 1327 type Chat = S::Chat; 1328 + type Verified = S::Verified; 1329 + type StarterpackJoined = S::StarterpackJoined; 1400 1330 type Follow = S::Follow; 1401 - type Like = S::Like; 1402 - type LikeViaRepost = S::LikeViaRepost; 1331 + type Reply = S::Reply; 1332 + type Quote = S::Quote; 1333 + type SubscribedPost = Set<members::subscribed_post>; 1403 1334 type Mention = S::Mention; 1404 - type Quote = S::Quote; 1405 - type Reply = S::Reply; 1335 + type Unverified = S::Unverified; 1336 + type LikeViaRepost = S::LikeViaRepost; 1406 1337 type Repost = S::Repost; 1338 + type Like = S::Like; 1407 1339 type RepostViaRepost = S::RepostViaRepost; 1340 + } 1341 + ///State transition - sets the `mention` field to Set 1342 + pub struct SetMention<S: State = Empty>(PhantomData<fn() -> S>); 1343 + impl<S: State> sealed::Sealed for SetMention<S> {} 1344 + impl<S: State> State for SetMention<S> { 1345 + type Chat = S::Chat; 1346 + type Verified = S::Verified; 1408 1347 type StarterpackJoined = S::StarterpackJoined; 1409 - type SubscribedPost = Set<members::subscribed_post>; 1348 + type Follow = S::Follow; 1349 + type Reply = S::Reply; 1350 + type Quote = S::Quote; 1351 + type SubscribedPost = S::SubscribedPost; 1352 + type Mention = Set<members::mention>; 1410 1353 type Unverified = S::Unverified; 1411 - type Verified = S::Verified; 1354 + type LikeViaRepost = S::LikeViaRepost; 1355 + type Repost = S::Repost; 1356 + type Like = S::Like; 1357 + type RepostViaRepost = S::RepostViaRepost; 1412 1358 } 1413 1359 ///State transition - sets the `unverified` field to Set 1414 1360 pub struct SetUnverified<S: State = Empty>(PhantomData<fn() -> S>); 1415 1361 impl<S: State> sealed::Sealed for SetUnverified<S> {} 1416 1362 impl<S: State> State for SetUnverified<S> { 1417 1363 type Chat = S::Chat; 1364 + type Verified = S::Verified; 1365 + type StarterpackJoined = S::StarterpackJoined; 1418 1366 type Follow = S::Follow; 1367 + type Reply = S::Reply; 1368 + type Quote = S::Quote; 1369 + type SubscribedPost = S::SubscribedPost; 1370 + type Mention = S::Mention; 1371 + type Unverified = Set<members::unverified>; 1372 + type LikeViaRepost = S::LikeViaRepost; 1373 + type Repost = S::Repost; 1419 1374 type Like = S::Like; 1420 - type LikeViaRepost = S::LikeViaRepost; 1375 + type RepostViaRepost = S::RepostViaRepost; 1376 + } 1377 + ///State transition - sets the `like_via_repost` field to Set 1378 + pub struct SetLikeViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1379 + impl<S: State> sealed::Sealed for SetLikeViaRepost<S> {} 1380 + impl<S: State> State for SetLikeViaRepost<S> { 1381 + type Chat = S::Chat; 1382 + type Verified = S::Verified; 1383 + type StarterpackJoined = S::StarterpackJoined; 1384 + type Follow = S::Follow; 1385 + type Reply = S::Reply; 1386 + type Quote = S::Quote; 1387 + type SubscribedPost = S::SubscribedPost; 1421 1388 type Mention = S::Mention; 1422 - type Quote = S::Quote; 1423 - type Reply = S::Reply; 1389 + type Unverified = S::Unverified; 1390 + type LikeViaRepost = Set<members::like_via_repost>; 1424 1391 type Repost = S::Repost; 1392 + type Like = S::Like; 1425 1393 type RepostViaRepost = S::RepostViaRepost; 1394 + } 1395 + ///State transition - sets the `repost` field to Set 1396 + pub struct SetRepost<S: State = Empty>(PhantomData<fn() -> S>); 1397 + impl<S: State> sealed::Sealed for SetRepost<S> {} 1398 + impl<S: State> State for SetRepost<S> { 1399 + type Chat = S::Chat; 1400 + type Verified = S::Verified; 1426 1401 type StarterpackJoined = S::StarterpackJoined; 1402 + type Follow = S::Follow; 1403 + type Reply = S::Reply; 1404 + type Quote = S::Quote; 1427 1405 type SubscribedPost = S::SubscribedPost; 1428 - type Unverified = Set<members::unverified>; 1429 - type Verified = S::Verified; 1406 + type Mention = S::Mention; 1407 + type Unverified = S::Unverified; 1408 + type LikeViaRepost = S::LikeViaRepost; 1409 + type Repost = Set<members::repost>; 1410 + type Like = S::Like; 1411 + type RepostViaRepost = S::RepostViaRepost; 1430 1412 } 1431 - ///State transition - sets the `verified` field to Set 1432 - pub struct SetVerified<S: State = Empty>(PhantomData<fn() -> S>); 1433 - impl<S: State> sealed::Sealed for SetVerified<S> {} 1434 - impl<S: State> State for SetVerified<S> { 1413 + ///State transition - sets the `like` field to Set 1414 + pub struct SetLike<S: State = Empty>(PhantomData<fn() -> S>); 1415 + impl<S: State> sealed::Sealed for SetLike<S> {} 1416 + impl<S: State> State for SetLike<S> { 1435 1417 type Chat = S::Chat; 1418 + type Verified = S::Verified; 1419 + type StarterpackJoined = S::StarterpackJoined; 1436 1420 type Follow = S::Follow; 1437 - type Like = S::Like; 1438 - type LikeViaRepost = S::LikeViaRepost; 1439 - type Mention = S::Mention; 1421 + type Reply = S::Reply; 1440 1422 type Quote = S::Quote; 1441 - type Reply = S::Reply; 1423 + type SubscribedPost = S::SubscribedPost; 1424 + type Mention = S::Mention; 1425 + type Unverified = S::Unverified; 1426 + type LikeViaRepost = S::LikeViaRepost; 1442 1427 type Repost = S::Repost; 1428 + type Like = Set<members::like>; 1443 1429 type RepostViaRepost = S::RepostViaRepost; 1430 + } 1431 + ///State transition - sets the `repost_via_repost` field to Set 1432 + pub struct SetRepostViaRepost<S: State = Empty>(PhantomData<fn() -> S>); 1433 + impl<S: State> sealed::Sealed for SetRepostViaRepost<S> {} 1434 + impl<S: State> State for SetRepostViaRepost<S> { 1435 + type Chat = S::Chat; 1436 + type Verified = S::Verified; 1444 1437 type StarterpackJoined = S::StarterpackJoined; 1438 + type Follow = S::Follow; 1439 + type Reply = S::Reply; 1440 + type Quote = S::Quote; 1445 1441 type SubscribedPost = S::SubscribedPost; 1442 + type Mention = S::Mention; 1446 1443 type Unverified = S::Unverified; 1447 - type Verified = Set<members::verified>; 1444 + type LikeViaRepost = S::LikeViaRepost; 1445 + type Repost = S::Repost; 1446 + type Like = S::Like; 1447 + type RepostViaRepost = Set<members::repost_via_repost>; 1448 1448 } 1449 1449 /// Marker types for field names 1450 1450 #[allow(non_camel_case_types)] 1451 1451 pub mod members { 1452 1452 ///Marker type for the `chat` field 1453 1453 pub struct chat(()); 1454 + ///Marker type for the `verified` field 1455 + pub struct verified(()); 1456 + ///Marker type for the `starterpack_joined` field 1457 + pub struct starterpack_joined(()); 1454 1458 ///Marker type for the `follow` field 1455 1459 pub struct follow(()); 1456 - ///Marker type for the `like` field 1457 - pub struct like(()); 1458 - ///Marker type for the `like_via_repost` field 1459 - pub struct like_via_repost(()); 1460 + ///Marker type for the `reply` field 1461 + pub struct reply(()); 1462 + ///Marker type for the `quote` field 1463 + pub struct quote(()); 1464 + ///Marker type for the `subscribed_post` field 1465 + pub struct subscribed_post(()); 1460 1466 ///Marker type for the `mention` field 1461 1467 pub struct mention(()); 1462 - ///Marker type for the `quote` field 1463 - pub struct quote(()); 1464 - ///Marker type for the `reply` field 1465 - pub struct reply(()); 1468 + ///Marker type for the `unverified` field 1469 + pub struct unverified(()); 1470 + ///Marker type for the `like_via_repost` field 1471 + pub struct like_via_repost(()); 1466 1472 ///Marker type for the `repost` field 1467 1473 pub struct repost(()); 1474 + ///Marker type for the `like` field 1475 + pub struct like(()); 1468 1476 ///Marker type for the `repost_via_repost` field 1469 1477 pub struct repost_via_repost(()); 1470 - ///Marker type for the `starterpack_joined` field 1471 - pub struct starterpack_joined(()); 1472 - ///Marker type for the `subscribed_post` field 1473 - pub struct subscribed_post(()); 1474 - ///Marker type for the `unverified` field 1475 - pub struct unverified(()); 1476 - ///Marker type for the `verified` field 1477 - pub struct verified(()); 1478 1478 } 1479 1479 } 1480 1480 ··· 1782 1782 where 1783 1783 S: preferences_state::State, 1784 1784 S::Chat: preferences_state::IsSet, 1785 + S::Verified: preferences_state::IsSet, 1786 + S::StarterpackJoined: preferences_state::IsSet, 1785 1787 S::Follow: preferences_state::IsSet, 1786 - S::Like: preferences_state::IsSet, 1787 - S::LikeViaRepost: preferences_state::IsSet, 1788 - S::Mention: preferences_state::IsSet, 1789 - S::Quote: preferences_state::IsSet, 1790 1788 S::Reply: preferences_state::IsSet, 1791 - S::Repost: preferences_state::IsSet, 1792 - S::RepostViaRepost: preferences_state::IsSet, 1793 - S::StarterpackJoined: preferences_state::IsSet, 1789 + S::Quote: preferences_state::IsSet, 1794 1790 S::SubscribedPost: preferences_state::IsSet, 1791 + S::Mention: preferences_state::IsSet, 1795 1792 S::Unverified: preferences_state::IsSet, 1796 - S::Verified: preferences_state::IsSet, 1793 + S::LikeViaRepost: preferences_state::IsSet, 1794 + S::Repost: preferences_state::IsSet, 1795 + S::Like: preferences_state::IsSet, 1796 + S::RepostViaRepost: preferences_state::IsSet, 1797 1797 { 1798 1798 /// Build the final struct 1799 1799 pub fn build(self) -> Preferences<'a> {
+43 -43
crates/weaver-api/src/app_bsky/notification/list_notifications.rs
··· 271 271 } 272 272 /// State trait tracking which required fields have been set 273 273 pub trait State: sealed::Sealed { 274 - type Uri; 275 274 type Cid; 276 275 type Author; 277 - type Reason; 278 276 type Record; 279 277 type IsRead; 280 278 type IndexedAt; 279 + type Reason; 280 + type Uri; 281 281 } 282 282 /// Empty state - all required fields are unset 283 283 pub struct Empty(()); 284 284 impl sealed::Sealed for Empty {} 285 285 impl State for Empty { 286 - type Uri = Unset; 287 286 type Cid = Unset; 288 287 type Author = Unset; 289 - type Reason = Unset; 290 288 type Record = Unset; 291 289 type IsRead = Unset; 292 290 type IndexedAt = Unset; 293 - } 294 - ///State transition - sets the `uri` field to Set 295 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 296 - impl<S: State> sealed::Sealed for SetUri<S> {} 297 - impl<S: State> State for SetUri<S> { 298 - type Uri = Set<members::uri>; 299 - type Cid = S::Cid; 300 - type Author = S::Author; 301 - type Reason = S::Reason; 302 - type Record = S::Record; 303 - type IsRead = S::IsRead; 304 - type IndexedAt = S::IndexedAt; 291 + type Reason = Unset; 292 + type Uri = Unset; 305 293 } 306 294 ///State transition - sets the `cid` field to Set 307 295 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 308 296 impl<S: State> sealed::Sealed for SetCid<S> {} 309 297 impl<S: State> State for SetCid<S> { 310 - type Uri = S::Uri; 311 298 type Cid = Set<members::cid>; 312 299 type Author = S::Author; 313 - type Reason = S::Reason; 314 300 type Record = S::Record; 315 301 type IsRead = S::IsRead; 316 302 type IndexedAt = S::IndexedAt; 303 + type Reason = S::Reason; 304 + type Uri = S::Uri; 317 305 } 318 306 ///State transition - sets the `author` field to Set 319 307 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 320 308 impl<S: State> sealed::Sealed for SetAuthor<S> {} 321 309 impl<S: State> State for SetAuthor<S> { 322 - type Uri = S::Uri; 323 310 type Cid = S::Cid; 324 311 type Author = Set<members::author>; 325 - type Reason = S::Reason; 326 312 type Record = S::Record; 327 313 type IsRead = S::IsRead; 328 314 type IndexedAt = S::IndexedAt; 329 - } 330 - ///State transition - sets the `reason` field to Set 331 - pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 332 - impl<S: State> sealed::Sealed for SetReason<S> {} 333 - impl<S: State> State for SetReason<S> { 315 + type Reason = S::Reason; 334 316 type Uri = S::Uri; 335 - type Cid = S::Cid; 336 - type Author = S::Author; 337 - type Reason = Set<members::reason>; 338 - type Record = S::Record; 339 - type IsRead = S::IsRead; 340 - type IndexedAt = S::IndexedAt; 341 317 } 342 318 ///State transition - sets the `record` field to Set 343 319 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 344 320 impl<S: State> sealed::Sealed for SetRecord<S> {} 345 321 impl<S: State> State for SetRecord<S> { 346 - type Uri = S::Uri; 347 322 type Cid = S::Cid; 348 323 type Author = S::Author; 349 - type Reason = S::Reason; 350 324 type Record = Set<members::record>; 351 325 type IsRead = S::IsRead; 352 326 type IndexedAt = S::IndexedAt; 327 + type Reason = S::Reason; 328 + type Uri = S::Uri; 353 329 } 354 330 ///State transition - sets the `is_read` field to Set 355 331 pub struct SetIsRead<S: State = Empty>(PhantomData<fn() -> S>); 356 332 impl<S: State> sealed::Sealed for SetIsRead<S> {} 357 333 impl<S: State> State for SetIsRead<S> { 358 - type Uri = S::Uri; 359 334 type Cid = S::Cid; 360 335 type Author = S::Author; 361 - type Reason = S::Reason; 362 336 type Record = S::Record; 363 337 type IsRead = Set<members::is_read>; 364 338 type IndexedAt = S::IndexedAt; 339 + type Reason = S::Reason; 340 + type Uri = S::Uri; 365 341 } 366 342 ///State transition - sets the `indexed_at` field to Set 367 343 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 368 344 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 369 345 impl<S: State> State for SetIndexedAt<S> { 346 + type Cid = S::Cid; 347 + type Author = S::Author; 348 + type Record = S::Record; 349 + type IsRead = S::IsRead; 350 + type IndexedAt = Set<members::indexed_at>; 351 + type Reason = S::Reason; 370 352 type Uri = S::Uri; 353 + } 354 + ///State transition - sets the `reason` field to Set 355 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 356 + impl<S: State> sealed::Sealed for SetReason<S> {} 357 + impl<S: State> State for SetReason<S> { 371 358 type Cid = S::Cid; 372 359 type Author = S::Author; 373 - type Reason = S::Reason; 360 + type Record = S::Record; 361 + type IsRead = S::IsRead; 362 + type IndexedAt = S::IndexedAt; 363 + type Reason = Set<members::reason>; 364 + type Uri = S::Uri; 365 + } 366 + ///State transition - sets the `uri` field to Set 367 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 368 + impl<S: State> sealed::Sealed for SetUri<S> {} 369 + impl<S: State> State for SetUri<S> { 370 + type Cid = S::Cid; 371 + type Author = S::Author; 374 372 type Record = S::Record; 375 373 type IsRead = S::IsRead; 376 - type IndexedAt = Set<members::indexed_at>; 374 + type IndexedAt = S::IndexedAt; 375 + type Reason = S::Reason; 376 + type Uri = Set<members::uri>; 377 377 } 378 378 /// Marker types for field names 379 379 #[allow(non_camel_case_types)] 380 380 pub mod members { 381 - ///Marker type for the `uri` field 382 - pub struct uri(()); 383 381 ///Marker type for the `cid` field 384 382 pub struct cid(()); 385 383 ///Marker type for the `author` field 386 384 pub struct author(()); 387 - ///Marker type for the `reason` field 388 - pub struct reason(()); 389 385 ///Marker type for the `record` field 390 386 pub struct record(()); 391 387 ///Marker type for the `is_read` field 392 388 pub struct is_read(()); 393 389 ///Marker type for the `indexed_at` field 394 390 pub struct indexed_at(()); 391 + ///Marker type for the `reason` field 392 + pub struct reason(()); 393 + ///Marker type for the `uri` field 394 + pub struct uri(()); 395 395 } 396 396 } 397 397 ··· 614 614 impl<'a, S> NotificationBuilder<'a, S> 615 615 where 616 616 S: notification_state::State, 617 - S::Uri: notification_state::IsSet, 618 617 S::Cid: notification_state::IsSet, 619 618 S::Author: notification_state::IsSet, 620 - S::Reason: notification_state::IsSet, 621 619 S::Record: notification_state::IsSet, 622 620 S::IsRead: notification_state::IsSet, 623 621 S::IndexedAt: notification_state::IsSet, 622 + S::Reason: notification_state::IsSet, 623 + S::Uri: notification_state::IsSet, 624 624 { 625 625 /// Build the final struct 626 626 pub fn build(self) -> Notification<'a> {
+13 -13
crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Subject; 37 36 type ActivitySubscription; 37 + type Subject; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Subject = Unset; 44 43 type ActivitySubscription = Unset; 45 - } 46 - ///State transition - sets the `subject` field to Set 47 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetSubject<S> {} 49 - impl<S: State> State for SetSubject<S> { 50 - type Subject = Set<members::subject>; 51 - type ActivitySubscription = S::ActivitySubscription; 44 + type Subject = Unset; 52 45 } 53 46 ///State transition - sets the `activity_subscription` field to Set 54 47 pub struct SetActivitySubscription<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetActivitySubscription<S> {} 56 49 impl<S: State> State for SetActivitySubscription<S> { 57 - type Subject = S::Subject; 58 50 type ActivitySubscription = Set<members::activity_subscription>; 51 + type Subject = S::Subject; 52 + } 53 + ///State transition - sets the `subject` field to Set 54 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetSubject<S> {} 56 + impl<S: State> State for SetSubject<S> { 57 + type ActivitySubscription = S::ActivitySubscription; 58 + type Subject = Set<members::subject>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `subject` field 64 - pub struct subject(()); 65 63 ///Marker type for the `activity_subscription` field 66 64 pub struct activity_subscription(()); 65 + ///Marker type for the `subject` field 66 + pub struct subject(()); 67 67 } 68 68 } 69 69 ··· 148 148 impl<'a, S> PutActivitySubscriptionBuilder<'a, S> 149 149 where 150 150 S: put_activity_subscription_state::State, 151 - S::Subject: put_activity_subscription_state::IsSet, 152 151 S::ActivitySubscription: put_activity_subscription_state::IsSet, 152 + S::Subject: put_activity_subscription_state::IsSet, 153 153 { 154 154 /// Build the final struct 155 155 pub fn build(self) -> PutActivitySubscription<'a> {
+17 -17
crates/weaver-api/src/app_bsky/notification/register_push.rs
··· 41 41 /// State trait tracking which required fields have been set 42 42 pub trait State: sealed::Sealed { 43 43 type ServiceDid; 44 - type Token; 45 44 type Platform; 45 + type Token; 46 46 type AppId; 47 47 } 48 48 /// Empty state - all required fields are unset ··· 50 50 impl sealed::Sealed for Empty {} 51 51 impl State for Empty { 52 52 type ServiceDid = Unset; 53 - type Token = Unset; 54 53 type Platform = Unset; 54 + type Token = Unset; 55 55 type AppId = Unset; 56 56 } 57 57 ///State transition - sets the `service_did` field to Set ··· 59 59 impl<S: State> sealed::Sealed for SetServiceDid<S> {} 60 60 impl<S: State> State for SetServiceDid<S> { 61 61 type ServiceDid = Set<members::service_did>; 62 - type Token = S::Token; 63 62 type Platform = S::Platform; 64 - type AppId = S::AppId; 65 - } 66 - ///State transition - sets the `token` field to Set 67 - pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 68 - impl<S: State> sealed::Sealed for SetToken<S> {} 69 - impl<S: State> State for SetToken<S> { 70 - type ServiceDid = S::ServiceDid; 71 - type Token = Set<members::token>; 72 - type Platform = S::Platform; 63 + type Token = S::Token; 73 64 type AppId = S::AppId; 74 65 } 75 66 ///State transition - sets the `platform` field to Set ··· 77 68 impl<S: State> sealed::Sealed for SetPlatform<S> {} 78 69 impl<S: State> State for SetPlatform<S> { 79 70 type ServiceDid = S::ServiceDid; 80 - type Token = S::Token; 81 71 type Platform = Set<members::platform>; 72 + type Token = S::Token; 73 + type AppId = S::AppId; 74 + } 75 + ///State transition - sets the `token` field to Set 76 + pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetToken<S> {} 78 + impl<S: State> State for SetToken<S> { 79 + type ServiceDid = S::ServiceDid; 80 + type Platform = S::Platform; 81 + type Token = Set<members::token>; 82 82 type AppId = S::AppId; 83 83 } 84 84 ///State transition - sets the `app_id` field to Set ··· 86 86 impl<S: State> sealed::Sealed for SetAppId<S> {} 87 87 impl<S: State> State for SetAppId<S> { 88 88 type ServiceDid = S::ServiceDid; 89 - type Token = S::Token; 90 89 type Platform = S::Platform; 90 + type Token = S::Token; 91 91 type AppId = Set<members::app_id>; 92 92 } 93 93 /// Marker types for field names ··· 95 95 pub mod members { 96 96 ///Marker type for the `service_did` field 97 97 pub struct service_did(()); 98 + ///Marker type for the `platform` field 99 + pub struct platform(()); 98 100 ///Marker type for the `token` field 99 101 pub struct token(()); 100 - ///Marker type for the `platform` field 101 - pub struct platform(()); 102 102 ///Marker type for the `app_id` field 103 103 pub struct app_id(()); 104 104 } ··· 228 228 where 229 229 S: register_push_state::State, 230 230 S::ServiceDid: register_push_state::IsSet, 231 - S::Token: register_push_state::IsSet, 232 231 S::Platform: register_push_state::IsSet, 232 + S::Token: register_push_state::IsSet, 233 233 S::AppId: register_push_state::IsSet, 234 234 { 235 235 /// Build the final struct
+39 -39
crates/weaver-api/src/app_bsky/notification/unregister_push.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 + type AppId; 41 + type Platform; 42 + type Token; 40 43 type ServiceDid; 41 - type Token; 42 - type Platform; 43 - type AppId; 44 44 } 45 45 /// Empty state - all required fields are unset 46 46 pub struct Empty(()); 47 47 impl sealed::Sealed for Empty {} 48 48 impl State for Empty { 49 - type ServiceDid = Unset; 50 - type Token = Unset; 51 - type Platform = Unset; 52 49 type AppId = Unset; 50 + type Platform = Unset; 51 + type Token = Unset; 52 + type ServiceDid = Unset; 53 53 } 54 - ///State transition - sets the `service_did` field to Set 55 - pub struct SetServiceDid<S: State = Empty>(PhantomData<fn() -> S>); 56 - impl<S: State> sealed::Sealed for SetServiceDid<S> {} 57 - impl<S: State> State for SetServiceDid<S> { 58 - type ServiceDid = Set<members::service_did>; 59 - type Token = S::Token; 54 + ///State transition - sets the `app_id` field to Set 55 + pub struct SetAppId<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetAppId<S> {} 57 + impl<S: State> State for SetAppId<S> { 58 + type AppId = Set<members::app_id>; 60 59 type Platform = S::Platform; 61 - type AppId = S::AppId; 62 - } 63 - ///State transition - sets the `token` field to Set 64 - pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 65 - impl<S: State> sealed::Sealed for SetToken<S> {} 66 - impl<S: State> State for SetToken<S> { 60 + type Token = S::Token; 67 61 type ServiceDid = S::ServiceDid; 68 - type Token = Set<members::token>; 69 - type Platform = S::Platform; 70 - type AppId = S::AppId; 71 62 } 72 63 ///State transition - sets the `platform` field to Set 73 64 pub struct SetPlatform<S: State = Empty>(PhantomData<fn() -> S>); 74 65 impl<S: State> sealed::Sealed for SetPlatform<S> {} 75 66 impl<S: State> State for SetPlatform<S> { 76 - type ServiceDid = S::ServiceDid; 77 - type Token = S::Token; 78 - type Platform = Set<members::platform>; 79 67 type AppId = S::AppId; 68 + type Platform = Set<members::platform>; 69 + type Token = S::Token; 70 + type ServiceDid = S::ServiceDid; 80 71 } 81 - ///State transition - sets the `app_id` field to Set 82 - pub struct SetAppId<S: State = Empty>(PhantomData<fn() -> S>); 83 - impl<S: State> sealed::Sealed for SetAppId<S> {} 84 - impl<S: State> State for SetAppId<S> { 72 + ///State transition - sets the `token` field to Set 73 + pub struct SetToken<S: State = Empty>(PhantomData<fn() -> S>); 74 + impl<S: State> sealed::Sealed for SetToken<S> {} 75 + impl<S: State> State for SetToken<S> { 76 + type AppId = S::AppId; 77 + type Platform = S::Platform; 78 + type Token = Set<members::token>; 85 79 type ServiceDid = S::ServiceDid; 86 - type Token = S::Token; 80 + } 81 + ///State transition - sets the `service_did` field to Set 82 + pub struct SetServiceDid<S: State = Empty>(PhantomData<fn() -> S>); 83 + impl<S: State> sealed::Sealed for SetServiceDid<S> {} 84 + impl<S: State> State for SetServiceDid<S> { 85 + type AppId = S::AppId; 87 86 type Platform = S::Platform; 88 - type AppId = Set<members::app_id>; 87 + type Token = S::Token; 88 + type ServiceDid = Set<members::service_did>; 89 89 } 90 90 /// Marker types for field names 91 91 #[allow(non_camel_case_types)] 92 92 pub mod members { 93 - ///Marker type for the `service_did` field 94 - pub struct service_did(()); 95 - ///Marker type for the `token` field 96 - pub struct token(()); 93 + ///Marker type for the `app_id` field 94 + pub struct app_id(()); 97 95 ///Marker type for the `platform` field 98 96 pub struct platform(()); 99 - ///Marker type for the `app_id` field 100 - pub struct app_id(()); 97 + ///Marker type for the `token` field 98 + pub struct token(()); 99 + ///Marker type for the `service_did` field 100 + pub struct service_did(()); 101 101 } 102 102 } 103 103 ··· 210 210 impl<'a, S> UnregisterPushBuilder<'a, S> 211 211 where 212 212 S: unregister_push_state::State, 213 - S::ServiceDid: unregister_push_state::IsSet, 214 - S::Token: unregister_push_state::IsSet, 215 - S::Platform: unregister_push_state::IsSet, 216 213 S::AppId: unregister_push_state::IsSet, 214 + S::Platform: unregister_push_state::IsSet, 215 + S::Token: unregister_push_state::IsSet, 216 + S::ServiceDid: unregister_push_state::IsSet, 217 217 { 218 218 /// Build the final struct 219 219 pub fn build(self) -> UnregisterPush<'a> {
+13 -13
crates/weaver-api/src/app_bsky/richtext/facet.rs
··· 32 32 } 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 - type ByteStart; 36 35 type ByteEnd; 36 + type ByteStart; 37 37 } 38 38 /// Empty state - all required fields are unset 39 39 pub struct Empty(()); 40 40 impl sealed::Sealed for Empty {} 41 41 impl State for Empty { 42 - type ByteStart = Unset; 43 42 type ByteEnd = Unset; 44 - } 45 - ///State transition - sets the `byte_start` field to Set 46 - pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetByteStart<S> {} 48 - impl<S: State> State for SetByteStart<S> { 49 - type ByteStart = Set<members::byte_start>; 50 - type ByteEnd = S::ByteEnd; 43 + type ByteStart = Unset; 51 44 } 52 45 ///State transition - sets the `byte_end` field to Set 53 46 pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>); 54 47 impl<S: State> sealed::Sealed for SetByteEnd<S> {} 55 48 impl<S: State> State for SetByteEnd<S> { 56 - type ByteStart = S::ByteStart; 57 49 type ByteEnd = Set<members::byte_end>; 50 + type ByteStart = S::ByteStart; 51 + } 52 + ///State transition - sets the `byte_start` field to Set 53 + pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetByteStart<S> {} 55 + impl<S: State> State for SetByteStart<S> { 56 + type ByteEnd = S::ByteEnd; 57 + type ByteStart = Set<members::byte_start>; 58 58 } 59 59 /// Marker types for field names 60 60 #[allow(non_camel_case_types)] 61 61 pub mod members { 62 - ///Marker type for the `byte_start` field 63 - pub struct byte_start(()); 64 62 ///Marker type for the `byte_end` field 65 63 pub struct byte_end(()); 64 + ///Marker type for the `byte_start` field 65 + pub struct byte_start(()); 66 66 } 67 67 } 68 68 ··· 132 132 impl<'a, S> ByteSliceBuilder<'a, S> 133 133 where 134 134 S: byte_slice_state::State, 135 - S::ByteStart: byte_slice_state::IsSet, 136 135 S::ByteEnd: byte_slice_state::IsSet, 136 + S::ByteStart: byte_slice_state::IsSet, 137 137 { 138 138 /// Build the final struct 139 139 pub fn build(self) -> ByteSlice<'a> {
+114 -114
crates/weaver-api/src/app_bsky/unspecced.rs
··· 81 81 } 82 82 /// State trait tracking which required fields have been set 83 83 pub trait State: sealed::Sealed { 84 - type CreatedAt; 85 - type Status; 86 84 type AttemptId; 85 + type Status; 86 + type CreatedAt; 87 87 } 88 88 /// Empty state - all required fields are unset 89 89 pub struct Empty(()); 90 90 impl sealed::Sealed for Empty {} 91 91 impl State for Empty { 92 + type AttemptId = Unset; 93 + type Status = Unset; 92 94 type CreatedAt = Unset; 93 - type Status = Unset; 94 - type AttemptId = Unset; 95 95 } 96 - ///State transition - sets the `created_at` field to Set 97 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 98 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 99 - impl<S: State> State for SetCreatedAt<S> { 100 - type CreatedAt = Set<members::created_at>; 96 + ///State transition - sets the `attempt_id` field to Set 97 + pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 98 + impl<S: State> sealed::Sealed for SetAttemptId<S> {} 99 + impl<S: State> State for SetAttemptId<S> { 100 + type AttemptId = Set<members::attempt_id>; 101 101 type Status = S::Status; 102 - type AttemptId = S::AttemptId; 102 + type CreatedAt = S::CreatedAt; 103 103 } 104 104 ///State transition - sets the `status` field to Set 105 105 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 106 106 impl<S: State> sealed::Sealed for SetStatus<S> {} 107 107 impl<S: State> State for SetStatus<S> { 108 - type CreatedAt = S::CreatedAt; 109 - type Status = Set<members::status>; 110 108 type AttemptId = S::AttemptId; 109 + type Status = Set<members::status>; 110 + type CreatedAt = S::CreatedAt; 111 111 } 112 - ///State transition - sets the `attempt_id` field to Set 113 - pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 114 - impl<S: State> sealed::Sealed for SetAttemptId<S> {} 115 - impl<S: State> State for SetAttemptId<S> { 116 - type CreatedAt = S::CreatedAt; 112 + ///State transition - sets the `created_at` field to Set 113 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 114 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 115 + impl<S: State> State for SetCreatedAt<S> { 116 + type AttemptId = S::AttemptId; 117 117 type Status = S::Status; 118 - type AttemptId = Set<members::attempt_id>; 118 + type CreatedAt = Set<members::created_at>; 119 119 } 120 120 /// Marker types for field names 121 121 #[allow(non_camel_case_types)] 122 122 pub mod members { 123 + ///Marker type for the `attempt_id` field 124 + pub struct attempt_id(()); 125 + ///Marker type for the `status` field 126 + pub struct status(()); 123 127 ///Marker type for the `created_at` field 124 128 pub struct created_at(()); 125 - ///Marker type for the `status` field 126 - pub struct status(()); 127 - ///Marker type for the `attempt_id` field 128 - pub struct attempt_id(()); 129 129 } 130 130 } 131 131 ··· 309 309 impl<'a, S> AgeAssuranceEventBuilder<'a, S> 310 310 where 311 311 S: age_assurance_event_state::State, 312 - S::CreatedAt: age_assurance_event_state::IsSet, 313 - S::Status: age_assurance_event_state::IsSet, 314 312 S::AttemptId: age_assurance_event_state::IsSet, 313 + S::Status: age_assurance_event_state::IsSet, 314 + S::CreatedAt: age_assurance_event_state::IsSet, 315 315 { 316 316 /// Build the final struct 317 317 pub fn build(self) -> AgeAssuranceEvent<'a> { ··· 1745 1745 pub trait State: sealed::Sealed { 1746 1746 type Topic; 1747 1747 type DisplayName; 1748 - type Link; 1749 1748 type StartedAt; 1750 1749 type PostCount; 1751 1750 type Dids; 1751 + type Link; 1752 1752 } 1753 1753 /// Empty state - all required fields are unset 1754 1754 pub struct Empty(()); ··· 1756 1756 impl State for Empty { 1757 1757 type Topic = Unset; 1758 1758 type DisplayName = Unset; 1759 - type Link = Unset; 1760 1759 type StartedAt = Unset; 1761 1760 type PostCount = Unset; 1762 1761 type Dids = Unset; 1762 + type Link = Unset; 1763 1763 } 1764 1764 ///State transition - sets the `topic` field to Set 1765 1765 pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>); ··· 1767 1767 impl<S: State> State for SetTopic<S> { 1768 1768 type Topic = Set<members::topic>; 1769 1769 type DisplayName = S::DisplayName; 1770 - type Link = S::Link; 1771 1770 type StartedAt = S::StartedAt; 1772 1771 type PostCount = S::PostCount; 1773 1772 type Dids = S::Dids; 1773 + type Link = S::Link; 1774 1774 } 1775 1775 ///State transition - sets the `display_name` field to Set 1776 1776 pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); ··· 1778 1778 impl<S: State> State for SetDisplayName<S> { 1779 1779 type Topic = S::Topic; 1780 1780 type DisplayName = Set<members::display_name>; 1781 - type Link = S::Link; 1782 1781 type StartedAt = S::StartedAt; 1783 1782 type PostCount = S::PostCount; 1784 1783 type Dids = S::Dids; 1785 - } 1786 - ///State transition - sets the `link` field to Set 1787 - pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 1788 - impl<S: State> sealed::Sealed for SetLink<S> {} 1789 - impl<S: State> State for SetLink<S> { 1790 - type Topic = S::Topic; 1791 - type DisplayName = S::DisplayName; 1792 - type Link = Set<members::link>; 1793 - type StartedAt = S::StartedAt; 1794 - type PostCount = S::PostCount; 1795 - type Dids = S::Dids; 1784 + type Link = S::Link; 1796 1785 } 1797 1786 ///State transition - sets the `started_at` field to Set 1798 1787 pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>); ··· 1800 1789 impl<S: State> State for SetStartedAt<S> { 1801 1790 type Topic = S::Topic; 1802 1791 type DisplayName = S::DisplayName; 1803 - type Link = S::Link; 1804 1792 type StartedAt = Set<members::started_at>; 1805 1793 type PostCount = S::PostCount; 1806 1794 type Dids = S::Dids; 1795 + type Link = S::Link; 1807 1796 } 1808 1797 ///State transition - sets the `post_count` field to Set 1809 1798 pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>); ··· 1811 1800 impl<S: State> State for SetPostCount<S> { 1812 1801 type Topic = S::Topic; 1813 1802 type DisplayName = S::DisplayName; 1814 - type Link = S::Link; 1815 1803 type StartedAt = S::StartedAt; 1816 1804 type PostCount = Set<members::post_count>; 1817 1805 type Dids = S::Dids; 1806 + type Link = S::Link; 1818 1807 } 1819 1808 ///State transition - sets the `dids` field to Set 1820 1809 pub struct SetDids<S: State = Empty>(PhantomData<fn() -> S>); ··· 1822 1811 impl<S: State> State for SetDids<S> { 1823 1812 type Topic = S::Topic; 1824 1813 type DisplayName = S::DisplayName; 1825 - type Link = S::Link; 1826 1814 type StartedAt = S::StartedAt; 1827 1815 type PostCount = S::PostCount; 1828 1816 type Dids = Set<members::dids>; 1817 + type Link = S::Link; 1818 + } 1819 + ///State transition - sets the `link` field to Set 1820 + pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 1821 + impl<S: State> sealed::Sealed for SetLink<S> {} 1822 + impl<S: State> State for SetLink<S> { 1823 + type Topic = S::Topic; 1824 + type DisplayName = S::DisplayName; 1825 + type StartedAt = S::StartedAt; 1826 + type PostCount = S::PostCount; 1827 + type Dids = S::Dids; 1828 + type Link = Set<members::link>; 1829 1829 } 1830 1830 /// Marker types for field names 1831 1831 #[allow(non_camel_case_types)] ··· 1834 1834 pub struct topic(()); 1835 1835 ///Marker type for the `display_name` field 1836 1836 pub struct display_name(()); 1837 - ///Marker type for the `link` field 1838 - pub struct link(()); 1839 1837 ///Marker type for the `started_at` field 1840 1838 pub struct started_at(()); 1841 1839 ///Marker type for the `post_count` field 1842 1840 pub struct post_count(()); 1843 1841 ///Marker type for the `dids` field 1844 1842 pub struct dids(()); 1843 + ///Marker type for the `link` field 1844 + pub struct link(()); 1845 1845 } 1846 1846 } 1847 1847 ··· 2030 2030 S: skeleton_trend_state::State, 2031 2031 S::Topic: skeleton_trend_state::IsSet, 2032 2032 S::DisplayName: skeleton_trend_state::IsSet, 2033 - S::Link: skeleton_trend_state::IsSet, 2034 2033 S::StartedAt: skeleton_trend_state::IsSet, 2035 2034 S::PostCount: skeleton_trend_state::IsSet, 2036 2035 S::Dids: skeleton_trend_state::IsSet, 2036 + S::Link: skeleton_trend_state::IsSet, 2037 2037 { 2038 2038 /// Build the final struct 2039 2039 pub fn build(self) -> SkeletonTrend<'a> { ··· 2322 2322 } 2323 2323 /// State trait tracking which required fields have been set 2324 2324 pub trait State: sealed::Sealed { 2325 + type OpThread; 2325 2326 type Post; 2326 2327 type MoreParents; 2327 2328 type MoreReplies; 2328 - type OpThread; 2329 2329 type HiddenByThreadgate; 2330 2330 type MutedByViewer; 2331 2331 } ··· 2333 2333 pub struct Empty(()); 2334 2334 impl sealed::Sealed for Empty {} 2335 2335 impl State for Empty { 2336 + type OpThread = Unset; 2336 2337 type Post = Unset; 2337 2338 type MoreParents = Unset; 2338 2339 type MoreReplies = Unset; 2339 - type OpThread = Unset; 2340 2340 type HiddenByThreadgate = Unset; 2341 2341 type MutedByViewer = Unset; 2342 2342 } 2343 + ///State transition - sets the `op_thread` field to Set 2344 + pub struct SetOpThread<S: State = Empty>(PhantomData<fn() -> S>); 2345 + impl<S: State> sealed::Sealed for SetOpThread<S> {} 2346 + impl<S: State> State for SetOpThread<S> { 2347 + type OpThread = Set<members::op_thread>; 2348 + type Post = S::Post; 2349 + type MoreParents = S::MoreParents; 2350 + type MoreReplies = S::MoreReplies; 2351 + type HiddenByThreadgate = S::HiddenByThreadgate; 2352 + type MutedByViewer = S::MutedByViewer; 2353 + } 2343 2354 ///State transition - sets the `post` field to Set 2344 2355 pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>); 2345 2356 impl<S: State> sealed::Sealed for SetPost<S> {} 2346 2357 impl<S: State> State for SetPost<S> { 2358 + type OpThread = S::OpThread; 2347 2359 type Post = Set<members::post>; 2348 2360 type MoreParents = S::MoreParents; 2349 2361 type MoreReplies = S::MoreReplies; 2350 - type OpThread = S::OpThread; 2351 2362 type HiddenByThreadgate = S::HiddenByThreadgate; 2352 2363 type MutedByViewer = S::MutedByViewer; 2353 2364 } ··· 2355 2366 pub struct SetMoreParents<S: State = Empty>(PhantomData<fn() -> S>); 2356 2367 impl<S: State> sealed::Sealed for SetMoreParents<S> {} 2357 2368 impl<S: State> State for SetMoreParents<S> { 2369 + type OpThread = S::OpThread; 2358 2370 type Post = S::Post; 2359 2371 type MoreParents = Set<members::more_parents>; 2360 2372 type MoreReplies = S::MoreReplies; 2361 - type OpThread = S::OpThread; 2362 2373 type HiddenByThreadgate = S::HiddenByThreadgate; 2363 2374 type MutedByViewer = S::MutedByViewer; 2364 2375 } ··· 2366 2377 pub struct SetMoreReplies<S: State = Empty>(PhantomData<fn() -> S>); 2367 2378 impl<S: State> sealed::Sealed for SetMoreReplies<S> {} 2368 2379 impl<S: State> State for SetMoreReplies<S> { 2369 - type Post = S::Post; 2370 - type MoreParents = S::MoreParents; 2371 - type MoreReplies = Set<members::more_replies>; 2372 2380 type OpThread = S::OpThread; 2373 - type HiddenByThreadgate = S::HiddenByThreadgate; 2374 - type MutedByViewer = S::MutedByViewer; 2375 - } 2376 - ///State transition - sets the `op_thread` field to Set 2377 - pub struct SetOpThread<S: State = Empty>(PhantomData<fn() -> S>); 2378 - impl<S: State> sealed::Sealed for SetOpThread<S> {} 2379 - impl<S: State> State for SetOpThread<S> { 2380 2381 type Post = S::Post; 2381 2382 type MoreParents = S::MoreParents; 2382 - type MoreReplies = S::MoreReplies; 2383 - type OpThread = Set<members::op_thread>; 2383 + type MoreReplies = Set<members::more_replies>; 2384 2384 type HiddenByThreadgate = S::HiddenByThreadgate; 2385 2385 type MutedByViewer = S::MutedByViewer; 2386 2386 } ··· 2388 2388 pub struct SetHiddenByThreadgate<S: State = Empty>(PhantomData<fn() -> S>); 2389 2389 impl<S: State> sealed::Sealed for SetHiddenByThreadgate<S> {} 2390 2390 impl<S: State> State for SetHiddenByThreadgate<S> { 2391 + type OpThread = S::OpThread; 2391 2392 type Post = S::Post; 2392 2393 type MoreParents = S::MoreParents; 2393 2394 type MoreReplies = S::MoreReplies; 2394 - type OpThread = S::OpThread; 2395 2395 type HiddenByThreadgate = Set<members::hidden_by_threadgate>; 2396 2396 type MutedByViewer = S::MutedByViewer; 2397 2397 } ··· 2399 2399 pub struct SetMutedByViewer<S: State = Empty>(PhantomData<fn() -> S>); 2400 2400 impl<S: State> sealed::Sealed for SetMutedByViewer<S> {} 2401 2401 impl<S: State> State for SetMutedByViewer<S> { 2402 + type OpThread = S::OpThread; 2402 2403 type Post = S::Post; 2403 2404 type MoreParents = S::MoreParents; 2404 2405 type MoreReplies = S::MoreReplies; 2405 - type OpThread = S::OpThread; 2406 2406 type HiddenByThreadgate = S::HiddenByThreadgate; 2407 2407 type MutedByViewer = Set<members::muted_by_viewer>; 2408 2408 } 2409 2409 /// Marker types for field names 2410 2410 #[allow(non_camel_case_types)] 2411 2411 pub mod members { 2412 + ///Marker type for the `op_thread` field 2413 + pub struct op_thread(()); 2412 2414 ///Marker type for the `post` field 2413 2415 pub struct post(()); 2414 2416 ///Marker type for the `more_parents` field 2415 2417 pub struct more_parents(()); 2416 2418 ///Marker type for the `more_replies` field 2417 2419 pub struct more_replies(()); 2418 - ///Marker type for the `op_thread` field 2419 - pub struct op_thread(()); 2420 2420 ///Marker type for the `hidden_by_threadgate` field 2421 2421 pub struct hidden_by_threadgate(()); 2422 2422 ///Marker type for the `muted_by_viewer` field ··· 2573 2573 impl<'a, S> ThreadItemPostBuilder<'a, S> 2574 2574 where 2575 2575 S: thread_item_post_state::State, 2576 + S::OpThread: thread_item_post_state::IsSet, 2576 2577 S::Post: thread_item_post_state::IsSet, 2577 2578 S::MoreParents: thread_item_post_state::IsSet, 2578 2579 S::MoreReplies: thread_item_post_state::IsSet, 2579 - S::OpThread: thread_item_post_state::IsSet, 2580 2580 S::HiddenByThreadgate: thread_item_post_state::IsSet, 2581 2581 S::MutedByViewer: thread_item_post_state::IsSet, 2582 2582 { ··· 2669 2669 } 2670 2670 /// State trait tracking which required fields have been set 2671 2671 pub trait State: sealed::Sealed { 2672 - type Topic; 2673 - type DisplayName; 2674 - type Link; 2675 2672 type StartedAt; 2673 + type Link; 2676 2674 type PostCount; 2677 2675 type Actors; 2676 + type Topic; 2677 + type DisplayName; 2678 2678 } 2679 2679 /// Empty state - all required fields are unset 2680 2680 pub struct Empty(()); 2681 2681 impl sealed::Sealed for Empty {} 2682 2682 impl State for Empty { 2683 - type Topic = Unset; 2684 - type DisplayName = Unset; 2683 + type StartedAt = Unset; 2685 2684 type Link = Unset; 2686 - type StartedAt = Unset; 2687 2685 type PostCount = Unset; 2688 2686 type Actors = Unset; 2687 + type Topic = Unset; 2688 + type DisplayName = Unset; 2689 2689 } 2690 - ///State transition - sets the `topic` field to Set 2691 - pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>); 2692 - impl<S: State> sealed::Sealed for SetTopic<S> {} 2693 - impl<S: State> State for SetTopic<S> { 2694 - type Topic = Set<members::topic>; 2695 - type DisplayName = S::DisplayName; 2690 + ///State transition - sets the `started_at` field to Set 2691 + pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>); 2692 + impl<S: State> sealed::Sealed for SetStartedAt<S> {} 2693 + impl<S: State> State for SetStartedAt<S> { 2694 + type StartedAt = Set<members::started_at>; 2696 2695 type Link = S::Link; 2697 - type StartedAt = S::StartedAt; 2698 2696 type PostCount = S::PostCount; 2699 2697 type Actors = S::Actors; 2700 - } 2701 - ///State transition - sets the `display_name` field to Set 2702 - pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 2703 - impl<S: State> sealed::Sealed for SetDisplayName<S> {} 2704 - impl<S: State> State for SetDisplayName<S> { 2705 2698 type Topic = S::Topic; 2706 - type DisplayName = Set<members::display_name>; 2707 - type Link = S::Link; 2708 - type StartedAt = S::StartedAt; 2709 - type PostCount = S::PostCount; 2710 - type Actors = S::Actors; 2699 + type DisplayName = S::DisplayName; 2711 2700 } 2712 2701 ///State transition - sets the `link` field to Set 2713 2702 pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 2714 2703 impl<S: State> sealed::Sealed for SetLink<S> {} 2715 2704 impl<S: State> State for SetLink<S> { 2716 - type Topic = S::Topic; 2717 - type DisplayName = S::DisplayName; 2705 + type StartedAt = S::StartedAt; 2718 2706 type Link = Set<members::link>; 2719 - type StartedAt = S::StartedAt; 2720 2707 type PostCount = S::PostCount; 2721 2708 type Actors = S::Actors; 2722 - } 2723 - ///State transition - sets the `started_at` field to Set 2724 - pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>); 2725 - impl<S: State> sealed::Sealed for SetStartedAt<S> {} 2726 - impl<S: State> State for SetStartedAt<S> { 2727 2709 type Topic = S::Topic; 2728 2710 type DisplayName = S::DisplayName; 2729 - type Link = S::Link; 2730 - type StartedAt = Set<members::started_at>; 2731 - type PostCount = S::PostCount; 2732 - type Actors = S::Actors; 2733 2711 } 2734 2712 ///State transition - sets the `post_count` field to Set 2735 2713 pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>); 2736 2714 impl<S: State> sealed::Sealed for SetPostCount<S> {} 2737 2715 impl<S: State> State for SetPostCount<S> { 2738 - type Topic = S::Topic; 2739 - type DisplayName = S::DisplayName; 2716 + type StartedAt = S::StartedAt; 2740 2717 type Link = S::Link; 2741 - type StartedAt = S::StartedAt; 2742 2718 type PostCount = Set<members::post_count>; 2743 2719 type Actors = S::Actors; 2720 + type Topic = S::Topic; 2721 + type DisplayName = S::DisplayName; 2744 2722 } 2745 2723 ///State transition - sets the `actors` field to Set 2746 2724 pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>); 2747 2725 impl<S: State> sealed::Sealed for SetActors<S> {} 2748 2726 impl<S: State> State for SetActors<S> { 2727 + type StartedAt = S::StartedAt; 2728 + type Link = S::Link; 2729 + type PostCount = S::PostCount; 2730 + type Actors = Set<members::actors>; 2749 2731 type Topic = S::Topic; 2750 2732 type DisplayName = S::DisplayName; 2733 + } 2734 + ///State transition - sets the `topic` field to Set 2735 + pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>); 2736 + impl<S: State> sealed::Sealed for SetTopic<S> {} 2737 + impl<S: State> State for SetTopic<S> { 2738 + type StartedAt = S::StartedAt; 2751 2739 type Link = S::Link; 2740 + type PostCount = S::PostCount; 2741 + type Actors = S::Actors; 2742 + type Topic = Set<members::topic>; 2743 + type DisplayName = S::DisplayName; 2744 + } 2745 + ///State transition - sets the `display_name` field to Set 2746 + pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 2747 + impl<S: State> sealed::Sealed for SetDisplayName<S> {} 2748 + impl<S: State> State for SetDisplayName<S> { 2752 2749 type StartedAt = S::StartedAt; 2750 + type Link = S::Link; 2753 2751 type PostCount = S::PostCount; 2754 - type Actors = Set<members::actors>; 2752 + type Actors = S::Actors; 2753 + type Topic = S::Topic; 2754 + type DisplayName = Set<members::display_name>; 2755 2755 } 2756 2756 /// Marker types for field names 2757 2757 #[allow(non_camel_case_types)] 2758 2758 pub mod members { 2759 - ///Marker type for the `topic` field 2760 - pub struct topic(()); 2761 - ///Marker type for the `display_name` field 2762 - pub struct display_name(()); 2763 - ///Marker type for the `link` field 2764 - pub struct link(()); 2765 2759 ///Marker type for the `started_at` field 2766 2760 pub struct started_at(()); 2761 + ///Marker type for the `link` field 2762 + pub struct link(()); 2767 2763 ///Marker type for the `post_count` field 2768 2764 pub struct post_count(()); 2769 2765 ///Marker type for the `actors` field 2770 2766 pub struct actors(()); 2767 + ///Marker type for the `topic` field 2768 + pub struct topic(()); 2769 + ///Marker type for the `display_name` field 2770 + pub struct display_name(()); 2771 2771 } 2772 2772 } 2773 2773 ··· 2954 2954 impl<'a, S> TrendViewBuilder<'a, S> 2955 2955 where 2956 2956 S: trend_view_state::State, 2957 - S::Topic: trend_view_state::IsSet, 2958 - S::DisplayName: trend_view_state::IsSet, 2959 - S::Link: trend_view_state::IsSet, 2960 2957 S::StartedAt: trend_view_state::IsSet, 2958 + S::Link: trend_view_state::IsSet, 2961 2959 S::PostCount: trend_view_state::IsSet, 2962 2960 S::Actors: trend_view_state::IsSet, 2961 + S::Topic: trend_view_state::IsSet, 2962 + S::DisplayName: trend_view_state::IsSet, 2963 2963 { 2964 2964 /// Build the final struct 2965 2965 pub fn build(self) -> TrendView<'a> {
+24 -24
crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs
··· 189 189 } 190 190 /// State trait tracking which required fields have been set 191 191 pub trait State: sealed::Sealed { 192 - type Uri; 193 - type Depth; 194 192 type Value; 193 + type Depth; 194 + type Uri; 195 195 } 196 196 /// Empty state - all required fields are unset 197 197 pub struct Empty(()); 198 198 impl sealed::Sealed for Empty {} 199 199 impl State for Empty { 200 + type Value = Unset; 201 + type Depth = Unset; 200 202 type Uri = Unset; 201 - type Depth = Unset; 202 - type Value = Unset; 203 203 } 204 - ///State transition - sets the `uri` field to Set 205 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 206 - impl<S: State> sealed::Sealed for SetUri<S> {} 207 - impl<S: State> State for SetUri<S> { 208 - type Uri = Set<members::uri>; 204 + ///State transition - sets the `value` field to Set 205 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 206 + impl<S: State> sealed::Sealed for SetValue<S> {} 207 + impl<S: State> State for SetValue<S> { 208 + type Value = Set<members::value>; 209 209 type Depth = S::Depth; 210 - type Value = S::Value; 210 + type Uri = S::Uri; 211 211 } 212 212 ///State transition - sets the `depth` field to Set 213 213 pub struct SetDepth<S: State = Empty>(PhantomData<fn() -> S>); 214 214 impl<S: State> sealed::Sealed for SetDepth<S> {} 215 215 impl<S: State> State for SetDepth<S> { 216 - type Uri = S::Uri; 217 - type Depth = Set<members::depth>; 218 216 type Value = S::Value; 217 + type Depth = Set<members::depth>; 218 + type Uri = S::Uri; 219 219 } 220 - ///State transition - sets the `value` field to Set 221 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 222 - impl<S: State> sealed::Sealed for SetValue<S> {} 223 - impl<S: State> State for SetValue<S> { 224 - type Uri = S::Uri; 220 + ///State transition - sets the `uri` field to Set 221 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 222 + impl<S: State> sealed::Sealed for SetUri<S> {} 223 + impl<S: State> State for SetUri<S> { 224 + type Value = S::Value; 225 225 type Depth = S::Depth; 226 - type Value = Set<members::value>; 226 + type Uri = Set<members::uri>; 227 227 } 228 228 /// Marker types for field names 229 229 #[allow(non_camel_case_types)] 230 230 pub mod members { 231 + ///Marker type for the `value` field 232 + pub struct value(()); 233 + ///Marker type for the `depth` field 234 + pub struct depth(()); 231 235 ///Marker type for the `uri` field 232 236 pub struct uri(()); 233 - ///Marker type for the `depth` field 234 - pub struct depth(()); 235 - ///Marker type for the `value` field 236 - pub struct value(()); 237 237 } 238 238 } 239 239 ··· 326 326 impl<'a, S> ThreadItemBuilder<'a, S> 327 327 where 328 328 S: thread_item_state::State, 329 - S::Uri: thread_item_state::IsSet, 330 - S::Depth: thread_item_state::IsSet, 331 329 S::Value: thread_item_state::IsSet, 330 + S::Depth: thread_item_state::IsSet, 331 + S::Uri: thread_item_state::IsSet, 332 332 { 333 333 /// Build the final struct 334 334 pub fn build(self) -> ThreadItem<'a> {
+15 -15
crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs
··· 91 91 /// State trait tracking which required fields have been set 92 92 pub trait State: sealed::Sealed { 93 93 type Tag; 94 - type SubjectType; 95 94 type Subject; 95 + type SubjectType; 96 96 } 97 97 /// Empty state - all required fields are unset 98 98 pub struct Empty(()); 99 99 impl sealed::Sealed for Empty {} 100 100 impl State for Empty { 101 101 type Tag = Unset; 102 - type SubjectType = Unset; 103 102 type Subject = Unset; 103 + type SubjectType = Unset; 104 104 } 105 105 ///State transition - sets the `tag` field to Set 106 106 pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 107 107 impl<S: State> sealed::Sealed for SetTag<S> {} 108 108 impl<S: State> State for SetTag<S> { 109 109 type Tag = Set<members::tag>; 110 - type SubjectType = S::SubjectType; 111 110 type Subject = S::Subject; 112 - } 113 - ///State transition - sets the `subject_type` field to Set 114 - pub struct SetSubjectType<S: State = Empty>(PhantomData<fn() -> S>); 115 - impl<S: State> sealed::Sealed for SetSubjectType<S> {} 116 - impl<S: State> State for SetSubjectType<S> { 117 - type Tag = S::Tag; 118 - type SubjectType = Set<members::subject_type>; 119 - type Subject = S::Subject; 111 + type SubjectType = S::SubjectType; 120 112 } 121 113 ///State transition - sets the `subject` field to Set 122 114 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 123 115 impl<S: State> sealed::Sealed for SetSubject<S> {} 124 116 impl<S: State> State for SetSubject<S> { 125 117 type Tag = S::Tag; 126 - type SubjectType = S::SubjectType; 127 118 type Subject = Set<members::subject>; 119 + type SubjectType = S::SubjectType; 120 + } 121 + ///State transition - sets the `subject_type` field to Set 122 + pub struct SetSubjectType<S: State = Empty>(PhantomData<fn() -> S>); 123 + impl<S: State> sealed::Sealed for SetSubjectType<S> {} 124 + impl<S: State> State for SetSubjectType<S> { 125 + type Tag = S::Tag; 126 + type Subject = S::Subject; 127 + type SubjectType = Set<members::subject_type>; 128 128 } 129 129 /// Marker types for field names 130 130 #[allow(non_camel_case_types)] 131 131 pub mod members { 132 132 ///Marker type for the `tag` field 133 133 pub struct tag(()); 134 + ///Marker type for the `subject` field 135 + pub struct subject(()); 134 136 ///Marker type for the `subject_type` field 135 137 pub struct subject_type(()); 136 - ///Marker type for the `subject` field 137 - pub struct subject(()); 138 138 } 139 139 } 140 140 ··· 228 228 where 229 229 S: suggestion_state::State, 230 230 S::Tag: suggestion_state::IsSet, 231 - S::SubjectType: suggestion_state::IsSet, 232 231 S::Subject: suggestion_state::IsSet, 232 + S::SubjectType: suggestion_state::IsSet, 233 233 { 234 234 /// Build the final struct 235 235 pub fn build(self) -> Suggestion<'a> {
+15 -15
crates/weaver-api/src/app_bsky/video.rs
··· 52 52 } 53 53 /// State trait tracking which required fields have been set 54 54 pub trait State: sealed::Sealed { 55 - type JobId; 56 55 type Did; 56 + type JobId; 57 57 type State; 58 58 } 59 59 /// Empty state - all required fields are unset 60 60 pub struct Empty(()); 61 61 impl sealed::Sealed for Empty {} 62 62 impl State for Empty { 63 - type JobId = Unset; 64 63 type Did = Unset; 64 + type JobId = Unset; 65 65 type State = Unset; 66 66 } 67 - ///State transition - sets the `job_id` field to Set 68 - pub struct SetJobId<S: State = Empty>(PhantomData<fn() -> S>); 69 - impl<S: State> sealed::Sealed for SetJobId<S> {} 70 - impl<S: State> State for SetJobId<S> { 71 - type JobId = Set<members::job_id>; 72 - type Did = S::Did; 73 - type State = S::State; 74 - } 75 67 ///State transition - sets the `did` field to Set 76 68 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 77 69 impl<S: State> sealed::Sealed for SetDid<S> {} 78 70 impl<S: State> State for SetDid<S> { 79 - type JobId = S::JobId; 80 71 type Did = Set<members::did>; 72 + type JobId = S::JobId; 73 + type State = S::State; 74 + } 75 + ///State transition - sets the `job_id` field to Set 76 + pub struct SetJobId<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetJobId<S> {} 78 + impl<S: State> State for SetJobId<S> { 79 + type Did = S::Did; 80 + type JobId = Set<members::job_id>; 81 81 type State = S::State; 82 82 } 83 83 ///State transition - sets the `state` field to Set 84 84 pub struct SetState<S: State = Empty>(PhantomData<fn() -> S>); 85 85 impl<S: State> sealed::Sealed for SetState<S> {} 86 86 impl<S: State> State for SetState<S> { 87 - type JobId = S::JobId; 88 87 type Did = S::Did; 88 + type JobId = S::JobId; 89 89 type State = Set<members::state>; 90 90 } 91 91 /// Marker types for field names 92 92 #[allow(non_camel_case_types)] 93 93 pub mod members { 94 + ///Marker type for the `did` field 95 + pub struct did(()); 94 96 ///Marker type for the `job_id` field 95 97 pub struct job_id(()); 96 - ///Marker type for the `did` field 97 - pub struct did(()); 98 98 ///Marker type for the `state` field 99 99 pub struct state(()); 100 100 } ··· 257 257 impl<'a, S> JobStatusBuilder<'a, S> 258 258 where 259 259 S: job_status_state::State, 260 - S::JobId: job_status_state::IsSet, 261 260 S::Did: job_status_state::IsSet, 261 + S::JobId: job_status_state::IsSet, 262 262 S::State: job_status_state::IsSet, 263 263 { 264 264 /// Build the final struct
+13 -13
crates/weaver-api/src/chat_bsky/actor.rs
··· 58 58 } 59 59 /// State trait tracking which required fields have been set 60 60 pub trait State: sealed::Sealed { 61 - type Did; 62 61 type Handle; 62 + type Did; 63 63 } 64 64 /// Empty state - all required fields are unset 65 65 pub struct Empty(()); 66 66 impl sealed::Sealed for Empty {} 67 67 impl State for Empty { 68 - type Did = Unset; 69 68 type Handle = Unset; 70 - } 71 - ///State transition - sets the `did` field to Set 72 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 73 - impl<S: State> sealed::Sealed for SetDid<S> {} 74 - impl<S: State> State for SetDid<S> { 75 - type Did = Set<members::did>; 76 - type Handle = S::Handle; 69 + type Did = Unset; 77 70 } 78 71 ///State transition - sets the `handle` field to Set 79 72 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 80 73 impl<S: State> sealed::Sealed for SetHandle<S> {} 81 74 impl<S: State> State for SetHandle<S> { 82 - type Did = S::Did; 83 75 type Handle = Set<members::handle>; 76 + type Did = S::Did; 77 + } 78 + ///State transition - sets the `did` field to Set 79 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 80 + impl<S: State> sealed::Sealed for SetDid<S> {} 81 + impl<S: State> State for SetDid<S> { 82 + type Handle = S::Handle; 83 + type Did = Set<members::did>; 84 84 } 85 85 /// Marker types for field names 86 86 #[allow(non_camel_case_types)] 87 87 pub mod members { 88 - ///Marker type for the `did` field 89 - pub struct did(()); 90 88 ///Marker type for the `handle` field 91 89 pub struct handle(()); 90 + ///Marker type for the `did` field 91 + pub struct did(()); 92 92 } 93 93 } 94 94 ··· 305 305 impl<'a, S> ProfileViewBasicBuilder<'a, S> 306 306 where 307 307 S: profile_view_basic_state::State, 308 - S::Did: profile_view_basic_state::IsSet, 309 308 S::Handle: profile_view_basic_state::IsSet, 309 + S::Did: profile_view_basic_state::IsSet, 310 310 { 311 311 /// Build the final struct 312 312 pub fn build(self) -> ProfileViewBasic<'a> {
+206 -206
crates/weaver-api/src/chat_bsky/convo.rs
··· 66 66 } 67 67 /// State trait tracking which required fields have been set 68 68 pub trait State: sealed::Sealed { 69 - type Id; 70 69 type Rev; 70 + type Id; 71 71 type Members; 72 + type UnreadCount; 72 73 type Muted; 73 - type UnreadCount; 74 74 } 75 75 /// Empty state - all required fields are unset 76 76 pub struct Empty(()); 77 77 impl sealed::Sealed for Empty {} 78 78 impl State for Empty { 79 + type Rev = Unset; 79 80 type Id = Unset; 80 - type Rev = Unset; 81 81 type Members = Unset; 82 + type UnreadCount = Unset; 82 83 type Muted = Unset; 83 - type UnreadCount = Unset; 84 + } 85 + ///State transition - sets the `rev` field to Set 86 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 87 + impl<S: State> sealed::Sealed for SetRev<S> {} 88 + impl<S: State> State for SetRev<S> { 89 + type Rev = Set<members::rev>; 90 + type Id = S::Id; 91 + type Members = S::Members; 92 + type UnreadCount = S::UnreadCount; 93 + type Muted = S::Muted; 84 94 } 85 95 ///State transition - sets the `id` field to Set 86 96 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 87 97 impl<S: State> sealed::Sealed for SetId<S> {} 88 98 impl<S: State> State for SetId<S> { 89 - type Id = Set<members::id>; 90 99 type Rev = S::Rev; 100 + type Id = Set<members::id>; 91 101 type Members = S::Members; 92 - type Muted = S::Muted; 93 102 type UnreadCount = S::UnreadCount; 94 - } 95 - ///State transition - sets the `rev` field to Set 96 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 97 - impl<S: State> sealed::Sealed for SetRev<S> {} 98 - impl<S: State> State for SetRev<S> { 99 - type Id = S::Id; 100 - type Rev = Set<members::rev>; 101 - type Members = S::Members; 102 103 type Muted = S::Muted; 103 - type UnreadCount = S::UnreadCount; 104 104 } 105 105 ///State transition - sets the `members` field to Set 106 106 pub struct SetMembers<S: State = Empty>(PhantomData<fn() -> S>); 107 107 impl<S: State> sealed::Sealed for SetMembers<S> {} 108 108 impl<S: State> State for SetMembers<S> { 109 - type Id = S::Id; 110 109 type Rev = S::Rev; 111 - type Members = Set<members::members>; 112 - type Muted = S::Muted; 113 - type UnreadCount = S::UnreadCount; 114 - } 115 - ///State transition - sets the `muted` field to Set 116 - pub struct SetMuted<S: State = Empty>(PhantomData<fn() -> S>); 117 - impl<S: State> sealed::Sealed for SetMuted<S> {} 118 - impl<S: State> State for SetMuted<S> { 119 110 type Id = S::Id; 120 - type Rev = S::Rev; 121 - type Members = S::Members; 122 - type Muted = Set<members::muted>; 111 + type Members = Set<members::members>; 123 112 type UnreadCount = S::UnreadCount; 113 + type Muted = S::Muted; 124 114 } 125 115 ///State transition - sets the `unread_count` field to Set 126 116 pub struct SetUnreadCount<S: State = Empty>(PhantomData<fn() -> S>); 127 117 impl<S: State> sealed::Sealed for SetUnreadCount<S> {} 128 118 impl<S: State> State for SetUnreadCount<S> { 119 + type Rev = S::Rev; 129 120 type Id = S::Id; 121 + type Members = S::Members; 122 + type UnreadCount = Set<members::unread_count>; 123 + type Muted = S::Muted; 124 + } 125 + ///State transition - sets the `muted` field to Set 126 + pub struct SetMuted<S: State = Empty>(PhantomData<fn() -> S>); 127 + impl<S: State> sealed::Sealed for SetMuted<S> {} 128 + impl<S: State> State for SetMuted<S> { 130 129 type Rev = S::Rev; 130 + type Id = S::Id; 131 131 type Members = S::Members; 132 - type Muted = S::Muted; 133 - type UnreadCount = Set<members::unread_count>; 132 + type UnreadCount = S::UnreadCount; 133 + type Muted = Set<members::muted>; 134 134 } 135 135 /// Marker types for field names 136 136 #[allow(non_camel_case_types)] 137 137 pub mod members { 138 + ///Marker type for the `rev` field 139 + pub struct rev(()); 138 140 ///Marker type for the `id` field 139 141 pub struct id(()); 140 - ///Marker type for the `rev` field 141 - pub struct rev(()); 142 142 ///Marker type for the `members` field 143 143 pub struct members(()); 144 + ///Marker type for the `unread_count` field 145 + pub struct unread_count(()); 144 146 ///Marker type for the `muted` field 145 147 pub struct muted(()); 146 - ///Marker type for the `unread_count` field 147 - pub struct unread_count(()); 148 148 } 149 149 } 150 150 ··· 334 334 impl<'a, S> ConvoViewBuilder<'a, S> 335 335 where 336 336 S: convo_view_state::State, 337 - S::Id: convo_view_state::IsSet, 338 337 S::Rev: convo_view_state::IsSet, 338 + S::Id: convo_view_state::IsSet, 339 339 S::Members: convo_view_state::IsSet, 340 - S::Muted: convo_view_state::IsSet, 341 340 S::UnreadCount: convo_view_state::IsSet, 341 + S::Muted: convo_view_state::IsSet, 342 342 { 343 343 /// Build the final struct 344 344 pub fn build(self) -> ConvoView<'a> { ··· 1649 1649 /// State trait tracking which required fields have been set 1650 1650 pub trait State: sealed::Sealed { 1651 1651 type Id; 1652 - type Rev; 1653 1652 type Sender; 1654 1653 type SentAt; 1654 + type Rev; 1655 1655 } 1656 1656 /// Empty state - all required fields are unset 1657 1657 pub struct Empty(()); 1658 1658 impl sealed::Sealed for Empty {} 1659 1659 impl State for Empty { 1660 1660 type Id = Unset; 1661 - type Rev = Unset; 1662 1661 type Sender = Unset; 1663 1662 type SentAt = Unset; 1663 + type Rev = Unset; 1664 1664 } 1665 1665 ///State transition - sets the `id` field to Set 1666 1666 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 1667 1667 impl<S: State> sealed::Sealed for SetId<S> {} 1668 1668 impl<S: State> State for SetId<S> { 1669 1669 type Id = Set<members::id>; 1670 - type Rev = S::Rev; 1671 1670 type Sender = S::Sender; 1672 1671 type SentAt = S::SentAt; 1673 - } 1674 - ///State transition - sets the `rev` field to Set 1675 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1676 - impl<S: State> sealed::Sealed for SetRev<S> {} 1677 - impl<S: State> State for SetRev<S> { 1678 - type Id = S::Id; 1679 - type Rev = Set<members::rev>; 1680 - type Sender = S::Sender; 1681 - type SentAt = S::SentAt; 1672 + type Rev = S::Rev; 1682 1673 } 1683 1674 ///State transition - sets the `sender` field to Set 1684 1675 pub struct SetSender<S: State = Empty>(PhantomData<fn() -> S>); 1685 1676 impl<S: State> sealed::Sealed for SetSender<S> {} 1686 1677 impl<S: State> State for SetSender<S> { 1687 1678 type Id = S::Id; 1688 - type Rev = S::Rev; 1689 1679 type Sender = Set<members::sender>; 1690 1680 type SentAt = S::SentAt; 1681 + type Rev = S::Rev; 1691 1682 } 1692 1683 ///State transition - sets the `sent_at` field to Set 1693 1684 pub struct SetSentAt<S: State = Empty>(PhantomData<fn() -> S>); 1694 1685 impl<S: State> sealed::Sealed for SetSentAt<S> {} 1695 1686 impl<S: State> State for SetSentAt<S> { 1696 1687 type Id = S::Id; 1697 - type Rev = S::Rev; 1698 1688 type Sender = S::Sender; 1699 1689 type SentAt = Set<members::sent_at>; 1690 + type Rev = S::Rev; 1691 + } 1692 + ///State transition - sets the `rev` field to Set 1693 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1694 + impl<S: State> sealed::Sealed for SetRev<S> {} 1695 + impl<S: State> State for SetRev<S> { 1696 + type Id = S::Id; 1697 + type Sender = S::Sender; 1698 + type SentAt = S::SentAt; 1699 + type Rev = Set<members::rev>; 1700 1700 } 1701 1701 /// Marker types for field names 1702 1702 #[allow(non_camel_case_types)] 1703 1703 pub mod members { 1704 1704 ///Marker type for the `id` field 1705 1705 pub struct id(()); 1706 - ///Marker type for the `rev` field 1707 - pub struct rev(()); 1708 1706 ///Marker type for the `sender` field 1709 1707 pub struct sender(()); 1710 1708 ///Marker type for the `sent_at` field 1711 1709 pub struct sent_at(()); 1710 + ///Marker type for the `rev` field 1711 + pub struct rev(()); 1712 1712 } 1713 1713 } 1714 1714 ··· 1822 1822 where 1823 1823 S: deleted_message_view_state::State, 1824 1824 S::Id: deleted_message_view_state::IsSet, 1825 - S::Rev: deleted_message_view_state::IsSet, 1826 1825 S::Sender: deleted_message_view_state::IsSet, 1827 1826 S::SentAt: deleted_message_view_state::IsSet, 1827 + S::Rev: deleted_message_view_state::IsSet, 1828 1828 { 1829 1829 /// Build the final struct 1830 1830 pub fn build(self) -> DeletedMessageView<'a> { ··· 1939 1939 } 1940 1940 /// State trait tracking which required fields have been set 1941 1941 pub trait State: sealed::Sealed { 1942 - type Rev; 1943 - type ConvoId; 1944 1942 type Message; 1943 + type Rev; 1945 1944 type Reaction; 1945 + type ConvoId; 1946 1946 } 1947 1947 /// Empty state - all required fields are unset 1948 1948 pub struct Empty(()); 1949 1949 impl sealed::Sealed for Empty {} 1950 1950 impl State for Empty { 1951 + type Message = Unset; 1951 1952 type Rev = Unset; 1952 - type ConvoId = Unset; 1953 - type Message = Unset; 1954 1953 type Reaction = Unset; 1955 - } 1956 - ///State transition - sets the `rev` field to Set 1957 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1958 - impl<S: State> sealed::Sealed for SetRev<S> {} 1959 - impl<S: State> State for SetRev<S> { 1960 - type Rev = Set<members::rev>; 1961 - type ConvoId = S::ConvoId; 1962 - type Message = S::Message; 1963 - type Reaction = S::Reaction; 1964 - } 1965 - ///State transition - sets the `convo_id` field to Set 1966 - pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 1967 - impl<S: State> sealed::Sealed for SetConvoId<S> {} 1968 - impl<S: State> State for SetConvoId<S> { 1969 - type Rev = S::Rev; 1970 - type ConvoId = Set<members::convo_id>; 1971 - type Message = S::Message; 1972 - type Reaction = S::Reaction; 1954 + type ConvoId = Unset; 1973 1955 } 1974 1956 ///State transition - sets the `message` field to Set 1975 1957 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 1976 1958 impl<S: State> sealed::Sealed for SetMessage<S> {} 1977 1959 impl<S: State> State for SetMessage<S> { 1960 + type Message = Set<members::message>; 1978 1961 type Rev = S::Rev; 1962 + type Reaction = S::Reaction; 1979 1963 type ConvoId = S::ConvoId; 1980 - type Message = Set<members::message>; 1964 + } 1965 + ///State transition - sets the `rev` field to Set 1966 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1967 + impl<S: State> sealed::Sealed for SetRev<S> {} 1968 + impl<S: State> State for SetRev<S> { 1969 + type Message = S::Message; 1970 + type Rev = Set<members::rev>; 1981 1971 type Reaction = S::Reaction; 1972 + type ConvoId = S::ConvoId; 1982 1973 } 1983 1974 ///State transition - sets the `reaction` field to Set 1984 1975 pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 1985 1976 impl<S: State> sealed::Sealed for SetReaction<S> {} 1986 1977 impl<S: State> State for SetReaction<S> { 1978 + type Message = S::Message; 1987 1979 type Rev = S::Rev; 1980 + type Reaction = Set<members::reaction>; 1988 1981 type ConvoId = S::ConvoId; 1982 + } 1983 + ///State transition - sets the `convo_id` field to Set 1984 + pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 1985 + impl<S: State> sealed::Sealed for SetConvoId<S> {} 1986 + impl<S: State> State for SetConvoId<S> { 1989 1987 type Message = S::Message; 1990 - type Reaction = Set<members::reaction>; 1988 + type Rev = S::Rev; 1989 + type Reaction = S::Reaction; 1990 + type ConvoId = Set<members::convo_id>; 1991 1991 } 1992 1992 /// Marker types for field names 1993 1993 #[allow(non_camel_case_types)] 1994 1994 pub mod members { 1995 - ///Marker type for the `rev` field 1996 - pub struct rev(()); 1997 - ///Marker type for the `convo_id` field 1998 - pub struct convo_id(()); 1999 1995 ///Marker type for the `message` field 2000 1996 pub struct message(()); 1997 + ///Marker type for the `rev` field 1998 + pub struct rev(()); 2001 1999 ///Marker type for the `reaction` field 2002 2000 pub struct reaction(()); 2001 + ///Marker type for the `convo_id` field 2002 + pub struct convo_id(()); 2003 2003 } 2004 2004 } 2005 2005 ··· 2112 2112 impl<'a, S> LogAddReactionBuilder<'a, S> 2113 2113 where 2114 2114 S: log_add_reaction_state::State, 2115 - S::Rev: log_add_reaction_state::IsSet, 2116 - S::ConvoId: log_add_reaction_state::IsSet, 2117 2115 S::Message: log_add_reaction_state::IsSet, 2116 + S::Rev: log_add_reaction_state::IsSet, 2118 2117 S::Reaction: log_add_reaction_state::IsSet, 2118 + S::ConvoId: log_add_reaction_state::IsSet, 2119 2119 { 2120 2120 /// Build the final struct 2121 2121 pub fn build(self) -> LogAddReaction<'a> { ··· 2247 2247 } 2248 2248 /// State trait tracking which required fields have been set 2249 2249 pub trait State: sealed::Sealed { 2250 + type Message; 2250 2251 type Rev; 2251 2252 type ConvoId; 2252 - type Message; 2253 2253 } 2254 2254 /// Empty state - all required fields are unset 2255 2255 pub struct Empty(()); 2256 2256 impl sealed::Sealed for Empty {} 2257 2257 impl State for Empty { 2258 + type Message = Unset; 2258 2259 type Rev = Unset; 2259 2260 type ConvoId = Unset; 2260 - type Message = Unset; 2261 + } 2262 + ///State transition - sets the `message` field to Set 2263 + pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2264 + impl<S: State> sealed::Sealed for SetMessage<S> {} 2265 + impl<S: State> State for SetMessage<S> { 2266 + type Message = Set<members::message>; 2267 + type Rev = S::Rev; 2268 + type ConvoId = S::ConvoId; 2261 2269 } 2262 2270 ///State transition - sets the `rev` field to Set 2263 2271 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2264 2272 impl<S: State> sealed::Sealed for SetRev<S> {} 2265 2273 impl<S: State> State for SetRev<S> { 2274 + type Message = S::Message; 2266 2275 type Rev = Set<members::rev>; 2267 2276 type ConvoId = S::ConvoId; 2268 - type Message = S::Message; 2269 2277 } 2270 2278 ///State transition - sets the `convo_id` field to Set 2271 2279 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2272 2280 impl<S: State> sealed::Sealed for SetConvoId<S> {} 2273 2281 impl<S: State> State for SetConvoId<S> { 2282 + type Message = S::Message; 2274 2283 type Rev = S::Rev; 2275 2284 type ConvoId = Set<members::convo_id>; 2276 - type Message = S::Message; 2277 - } 2278 - ///State transition - sets the `message` field to Set 2279 - pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2280 - impl<S: State> sealed::Sealed for SetMessage<S> {} 2281 - impl<S: State> State for SetMessage<S> { 2282 - type Rev = S::Rev; 2283 - type ConvoId = S::ConvoId; 2284 - type Message = Set<members::message>; 2285 2285 } 2286 2286 /// Marker types for field names 2287 2287 #[allow(non_camel_case_types)] 2288 2288 pub mod members { 2289 + ///Marker type for the `message` field 2290 + pub struct message(()); 2289 2291 ///Marker type for the `rev` field 2290 2292 pub struct rev(()); 2291 2293 ///Marker type for the `convo_id` field 2292 2294 pub struct convo_id(()); 2293 - ///Marker type for the `message` field 2294 - pub struct message(()); 2295 2295 } 2296 2296 } 2297 2297 ··· 2384 2384 impl<'a, S> LogCreateMessageBuilder<'a, S> 2385 2385 where 2386 2386 S: log_create_message_state::State, 2387 + S::Message: log_create_message_state::IsSet, 2387 2388 S::Rev: log_create_message_state::IsSet, 2388 2389 S::ConvoId: log_create_message_state::IsSet, 2389 - S::Message: log_create_message_state::IsSet, 2390 2390 { 2391 2391 /// Build the final struct 2392 2392 pub fn build(self) -> LogCreateMessage<'a> { ··· 2480 2480 } 2481 2481 /// State trait tracking which required fields have been set 2482 2482 pub trait State: sealed::Sealed { 2483 - type Rev; 2484 2483 type ConvoId; 2485 2484 type Message; 2485 + type Rev; 2486 2486 } 2487 2487 /// Empty state - all required fields are unset 2488 2488 pub struct Empty(()); 2489 2489 impl sealed::Sealed for Empty {} 2490 2490 impl State for Empty { 2491 - type Rev = Unset; 2492 2491 type ConvoId = Unset; 2493 2492 type Message = Unset; 2494 - } 2495 - ///State transition - sets the `rev` field to Set 2496 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2497 - impl<S: State> sealed::Sealed for SetRev<S> {} 2498 - impl<S: State> State for SetRev<S> { 2499 - type Rev = Set<members::rev>; 2500 - type ConvoId = S::ConvoId; 2501 - type Message = S::Message; 2493 + type Rev = Unset; 2502 2494 } 2503 2495 ///State transition - sets the `convo_id` field to Set 2504 2496 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2505 2497 impl<S: State> sealed::Sealed for SetConvoId<S> {} 2506 2498 impl<S: State> State for SetConvoId<S> { 2507 - type Rev = S::Rev; 2508 2499 type ConvoId = Set<members::convo_id>; 2509 2500 type Message = S::Message; 2501 + type Rev = S::Rev; 2510 2502 } 2511 2503 ///State transition - sets the `message` field to Set 2512 2504 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2513 2505 impl<S: State> sealed::Sealed for SetMessage<S> {} 2514 2506 impl<S: State> State for SetMessage<S> { 2515 - type Rev = S::Rev; 2516 2507 type ConvoId = S::ConvoId; 2517 2508 type Message = Set<members::message>; 2509 + type Rev = S::Rev; 2510 + } 2511 + ///State transition - sets the `rev` field to Set 2512 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2513 + impl<S: State> sealed::Sealed for SetRev<S> {} 2514 + impl<S: State> State for SetRev<S> { 2515 + type ConvoId = S::ConvoId; 2516 + type Message = S::Message; 2517 + type Rev = Set<members::rev>; 2518 2518 } 2519 2519 /// Marker types for field names 2520 2520 #[allow(non_camel_case_types)] 2521 2521 pub mod members { 2522 - ///Marker type for the `rev` field 2523 - pub struct rev(()); 2524 2522 ///Marker type for the `convo_id` field 2525 2523 pub struct convo_id(()); 2526 2524 ///Marker type for the `message` field 2527 2525 pub struct message(()); 2526 + ///Marker type for the `rev` field 2527 + pub struct rev(()); 2528 2528 } 2529 2529 } 2530 2530 ··· 2617 2617 impl<'a, S> LogDeleteMessageBuilder<'a, S> 2618 2618 where 2619 2619 S: log_delete_message_state::State, 2620 - S::Rev: log_delete_message_state::IsSet, 2621 2620 S::ConvoId: log_delete_message_state::IsSet, 2622 2621 S::Message: log_delete_message_state::IsSet, 2622 + S::Rev: log_delete_message_state::IsSet, 2623 2623 { 2624 2624 /// Build the final struct 2625 2625 pub fn build(self) -> LogDeleteMessage<'a> { ··· 2785 2785 } 2786 2786 /// State trait tracking which required fields have been set 2787 2787 pub trait State: sealed::Sealed { 2788 + type Message; 2788 2789 type Rev; 2789 2790 type ConvoId; 2790 - type Message; 2791 2791 } 2792 2792 /// Empty state - all required fields are unset 2793 2793 pub struct Empty(()); 2794 2794 impl sealed::Sealed for Empty {} 2795 2795 impl State for Empty { 2796 + type Message = Unset; 2796 2797 type Rev = Unset; 2797 2798 type ConvoId = Unset; 2798 - type Message = Unset; 2799 + } 2800 + ///State transition - sets the `message` field to Set 2801 + pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2802 + impl<S: State> sealed::Sealed for SetMessage<S> {} 2803 + impl<S: State> State for SetMessage<S> { 2804 + type Message = Set<members::message>; 2805 + type Rev = S::Rev; 2806 + type ConvoId = S::ConvoId; 2799 2807 } 2800 2808 ///State transition - sets the `rev` field to Set 2801 2809 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2802 2810 impl<S: State> sealed::Sealed for SetRev<S> {} 2803 2811 impl<S: State> State for SetRev<S> { 2812 + type Message = S::Message; 2804 2813 type Rev = Set<members::rev>; 2805 2814 type ConvoId = S::ConvoId; 2806 - type Message = S::Message; 2807 2815 } 2808 2816 ///State transition - sets the `convo_id` field to Set 2809 2817 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 2810 2818 impl<S: State> sealed::Sealed for SetConvoId<S> {} 2811 2819 impl<S: State> State for SetConvoId<S> { 2812 - type Rev = S::Rev; 2813 - type ConvoId = Set<members::convo_id>; 2814 2820 type Message = S::Message; 2815 - } 2816 - ///State transition - sets the `message` field to Set 2817 - pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 2818 - impl<S: State> sealed::Sealed for SetMessage<S> {} 2819 - impl<S: State> State for SetMessage<S> { 2820 2821 type Rev = S::Rev; 2821 - type ConvoId = S::ConvoId; 2822 - type Message = Set<members::message>; 2822 + type ConvoId = Set<members::convo_id>; 2823 2823 } 2824 2824 /// Marker types for field names 2825 2825 #[allow(non_camel_case_types)] 2826 2826 pub mod members { 2827 + ///Marker type for the `message` field 2828 + pub struct message(()); 2827 2829 ///Marker type for the `rev` field 2828 2830 pub struct rev(()); 2829 2831 ///Marker type for the `convo_id` field 2830 2832 pub struct convo_id(()); 2831 - ///Marker type for the `message` field 2832 - pub struct message(()); 2833 2833 } 2834 2834 } 2835 2835 ··· 2922 2922 impl<'a, S> LogReadMessageBuilder<'a, S> 2923 2923 where 2924 2924 S: log_read_message_state::State, 2925 + S::Message: log_read_message_state::IsSet, 2925 2926 S::Rev: log_read_message_state::IsSet, 2926 2927 S::ConvoId: log_read_message_state::IsSet, 2927 - S::Message: log_read_message_state::IsSet, 2928 2928 { 2929 2929 /// Build the final struct 2930 2930 pub fn build(self) -> LogReadMessage<'a> { ··· 3020 3020 } 3021 3021 /// State trait tracking which required fields have been set 3022 3022 pub trait State: sealed::Sealed { 3023 - type Rev; 3024 3023 type ConvoId; 3025 3024 type Message; 3026 3025 type Reaction; 3026 + type Rev; 3027 3027 } 3028 3028 /// Empty state - all required fields are unset 3029 3029 pub struct Empty(()); 3030 3030 impl sealed::Sealed for Empty {} 3031 3031 impl State for Empty { 3032 - type Rev = Unset; 3033 3032 type ConvoId = Unset; 3034 3033 type Message = Unset; 3035 3034 type Reaction = Unset; 3036 - } 3037 - ///State transition - sets the `rev` field to Set 3038 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 3039 - impl<S: State> sealed::Sealed for SetRev<S> {} 3040 - impl<S: State> State for SetRev<S> { 3041 - type Rev = Set<members::rev>; 3042 - type ConvoId = S::ConvoId; 3043 - type Message = S::Message; 3044 - type Reaction = S::Reaction; 3035 + type Rev = Unset; 3045 3036 } 3046 3037 ///State transition - sets the `convo_id` field to Set 3047 3038 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 3048 3039 impl<S: State> sealed::Sealed for SetConvoId<S> {} 3049 3040 impl<S: State> State for SetConvoId<S> { 3050 - type Rev = S::Rev; 3051 3041 type ConvoId = Set<members::convo_id>; 3052 3042 type Message = S::Message; 3053 3043 type Reaction = S::Reaction; 3044 + type Rev = S::Rev; 3054 3045 } 3055 3046 ///State transition - sets the `message` field to Set 3056 3047 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 3057 3048 impl<S: State> sealed::Sealed for SetMessage<S> {} 3058 3049 impl<S: State> State for SetMessage<S> { 3059 - type Rev = S::Rev; 3060 3050 type ConvoId = S::ConvoId; 3061 3051 type Message = Set<members::message>; 3062 3052 type Reaction = S::Reaction; 3053 + type Rev = S::Rev; 3063 3054 } 3064 3055 ///State transition - sets the `reaction` field to Set 3065 3056 pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 3066 3057 impl<S: State> sealed::Sealed for SetReaction<S> {} 3067 3058 impl<S: State> State for SetReaction<S> { 3059 + type ConvoId = S::ConvoId; 3060 + type Message = S::Message; 3061 + type Reaction = Set<members::reaction>; 3068 3062 type Rev = S::Rev; 3063 + } 3064 + ///State transition - sets the `rev` field to Set 3065 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 3066 + impl<S: State> sealed::Sealed for SetRev<S> {} 3067 + impl<S: State> State for SetRev<S> { 3069 3068 type ConvoId = S::ConvoId; 3070 3069 type Message = S::Message; 3071 - type Reaction = Set<members::reaction>; 3070 + type Reaction = S::Reaction; 3071 + type Rev = Set<members::rev>; 3072 3072 } 3073 3073 /// Marker types for field names 3074 3074 #[allow(non_camel_case_types)] 3075 3075 pub mod members { 3076 - ///Marker type for the `rev` field 3077 - pub struct rev(()); 3078 3076 ///Marker type for the `convo_id` field 3079 3077 pub struct convo_id(()); 3080 3078 ///Marker type for the `message` field 3081 3079 pub struct message(()); 3082 3080 ///Marker type for the `reaction` field 3083 3081 pub struct reaction(()); 3082 + ///Marker type for the `rev` field 3083 + pub struct rev(()); 3084 3084 } 3085 3085 } 3086 3086 ··· 3193 3193 impl<'a, S> LogRemoveReactionBuilder<'a, S> 3194 3194 where 3195 3195 S: log_remove_reaction_state::State, 3196 - S::Rev: log_remove_reaction_state::IsSet, 3197 3196 S::ConvoId: log_remove_reaction_state::IsSet, 3198 3197 S::Message: log_remove_reaction_state::IsSet, 3199 3198 S::Reaction: log_remove_reaction_state::IsSet, 3199 + S::Rev: log_remove_reaction_state::IsSet, 3200 3200 { 3201 3201 /// Build the final struct 3202 3202 pub fn build(self) -> LogRemoveReaction<'a> { ··· 3326 3326 } 3327 3327 /// State trait tracking which required fields have been set 3328 3328 pub trait State: sealed::Sealed { 3329 - type Message; 3330 3329 type Reaction; 3330 + type Message; 3331 3331 } 3332 3332 /// Empty state - all required fields are unset 3333 3333 pub struct Empty(()); 3334 3334 impl sealed::Sealed for Empty {} 3335 3335 impl State for Empty { 3336 + type Reaction = Unset; 3336 3337 type Message = Unset; 3337 - type Reaction = Unset; 3338 + } 3339 + ///State transition - sets the `reaction` field to Set 3340 + pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 3341 + impl<S: State> sealed::Sealed for SetReaction<S> {} 3342 + impl<S: State> State for SetReaction<S> { 3343 + type Reaction = Set<members::reaction>; 3344 + type Message = S::Message; 3338 3345 } 3339 3346 ///State transition - sets the `message` field to Set 3340 3347 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 3341 3348 impl<S: State> sealed::Sealed for SetMessage<S> {} 3342 3349 impl<S: State> State for SetMessage<S> { 3343 - type Message = Set<members::message>; 3344 3350 type Reaction = S::Reaction; 3345 - } 3346 - ///State transition - sets the `reaction` field to Set 3347 - pub struct SetReaction<S: State = Empty>(PhantomData<fn() -> S>); 3348 - impl<S: State> sealed::Sealed for SetReaction<S> {} 3349 - impl<S: State> State for SetReaction<S> { 3350 - type Message = S::Message; 3351 - type Reaction = Set<members::reaction>; 3351 + type Message = Set<members::message>; 3352 3352 } 3353 3353 /// Marker types for field names 3354 3354 #[allow(non_camel_case_types)] 3355 3355 pub mod members { 3356 - ///Marker type for the `message` field 3357 - pub struct message(()); 3358 3356 ///Marker type for the `reaction` field 3359 3357 pub struct reaction(()); 3358 + ///Marker type for the `message` field 3359 + pub struct message(()); 3360 3360 } 3361 3361 } 3362 3362 ··· 3438 3438 impl<'a, S> MessageAndReactionViewBuilder<'a, S> 3439 3439 where 3440 3440 S: message_and_reaction_view_state::State, 3441 - S::Message: message_and_reaction_view_state::IsSet, 3442 3441 S::Reaction: message_and_reaction_view_state::IsSet, 3442 + S::Message: message_and_reaction_view_state::IsSet, 3443 3443 { 3444 3444 /// Build the final struct 3445 3445 pub fn build(self) -> MessageAndReactionView<'a> { ··· 3585 3585 } 3586 3586 /// State trait tracking which required fields have been set 3587 3587 pub trait State: sealed::Sealed { 3588 - type Did; 3589 3588 type MessageId; 3589 + type Did; 3590 3590 type ConvoId; 3591 3591 } 3592 3592 /// Empty state - all required fields are unset 3593 3593 pub struct Empty(()); 3594 3594 impl sealed::Sealed for Empty {} 3595 3595 impl State for Empty { 3596 - type Did = Unset; 3597 3596 type MessageId = Unset; 3597 + type Did = Unset; 3598 3598 type ConvoId = Unset; 3599 3599 } 3600 - ///State transition - sets the `did` field to Set 3601 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 3602 - impl<S: State> sealed::Sealed for SetDid<S> {} 3603 - impl<S: State> State for SetDid<S> { 3604 - type Did = Set<members::did>; 3605 - type MessageId = S::MessageId; 3606 - type ConvoId = S::ConvoId; 3607 - } 3608 3600 ///State transition - sets the `message_id` field to Set 3609 3601 pub struct SetMessageId<S: State = Empty>(PhantomData<fn() -> S>); 3610 3602 impl<S: State> sealed::Sealed for SetMessageId<S> {} 3611 3603 impl<S: State> State for SetMessageId<S> { 3612 - type Did = S::Did; 3613 3604 type MessageId = Set<members::message_id>; 3605 + type Did = S::Did; 3606 + type ConvoId = S::ConvoId; 3607 + } 3608 + ///State transition - sets the `did` field to Set 3609 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 3610 + impl<S: State> sealed::Sealed for SetDid<S> {} 3611 + impl<S: State> State for SetDid<S> { 3612 + type MessageId = S::MessageId; 3613 + type Did = Set<members::did>; 3614 3614 type ConvoId = S::ConvoId; 3615 3615 } 3616 3616 ///State transition - sets the `convo_id` field to Set 3617 3617 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 3618 3618 impl<S: State> sealed::Sealed for SetConvoId<S> {} 3619 3619 impl<S: State> State for SetConvoId<S> { 3620 - type Did = S::Did; 3621 3620 type MessageId = S::MessageId; 3621 + type Did = S::Did; 3622 3622 type ConvoId = Set<members::convo_id>; 3623 3623 } 3624 3624 /// Marker types for field names 3625 3625 #[allow(non_camel_case_types)] 3626 3626 pub mod members { 3627 + ///Marker type for the `message_id` field 3628 + pub struct message_id(()); 3627 3629 ///Marker type for the `did` field 3628 3630 pub struct did(()); 3629 - ///Marker type for the `message_id` field 3630 - pub struct message_id(()); 3631 3631 ///Marker type for the `convo_id` field 3632 3632 pub struct convo_id(()); 3633 3633 } ··· 3722 3722 impl<'a, S> MessageRefBuilder<'a, S> 3723 3723 where 3724 3724 S: message_ref_state::State, 3725 - S::Did: message_ref_state::IsSet, 3726 3725 S::MessageId: message_ref_state::IsSet, 3726 + S::Did: message_ref_state::IsSet, 3727 3727 S::ConvoId: message_ref_state::IsSet, 3728 3728 { 3729 3729 /// Build the final struct ··· 3813 3813 } 3814 3814 /// State trait tracking which required fields have been set 3815 3815 pub trait State: sealed::Sealed { 3816 - type Id; 3817 3816 type Rev; 3818 3817 type Text; 3819 3818 type Sender; 3819 + type Id; 3820 3820 type SentAt; 3821 3821 } 3822 3822 /// Empty state - all required fields are unset 3823 3823 pub struct Empty(()); 3824 3824 impl sealed::Sealed for Empty {} 3825 3825 impl State for Empty { 3826 - type Id = Unset; 3827 3826 type Rev = Unset; 3828 3827 type Text = Unset; 3829 3828 type Sender = Unset; 3829 + type Id = Unset; 3830 3830 type SentAt = Unset; 3831 3831 } 3832 - ///State transition - sets the `id` field to Set 3833 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 3834 - impl<S: State> sealed::Sealed for SetId<S> {} 3835 - impl<S: State> State for SetId<S> { 3836 - type Id = Set<members::id>; 3837 - type Rev = S::Rev; 3838 - type Text = S::Text; 3839 - type Sender = S::Sender; 3840 - type SentAt = S::SentAt; 3841 - } 3842 3832 ///State transition - sets the `rev` field to Set 3843 3833 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 3844 3834 impl<S: State> sealed::Sealed for SetRev<S> {} 3845 3835 impl<S: State> State for SetRev<S> { 3846 - type Id = S::Id; 3847 3836 type Rev = Set<members::rev>; 3848 3837 type Text = S::Text; 3849 3838 type Sender = S::Sender; 3839 + type Id = S::Id; 3850 3840 type SentAt = S::SentAt; 3851 3841 } 3852 3842 ///State transition - sets the `text` field to Set 3853 3843 pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>); 3854 3844 impl<S: State> sealed::Sealed for SetText<S> {} 3855 3845 impl<S: State> State for SetText<S> { 3856 - type Id = S::Id; 3857 3846 type Rev = S::Rev; 3858 3847 type Text = Set<members::text>; 3859 3848 type Sender = S::Sender; 3849 + type Id = S::Id; 3860 3850 type SentAt = S::SentAt; 3861 3851 } 3862 3852 ///State transition - sets the `sender` field to Set 3863 3853 pub struct SetSender<S: State = Empty>(PhantomData<fn() -> S>); 3864 3854 impl<S: State> sealed::Sealed for SetSender<S> {} 3865 3855 impl<S: State> State for SetSender<S> { 3856 + type Rev = S::Rev; 3857 + type Text = S::Text; 3858 + type Sender = Set<members::sender>; 3866 3859 type Id = S::Id; 3860 + type SentAt = S::SentAt; 3861 + } 3862 + ///State transition - sets the `id` field to Set 3863 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 3864 + impl<S: State> sealed::Sealed for SetId<S> {} 3865 + impl<S: State> State for SetId<S> { 3867 3866 type Rev = S::Rev; 3868 3867 type Text = S::Text; 3869 - type Sender = Set<members::sender>; 3868 + type Sender = S::Sender; 3869 + type Id = Set<members::id>; 3870 3870 type SentAt = S::SentAt; 3871 3871 } 3872 3872 ///State transition - sets the `sent_at` field to Set 3873 3873 pub struct SetSentAt<S: State = Empty>(PhantomData<fn() -> S>); 3874 3874 impl<S: State> sealed::Sealed for SetSentAt<S> {} 3875 3875 impl<S: State> State for SetSentAt<S> { 3876 - type Id = S::Id; 3877 3876 type Rev = S::Rev; 3878 3877 type Text = S::Text; 3879 3878 type Sender = S::Sender; 3879 + type Id = S::Id; 3880 3880 type SentAt = Set<members::sent_at>; 3881 3881 } 3882 3882 /// Marker types for field names 3883 3883 #[allow(non_camel_case_types)] 3884 3884 pub mod members { 3885 - ///Marker type for the `id` field 3886 - pub struct id(()); 3887 3885 ///Marker type for the `rev` field 3888 3886 pub struct rev(()); 3889 3887 ///Marker type for the `text` field 3890 3888 pub struct text(()); 3891 3889 ///Marker type for the `sender` field 3892 3890 pub struct sender(()); 3891 + ///Marker type for the `id` field 3892 + pub struct id(()); 3893 3893 ///Marker type for the `sent_at` field 3894 3894 pub struct sent_at(()); 3895 3895 } ··· 4084 4084 impl<'a, S> MessageViewBuilder<'a, S> 4085 4085 where 4086 4086 S: message_view_state::State, 4087 - S::Id: message_view_state::IsSet, 4088 4087 S::Rev: message_view_state::IsSet, 4089 4088 S::Text: message_view_state::IsSet, 4090 4089 S::Sender: message_view_state::IsSet, 4090 + S::Id: message_view_state::IsSet, 4091 4091 S::SentAt: message_view_state::IsSet, 4092 4092 { 4093 4093 /// Build the final struct ··· 4342 4342 } 4343 4343 /// State trait tracking which required fields have been set 4344 4344 pub trait State: sealed::Sealed { 4345 + type CreatedAt; 4345 4346 type Value; 4346 4347 type Sender; 4347 - type CreatedAt; 4348 4348 } 4349 4349 /// Empty state - all required fields are unset 4350 4350 pub struct Empty(()); 4351 4351 impl sealed::Sealed for Empty {} 4352 4352 impl State for Empty { 4353 + type CreatedAt = Unset; 4353 4354 type Value = Unset; 4354 4355 type Sender = Unset; 4355 - type CreatedAt = Unset; 4356 + } 4357 + ///State transition - sets the `created_at` field to Set 4358 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 4359 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 4360 + impl<S: State> State for SetCreatedAt<S> { 4361 + type CreatedAt = Set<members::created_at>; 4362 + type Value = S::Value; 4363 + type Sender = S::Sender; 4356 4364 } 4357 4365 ///State transition - sets the `value` field to Set 4358 4366 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 4359 4367 impl<S: State> sealed::Sealed for SetValue<S> {} 4360 4368 impl<S: State> State for SetValue<S> { 4369 + type CreatedAt = S::CreatedAt; 4361 4370 type Value = Set<members::value>; 4362 4371 type Sender = S::Sender; 4363 - type CreatedAt = S::CreatedAt; 4364 4372 } 4365 4373 ///State transition - sets the `sender` field to Set 4366 4374 pub struct SetSender<S: State = Empty>(PhantomData<fn() -> S>); 4367 4375 impl<S: State> sealed::Sealed for SetSender<S> {} 4368 4376 impl<S: State> State for SetSender<S> { 4377 + type CreatedAt = S::CreatedAt; 4369 4378 type Value = S::Value; 4370 4379 type Sender = Set<members::sender>; 4371 - type CreatedAt = S::CreatedAt; 4372 - } 4373 - ///State transition - sets the `created_at` field to Set 4374 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 4375 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 4376 - impl<S: State> State for SetCreatedAt<S> { 4377 - type Value = S::Value; 4378 - type Sender = S::Sender; 4379 - type CreatedAt = Set<members::created_at>; 4380 4380 } 4381 4381 /// Marker types for field names 4382 4382 #[allow(non_camel_case_types)] 4383 4383 pub mod members { 4384 + ///Marker type for the `created_at` field 4385 + pub struct created_at(()); 4384 4386 ///Marker type for the `value` field 4385 4387 pub struct value(()); 4386 4388 ///Marker type for the `sender` field 4387 4389 pub struct sender(()); 4388 - ///Marker type for the `created_at` field 4389 - pub struct created_at(()); 4390 4390 } 4391 4391 } 4392 4392 ··· 4479 4479 impl<'a, S> ReactionViewBuilder<'a, S> 4480 4480 where 4481 4481 S: reaction_view_state::State, 4482 + S::CreatedAt: reaction_view_state::IsSet, 4482 4483 S::Value: reaction_view_state::IsSet, 4483 4484 S::Sender: reaction_view_state::IsSet, 4484 - S::CreatedAt: reaction_view_state::IsSet, 4485 4485 { 4486 4486 /// Build the final struct 4487 4487 pub fn build(self) -> ReactionView<'a> {
+13 -13
crates/weaver-api/src/chat_bsky/convo/send_message.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type ConvoId; 37 36 type Message; 37 + type ConvoId; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type ConvoId = Unset; 44 43 type Message = Unset; 45 - } 46 - ///State transition - sets the `convo_id` field to Set 47 - pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetConvoId<S> {} 49 - impl<S: State> State for SetConvoId<S> { 50 - type ConvoId = Set<members::convo_id>; 51 - type Message = S::Message; 44 + type ConvoId = Unset; 52 45 } 53 46 ///State transition - sets the `message` field to Set 54 47 pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetMessage<S> {} 56 49 impl<S: State> State for SetMessage<S> { 57 - type ConvoId = S::ConvoId; 58 50 type Message = Set<members::message>; 51 + type ConvoId = S::ConvoId; 52 + } 53 + ///State transition - sets the `convo_id` field to Set 54 + pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetConvoId<S> {} 56 + impl<S: State> State for SetConvoId<S> { 57 + type Message = S::Message; 58 + type ConvoId = Set<members::convo_id>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `convo_id` field 64 - pub struct convo_id(()); 65 63 ///Marker type for the `message` field 66 64 pub struct message(()); 65 + ///Marker type for the `convo_id` field 66 + pub struct convo_id(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> SendMessageBuilder<'a, S> 137 137 where 138 138 S: send_message_state::State, 139 - S::ConvoId: send_message_state::IsSet, 140 139 S::Message: send_message_state::IsSet, 140 + S::ConvoId: send_message_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> SendMessage<'a> {
+26 -26
crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs
··· 185 185 } 186 186 /// State trait tracking which required fields have been set 187 187 pub trait State: sealed::Sealed { 188 - type MessagesSent; 189 - type MessagesReceived; 190 188 type Convos; 189 + type MessagesReceived; 190 + type MessagesSent; 191 191 type ConvosStarted; 192 192 } 193 193 /// Empty state - all required fields are unset 194 194 pub struct Empty(()); 195 195 impl sealed::Sealed for Empty {} 196 196 impl State for Empty { 197 - type MessagesSent = Unset; 198 - type MessagesReceived = Unset; 199 197 type Convos = Unset; 198 + type MessagesReceived = Unset; 199 + type MessagesSent = Unset; 200 200 type ConvosStarted = Unset; 201 201 } 202 - ///State transition - sets the `messages_sent` field to Set 203 - pub struct SetMessagesSent<S: State = Empty>(PhantomData<fn() -> S>); 204 - impl<S: State> sealed::Sealed for SetMessagesSent<S> {} 205 - impl<S: State> State for SetMessagesSent<S> { 206 - type MessagesSent = Set<members::messages_sent>; 202 + ///State transition - sets the `convos` field to Set 203 + pub struct SetConvos<S: State = Empty>(PhantomData<fn() -> S>); 204 + impl<S: State> sealed::Sealed for SetConvos<S> {} 205 + impl<S: State> State for SetConvos<S> { 206 + type Convos = Set<members::convos>; 207 207 type MessagesReceived = S::MessagesReceived; 208 - type Convos = S::Convos; 208 + type MessagesSent = S::MessagesSent; 209 209 type ConvosStarted = S::ConvosStarted; 210 210 } 211 211 ///State transition - sets the `messages_received` field to Set 212 212 pub struct SetMessagesReceived<S: State = Empty>(PhantomData<fn() -> S>); 213 213 impl<S: State> sealed::Sealed for SetMessagesReceived<S> {} 214 214 impl<S: State> State for SetMessagesReceived<S> { 215 - type MessagesSent = S::MessagesSent; 216 - type MessagesReceived = Set<members::messages_received>; 217 215 type Convos = S::Convos; 216 + type MessagesReceived = Set<members::messages_received>; 217 + type MessagesSent = S::MessagesSent; 218 218 type ConvosStarted = S::ConvosStarted; 219 219 } 220 - ///State transition - sets the `convos` field to Set 221 - pub struct SetConvos<S: State = Empty>(PhantomData<fn() -> S>); 222 - impl<S: State> sealed::Sealed for SetConvos<S> {} 223 - impl<S: State> State for SetConvos<S> { 224 - type MessagesSent = S::MessagesSent; 220 + ///State transition - sets the `messages_sent` field to Set 221 + pub struct SetMessagesSent<S: State = Empty>(PhantomData<fn() -> S>); 222 + impl<S: State> sealed::Sealed for SetMessagesSent<S> {} 223 + impl<S: State> State for SetMessagesSent<S> { 224 + type Convos = S::Convos; 225 225 type MessagesReceived = S::MessagesReceived; 226 - type Convos = Set<members::convos>; 226 + type MessagesSent = Set<members::messages_sent>; 227 227 type ConvosStarted = S::ConvosStarted; 228 228 } 229 229 ///State transition - sets the `convos_started` field to Set 230 230 pub struct SetConvosStarted<S: State = Empty>(PhantomData<fn() -> S>); 231 231 impl<S: State> sealed::Sealed for SetConvosStarted<S> {} 232 232 impl<S: State> State for SetConvosStarted<S> { 233 - type MessagesSent = S::MessagesSent; 234 - type MessagesReceived = S::MessagesReceived; 235 233 type Convos = S::Convos; 234 + type MessagesReceived = S::MessagesReceived; 235 + type MessagesSent = S::MessagesSent; 236 236 type ConvosStarted = Set<members::convos_started>; 237 237 } 238 238 /// Marker types for field names 239 239 #[allow(non_camel_case_types)] 240 240 pub mod members { 241 - ///Marker type for the `messages_sent` field 242 - pub struct messages_sent(()); 243 - ///Marker type for the `messages_received` field 244 - pub struct messages_received(()); 245 241 ///Marker type for the `convos` field 246 242 pub struct convos(()); 243 + ///Marker type for the `messages_received` field 244 + pub struct messages_received(()); 245 + ///Marker type for the `messages_sent` field 246 + pub struct messages_sent(()); 247 247 ///Marker type for the `convos_started` field 248 248 pub struct convos_started(()); 249 249 } ··· 358 358 impl<'a, S> MetadataBuilder<'a, S> 359 359 where 360 360 S: metadata_state::State, 361 - S::MessagesSent: metadata_state::IsSet, 362 - S::MessagesReceived: metadata_state::IsSet, 363 361 S::Convos: metadata_state::IsSet, 362 + S::MessagesReceived: metadata_state::IsSet, 363 + S::MessagesSent: metadata_state::IsSet, 364 364 S::ConvosStarted: metadata_state::IsSet, 365 365 { 366 366 /// Build the final struct
+28 -28
crates/weaver-api/src/com_atproto/admin.rs
··· 80 80 } 81 81 /// State trait tracking which required fields have been set 82 82 pub trait State: sealed::Sealed { 83 + type IndexedAt; 83 84 type Did; 84 85 type Handle; 85 - type IndexedAt; 86 86 } 87 87 /// Empty state - all required fields are unset 88 88 pub struct Empty(()); 89 89 impl sealed::Sealed for Empty {} 90 90 impl State for Empty { 91 + type IndexedAt = Unset; 91 92 type Did = Unset; 92 93 type Handle = Unset; 93 - type IndexedAt = Unset; 94 + } 95 + ///State transition - sets the `indexed_at` field to Set 96 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 97 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 98 + impl<S: State> State for SetIndexedAt<S> { 99 + type IndexedAt = Set<members::indexed_at>; 100 + type Did = S::Did; 101 + type Handle = S::Handle; 94 102 } 95 103 ///State transition - sets the `did` field to Set 96 104 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 97 105 impl<S: State> sealed::Sealed for SetDid<S> {} 98 106 impl<S: State> State for SetDid<S> { 107 + type IndexedAt = S::IndexedAt; 99 108 type Did = Set<members::did>; 100 109 type Handle = S::Handle; 101 - type IndexedAt = S::IndexedAt; 102 110 } 103 111 ///State transition - sets the `handle` field to Set 104 112 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 105 113 impl<S: State> sealed::Sealed for SetHandle<S> {} 106 114 impl<S: State> State for SetHandle<S> { 107 - type Did = S::Did; 108 - type Handle = Set<members::handle>; 109 115 type IndexedAt = S::IndexedAt; 110 - } 111 - ///State transition - sets the `indexed_at` field to Set 112 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 113 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 114 - impl<S: State> State for SetIndexedAt<S> { 115 116 type Did = S::Did; 116 - type Handle = S::Handle; 117 - type IndexedAt = Set<members::indexed_at>; 117 + type Handle = Set<members::handle>; 118 118 } 119 119 /// Marker types for field names 120 120 #[allow(non_camel_case_types)] 121 121 pub mod members { 122 + ///Marker type for the `indexed_at` field 123 + pub struct indexed_at(()); 122 124 ///Marker type for the `did` field 123 125 pub struct did(()); 124 126 ///Marker type for the `handle` field 125 127 pub struct handle(()); 126 - ///Marker type for the `indexed_at` field 127 - pub struct indexed_at(()); 128 128 } 129 129 } 130 130 ··· 401 401 impl<'a, S> AccountViewBuilder<'a, S> 402 402 where 403 403 S: account_view_state::State, 404 + S::IndexedAt: account_view_state::IsSet, 404 405 S::Did: account_view_state::IsSet, 405 406 S::Handle: account_view_state::IsSet, 406 - S::IndexedAt: account_view_state::IsSet, 407 407 { 408 408 /// Build the final struct 409 409 pub fn build(self) -> AccountView<'a> { ··· 907 907 } 908 908 /// State trait tracking which required fields have been set 909 909 pub trait State: sealed::Sealed { 910 - type Did; 911 910 type Cid; 911 + type Did; 912 912 } 913 913 /// Empty state - all required fields are unset 914 914 pub struct Empty(()); 915 915 impl sealed::Sealed for Empty {} 916 916 impl State for Empty { 917 - type Did = Unset; 918 917 type Cid = Unset; 919 - } 920 - ///State transition - sets the `did` field to Set 921 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 922 - impl<S: State> sealed::Sealed for SetDid<S> {} 923 - impl<S: State> State for SetDid<S> { 924 - type Did = Set<members::did>; 925 - type Cid = S::Cid; 918 + type Did = Unset; 926 919 } 927 920 ///State transition - sets the `cid` field to Set 928 921 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 929 922 impl<S: State> sealed::Sealed for SetCid<S> {} 930 923 impl<S: State> State for SetCid<S> { 931 - type Did = S::Did; 932 924 type Cid = Set<members::cid>; 925 + type Did = S::Did; 926 + } 927 + ///State transition - sets the `did` field to Set 928 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 929 + impl<S: State> sealed::Sealed for SetDid<S> {} 930 + impl<S: State> State for SetDid<S> { 931 + type Cid = S::Cid; 932 + type Did = Set<members::did>; 933 933 } 934 934 /// Marker types for field names 935 935 #[allow(non_camel_case_types)] 936 936 pub mod members { 937 - ///Marker type for the `did` field 938 - pub struct did(()); 939 937 ///Marker type for the `cid` field 940 938 pub struct cid(()); 939 + ///Marker type for the `did` field 940 + pub struct did(()); 941 941 } 942 942 } 943 943 ··· 1030 1030 impl<'a, S> RepoBlobRefBuilder<'a, S> 1031 1031 where 1032 1032 S: repo_blob_ref_state::State, 1033 - S::Did: repo_blob_ref_state::IsSet, 1034 1033 S::Cid: repo_blob_ref_state::IsSet, 1034 + S::Did: repo_blob_ref_state::IsSet, 1035 1035 { 1036 1036 /// Build the final struct 1037 1037 pub fn build(self) -> RepoBlobRef<'a> {
+15 -15
crates/weaver-api/src/com_atproto/admin/send_email.rs
··· 42 42 } 43 43 /// State trait tracking which required fields have been set 44 44 pub trait State: sealed::Sealed { 45 + type SenderDid; 45 46 type RecipientDid; 46 47 type Content; 47 - type SenderDid; 48 48 } 49 49 /// Empty state - all required fields are unset 50 50 pub struct Empty(()); 51 51 impl sealed::Sealed for Empty {} 52 52 impl State for Empty { 53 + type SenderDid = Unset; 53 54 type RecipientDid = Unset; 54 55 type Content = Unset; 55 - type SenderDid = Unset; 56 + } 57 + ///State transition - sets the `sender_did` field to Set 58 + pub struct SetSenderDid<S: State = Empty>(PhantomData<fn() -> S>); 59 + impl<S: State> sealed::Sealed for SetSenderDid<S> {} 60 + impl<S: State> State for SetSenderDid<S> { 61 + type SenderDid = Set<members::sender_did>; 62 + type RecipientDid = S::RecipientDid; 63 + type Content = S::Content; 56 64 } 57 65 ///State transition - sets the `recipient_did` field to Set 58 66 pub struct SetRecipientDid<S: State = Empty>(PhantomData<fn() -> S>); 59 67 impl<S: State> sealed::Sealed for SetRecipientDid<S> {} 60 68 impl<S: State> State for SetRecipientDid<S> { 69 + type SenderDid = S::SenderDid; 61 70 type RecipientDid = Set<members::recipient_did>; 62 71 type Content = S::Content; 63 - type SenderDid = S::SenderDid; 64 72 } 65 73 ///State transition - sets the `content` field to Set 66 74 pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 67 75 impl<S: State> sealed::Sealed for SetContent<S> {} 68 76 impl<S: State> State for SetContent<S> { 69 - type RecipientDid = S::RecipientDid; 70 - type Content = Set<members::content>; 71 77 type SenderDid = S::SenderDid; 72 - } 73 - ///State transition - sets the `sender_did` field to Set 74 - pub struct SetSenderDid<S: State = Empty>(PhantomData<fn() -> S>); 75 - impl<S: State> sealed::Sealed for SetSenderDid<S> {} 76 - impl<S: State> State for SetSenderDid<S> { 77 78 type RecipientDid = S::RecipientDid; 78 - type Content = S::Content; 79 - type SenderDid = Set<members::sender_did>; 79 + type Content = Set<members::content>; 80 80 } 81 81 /// Marker types for field names 82 82 #[allow(non_camel_case_types)] 83 83 pub mod members { 84 + ///Marker type for the `sender_did` field 85 + pub struct sender_did(()); 84 86 ///Marker type for the `recipient_did` field 85 87 pub struct recipient_did(()); 86 88 ///Marker type for the `content` field 87 89 pub struct content(()); 88 - ///Marker type for the `sender_did` field 89 - pub struct sender_did(()); 90 90 } 91 91 } 92 92 ··· 213 213 impl<'a, S> SendEmailBuilder<'a, S> 214 214 where 215 215 S: send_email_state::State, 216 + S::SenderDid: send_email_state::IsSet, 216 217 S::RecipientDid: send_email_state::IsSet, 217 218 S::Content: send_email_state::IsSet, 218 - S::SenderDid: send_email_state::IsSet, 219 219 { 220 220 /// Build the final struct 221 221 pub fn build(self) -> SendEmail<'a> {
+13 -13
crates/weaver-api/src/com_atproto/admin/update_account_password.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Did; 37 36 type Password; 37 + type Did; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Did = Unset; 44 43 type Password = Unset; 45 - } 46 - ///State transition - sets the `did` field to Set 47 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetDid<S> {} 49 - impl<S: State> State for SetDid<S> { 50 - type Did = Set<members::did>; 51 - type Password = S::Password; 44 + type Did = Unset; 52 45 } 53 46 ///State transition - sets the `password` field to Set 54 47 pub struct SetPassword<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetPassword<S> {} 56 49 impl<S: State> State for SetPassword<S> { 57 - type Did = S::Did; 58 50 type Password = Set<members::password>; 51 + type Did = S::Did; 52 + } 53 + ///State transition - sets the `did` field to Set 54 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetDid<S> {} 56 + impl<S: State> State for SetDid<S> { 57 + type Password = S::Password; 58 + type Did = Set<members::did>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `did` field 64 - pub struct did(()); 65 63 ///Marker type for the `password` field 66 64 pub struct password(()); 65 + ///Marker type for the `did` field 66 + pub struct did(()); 67 67 } 68 68 } 69 69 ··· 142 142 impl<'a, S> UpdateAccountPasswordBuilder<'a, S> 143 143 where 144 144 S: update_account_password_state::State, 145 - S::Did: update_account_password_state::IsSet, 146 145 S::Password: update_account_password_state::IsSet, 146 + S::Did: update_account_password_state::IsSet, 147 147 { 148 148 /// Build the final struct 149 149 pub fn build(self) -> UpdateAccountPassword<'a> {
+13 -13
crates/weaver-api/src/com_atproto/admin/update_account_signing_key.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Did; 38 37 type SigningKey; 38 + type Did; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type Did = Unset; 45 44 type SigningKey = Unset; 46 - } 47 - ///State transition - sets the `did` field to Set 48 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetDid<S> {} 50 - impl<S: State> State for SetDid<S> { 51 - type Did = Set<members::did>; 52 - type SigningKey = S::SigningKey; 45 + type Did = Unset; 53 46 } 54 47 ///State transition - sets the `signing_key` field to Set 55 48 pub struct SetSigningKey<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetSigningKey<S> {} 57 50 impl<S: State> State for SetSigningKey<S> { 58 - type Did = S::Did; 59 51 type SigningKey = Set<members::signing_key>; 52 + type Did = S::Did; 53 + } 54 + ///State transition - sets the `did` field to Set 55 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetDid<S> {} 57 + impl<S: State> State for SetDid<S> { 58 + type SigningKey = S::SigningKey; 59 + type Did = Set<members::did>; 60 60 } 61 61 /// Marker types for field names 62 62 #[allow(non_camel_case_types)] 63 63 pub mod members { 64 - ///Marker type for the `did` field 65 - pub struct did(()); 66 64 ///Marker type for the `signing_key` field 67 65 pub struct signing_key(()); 66 + ///Marker type for the `did` field 67 + pub struct did(()); 68 68 } 69 69 } 70 70 ··· 149 149 impl<'a, S> UpdateAccountSigningKeyBuilder<'a, S> 150 150 where 151 151 S: update_account_signing_key_state::State, 152 - S::Did: update_account_signing_key_state::IsSet, 153 152 S::SigningKey: update_account_signing_key_state::IsSet, 153 + S::Did: update_account_signing_key_state::IsSet, 154 154 { 155 155 /// Build the final struct 156 156 pub fn build(self) -> UpdateAccountSigningKey<'a> {
+61 -60
crates/weaver-api/src/com_atproto/label.rs
··· 37 37 pub neg: std::option::Option<bool>, 38 38 /// Signature of dag-cbor encoded label. 39 39 #[serde(skip_serializing_if = "std::option::Option::is_none")] 40 + #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")] 40 41 pub sig: std::option::Option<bytes::Bytes>, 41 42 /// DID of the actor who created this label. 42 43 #[serde(borrow)] ··· 62 63 } 63 64 /// State trait tracking which required fields have been set 64 65 pub trait State: sealed::Sealed { 65 - type Src; 66 - type Uri; 67 66 type Val; 67 + type Uri; 68 68 type Cts; 69 + type Src; 69 70 } 70 71 /// Empty state - all required fields are unset 71 72 pub struct Empty(()); 72 73 impl sealed::Sealed for Empty {} 73 74 impl State for Empty { 74 - type Src = Unset; 75 + type Val = Unset; 75 76 type Uri = Unset; 76 - type Val = Unset; 77 77 type Cts = Unset; 78 + type Src = Unset; 78 79 } 79 - ///State transition - sets the `src` field to Set 80 - pub struct SetSrc<S: State = Empty>(PhantomData<fn() -> S>); 81 - impl<S: State> sealed::Sealed for SetSrc<S> {} 82 - impl<S: State> State for SetSrc<S> { 83 - type Src = Set<members::src>; 80 + ///State transition - sets the `val` field to Set 81 + pub struct SetVal<S: State = Empty>(PhantomData<fn() -> S>); 82 + impl<S: State> sealed::Sealed for SetVal<S> {} 83 + impl<S: State> State for SetVal<S> { 84 + type Val = Set<members::val>; 84 85 type Uri = S::Uri; 85 - type Val = S::Val; 86 86 type Cts = S::Cts; 87 + type Src = S::Src; 87 88 } 88 89 ///State transition - sets the `uri` field to Set 89 90 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 90 91 impl<S: State> sealed::Sealed for SetUri<S> {} 91 92 impl<S: State> State for SetUri<S> { 92 - type Src = S::Src; 93 + type Val = S::Val; 93 94 type Uri = Set<members::uri>; 94 - type Val = S::Val; 95 95 type Cts = S::Cts; 96 - } 97 - ///State transition - sets the `val` field to Set 98 - pub struct SetVal<S: State = Empty>(PhantomData<fn() -> S>); 99 - impl<S: State> sealed::Sealed for SetVal<S> {} 100 - impl<S: State> State for SetVal<S> { 101 96 type Src = S::Src; 102 - type Uri = S::Uri; 103 - type Val = Set<members::val>; 104 - type Cts = S::Cts; 105 97 } 106 98 ///State transition - sets the `cts` field to Set 107 99 pub struct SetCts<S: State = Empty>(PhantomData<fn() -> S>); 108 100 impl<S: State> sealed::Sealed for SetCts<S> {} 109 101 impl<S: State> State for SetCts<S> { 110 - type Src = S::Src; 102 + type Val = S::Val; 111 103 type Uri = S::Uri; 112 - type Val = S::Val; 113 104 type Cts = Set<members::cts>; 105 + type Src = S::Src; 106 + } 107 + ///State transition - sets the `src` field to Set 108 + pub struct SetSrc<S: State = Empty>(PhantomData<fn() -> S>); 109 + impl<S: State> sealed::Sealed for SetSrc<S> {} 110 + impl<S: State> State for SetSrc<S> { 111 + type Val = S::Val; 112 + type Uri = S::Uri; 113 + type Cts = S::Cts; 114 + type Src = Set<members::src>; 114 115 } 115 116 /// Marker types for field names 116 117 #[allow(non_camel_case_types)] 117 118 pub mod members { 118 - ///Marker type for the `src` field 119 - pub struct src(()); 119 + ///Marker type for the `val` field 120 + pub struct val(()); 120 121 ///Marker type for the `uri` field 121 122 pub struct uri(()); 122 - ///Marker type for the `val` field 123 - pub struct val(()); 124 123 ///Marker type for the `cts` field 125 124 pub struct cts(()); 125 + ///Marker type for the `src` field 126 + pub struct src(()); 126 127 } 127 128 } 128 129 ··· 327 328 impl<'a, S> LabelBuilder<'a, S> 328 329 where 329 330 S: label_state::State, 330 - S::Src: label_state::IsSet, 331 - S::Uri: label_state::IsSet, 332 331 S::Val: label_state::IsSet, 332 + S::Uri: label_state::IsSet, 333 333 S::Cts: label_state::IsSet, 334 + S::Src: label_state::IsSet, 334 335 { 335 336 /// Build the final struct 336 337 pub fn build(self) -> Label<'a> { ··· 1052 1053 } 1053 1054 /// State trait tracking which required fields have been set 1054 1055 pub trait State: sealed::Sealed { 1055 - type Identifier; 1056 1056 type Severity; 1057 1057 type Blurs; 1058 + type Identifier; 1058 1059 type Locales; 1059 1060 } 1060 1061 /// Empty state - all required fields are unset 1061 1062 pub struct Empty(()); 1062 1063 impl sealed::Sealed for Empty {} 1063 1064 impl State for Empty { 1064 - type Identifier = Unset; 1065 1065 type Severity = Unset; 1066 1066 type Blurs = Unset; 1067 + type Identifier = Unset; 1067 1068 type Locales = Unset; 1068 1069 } 1069 - ///State transition - sets the `identifier` field to Set 1070 - pub struct SetIdentifier<S: State = Empty>(PhantomData<fn() -> S>); 1071 - impl<S: State> sealed::Sealed for SetIdentifier<S> {} 1072 - impl<S: State> State for SetIdentifier<S> { 1073 - type Identifier = Set<members::identifier>; 1074 - type Severity = S::Severity; 1075 - type Blurs = S::Blurs; 1076 - type Locales = S::Locales; 1077 - } 1078 1070 ///State transition - sets the `severity` field to Set 1079 1071 pub struct SetSeverity<S: State = Empty>(PhantomData<fn() -> S>); 1080 1072 impl<S: State> sealed::Sealed for SetSeverity<S> {} 1081 1073 impl<S: State> State for SetSeverity<S> { 1082 - type Identifier = S::Identifier; 1083 1074 type Severity = Set<members::severity>; 1084 1075 type Blurs = S::Blurs; 1076 + type Identifier = S::Identifier; 1085 1077 type Locales = S::Locales; 1086 1078 } 1087 1079 ///State transition - sets the `blurs` field to Set 1088 1080 pub struct SetBlurs<S: State = Empty>(PhantomData<fn() -> S>); 1089 1081 impl<S: State> sealed::Sealed for SetBlurs<S> {} 1090 1082 impl<S: State> State for SetBlurs<S> { 1091 - type Identifier = S::Identifier; 1092 1083 type Severity = S::Severity; 1093 1084 type Blurs = Set<members::blurs>; 1085 + type Identifier = S::Identifier; 1086 + type Locales = S::Locales; 1087 + } 1088 + ///State transition - sets the `identifier` field to Set 1089 + pub struct SetIdentifier<S: State = Empty>(PhantomData<fn() -> S>); 1090 + impl<S: State> sealed::Sealed for SetIdentifier<S> {} 1091 + impl<S: State> State for SetIdentifier<S> { 1092 + type Severity = S::Severity; 1093 + type Blurs = S::Blurs; 1094 + type Identifier = Set<members::identifier>; 1094 1095 type Locales = S::Locales; 1095 1096 } 1096 1097 ///State transition - sets the `locales` field to Set 1097 1098 pub struct SetLocales<S: State = Empty>(PhantomData<fn() -> S>); 1098 1099 impl<S: State> sealed::Sealed for SetLocales<S> {} 1099 1100 impl<S: State> State for SetLocales<S> { 1100 - type Identifier = S::Identifier; 1101 1101 type Severity = S::Severity; 1102 1102 type Blurs = S::Blurs; 1103 + type Identifier = S::Identifier; 1103 1104 type Locales = Set<members::locales>; 1104 1105 } 1105 1106 /// Marker types for field names 1106 1107 #[allow(non_camel_case_types)] 1107 1108 pub mod members { 1108 - ///Marker type for the `identifier` field 1109 - pub struct identifier(()); 1110 1109 ///Marker type for the `severity` field 1111 1110 pub struct severity(()); 1112 1111 ///Marker type for the `blurs` field 1113 1112 pub struct blurs(()); 1113 + ///Marker type for the `identifier` field 1114 + pub struct identifier(()); 1114 1115 ///Marker type for the `locales` field 1115 1116 pub struct locales(()); 1116 1117 } ··· 1267 1268 impl<'a, S> LabelValueDefinitionBuilder<'a, S> 1268 1269 where 1269 1270 S: label_value_definition_state::State, 1270 - S::Identifier: label_value_definition_state::IsSet, 1271 1271 S::Severity: label_value_definition_state::IsSet, 1272 1272 S::Blurs: label_value_definition_state::IsSet, 1273 + S::Identifier: label_value_definition_state::IsSet, 1273 1274 S::Locales: label_value_definition_state::IsSet, 1274 1275 { 1275 1276 /// Build the final struct ··· 1387 1388 /// State trait tracking which required fields have been set 1388 1389 pub trait State: sealed::Sealed { 1389 1390 type Lang; 1390 - type Name; 1391 1391 type Description; 1392 + type Name; 1392 1393 } 1393 1394 /// Empty state - all required fields are unset 1394 1395 pub struct Empty(()); 1395 1396 impl sealed::Sealed for Empty {} 1396 1397 impl State for Empty { 1397 1398 type Lang = Unset; 1398 - type Name = Unset; 1399 1399 type Description = Unset; 1400 + type Name = Unset; 1400 1401 } 1401 1402 ///State transition - sets the `lang` field to Set 1402 1403 pub struct SetLang<S: State = Empty>(PhantomData<fn() -> S>); 1403 1404 impl<S: State> sealed::Sealed for SetLang<S> {} 1404 1405 impl<S: State> State for SetLang<S> { 1405 1406 type Lang = Set<members::lang>; 1406 - type Name = S::Name; 1407 1407 type Description = S::Description; 1408 - } 1409 - ///State transition - sets the `name` field to Set 1410 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1411 - impl<S: State> sealed::Sealed for SetName<S> {} 1412 - impl<S: State> State for SetName<S> { 1413 - type Lang = S::Lang; 1414 - type Name = Set<members::name>; 1415 - type Description = S::Description; 1408 + type Name = S::Name; 1416 1409 } 1417 1410 ///State transition - sets the `description` field to Set 1418 1411 pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 1419 1412 impl<S: State> sealed::Sealed for SetDescription<S> {} 1420 1413 impl<S: State> State for SetDescription<S> { 1421 1414 type Lang = S::Lang; 1422 - type Name = S::Name; 1423 1415 type Description = Set<members::description>; 1416 + type Name = S::Name; 1417 + } 1418 + ///State transition - sets the `name` field to Set 1419 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 1420 + impl<S: State> sealed::Sealed for SetName<S> {} 1421 + impl<S: State> State for SetName<S> { 1422 + type Lang = S::Lang; 1423 + type Description = S::Description; 1424 + type Name = Set<members::name>; 1424 1425 } 1425 1426 /// Marker types for field names 1426 1427 #[allow(non_camel_case_types)] 1427 1428 pub mod members { 1428 1429 ///Marker type for the `lang` field 1429 1430 pub struct lang(()); 1431 + ///Marker type for the `description` field 1432 + pub struct description(()); 1430 1433 ///Marker type for the `name` field 1431 1434 pub struct name(()); 1432 - ///Marker type for the `description` field 1433 - pub struct description(()); 1434 1435 } 1435 1436 } 1436 1437 ··· 1541 1542 where 1542 1543 S: label_value_definition_strings_state::State, 1543 1544 S::Lang: label_value_definition_strings_state::IsSet, 1544 - S::Name: label_value_definition_strings_state::IsSet, 1545 1545 S::Description: label_value_definition_strings_state::IsSet, 1546 + S::Name: label_value_definition_strings_state::IsSet, 1546 1547 { 1547 1548 /// Build the final struct 1548 1549 pub fn build(self) -> LabelValueDefinitionStrings<'a> {
+13 -13
crates/weaver-api/src/com_atproto/label/subscribe_labels.rs
··· 203 203 } 204 204 /// State trait tracking which required fields have been set 205 205 pub trait State: sealed::Sealed { 206 - type Seq; 207 206 type Labels; 207 + type Seq; 208 208 } 209 209 /// Empty state - all required fields are unset 210 210 pub struct Empty(()); 211 211 impl sealed::Sealed for Empty {} 212 212 impl State for Empty { 213 - type Seq = Unset; 214 213 type Labels = Unset; 215 - } 216 - ///State transition - sets the `seq` field to Set 217 - pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 218 - impl<S: State> sealed::Sealed for SetSeq<S> {} 219 - impl<S: State> State for SetSeq<S> { 220 - type Seq = Set<members::seq>; 221 - type Labels = S::Labels; 214 + type Seq = Unset; 222 215 } 223 216 ///State transition - sets the `labels` field to Set 224 217 pub struct SetLabels<S: State = Empty>(PhantomData<fn() -> S>); 225 218 impl<S: State> sealed::Sealed for SetLabels<S> {} 226 219 impl<S: State> State for SetLabels<S> { 227 - type Seq = S::Seq; 228 220 type Labels = Set<members::labels>; 221 + type Seq = S::Seq; 222 + } 223 + ///State transition - sets the `seq` field to Set 224 + pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 225 + impl<S: State> sealed::Sealed for SetSeq<S> {} 226 + impl<S: State> State for SetSeq<S> { 227 + type Labels = S::Labels; 228 + type Seq = Set<members::seq>; 229 229 } 230 230 /// Marker types for field names 231 231 #[allow(non_camel_case_types)] 232 232 pub mod members { 233 - ///Marker type for the `seq` field 234 - pub struct seq(()); 235 233 ///Marker type for the `labels` field 236 234 pub struct labels(()); 235 + ///Marker type for the `seq` field 236 + pub struct seq(()); 237 237 } 238 238 } 239 239 ··· 306 306 impl<'a, S> LabelsBuilder<'a, S> 307 307 where 308 308 S: labels_state::State, 309 - S::Seq: labels_state::IsSet, 310 309 S::Labels: labels_state::IsSet, 310 + S::Seq: labels_state::IsSet, 311 311 { 312 312 /// Build the final struct 313 313 pub fn build(self) -> Labels<'a> {
+13 -13
crates/weaver-api/src/com_atproto/moderation/create_report.rs
··· 43 43 } 44 44 /// State trait tracking which required fields have been set 45 45 pub trait State: sealed::Sealed { 46 - type ReasonType; 47 46 type Subject; 47 + type ReasonType; 48 48 } 49 49 /// Empty state - all required fields are unset 50 50 pub struct Empty(()); 51 51 impl sealed::Sealed for Empty {} 52 52 impl State for Empty { 53 - type ReasonType = Unset; 54 53 type Subject = Unset; 55 - } 56 - ///State transition - sets the `reason_type` field to Set 57 - pub struct SetReasonType<S: State = Empty>(PhantomData<fn() -> S>); 58 - impl<S: State> sealed::Sealed for SetReasonType<S> {} 59 - impl<S: State> State for SetReasonType<S> { 60 - type ReasonType = Set<members::reason_type>; 61 - type Subject = S::Subject; 54 + type ReasonType = Unset; 62 55 } 63 56 ///State transition - sets the `subject` field to Set 64 57 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 65 58 impl<S: State> sealed::Sealed for SetSubject<S> {} 66 59 impl<S: State> State for SetSubject<S> { 67 - type ReasonType = S::ReasonType; 68 60 type Subject = Set<members::subject>; 61 + type ReasonType = S::ReasonType; 62 + } 63 + ///State transition - sets the `reason_type` field to Set 64 + pub struct SetReasonType<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetReasonType<S> {} 66 + impl<S: State> State for SetReasonType<S> { 67 + type Subject = S::Subject; 68 + type ReasonType = Set<members::reason_type>; 69 69 } 70 70 /// Marker types for field names 71 71 #[allow(non_camel_case_types)] 72 72 pub mod members { 73 - ///Marker type for the `reason_type` field 74 - pub struct reason_type(()); 75 73 ///Marker type for the `subject` field 76 74 pub struct subject(()); 75 + ///Marker type for the `reason_type` field 76 + pub struct reason_type(()); 77 77 } 78 78 } 79 79 ··· 187 187 impl<'a, S> CreateReportBuilder<'a, S> 188 188 where 189 189 S: create_report_state::State, 190 - S::ReasonType: create_report_state::IsSet, 191 190 S::Subject: create_report_state::IsSet, 191 + S::ReasonType: create_report_state::IsSet, 192 192 { 193 193 /// Build the final struct 194 194 pub fn build(self) -> CreateReport<'a> {
+63 -63
crates/weaver-api/src/com_atproto/repo/apply_writes.rs
··· 42 42 } 43 43 /// State trait tracking which required fields have been set 44 44 pub trait State: sealed::Sealed { 45 - type Collection; 46 45 type Value; 46 + type Collection; 47 47 } 48 48 /// Empty state - all required fields are unset 49 49 pub struct Empty(()); 50 50 impl sealed::Sealed for Empty {} 51 51 impl State for Empty { 52 - type Collection = Unset; 53 52 type Value = Unset; 54 - } 55 - ///State transition - sets the `collection` field to Set 56 - pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 57 - impl<S: State> sealed::Sealed for SetCollection<S> {} 58 - impl<S: State> State for SetCollection<S> { 59 - type Collection = Set<members::collection>; 60 - type Value = S::Value; 53 + type Collection = Unset; 61 54 } 62 55 ///State transition - sets the `value` field to Set 63 56 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 64 57 impl<S: State> sealed::Sealed for SetValue<S> {} 65 58 impl<S: State> State for SetValue<S> { 66 - type Collection = S::Collection; 67 59 type Value = Set<members::value>; 60 + type Collection = S::Collection; 61 + } 62 + ///State transition - sets the `collection` field to Set 63 + pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetCollection<S> {} 65 + impl<S: State> State for SetCollection<S> { 66 + type Value = S::Value; 67 + type Collection = Set<members::collection>; 68 68 } 69 69 /// Marker types for field names 70 70 #[allow(non_camel_case_types)] 71 71 pub mod members { 72 - ///Marker type for the `collection` field 73 - pub struct collection(()); 74 72 ///Marker type for the `value` field 75 73 pub struct value(()); 74 + ///Marker type for the `collection` field 75 + pub struct collection(()); 76 76 } 77 77 } 78 78 ··· 179 179 impl<'a, S> CreateBuilder<'a, S> 180 180 where 181 181 S: create_state::State, 182 - S::Collection: create_state::IsSet, 183 182 S::Value: create_state::IsSet, 183 + S::Collection: create_state::IsSet, 184 184 { 185 185 /// Build the final struct 186 186 pub fn build(self) -> Create<'a> { ··· 728 728 } 729 729 /// State trait tracking which required fields have been set 730 730 pub trait State: sealed::Sealed { 731 - type Uri; 732 731 type Cid; 732 + type Uri; 733 733 } 734 734 /// Empty state - all required fields are unset 735 735 pub struct Empty(()); 736 736 impl sealed::Sealed for Empty {} 737 737 impl State for Empty { 738 + type Cid = Unset; 738 739 type Uri = Unset; 739 - type Cid = Unset; 740 + } 741 + ///State transition - sets the `cid` field to Set 742 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 743 + impl<S: State> sealed::Sealed for SetCid<S> {} 744 + impl<S: State> State for SetCid<S> { 745 + type Cid = Set<members::cid>; 746 + type Uri = S::Uri; 740 747 } 741 748 ///State transition - sets the `uri` field to Set 742 749 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 743 750 impl<S: State> sealed::Sealed for SetUri<S> {} 744 751 impl<S: State> State for SetUri<S> { 745 - type Uri = Set<members::uri>; 746 752 type Cid = S::Cid; 747 - } 748 - ///State transition - sets the `cid` field to Set 749 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 750 - impl<S: State> sealed::Sealed for SetCid<S> {} 751 - impl<S: State> State for SetCid<S> { 752 - type Uri = S::Uri; 753 - type Cid = Set<members::cid>; 753 + type Uri = Set<members::uri>; 754 754 } 755 755 /// Marker types for field names 756 756 #[allow(non_camel_case_types)] 757 757 pub mod members { 758 + ///Marker type for the `cid` field 759 + pub struct cid(()); 758 760 ///Marker type for the `uri` field 759 761 pub struct uri(()); 760 - ///Marker type for the `cid` field 761 - pub struct cid(()); 762 762 } 763 763 } 764 764 ··· 851 851 impl<'a, S> CreateResultBuilder<'a, S> 852 852 where 853 853 S: create_result_state::State, 854 - S::Uri: create_result_state::IsSet, 855 854 S::Cid: create_result_state::IsSet, 855 + S::Uri: create_result_state::IsSet, 856 856 { 857 857 /// Build the final struct 858 858 pub fn build(self) -> CreateResult<'a> { ··· 1149 1149 } 1150 1150 /// State trait tracking which required fields have been set 1151 1151 pub trait State: sealed::Sealed { 1152 - type Repo; 1153 1152 type Writes; 1153 + type Repo; 1154 1154 } 1155 1155 /// Empty state - all required fields are unset 1156 1156 pub struct Empty(()); 1157 1157 impl sealed::Sealed for Empty {} 1158 1158 impl State for Empty { 1159 - type Repo = Unset; 1160 1159 type Writes = Unset; 1161 - } 1162 - ///State transition - sets the `repo` field to Set 1163 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1164 - impl<S: State> sealed::Sealed for SetRepo<S> {} 1165 - impl<S: State> State for SetRepo<S> { 1166 - type Repo = Set<members::repo>; 1167 - type Writes = S::Writes; 1160 + type Repo = Unset; 1168 1161 } 1169 1162 ///State transition - sets the `writes` field to Set 1170 1163 pub struct SetWrites<S: State = Empty>(PhantomData<fn() -> S>); 1171 1164 impl<S: State> sealed::Sealed for SetWrites<S> {} 1172 1165 impl<S: State> State for SetWrites<S> { 1166 + type Writes = Set<members::writes>; 1173 1167 type Repo = S::Repo; 1174 - type Writes = Set<members::writes>; 1168 + } 1169 + ///State transition - sets the `repo` field to Set 1170 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1171 + impl<S: State> sealed::Sealed for SetRepo<S> {} 1172 + impl<S: State> State for SetRepo<S> { 1173 + type Writes = S::Writes; 1174 + type Repo = Set<members::repo>; 1175 1175 } 1176 1176 /// Marker types for field names 1177 1177 #[allow(non_camel_case_types)] 1178 1178 pub mod members { 1179 - ///Marker type for the `repo` field 1180 - pub struct repo(()); 1181 1179 ///Marker type for the `writes` field 1182 1180 pub struct writes(()); 1181 + ///Marker type for the `repo` field 1182 + pub struct repo(()); 1183 1183 } 1184 1184 } 1185 1185 ··· 1286 1286 impl<'a, S> ApplyWritesBuilder<'a, S> 1287 1287 where 1288 1288 S: apply_writes_state::State, 1289 - S::Repo: apply_writes_state::IsSet, 1290 1289 S::Writes: apply_writes_state::IsSet, 1290 + S::Repo: apply_writes_state::IsSet, 1291 1291 { 1292 1292 /// Build the final struct 1293 1293 pub fn build(self) -> ApplyWrites<'a> { ··· 1476 1476 } 1477 1477 /// State trait tracking which required fields have been set 1478 1478 pub trait State: sealed::Sealed { 1479 - type Collection; 1480 - type Rkey; 1481 1479 type Value; 1480 + type Rkey; 1481 + type Collection; 1482 1482 } 1483 1483 /// Empty state - all required fields are unset 1484 1484 pub struct Empty(()); 1485 1485 impl sealed::Sealed for Empty {} 1486 1486 impl State for Empty { 1487 - type Collection = Unset; 1487 + type Value = Unset; 1488 1488 type Rkey = Unset; 1489 - type Value = Unset; 1489 + type Collection = Unset; 1490 1490 } 1491 - ///State transition - sets the `collection` field to Set 1492 - pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 1493 - impl<S: State> sealed::Sealed for SetCollection<S> {} 1494 - impl<S: State> State for SetCollection<S> { 1495 - type Collection = Set<members::collection>; 1491 + ///State transition - sets the `value` field to Set 1492 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1493 + impl<S: State> sealed::Sealed for SetValue<S> {} 1494 + impl<S: State> State for SetValue<S> { 1495 + type Value = Set<members::value>; 1496 1496 type Rkey = S::Rkey; 1497 - type Value = S::Value; 1497 + type Collection = S::Collection; 1498 1498 } 1499 1499 ///State transition - sets the `rkey` field to Set 1500 1500 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 1501 1501 impl<S: State> sealed::Sealed for SetRkey<S> {} 1502 1502 impl<S: State> State for SetRkey<S> { 1503 - type Collection = S::Collection; 1503 + type Value = S::Value; 1504 1504 type Rkey = Set<members::rkey>; 1505 - type Value = S::Value; 1505 + type Collection = S::Collection; 1506 1506 } 1507 - ///State transition - sets the `value` field to Set 1508 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1509 - impl<S: State> sealed::Sealed for SetValue<S> {} 1510 - impl<S: State> State for SetValue<S> { 1511 - type Collection = S::Collection; 1507 + ///State transition - sets the `collection` field to Set 1508 + pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 1509 + impl<S: State> sealed::Sealed for SetCollection<S> {} 1510 + impl<S: State> State for SetCollection<S> { 1511 + type Value = S::Value; 1512 1512 type Rkey = S::Rkey; 1513 - type Value = Set<members::value>; 1513 + type Collection = Set<members::collection>; 1514 1514 } 1515 1515 /// Marker types for field names 1516 1516 #[allow(non_camel_case_types)] 1517 1517 pub mod members { 1518 - ///Marker type for the `collection` field 1519 - pub struct collection(()); 1518 + ///Marker type for the `value` field 1519 + pub struct value(()); 1520 1520 ///Marker type for the `rkey` field 1521 1521 pub struct rkey(()); 1522 - ///Marker type for the `value` field 1523 - pub struct value(()); 1522 + ///Marker type for the `collection` field 1523 + pub struct collection(()); 1524 1524 } 1525 1525 } 1526 1526 ··· 1621 1621 impl<'a, S> UpdateBuilder<'a, S> 1622 1622 where 1623 1623 S: update_state::State, 1624 - S::Collection: update_state::IsSet, 1625 - S::Rkey: update_state::IsSet, 1626 1624 S::Value: update_state::IsSet, 1625 + S::Rkey: update_state::IsSet, 1626 + S::Collection: update_state::IsSet, 1627 1627 { 1628 1628 /// Build the final struct 1629 1629 pub fn build(self) -> Update<'a> {
+15 -15
crates/weaver-api/src/com_atproto/repo/create_record.rs
··· 54 54 /// State trait tracking which required fields have been set 55 55 pub trait State: sealed::Sealed { 56 56 type Repo; 57 - type Collection; 58 57 type Record; 58 + type Collection; 59 59 } 60 60 /// Empty state - all required fields are unset 61 61 pub struct Empty(()); 62 62 impl sealed::Sealed for Empty {} 63 63 impl State for Empty { 64 64 type Repo = Unset; 65 - type Collection = Unset; 66 65 type Record = Unset; 66 + type Collection = Unset; 67 67 } 68 68 ///State transition - sets the `repo` field to Set 69 69 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 70 70 impl<S: State> sealed::Sealed for SetRepo<S> {} 71 71 impl<S: State> State for SetRepo<S> { 72 72 type Repo = Set<members::repo>; 73 - type Collection = S::Collection; 74 73 type Record = S::Record; 75 - } 76 - ///State transition - sets the `collection` field to Set 77 - pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 78 - impl<S: State> sealed::Sealed for SetCollection<S> {} 79 - impl<S: State> State for SetCollection<S> { 80 - type Repo = S::Repo; 81 - type Collection = Set<members::collection>; 82 - type Record = S::Record; 74 + type Collection = S::Collection; 83 75 } 84 76 ///State transition - sets the `record` field to Set 85 77 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 86 78 impl<S: State> sealed::Sealed for SetRecord<S> {} 87 79 impl<S: State> State for SetRecord<S> { 88 80 type Repo = S::Repo; 89 - type Collection = S::Collection; 90 81 type Record = Set<members::record>; 82 + type Collection = S::Collection; 83 + } 84 + ///State transition - sets the `collection` field to Set 85 + pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 86 + impl<S: State> sealed::Sealed for SetCollection<S> {} 87 + impl<S: State> State for SetCollection<S> { 88 + type Repo = S::Repo; 89 + type Record = S::Record; 90 + type Collection = Set<members::collection>; 91 91 } 92 92 /// Marker types for field names 93 93 #[allow(non_camel_case_types)] 94 94 pub mod members { 95 95 ///Marker type for the `repo` field 96 96 pub struct repo(()); 97 + ///Marker type for the `record` field 98 + pub struct record(()); 97 99 ///Marker type for the `collection` field 98 100 pub struct collection(()); 99 - ///Marker type for the `record` field 100 - pub struct record(()); 101 101 } 102 102 } 103 103 ··· 259 259 where 260 260 S: create_record_state::State, 261 261 S::Repo: create_record_state::IsSet, 262 - S::Collection: create_record_state::IsSet, 263 262 S::Record: create_record_state::IsSet, 263 + S::Collection: create_record_state::IsSet, 264 264 { 265 265 /// Build the final struct 266 266 pub fn build(self) -> CreateRecord<'a> {
+15 -15
crates/weaver-api/src/com_atproto/repo/delete_record.rs
··· 48 48 } 49 49 /// State trait tracking which required fields have been set 50 50 pub trait State: sealed::Sealed { 51 - type Repo; 52 51 type Collection; 52 + type Repo; 53 53 type Rkey; 54 54 } 55 55 /// Empty state - all required fields are unset 56 56 pub struct Empty(()); 57 57 impl sealed::Sealed for Empty {} 58 58 impl State for Empty { 59 - type Repo = Unset; 60 59 type Collection = Unset; 60 + type Repo = Unset; 61 61 type Rkey = Unset; 62 62 } 63 - ///State transition - sets the `repo` field to Set 64 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 65 - impl<S: State> sealed::Sealed for SetRepo<S> {} 66 - impl<S: State> State for SetRepo<S> { 67 - type Repo = Set<members::repo>; 68 - type Collection = S::Collection; 69 - type Rkey = S::Rkey; 70 - } 71 63 ///State transition - sets the `collection` field to Set 72 64 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 73 65 impl<S: State> sealed::Sealed for SetCollection<S> {} 74 66 impl<S: State> State for SetCollection<S> { 75 - type Repo = S::Repo; 76 67 type Collection = Set<members::collection>; 68 + type Repo = S::Repo; 69 + type Rkey = S::Rkey; 70 + } 71 + ///State transition - sets the `repo` field to Set 72 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 73 + impl<S: State> sealed::Sealed for SetRepo<S> {} 74 + impl<S: State> State for SetRepo<S> { 75 + type Collection = S::Collection; 76 + type Repo = Set<members::repo>; 77 77 type Rkey = S::Rkey; 78 78 } 79 79 ///State transition - sets the `rkey` field to Set 80 80 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 81 81 impl<S: State> sealed::Sealed for SetRkey<S> {} 82 82 impl<S: State> State for SetRkey<S> { 83 - type Repo = S::Repo; 84 83 type Collection = S::Collection; 84 + type Repo = S::Repo; 85 85 type Rkey = Set<members::rkey>; 86 86 } 87 87 /// Marker types for field names 88 88 #[allow(non_camel_case_types)] 89 89 pub mod members { 90 + ///Marker type for the `collection` field 91 + pub struct collection(()); 90 92 ///Marker type for the `repo` field 91 93 pub struct repo(()); 92 - ///Marker type for the `collection` field 93 - pub struct collection(()); 94 94 ///Marker type for the `rkey` field 95 95 pub struct rkey(()); 96 96 } ··· 233 233 impl<'a, S> DeleteRecordBuilder<'a, S> 234 234 where 235 235 S: delete_record_state::State, 236 - S::Repo: delete_record_state::IsSet, 237 236 S::Collection: delete_record_state::IsSet, 237 + S::Repo: delete_record_state::IsSet, 238 238 S::Rkey: delete_record_state::IsSet, 239 239 { 240 240 /// Build the final struct
+15 -15
crates/weaver-api/src/com_atproto/repo/get_record.rs
··· 39 39 } 40 40 /// State trait tracking which required fields have been set 41 41 pub trait State: sealed::Sealed { 42 - type Repo; 43 42 type Collection; 43 + type Repo; 44 44 type Rkey; 45 45 } 46 46 /// Empty state - all required fields are unset 47 47 pub struct Empty(()); 48 48 impl sealed::Sealed for Empty {} 49 49 impl State for Empty { 50 - type Repo = Unset; 51 50 type Collection = Unset; 51 + type Repo = Unset; 52 52 type Rkey = Unset; 53 53 } 54 - ///State transition - sets the `repo` field to Set 55 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 56 - impl<S: State> sealed::Sealed for SetRepo<S> {} 57 - impl<S: State> State for SetRepo<S> { 58 - type Repo = Set<members::repo>; 59 - type Collection = S::Collection; 60 - type Rkey = S::Rkey; 61 - } 62 54 ///State transition - sets the `collection` field to Set 63 55 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 64 56 impl<S: State> sealed::Sealed for SetCollection<S> {} 65 57 impl<S: State> State for SetCollection<S> { 66 - type Repo = S::Repo; 67 58 type Collection = Set<members::collection>; 59 + type Repo = S::Repo; 60 + type Rkey = S::Rkey; 61 + } 62 + ///State transition - sets the `repo` field to Set 63 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetRepo<S> {} 65 + impl<S: State> State for SetRepo<S> { 66 + type Collection = S::Collection; 67 + type Repo = Set<members::repo>; 68 68 type Rkey = S::Rkey; 69 69 } 70 70 ///State transition - sets the `rkey` field to Set 71 71 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 72 72 impl<S: State> sealed::Sealed for SetRkey<S> {} 73 73 impl<S: State> State for SetRkey<S> { 74 - type Repo = S::Repo; 75 74 type Collection = S::Collection; 75 + type Repo = S::Repo; 76 76 type Rkey = Set<members::rkey>; 77 77 } 78 78 /// Marker types for field names 79 79 #[allow(non_camel_case_types)] 80 80 pub mod members { 81 + ///Marker type for the `collection` field 82 + pub struct collection(()); 81 83 ///Marker type for the `repo` field 82 84 pub struct repo(()); 83 - ///Marker type for the `collection` field 84 - pub struct collection(()); 85 85 ///Marker type for the `rkey` field 86 86 pub struct rkey(()); 87 87 } ··· 204 204 impl<'a, S> GetRecordBuilder<'a, S> 205 205 where 206 206 S: get_record_state::State, 207 - S::Repo: get_record_state::IsSet, 208 207 S::Collection: get_record_state::IsSet, 208 + S::Repo: get_record_state::IsSet, 209 209 S::Rkey: get_record_state::IsSet, 210 210 { 211 211 /// Build the final struct
+28 -28
crates/weaver-api/src/com_atproto/repo/list_records.rs
··· 40 40 } 41 41 /// State trait tracking which required fields have been set 42 42 pub trait State: sealed::Sealed { 43 - type Repo; 44 43 type Collection; 44 + type Repo; 45 45 } 46 46 /// Empty state - all required fields are unset 47 47 pub struct Empty(()); 48 48 impl sealed::Sealed for Empty {} 49 49 impl State for Empty { 50 - type Repo = Unset; 51 50 type Collection = Unset; 52 - } 53 - ///State transition - sets the `repo` field to Set 54 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 55 - impl<S: State> sealed::Sealed for SetRepo<S> {} 56 - impl<S: State> State for SetRepo<S> { 57 - type Repo = Set<members::repo>; 58 - type Collection = S::Collection; 51 + type Repo = Unset; 59 52 } 60 53 ///State transition - sets the `collection` field to Set 61 54 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 62 55 impl<S: State> sealed::Sealed for SetCollection<S> {} 63 56 impl<S: State> State for SetCollection<S> { 64 - type Repo = S::Repo; 65 57 type Collection = Set<members::collection>; 58 + type Repo = S::Repo; 59 + } 60 + ///State transition - sets the `repo` field to Set 61 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 62 + impl<S: State> sealed::Sealed for SetRepo<S> {} 63 + impl<S: State> State for SetRepo<S> { 64 + type Collection = S::Collection; 65 + type Repo = Set<members::repo>; 66 66 } 67 67 /// Marker types for field names 68 68 #[allow(non_camel_case_types)] 69 69 pub mod members { 70 + ///Marker type for the `collection` field 71 + pub struct collection(()); 70 72 ///Marker type for the `repo` field 71 73 pub struct repo(()); 72 - ///Marker type for the `collection` field 73 - pub struct collection(()); 74 74 } 75 75 } 76 76 ··· 188 188 impl<'a, S> ListRecordsBuilder<'a, S> 189 189 where 190 190 S: list_records_state::State, 191 - S::Repo: list_records_state::IsSet, 192 191 S::Collection: list_records_state::IsSet, 192 + S::Repo: list_records_state::IsSet, 193 193 { 194 194 /// Build the final struct 195 195 pub fn build(self) -> ListRecords<'a> { ··· 278 278 } 279 279 /// State trait tracking which required fields have been set 280 280 pub trait State: sealed::Sealed { 281 - type Uri; 282 281 type Cid; 282 + type Uri; 283 283 type Value; 284 284 } 285 285 /// Empty state - all required fields are unset 286 286 pub struct Empty(()); 287 287 impl sealed::Sealed for Empty {} 288 288 impl State for Empty { 289 - type Uri = Unset; 290 289 type Cid = Unset; 290 + type Uri = Unset; 291 291 type Value = Unset; 292 292 } 293 - ///State transition - sets the `uri` field to Set 294 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 295 - impl<S: State> sealed::Sealed for SetUri<S> {} 296 - impl<S: State> State for SetUri<S> { 297 - type Uri = Set<members::uri>; 298 - type Cid = S::Cid; 299 - type Value = S::Value; 300 - } 301 293 ///State transition - sets the `cid` field to Set 302 294 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 303 295 impl<S: State> sealed::Sealed for SetCid<S> {} 304 296 impl<S: State> State for SetCid<S> { 305 - type Uri = S::Uri; 306 297 type Cid = Set<members::cid>; 298 + type Uri = S::Uri; 299 + type Value = S::Value; 300 + } 301 + ///State transition - sets the `uri` field to Set 302 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 303 + impl<S: State> sealed::Sealed for SetUri<S> {} 304 + impl<S: State> State for SetUri<S> { 305 + type Cid = S::Cid; 306 + type Uri = Set<members::uri>; 307 307 type Value = S::Value; 308 308 } 309 309 ///State transition - sets the `value` field to Set 310 310 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 311 311 impl<S: State> sealed::Sealed for SetValue<S> {} 312 312 impl<S: State> State for SetValue<S> { 313 - type Uri = S::Uri; 314 313 type Cid = S::Cid; 314 + type Uri = S::Uri; 315 315 type Value = Set<members::value>; 316 316 } 317 317 /// Marker types for field names 318 318 #[allow(non_camel_case_types)] 319 319 pub mod members { 320 - ///Marker type for the `uri` field 321 - pub struct uri(()); 322 320 ///Marker type for the `cid` field 323 321 pub struct cid(()); 322 + ///Marker type for the `uri` field 323 + pub struct uri(()); 324 324 ///Marker type for the `value` field 325 325 pub struct value(()); 326 326 } ··· 415 415 impl<'a, S> RecordBuilder<'a, S> 416 416 where 417 417 S: record_state::State, 418 - S::Uri: record_state::IsSet, 419 418 S::Cid: record_state::IsSet, 419 + S::Uri: record_state::IsSet, 420 420 S::Value: record_state::IsSet, 421 421 { 422 422 /// Build the final struct
+26 -26
crates/weaver-api/src/com_atproto/repo/put_record.rs
··· 54 54 } 55 55 /// State trait tracking which required fields have been set 56 56 pub trait State: sealed::Sealed { 57 - type Repo; 57 + type Record; 58 58 type Collection; 59 59 type Rkey; 60 - type Record; 60 + type Repo; 61 61 } 62 62 /// Empty state - all required fields are unset 63 63 pub struct Empty(()); 64 64 impl sealed::Sealed for Empty {} 65 65 impl State for Empty { 66 - type Repo = Unset; 66 + type Record = Unset; 67 67 type Collection = Unset; 68 68 type Rkey = Unset; 69 - type Record = Unset; 69 + type Repo = Unset; 70 70 } 71 - ///State transition - sets the `repo` field to Set 72 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 73 - impl<S: State> sealed::Sealed for SetRepo<S> {} 74 - impl<S: State> State for SetRepo<S> { 75 - type Repo = Set<members::repo>; 71 + ///State transition - sets the `record` field to Set 72 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 73 + impl<S: State> sealed::Sealed for SetRecord<S> {} 74 + impl<S: State> State for SetRecord<S> { 75 + type Record = Set<members::record>; 76 76 type Collection = S::Collection; 77 77 type Rkey = S::Rkey; 78 - type Record = S::Record; 78 + type Repo = S::Repo; 79 79 } 80 80 ///State transition - sets the `collection` field to Set 81 81 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 82 82 impl<S: State> sealed::Sealed for SetCollection<S> {} 83 83 impl<S: State> State for SetCollection<S> { 84 - type Repo = S::Repo; 84 + type Record = S::Record; 85 85 type Collection = Set<members::collection>; 86 86 type Rkey = S::Rkey; 87 - type Record = S::Record; 87 + type Repo = S::Repo; 88 88 } 89 89 ///State transition - sets the `rkey` field to Set 90 90 pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 91 91 impl<S: State> sealed::Sealed for SetRkey<S> {} 92 92 impl<S: State> State for SetRkey<S> { 93 - type Repo = S::Repo; 93 + type Record = S::Record; 94 94 type Collection = S::Collection; 95 95 type Rkey = Set<members::rkey>; 96 - type Record = S::Record; 97 - } 98 - ///State transition - sets the `record` field to Set 99 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 100 - impl<S: State> sealed::Sealed for SetRecord<S> {} 101 - impl<S: State> State for SetRecord<S> { 102 96 type Repo = S::Repo; 97 + } 98 + ///State transition - sets the `repo` field to Set 99 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 100 + impl<S: State> sealed::Sealed for SetRepo<S> {} 101 + impl<S: State> State for SetRepo<S> { 102 + type Record = S::Record; 103 103 type Collection = S::Collection; 104 104 type Rkey = S::Rkey; 105 - type Record = Set<members::record>; 105 + type Repo = Set<members::repo>; 106 106 } 107 107 /// Marker types for field names 108 108 #[allow(non_camel_case_types)] 109 109 pub mod members { 110 - ///Marker type for the `repo` field 111 - pub struct repo(()); 110 + ///Marker type for the `record` field 111 + pub struct record(()); 112 112 ///Marker type for the `collection` field 113 113 pub struct collection(()); 114 114 ///Marker type for the `rkey` field 115 115 pub struct rkey(()); 116 - ///Marker type for the `record` field 117 - pub struct record(()); 116 + ///Marker type for the `repo` field 117 + pub struct repo(()); 118 118 } 119 119 } 120 120 ··· 289 289 impl<'a, S> PutRecordBuilder<'a, S> 290 290 where 291 291 S: put_record_state::State, 292 - S::Repo: put_record_state::IsSet, 292 + S::Record: put_record_state::IsSet, 293 293 S::Collection: put_record_state::IsSet, 294 294 S::Rkey: put_record_state::IsSet, 295 - S::Record: put_record_state::IsSet, 295 + S::Repo: put_record_state::IsSet, 296 296 { 297 297 /// Build the final struct 298 298 pub fn build(self) -> PutRecord<'a> {
+70 -70
crates/weaver-api/src/com_atproto/server.rs
··· 66 66 } 67 67 /// State trait tracking which required fields have been set 68 68 pub trait State: sealed::Sealed { 69 + type Disabled; 70 + type CreatedBy; 71 + type Uses; 72 + type CreatedAt; 69 73 type Code; 70 74 type Available; 71 - type Disabled; 72 75 type ForAccount; 73 - type CreatedBy; 74 - type CreatedAt; 75 - type Uses; 76 76 } 77 77 /// Empty state - all required fields are unset 78 78 pub struct Empty(()); 79 79 impl sealed::Sealed for Empty {} 80 80 impl State for Empty { 81 - type Code = Unset; 82 - type Available = Unset; 83 81 type Disabled = Unset; 84 - type ForAccount = Unset; 85 82 type CreatedBy = Unset; 86 - type CreatedAt = Unset; 87 83 type Uses = Unset; 88 - } 89 - ///State transition - sets the `code` field to Set 90 - pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 91 - impl<S: State> sealed::Sealed for SetCode<S> {} 92 - impl<S: State> State for SetCode<S> { 93 - type Code = Set<members::code>; 94 - type Available = S::Available; 95 - type Disabled = S::Disabled; 96 - type ForAccount = S::ForAccount; 97 - type CreatedBy = S::CreatedBy; 98 - type CreatedAt = S::CreatedAt; 99 - type Uses = S::Uses; 100 - } 101 - ///State transition - sets the `available` field to Set 102 - pub struct SetAvailable<S: State = Empty>(PhantomData<fn() -> S>); 103 - impl<S: State> sealed::Sealed for SetAvailable<S> {} 104 - impl<S: State> State for SetAvailable<S> { 105 - type Code = S::Code; 106 - type Available = Set<members::available>; 107 - type Disabled = S::Disabled; 108 - type ForAccount = S::ForAccount; 109 - type CreatedBy = S::CreatedBy; 110 - type CreatedAt = S::CreatedAt; 111 - type Uses = S::Uses; 84 + type CreatedAt = Unset; 85 + type Code = Unset; 86 + type Available = Unset; 87 + type ForAccount = Unset; 112 88 } 113 89 ///State transition - sets the `disabled` field to Set 114 90 pub struct SetDisabled<S: State = Empty>(PhantomData<fn() -> S>); 115 91 impl<S: State> sealed::Sealed for SetDisabled<S> {} 116 92 impl<S: State> State for SetDisabled<S> { 117 - type Code = S::Code; 118 - type Available = S::Available; 119 93 type Disabled = Set<members::disabled>; 120 - type ForAccount = S::ForAccount; 121 94 type CreatedBy = S::CreatedBy; 122 - type CreatedAt = S::CreatedAt; 123 95 type Uses = S::Uses; 124 - } 125 - ///State transition - sets the `for_account` field to Set 126 - pub struct SetForAccount<S: State = Empty>(PhantomData<fn() -> S>); 127 - impl<S: State> sealed::Sealed for SetForAccount<S> {} 128 - impl<S: State> State for SetForAccount<S> { 96 + type CreatedAt = S::CreatedAt; 129 97 type Code = S::Code; 130 98 type Available = S::Available; 131 - type Disabled = S::Disabled; 132 - type ForAccount = Set<members::for_account>; 133 - type CreatedBy = S::CreatedBy; 134 - type CreatedAt = S::CreatedAt; 135 - type Uses = S::Uses; 99 + type ForAccount = S::ForAccount; 136 100 } 137 101 ///State transition - sets the `created_by` field to Set 138 102 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 139 103 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 140 104 impl<S: State> State for SetCreatedBy<S> { 105 + type Disabled = S::Disabled; 106 + type CreatedBy = Set<members::created_by>; 107 + type Uses = S::Uses; 108 + type CreatedAt = S::CreatedAt; 141 109 type Code = S::Code; 142 110 type Available = S::Available; 143 - type Disabled = S::Disabled; 144 111 type ForAccount = S::ForAccount; 145 - type CreatedBy = Set<members::created_by>; 112 + } 113 + ///State transition - sets the `uses` field to Set 114 + pub struct SetUses<S: State = Empty>(PhantomData<fn() -> S>); 115 + impl<S: State> sealed::Sealed for SetUses<S> {} 116 + impl<S: State> State for SetUses<S> { 117 + type Disabled = S::Disabled; 118 + type CreatedBy = S::CreatedBy; 119 + type Uses = Set<members::uses>; 146 120 type CreatedAt = S::CreatedAt; 147 - type Uses = S::Uses; 121 + type Code = S::Code; 122 + type Available = S::Available; 123 + type ForAccount = S::ForAccount; 148 124 } 149 125 ///State transition - sets the `created_at` field to Set 150 126 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 151 127 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 152 128 impl<S: State> State for SetCreatedAt<S> { 129 + type Disabled = S::Disabled; 130 + type CreatedBy = S::CreatedBy; 131 + type Uses = S::Uses; 132 + type CreatedAt = Set<members::created_at>; 153 133 type Code = S::Code; 154 134 type Available = S::Available; 135 + type ForAccount = S::ForAccount; 136 + } 137 + ///State transition - sets the `code` field to Set 138 + pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 139 + impl<S: State> sealed::Sealed for SetCode<S> {} 140 + impl<S: State> State for SetCode<S> { 155 141 type Disabled = S::Disabled; 156 - type ForAccount = S::ForAccount; 157 142 type CreatedBy = S::CreatedBy; 158 - type CreatedAt = Set<members::created_at>; 159 143 type Uses = S::Uses; 160 - } 161 - ///State transition - sets the `uses` field to Set 162 - pub struct SetUses<S: State = Empty>(PhantomData<fn() -> S>); 163 - impl<S: State> sealed::Sealed for SetUses<S> {} 164 - impl<S: State> State for SetUses<S> { 165 - type Code = S::Code; 144 + type CreatedAt = S::CreatedAt; 145 + type Code = Set<members::code>; 166 146 type Available = S::Available; 147 + type ForAccount = S::ForAccount; 148 + } 149 + ///State transition - sets the `available` field to Set 150 + pub struct SetAvailable<S: State = Empty>(PhantomData<fn() -> S>); 151 + impl<S: State> sealed::Sealed for SetAvailable<S> {} 152 + impl<S: State> State for SetAvailable<S> { 167 153 type Disabled = S::Disabled; 154 + type CreatedBy = S::CreatedBy; 155 + type Uses = S::Uses; 156 + type CreatedAt = S::CreatedAt; 157 + type Code = S::Code; 158 + type Available = Set<members::available>; 168 159 type ForAccount = S::ForAccount; 160 + } 161 + ///State transition - sets the `for_account` field to Set 162 + pub struct SetForAccount<S: State = Empty>(PhantomData<fn() -> S>); 163 + impl<S: State> sealed::Sealed for SetForAccount<S> {} 164 + impl<S: State> State for SetForAccount<S> { 165 + type Disabled = S::Disabled; 169 166 type CreatedBy = S::CreatedBy; 167 + type Uses = S::Uses; 170 168 type CreatedAt = S::CreatedAt; 171 - type Uses = Set<members::uses>; 169 + type Code = S::Code; 170 + type Available = S::Available; 171 + type ForAccount = Set<members::for_account>; 172 172 } 173 173 /// Marker types for field names 174 174 #[allow(non_camel_case_types)] 175 175 pub mod members { 176 - ///Marker type for the `code` field 177 - pub struct code(()); 178 - ///Marker type for the `available` field 179 - pub struct available(()); 180 176 ///Marker type for the `disabled` field 181 177 pub struct disabled(()); 182 - ///Marker type for the `for_account` field 183 - pub struct for_account(()); 184 178 ///Marker type for the `created_by` field 185 179 pub struct created_by(()); 186 - ///Marker type for the `created_at` field 187 - pub struct created_at(()); 188 180 ///Marker type for the `uses` field 189 181 pub struct uses(()); 182 + ///Marker type for the `created_at` field 183 + pub struct created_at(()); 184 + ///Marker type for the `code` field 185 + pub struct code(()); 186 + ///Marker type for the `available` field 187 + pub struct available(()); 188 + ///Marker type for the `for_account` field 189 + pub struct for_account(()); 190 190 } 191 191 } 192 192 ··· 359 359 impl<'a, S> InviteCodeBuilder<'a, S> 360 360 where 361 361 S: invite_code_state::State, 362 - S::Code: invite_code_state::IsSet, 363 - S::Available: invite_code_state::IsSet, 364 362 S::Disabled: invite_code_state::IsSet, 365 - S::ForAccount: invite_code_state::IsSet, 366 363 S::CreatedBy: invite_code_state::IsSet, 367 - S::CreatedAt: invite_code_state::IsSet, 368 364 S::Uses: invite_code_state::IsSet, 365 + S::CreatedAt: invite_code_state::IsSet, 366 + S::Code: invite_code_state::IsSet, 367 + S::Available: invite_code_state::IsSet, 368 + S::ForAccount: invite_code_state::IsSet, 369 369 { 370 370 /// Build the final struct 371 371 pub fn build(self) -> InviteCode<'a> {
+15 -15
crates/weaver-api/src/com_atproto/server/create_app_password.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 + type CreatedAt; 39 40 type Name; 40 41 type Password; 41 - type CreatedAt; 42 42 } 43 43 /// Empty state - all required fields are unset 44 44 pub struct Empty(()); 45 45 impl sealed::Sealed for Empty {} 46 46 impl State for Empty { 47 + type CreatedAt = Unset; 47 48 type Name = Unset; 48 49 type Password = Unset; 49 - type CreatedAt = Unset; 50 + } 51 + ///State transition - sets the `created_at` field to Set 52 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 53 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 54 + impl<S: State> State for SetCreatedAt<S> { 55 + type CreatedAt = Set<members::created_at>; 56 + type Name = S::Name; 57 + type Password = S::Password; 50 58 } 51 59 ///State transition - sets the `name` field to Set 52 60 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 53 61 impl<S: State> sealed::Sealed for SetName<S> {} 54 62 impl<S: State> State for SetName<S> { 63 + type CreatedAt = S::CreatedAt; 55 64 type Name = Set<members::name>; 56 65 type Password = S::Password; 57 - type CreatedAt = S::CreatedAt; 58 66 } 59 67 ///State transition - sets the `password` field to Set 60 68 pub struct SetPassword<S: State = Empty>(PhantomData<fn() -> S>); 61 69 impl<S: State> sealed::Sealed for SetPassword<S> {} 62 70 impl<S: State> State for SetPassword<S> { 63 - type Name = S::Name; 64 - type Password = Set<members::password>; 65 71 type CreatedAt = S::CreatedAt; 66 - } 67 - ///State transition - sets the `created_at` field to Set 68 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 69 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 70 - impl<S: State> State for SetCreatedAt<S> { 71 72 type Name = S::Name; 72 - type Password = S::Password; 73 - type CreatedAt = Set<members::created_at>; 73 + type Password = Set<members::password>; 74 74 } 75 75 /// Marker types for field names 76 76 #[allow(non_camel_case_types)] 77 77 pub mod members { 78 + ///Marker type for the `created_at` field 79 + pub struct created_at(()); 78 80 ///Marker type for the `name` field 79 81 pub struct name(()); 80 82 ///Marker type for the `password` field 81 83 pub struct password(()); 82 - ///Marker type for the `created_at` field 83 - pub struct created_at(()); 84 84 } 85 85 } 86 86 ··· 187 187 impl<'a, S> AppPasswordBuilder<'a, S> 188 188 where 189 189 S: app_password_state::State, 190 + S::CreatedAt: app_password_state::IsSet, 190 191 S::Name: app_password_state::IsSet, 191 192 S::Password: app_password_state::IsSet, 192 - S::CreatedAt: app_password_state::IsSet, 193 193 { 194 194 /// Build the final struct 195 195 pub fn build(self) -> AppPassword<'a> {
+13 -13
crates/weaver-api/src/com_atproto/server/create_invite_codes.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Account; 37 36 type Codes; 37 + type Account; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Account = Unset; 44 43 type Codes = Unset; 45 - } 46 - ///State transition - sets the `account` field to Set 47 - pub struct SetAccount<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetAccount<S> {} 49 - impl<S: State> State for SetAccount<S> { 50 - type Account = Set<members::account>; 51 - type Codes = S::Codes; 44 + type Account = Unset; 52 45 } 53 46 ///State transition - sets the `codes` field to Set 54 47 pub struct SetCodes<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetCodes<S> {} 56 49 impl<S: State> State for SetCodes<S> { 57 - type Account = S::Account; 58 50 type Codes = Set<members::codes>; 51 + type Account = S::Account; 52 + } 53 + ///State transition - sets the `account` field to Set 54 + pub struct SetAccount<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetAccount<S> {} 56 + impl<S: State> State for SetAccount<S> { 57 + type Codes = S::Codes; 58 + type Account = Set<members::account>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `account` field 64 - pub struct account(()); 65 63 ///Marker type for the `codes` field 66 64 pub struct codes(()); 65 + ///Marker type for the `account` field 66 + pub struct account(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> AccountCodesBuilder<'a, S> 137 137 where 138 138 S: account_codes_state::State, 139 - S::Account: account_codes_state::IsSet, 140 139 S::Codes: account_codes_state::IsSet, 140 + S::Account: account_codes_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> AccountCodes<'a> {
+13 -13
crates/weaver-api/src/com_atproto/server/list_app_passwords.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Name; 38 37 type CreatedAt; 38 + type Name; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type Name = Unset; 45 44 type CreatedAt = Unset; 46 - } 47 - ///State transition - sets the `name` field to Set 48 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetName<S> {} 50 - impl<S: State> State for SetName<S> { 51 - type Name = Set<members::name>; 52 - type CreatedAt = S::CreatedAt; 45 + type Name = Unset; 53 46 } 54 47 ///State transition - sets the `created_at` field to Set 55 48 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 57 50 impl<S: State> State for SetCreatedAt<S> { 58 - type Name = S::Name; 59 51 type CreatedAt = Set<members::created_at>; 52 + type Name = S::Name; 53 + } 54 + ///State transition - sets the `name` field to Set 55 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetName<S> {} 57 + impl<S: State> State for SetName<S> { 58 + type CreatedAt = S::CreatedAt; 59 + type Name = Set<members::name>; 60 60 } 61 61 /// Marker types for field names 62 62 #[allow(non_camel_case_types)] 63 63 pub mod members { 64 - ///Marker type for the `name` field 65 - pub struct name(()); 66 64 ///Marker type for the `created_at` field 67 65 pub struct created_at(()); 66 + ///Marker type for the `name` field 67 + pub struct name(()); 68 68 } 69 69 } 70 70 ··· 151 151 impl<'a, S> AppPasswordBuilder<'a, S> 152 152 where 153 153 S: app_password_state::State, 154 - S::Name: app_password_state::IsSet, 155 154 S::CreatedAt: app_password_state::IsSet, 155 + S::Name: app_password_state::IsSet, 156 156 { 157 157 /// Build the final struct 158 158 pub fn build(self) -> AppPassword<'a> {
+24 -24
crates/weaver-api/src/com_atproto/sync/get_record.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Did; 40 - type Collection; 41 39 type Rkey; 40 + type Collection; 41 + type Did; 42 42 } 43 43 /// Empty state - all required fields are unset 44 44 pub struct Empty(()); 45 45 impl sealed::Sealed for Empty {} 46 46 impl State for Empty { 47 + type Rkey = Unset; 48 + type Collection = Unset; 47 49 type Did = Unset; 48 - type Collection = Unset; 49 - type Rkey = Unset; 50 50 } 51 - ///State transition - sets the `did` field to Set 52 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetDid<S> {} 54 - impl<S: State> State for SetDid<S> { 55 - type Did = Set<members::did>; 51 + ///State transition - sets the `rkey` field to Set 52 + pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 53 + impl<S: State> sealed::Sealed for SetRkey<S> {} 54 + impl<S: State> State for SetRkey<S> { 55 + type Rkey = Set<members::rkey>; 56 56 type Collection = S::Collection; 57 - type Rkey = S::Rkey; 57 + type Did = S::Did; 58 58 } 59 59 ///State transition - sets the `collection` field to Set 60 60 pub struct SetCollection<S: State = Empty>(PhantomData<fn() -> S>); 61 61 impl<S: State> sealed::Sealed for SetCollection<S> {} 62 62 impl<S: State> State for SetCollection<S> { 63 - type Did = S::Did; 64 - type Collection = Set<members::collection>; 65 63 type Rkey = S::Rkey; 64 + type Collection = Set<members::collection>; 65 + type Did = S::Did; 66 66 } 67 - ///State transition - sets the `rkey` field to Set 68 - pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 69 - impl<S: State> sealed::Sealed for SetRkey<S> {} 70 - impl<S: State> State for SetRkey<S> { 71 - type Did = S::Did; 67 + ///State transition - sets the `did` field to Set 68 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 69 + impl<S: State> sealed::Sealed for SetDid<S> {} 70 + impl<S: State> State for SetDid<S> { 71 + type Rkey = S::Rkey; 72 72 type Collection = S::Collection; 73 - type Rkey = Set<members::rkey>; 73 + type Did = Set<members::did>; 74 74 } 75 75 /// Marker types for field names 76 76 #[allow(non_camel_case_types)] 77 77 pub mod members { 78 + ///Marker type for the `rkey` field 79 + pub struct rkey(()); 80 + ///Marker type for the `collection` field 81 + pub struct collection(()); 78 82 ///Marker type for the `did` field 79 83 pub struct did(()); 80 - ///Marker type for the `collection` field 81 - pub struct collection(()); 82 - ///Marker type for the `rkey` field 83 - pub struct rkey(()); 84 84 } 85 85 } 86 86 ··· 181 181 impl<'a, S> GetRecordBuilder<'a, S> 182 182 where 183 183 S: get_record_state::State, 184 - S::Did: get_record_state::IsSet, 185 - S::Collection: get_record_state::IsSet, 186 184 S::Rkey: get_record_state::IsSet, 185 + S::Collection: get_record_state::IsSet, 186 + S::Did: get_record_state::IsSet, 187 187 { 188 188 /// Build the final struct 189 189 pub fn build(self) -> GetRecord<'a> {
+221 -265
crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs
··· 41 41 /// State trait tracking which required fields have been set 42 42 pub trait State: sealed::Sealed { 43 43 type Seq; 44 + type Active; 44 45 type Did; 45 46 type Time; 46 - type Active; 47 47 } 48 48 /// Empty state - all required fields are unset 49 49 pub struct Empty(()); 50 50 impl sealed::Sealed for Empty {} 51 51 impl State for Empty { 52 52 type Seq = Unset; 53 + type Active = Unset; 53 54 type Did = Unset; 54 55 type Time = Unset; 55 - type Active = Unset; 56 56 } 57 57 ///State transition - sets the `seq` field to Set 58 58 pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 59 59 impl<S: State> sealed::Sealed for SetSeq<S> {} 60 60 impl<S: State> State for SetSeq<S> { 61 61 type Seq = Set<members::seq>; 62 + type Active = S::Active; 62 63 type Did = S::Did; 63 64 type Time = S::Time; 64 - type Active = S::Active; 65 + } 66 + ///State transition - sets the `active` field to Set 67 + pub struct SetActive<S: State = Empty>(PhantomData<fn() -> S>); 68 + impl<S: State> sealed::Sealed for SetActive<S> {} 69 + impl<S: State> State for SetActive<S> { 70 + type Seq = S::Seq; 71 + type Active = Set<members::active>; 72 + type Did = S::Did; 73 + type Time = S::Time; 65 74 } 66 75 ///State transition - sets the `did` field to Set 67 76 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 68 77 impl<S: State> sealed::Sealed for SetDid<S> {} 69 78 impl<S: State> State for SetDid<S> { 70 79 type Seq = S::Seq; 80 + type Active = S::Active; 71 81 type Did = Set<members::did>; 72 82 type Time = S::Time; 73 - type Active = S::Active; 74 83 } 75 84 ///State transition - sets the `time` field to Set 76 85 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 77 86 impl<S: State> sealed::Sealed for SetTime<S> {} 78 87 impl<S: State> State for SetTime<S> { 79 88 type Seq = S::Seq; 80 - type Did = S::Did; 81 - type Time = Set<members::time>; 82 89 type Active = S::Active; 83 - } 84 - ///State transition - sets the `active` field to Set 85 - pub struct SetActive<S: State = Empty>(PhantomData<fn() -> S>); 86 - impl<S: State> sealed::Sealed for SetActive<S> {} 87 - impl<S: State> State for SetActive<S> { 88 - type Seq = S::Seq; 89 90 type Did = S::Did; 90 - type Time = S::Time; 91 - type Active = Set<members::active>; 91 + type Time = Set<members::time>; 92 92 } 93 93 /// Marker types for field names 94 94 #[allow(non_camel_case_types)] 95 95 pub mod members { 96 96 ///Marker type for the `seq` field 97 97 pub struct seq(()); 98 + ///Marker type for the `active` field 99 + pub struct active(()); 98 100 ///Marker type for the `did` field 99 101 pub struct did(()); 100 102 ///Marker type for the `time` field 101 103 pub struct time(()); 102 - ///Marker type for the `active` field 103 - pub struct active(()); 104 104 } 105 105 } 106 106 ··· 231 231 where 232 232 S: account_state::State, 233 233 S::Seq: account_state::IsSet, 234 + S::Active: account_state::IsSet, 234 235 S::Did: account_state::IsSet, 235 236 S::Time: account_state::IsSet, 236 - S::Active: account_state::IsSet, 237 237 { 238 238 /// Build the final struct 239 239 pub fn build(self) -> Account<'a> { ··· 929 929 #[serde(borrow)] 930 930 pub blobs: Vec<jacquard_common::types::cid::CidLink<'a>>, 931 931 /// 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. 932 + #[serde(with = "jacquard_common::serde_bytes_helper")] 932 933 pub blocks: bytes::Bytes, 933 934 /// Repo commit object CID. 934 935 #[serde(borrow)] ··· 949 950 /// The stream sequence number of this message. 950 951 pub seq: i64, 951 952 /// The rev of the last emitted commit from this repo (if any). 952 - pub since: jacquard_common::types::string::Tid, 953 + pub since: std::option::Option<jacquard_common::types::string::Tid>, 953 954 /// Timestamp of when this message was originally broadcast. 954 955 pub time: jacquard_common::types::string::Datetime, 955 956 /// 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 968 /// State trait tracking which required fields have been set 968 969 pub trait State: sealed::Sealed { 969 970 type Seq; 970 - type Rebase; 971 971 type TooBig; 972 - type Repo; 973 - type Commit; 974 - type Rev; 975 - type Since; 976 - type Blocks; 977 972 type Ops; 978 973 type Blobs; 974 + type Blocks; 975 + type Rev; 979 976 type Time; 977 + type Rebase; 978 + type Repo; 979 + type Commit; 980 980 } 981 981 /// Empty state - all required fields are unset 982 982 pub struct Empty(()); 983 983 impl sealed::Sealed for Empty {} 984 984 impl State for Empty { 985 985 type Seq = Unset; 986 - type Rebase = Unset; 987 986 type TooBig = Unset; 988 - type Repo = Unset; 989 - type Commit = Unset; 990 - type Rev = Unset; 991 - type Since = Unset; 992 - type Blocks = Unset; 993 987 type Ops = Unset; 994 988 type Blobs = Unset; 989 + type Blocks = Unset; 990 + type Rev = Unset; 995 991 type Time = Unset; 992 + type Rebase = Unset; 993 + type Repo = Unset; 994 + type Commit = Unset; 996 995 } 997 996 ///State transition - sets the `seq` field to Set 998 997 pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 999 998 impl<S: State> sealed::Sealed for SetSeq<S> {} 1000 999 impl<S: State> State for SetSeq<S> { 1001 1000 type Seq = Set<members::seq>; 1002 - type Rebase = S::Rebase; 1003 1001 type TooBig = S::TooBig; 1004 - type Repo = S::Repo; 1005 - type Commit = S::Commit; 1006 - type Rev = S::Rev; 1007 - type Since = S::Since; 1008 - type Blocks = S::Blocks; 1009 1002 type Ops = S::Ops; 1010 1003 type Blobs = S::Blobs; 1004 + type Blocks = S::Blocks; 1005 + type Rev = S::Rev; 1011 1006 type Time = S::Time; 1012 - } 1013 - ///State transition - sets the `rebase` field to Set 1014 - pub struct SetRebase<S: State = Empty>(PhantomData<fn() -> S>); 1015 - impl<S: State> sealed::Sealed for SetRebase<S> {} 1016 - impl<S: State> State for SetRebase<S> { 1017 - type Seq = S::Seq; 1018 - type Rebase = Set<members::rebase>; 1019 - type TooBig = S::TooBig; 1007 + type Rebase = S::Rebase; 1020 1008 type Repo = S::Repo; 1021 1009 type Commit = S::Commit; 1022 - type Rev = S::Rev; 1023 - type Since = S::Since; 1024 - type Blocks = S::Blocks; 1025 - type Ops = S::Ops; 1026 - type Blobs = S::Blobs; 1027 - type Time = S::Time; 1028 1010 } 1029 1011 ///State transition - sets the `too_big` field to Set 1030 1012 pub struct SetTooBig<S: State = Empty>(PhantomData<fn() -> S>); 1031 1013 impl<S: State> sealed::Sealed for SetTooBig<S> {} 1032 1014 impl<S: State> State for SetTooBig<S> { 1033 1015 type Seq = S::Seq; 1034 - type Rebase = S::Rebase; 1035 1016 type TooBig = Set<members::too_big>; 1036 - type Repo = S::Repo; 1037 - type Commit = S::Commit; 1038 - type Rev = S::Rev; 1039 - type Since = S::Since; 1040 - type Blocks = S::Blocks; 1041 1017 type Ops = S::Ops; 1042 1018 type Blobs = S::Blobs; 1019 + type Blocks = S::Blocks; 1020 + type Rev = S::Rev; 1043 1021 type Time = S::Time; 1044 - } 1045 - ///State transition - sets the `repo` field to Set 1046 - pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1047 - impl<S: State> sealed::Sealed for SetRepo<S> {} 1048 - impl<S: State> State for SetRepo<S> { 1049 - type Seq = S::Seq; 1050 1022 type Rebase = S::Rebase; 1051 - type TooBig = S::TooBig; 1052 - type Repo = Set<members::repo>; 1023 + type Repo = S::Repo; 1053 1024 type Commit = S::Commit; 1054 - type Rev = S::Rev; 1055 - type Since = S::Since; 1056 - type Blocks = S::Blocks; 1057 - type Ops = S::Ops; 1058 - type Blobs = S::Blobs; 1059 - type Time = S::Time; 1060 1025 } 1061 - ///State transition - sets the `commit` field to Set 1062 - pub struct SetCommit<S: State = Empty>(PhantomData<fn() -> S>); 1063 - impl<S: State> sealed::Sealed for SetCommit<S> {} 1064 - impl<S: State> State for SetCommit<S> { 1026 + ///State transition - sets the `ops` field to Set 1027 + pub struct SetOps<S: State = Empty>(PhantomData<fn() -> S>); 1028 + impl<S: State> sealed::Sealed for SetOps<S> {} 1029 + impl<S: State> State for SetOps<S> { 1065 1030 type Seq = S::Seq; 1066 - type Rebase = S::Rebase; 1067 1031 type TooBig = S::TooBig; 1068 - type Repo = S::Repo; 1069 - type Commit = Set<members::commit>; 1032 + type Ops = Set<members::ops>; 1033 + type Blobs = S::Blobs; 1034 + type Blocks = S::Blocks; 1070 1035 type Rev = S::Rev; 1071 - type Since = S::Since; 1072 - type Blocks = S::Blocks; 1073 - type Ops = S::Ops; 1074 - type Blobs = S::Blobs; 1075 1036 type Time = S::Time; 1076 - } 1077 - ///State transition - sets the `rev` field to Set 1078 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1079 - impl<S: State> sealed::Sealed for SetRev<S> {} 1080 - impl<S: State> State for SetRev<S> { 1081 - type Seq = S::Seq; 1082 1037 type Rebase = S::Rebase; 1083 - type TooBig = S::TooBig; 1084 1038 type Repo = S::Repo; 1085 1039 type Commit = S::Commit; 1086 - type Rev = Set<members::rev>; 1087 - type Since = S::Since; 1040 + } 1041 + ///State transition - sets the `blobs` field to Set 1042 + pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>); 1043 + impl<S: State> sealed::Sealed for SetBlobs<S> {} 1044 + impl<S: State> State for SetBlobs<S> { 1045 + type Seq = S::Seq; 1046 + type TooBig = S::TooBig; 1047 + type Ops = S::Ops; 1048 + type Blobs = Set<members::blobs>; 1088 1049 type Blocks = S::Blocks; 1089 - type Ops = S::Ops; 1090 - type Blobs = S::Blobs; 1050 + type Rev = S::Rev; 1091 1051 type Time = S::Time; 1092 - } 1093 - ///State transition - sets the `since` field to Set 1094 - pub struct SetSince<S: State = Empty>(PhantomData<fn() -> S>); 1095 - impl<S: State> sealed::Sealed for SetSince<S> {} 1096 - impl<S: State> State for SetSince<S> { 1097 - type Seq = S::Seq; 1098 1052 type Rebase = S::Rebase; 1099 - type TooBig = S::TooBig; 1100 1053 type Repo = S::Repo; 1101 1054 type Commit = S::Commit; 1102 - type Rev = S::Rev; 1103 - type Since = Set<members::since>; 1104 - type Blocks = S::Blocks; 1105 - type Ops = S::Ops; 1106 - type Blobs = S::Blobs; 1107 - type Time = S::Time; 1108 1055 } 1109 1056 ///State transition - sets the `blocks` field to Set 1110 1057 pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>); 1111 1058 impl<S: State> sealed::Sealed for SetBlocks<S> {} 1112 1059 impl<S: State> State for SetBlocks<S> { 1113 1060 type Seq = S::Seq; 1114 - type Rebase = S::Rebase; 1115 1061 type TooBig = S::TooBig; 1116 - type Repo = S::Repo; 1117 - type Commit = S::Commit; 1118 - type Rev = S::Rev; 1119 - type Since = S::Since; 1120 - type Blocks = Set<members::blocks>; 1121 1062 type Ops = S::Ops; 1122 1063 type Blobs = S::Blobs; 1064 + type Blocks = Set<members::blocks>; 1065 + type Rev = S::Rev; 1123 1066 type Time = S::Time; 1124 - } 1125 - ///State transition - sets the `ops` field to Set 1126 - pub struct SetOps<S: State = Empty>(PhantomData<fn() -> S>); 1127 - impl<S: State> sealed::Sealed for SetOps<S> {} 1128 - impl<S: State> State for SetOps<S> { 1129 - type Seq = S::Seq; 1130 1067 type Rebase = S::Rebase; 1131 - type TooBig = S::TooBig; 1132 1068 type Repo = S::Repo; 1133 1069 type Commit = S::Commit; 1134 - type Rev = S::Rev; 1135 - type Since = S::Since; 1136 - type Blocks = S::Blocks; 1137 - type Ops = Set<members::ops>; 1138 - type Blobs = S::Blobs; 1139 - type Time = S::Time; 1140 1070 } 1141 - ///State transition - sets the `blobs` field to Set 1142 - pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>); 1143 - impl<S: State> sealed::Sealed for SetBlobs<S> {} 1144 - impl<S: State> State for SetBlobs<S> { 1071 + ///State transition - sets the `rev` field to Set 1072 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 1073 + impl<S: State> sealed::Sealed for SetRev<S> {} 1074 + impl<S: State> State for SetRev<S> { 1145 1075 type Seq = S::Seq; 1146 - type Rebase = S::Rebase; 1147 1076 type TooBig = S::TooBig; 1148 - type Repo = S::Repo; 1149 - type Commit = S::Commit; 1150 - type Rev = S::Rev; 1151 - type Since = S::Since; 1152 - type Blocks = S::Blocks; 1153 1077 type Ops = S::Ops; 1154 - type Blobs = Set<members::blobs>; 1078 + type Blobs = S::Blobs; 1079 + type Blocks = S::Blocks; 1080 + type Rev = Set<members::rev>; 1155 1081 type Time = S::Time; 1082 + type Rebase = S::Rebase; 1083 + type Repo = S::Repo; 1084 + type Commit = S::Commit; 1156 1085 } 1157 1086 ///State transition - sets the `time` field to Set 1158 1087 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 1159 1088 impl<S: State> sealed::Sealed for SetTime<S> {} 1160 1089 impl<S: State> State for SetTime<S> { 1161 1090 type Seq = S::Seq; 1162 - type Rebase = S::Rebase; 1163 1091 type TooBig = S::TooBig; 1092 + type Ops = S::Ops; 1093 + type Blobs = S::Blobs; 1094 + type Blocks = S::Blocks; 1095 + type Rev = S::Rev; 1096 + type Time = Set<members::time>; 1097 + type Rebase = S::Rebase; 1164 1098 type Repo = S::Repo; 1165 1099 type Commit = S::Commit; 1100 + } 1101 + ///State transition - sets the `rebase` field to Set 1102 + pub struct SetRebase<S: State = Empty>(PhantomData<fn() -> S>); 1103 + impl<S: State> sealed::Sealed for SetRebase<S> {} 1104 + impl<S: State> State for SetRebase<S> { 1105 + type Seq = S::Seq; 1106 + type TooBig = S::TooBig; 1107 + type Ops = S::Ops; 1108 + type Blobs = S::Blobs; 1109 + type Blocks = S::Blocks; 1166 1110 type Rev = S::Rev; 1167 - type Since = S::Since; 1111 + type Time = S::Time; 1112 + type Rebase = Set<members::rebase>; 1113 + type Repo = S::Repo; 1114 + type Commit = S::Commit; 1115 + } 1116 + ///State transition - sets the `repo` field to Set 1117 + pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 1118 + impl<S: State> sealed::Sealed for SetRepo<S> {} 1119 + impl<S: State> State for SetRepo<S> { 1120 + type Seq = S::Seq; 1121 + type TooBig = S::TooBig; 1122 + type Ops = S::Ops; 1123 + type Blobs = S::Blobs; 1168 1124 type Blocks = S::Blocks; 1125 + type Rev = S::Rev; 1126 + type Time = S::Time; 1127 + type Rebase = S::Rebase; 1128 + type Repo = Set<members::repo>; 1129 + type Commit = S::Commit; 1130 + } 1131 + ///State transition - sets the `commit` field to Set 1132 + pub struct SetCommit<S: State = Empty>(PhantomData<fn() -> S>); 1133 + impl<S: State> sealed::Sealed for SetCommit<S> {} 1134 + impl<S: State> State for SetCommit<S> { 1135 + type Seq = S::Seq; 1136 + type TooBig = S::TooBig; 1169 1137 type Ops = S::Ops; 1170 1138 type Blobs = S::Blobs; 1171 - type Time = Set<members::time>; 1139 + type Blocks = S::Blocks; 1140 + type Rev = S::Rev; 1141 + type Time = S::Time; 1142 + type Rebase = S::Rebase; 1143 + type Repo = S::Repo; 1144 + type Commit = Set<members::commit>; 1172 1145 } 1173 1146 /// Marker types for field names 1174 1147 #[allow(non_camel_case_types)] 1175 1148 pub mod members { 1176 1149 ///Marker type for the `seq` field 1177 1150 pub struct seq(()); 1178 - ///Marker type for the `rebase` field 1179 - pub struct rebase(()); 1180 1151 ///Marker type for the `too_big` field 1181 1152 pub struct too_big(()); 1182 - ///Marker type for the `repo` field 1183 - pub struct repo(()); 1184 - ///Marker type for the `commit` field 1185 - pub struct commit(()); 1186 - ///Marker type for the `rev` field 1187 - pub struct rev(()); 1188 - ///Marker type for the `since` field 1189 - pub struct since(()); 1190 - ///Marker type for the `blocks` field 1191 - pub struct blocks(()); 1192 1153 ///Marker type for the `ops` field 1193 1154 pub struct ops(()); 1194 1155 ///Marker type for the `blobs` field 1195 1156 pub struct blobs(()); 1157 + ///Marker type for the `blocks` field 1158 + pub struct blocks(()); 1159 + ///Marker type for the `rev` field 1160 + pub struct rev(()); 1196 1161 ///Marker type for the `time` field 1197 1162 pub struct time(()); 1163 + ///Marker type for the `rebase` field 1164 + pub struct rebase(()); 1165 + ///Marker type for the `repo` field 1166 + pub struct repo(()); 1167 + ///Marker type for the `commit` field 1168 + pub struct commit(()); 1198 1169 } 1199 1170 } 1200 1171 ··· 1422 1393 } 1423 1394 } 1424 1395 1425 - impl<'a, S> CommitBuilder<'a, S> 1426 - where 1427 - S: commit_state::State, 1428 - S::Since: commit_state::IsUnset, 1429 - { 1430 - /// Set the `since` field (required) 1396 + impl<'a, S: commit_state::State> CommitBuilder<'a, S> { 1397 + /// Set the `since` field (optional) 1431 1398 pub fn since( 1432 1399 mut self, 1433 - value: impl Into<jacquard_common::types::string::Tid>, 1434 - ) -> CommitBuilder<'a, commit_state::SetSince<S>> { 1435 - self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); 1436 - CommitBuilder { 1437 - _phantom_state: ::core::marker::PhantomData, 1438 - __unsafe_private_named: self.__unsafe_private_named, 1439 - _phantom: ::core::marker::PhantomData, 1440 - } 1400 + value: impl Into<Option<jacquard_common::types::string::Tid>>, 1401 + ) -> Self { 1402 + self.__unsafe_private_named.9 = value.into(); 1403 + self 1404 + } 1405 + /// Set the `since` field to an Option value (optional) 1406 + pub fn maybe_since( 1407 + mut self, 1408 + value: Option<jacquard_common::types::string::Tid>, 1409 + ) -> Self { 1410 + self.__unsafe_private_named.9 = value; 1411 + self 1441 1412 } 1442 1413 } 1443 1414 ··· 1483 1454 where 1484 1455 S: commit_state::State, 1485 1456 S::Seq: commit_state::IsSet, 1486 - S::Rebase: commit_state::IsSet, 1487 1457 S::TooBig: commit_state::IsSet, 1488 - S::Repo: commit_state::IsSet, 1489 - S::Commit: commit_state::IsSet, 1490 - S::Rev: commit_state::IsSet, 1491 - S::Since: commit_state::IsSet, 1492 - S::Blocks: commit_state::IsSet, 1493 1458 S::Ops: commit_state::IsSet, 1494 1459 S::Blobs: commit_state::IsSet, 1460 + S::Blocks: commit_state::IsSet, 1461 + S::Rev: commit_state::IsSet, 1495 1462 S::Time: commit_state::IsSet, 1463 + S::Rebase: commit_state::IsSet, 1464 + S::Repo: commit_state::IsSet, 1465 + S::Commit: commit_state::IsSet, 1496 1466 { 1497 1467 /// Build the final struct 1498 1468 pub fn build(self) -> Commit<'a> { ··· 1506 1476 repo: self.__unsafe_private_named.6.unwrap(), 1507 1477 rev: self.__unsafe_private_named.7.unwrap(), 1508 1478 seq: self.__unsafe_private_named.8.unwrap(), 1509 - since: self.__unsafe_private_named.9.unwrap(), 1479 + since: self.__unsafe_private_named.9, 1510 1480 time: self.__unsafe_private_named.10.unwrap(), 1511 1481 too_big: self.__unsafe_private_named.11.unwrap(), 1512 1482 extra_data: Default::default(), ··· 1530 1500 repo: self.__unsafe_private_named.6.unwrap(), 1531 1501 rev: self.__unsafe_private_named.7.unwrap(), 1532 1502 seq: self.__unsafe_private_named.8.unwrap(), 1533 - since: self.__unsafe_private_named.9.unwrap(), 1503 + since: self.__unsafe_private_named.9, 1534 1504 time: self.__unsafe_private_named.10.unwrap(), 1535 1505 too_big: self.__unsafe_private_named.11.unwrap(), 1536 1506 extra_data: Some(extra_data), ··· 1601 1571 } 1602 1572 /// State trait tracking which required fields have been set 1603 1573 pub trait State: sealed::Sealed { 1604 - type Seq; 1605 1574 type Did; 1606 1575 type Time; 1576 + type Seq; 1607 1577 } 1608 1578 /// Empty state - all required fields are unset 1609 1579 pub struct Empty(()); 1610 1580 impl sealed::Sealed for Empty {} 1611 1581 impl State for Empty { 1612 - type Seq = Unset; 1613 1582 type Did = Unset; 1614 1583 type Time = Unset; 1615 - } 1616 - ///State transition - sets the `seq` field to Set 1617 - pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 1618 - impl<S: State> sealed::Sealed for SetSeq<S> {} 1619 - impl<S: State> State for SetSeq<S> { 1620 - type Seq = Set<members::seq>; 1621 - type Did = S::Did; 1622 - type Time = S::Time; 1584 + type Seq = Unset; 1623 1585 } 1624 1586 ///State transition - sets the `did` field to Set 1625 1587 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 1626 1588 impl<S: State> sealed::Sealed for SetDid<S> {} 1627 1589 impl<S: State> State for SetDid<S> { 1628 - type Seq = S::Seq; 1629 1590 type Did = Set<members::did>; 1630 1591 type Time = S::Time; 1592 + type Seq = S::Seq; 1631 1593 } 1632 1594 ///State transition - sets the `time` field to Set 1633 1595 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 1634 1596 impl<S: State> sealed::Sealed for SetTime<S> {} 1635 1597 impl<S: State> State for SetTime<S> { 1598 + type Did = S::Did; 1599 + type Time = Set<members::time>; 1636 1600 type Seq = S::Seq; 1601 + } 1602 + ///State transition - sets the `seq` field to Set 1603 + pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 1604 + impl<S: State> sealed::Sealed for SetSeq<S> {} 1605 + impl<S: State> State for SetSeq<S> { 1637 1606 type Did = S::Did; 1638 - type Time = Set<members::time>; 1607 + type Time = S::Time; 1608 + type Seq = Set<members::seq>; 1639 1609 } 1640 1610 /// Marker types for field names 1641 1611 #[allow(non_camel_case_types)] 1642 1612 pub mod members { 1643 - ///Marker type for the `seq` field 1644 - pub struct seq(()); 1645 1613 ///Marker type for the `did` field 1646 1614 pub struct did(()); 1647 1615 ///Marker type for the `time` field 1648 1616 pub struct time(()); 1617 + ///Marker type for the `seq` field 1618 + pub struct seq(()); 1649 1619 } 1650 1620 } 1651 1621 ··· 1758 1728 impl<'a, S> IdentityBuilder<'a, S> 1759 1729 where 1760 1730 S: identity_state::State, 1761 - S::Seq: identity_state::IsSet, 1762 1731 S::Did: identity_state::IsSet, 1763 1732 S::Time: identity_state::IsSet, 1733 + S::Seq: identity_state::IsSet, 1764 1734 { 1765 1735 /// Build the final struct 1766 1736 pub fn build(self) -> Identity<'a> { ··· 2079 2049 pub action: jacquard_common::CowStr<'a>, 2080 2050 /// For creates and updates, the new record CID. For deletions, null. 2081 2051 #[serde(borrow)] 2082 - pub cid: jacquard_common::types::cid::CidLink<'a>, 2052 + pub cid: std::option::Option<jacquard_common::types::cid::CidLink<'a>>, 2083 2053 #[serde(borrow)] 2084 2054 pub path: jacquard_common::CowStr<'a>, 2085 2055 /// For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. ··· 2098 2068 } 2099 2069 /// State trait tracking which required fields have been set 2100 2070 pub trait State: sealed::Sealed { 2101 - type Action; 2102 2071 type Path; 2103 - type Cid; 2072 + type Action; 2104 2073 } 2105 2074 /// Empty state - all required fields are unset 2106 2075 pub struct Empty(()); 2107 2076 impl sealed::Sealed for Empty {} 2108 2077 impl State for Empty { 2109 - type Action = Unset; 2110 2078 type Path = Unset; 2111 - type Cid = Unset; 2112 - } 2113 - ///State transition - sets the `action` field to Set 2114 - pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 2115 - impl<S: State> sealed::Sealed for SetAction<S> {} 2116 - impl<S: State> State for SetAction<S> { 2117 - type Action = Set<members::action>; 2118 - type Path = S::Path; 2119 - type Cid = S::Cid; 2079 + type Action = Unset; 2120 2080 } 2121 2081 ///State transition - sets the `path` field to Set 2122 2082 pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 2123 2083 impl<S: State> sealed::Sealed for SetPath<S> {} 2124 2084 impl<S: State> State for SetPath<S> { 2125 - type Action = S::Action; 2126 2085 type Path = Set<members::path>; 2127 - type Cid = S::Cid; 2086 + type Action = S::Action; 2128 2087 } 2129 - ///State transition - sets the `cid` field to Set 2130 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2131 - impl<S: State> sealed::Sealed for SetCid<S> {} 2132 - impl<S: State> State for SetCid<S> { 2133 - type Action = S::Action; 2088 + ///State transition - sets the `action` field to Set 2089 + pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 2090 + impl<S: State> sealed::Sealed for SetAction<S> {} 2091 + impl<S: State> State for SetAction<S> { 2134 2092 type Path = S::Path; 2135 - type Cid = Set<members::cid>; 2093 + type Action = Set<members::action>; 2136 2094 } 2137 2095 /// Marker types for field names 2138 2096 #[allow(non_camel_case_types)] 2139 2097 pub mod members { 2098 + ///Marker type for the `path` field 2099 + pub struct path(()); 2140 2100 ///Marker type for the `action` field 2141 2101 pub struct action(()); 2142 - ///Marker type for the `path` field 2143 - pub struct path(()); 2144 - ///Marker type for the `cid` field 2145 - pub struct cid(()); 2146 2102 } 2147 2103 } 2148 2104 ··· 2195 2151 } 2196 2152 } 2197 2153 2198 - impl<'a, S> RepoOpBuilder<'a, S> 2199 - where 2200 - S: repo_op_state::State, 2201 - S::Cid: repo_op_state::IsUnset, 2202 - { 2203 - /// Set the `cid` field (required) 2154 + impl<'a, S: repo_op_state::State> RepoOpBuilder<'a, S> { 2155 + /// Set the `cid` field (optional) 2204 2156 pub fn cid( 2205 2157 mut self, 2206 - value: impl Into<jacquard_common::types::cid::CidLink<'a>>, 2207 - ) -> RepoOpBuilder<'a, repo_op_state::SetCid<S>> { 2208 - self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 2209 - RepoOpBuilder { 2210 - _phantom_state: ::core::marker::PhantomData, 2211 - __unsafe_private_named: self.__unsafe_private_named, 2212 - _phantom: ::core::marker::PhantomData, 2213 - } 2158 + value: impl Into<Option<jacquard_common::types::cid::CidLink<'a>>>, 2159 + ) -> Self { 2160 + self.__unsafe_private_named.1 = value.into(); 2161 + self 2162 + } 2163 + /// Set the `cid` field to an Option value (optional) 2164 + pub fn maybe_cid( 2165 + mut self, 2166 + value: Option<jacquard_common::types::cid::CidLink<'a>>, 2167 + ) -> Self { 2168 + self.__unsafe_private_named.1 = value; 2169 + self 2214 2170 } 2215 2171 } 2216 2172 ··· 2255 2211 impl<'a, S> RepoOpBuilder<'a, S> 2256 2212 where 2257 2213 S: repo_op_state::State, 2258 - S::Action: repo_op_state::IsSet, 2259 2214 S::Path: repo_op_state::IsSet, 2260 - S::Cid: repo_op_state::IsSet, 2215 + S::Action: repo_op_state::IsSet, 2261 2216 { 2262 2217 /// Build the final struct 2263 2218 pub fn build(self) -> RepoOp<'a> { 2264 2219 RepoOp { 2265 2220 action: self.__unsafe_private_named.0.unwrap(), 2266 - cid: self.__unsafe_private_named.1.unwrap(), 2221 + cid: self.__unsafe_private_named.1, 2267 2222 path: self.__unsafe_private_named.2.unwrap(), 2268 2223 prev: self.__unsafe_private_named.3, 2269 2224 extra_data: Default::default(), ··· 2279 2234 ) -> RepoOp<'a> { 2280 2235 RepoOp { 2281 2236 action: self.__unsafe_private_named.0.unwrap(), 2282 - cid: self.__unsafe_private_named.1.unwrap(), 2237 + cid: self.__unsafe_private_named.1, 2283 2238 path: self.__unsafe_private_named.2.unwrap(), 2284 2239 prev: self.__unsafe_private_named.3, 2285 2240 extra_data: Some(extra_data), ··· 2318 2273 #[serde(rename_all = "camelCase")] 2319 2274 pub struct Sync<'a> { 2320 2275 /// CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. 2276 + #[serde(with = "jacquard_common::serde_bytes_helper")] 2321 2277 pub blocks: bytes::Bytes, 2322 2278 /// The account this repo event corresponds to. Must match that in the commit object. 2323 2279 #[serde(borrow)] ··· 2341 2297 } 2342 2298 /// State trait tracking which required fields have been set 2343 2299 pub trait State: sealed::Sealed { 2300 + type Rev; 2301 + type Time; 2344 2302 type Seq; 2345 2303 type Did; 2346 2304 type Blocks; 2347 - type Rev; 2348 - type Time; 2349 2305 } 2350 2306 /// Empty state - all required fields are unset 2351 2307 pub struct Empty(()); 2352 2308 impl sealed::Sealed for Empty {} 2353 2309 impl State for Empty { 2310 + type Rev = Unset; 2311 + type Time = Unset; 2354 2312 type Seq = Unset; 2355 2313 type Did = Unset; 2356 2314 type Blocks = Unset; 2357 - type Rev = Unset; 2358 - type Time = Unset; 2315 + } 2316 + ///State transition - sets the `rev` field to Set 2317 + pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2318 + impl<S: State> sealed::Sealed for SetRev<S> {} 2319 + impl<S: State> State for SetRev<S> { 2320 + type Rev = Set<members::rev>; 2321 + type Time = S::Time; 2322 + type Seq = S::Seq; 2323 + type Did = S::Did; 2324 + type Blocks = S::Blocks; 2325 + } 2326 + ///State transition - sets the `time` field to Set 2327 + pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 2328 + impl<S: State> sealed::Sealed for SetTime<S> {} 2329 + impl<S: State> State for SetTime<S> { 2330 + type Rev = S::Rev; 2331 + type Time = Set<members::time>; 2332 + type Seq = S::Seq; 2333 + type Did = S::Did; 2334 + type Blocks = S::Blocks; 2359 2335 } 2360 2336 ///State transition - sets the `seq` field to Set 2361 2337 pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>); 2362 2338 impl<S: State> sealed::Sealed for SetSeq<S> {} 2363 2339 impl<S: State> State for SetSeq<S> { 2340 + type Rev = S::Rev; 2341 + type Time = S::Time; 2364 2342 type Seq = Set<members::seq>; 2365 2343 type Did = S::Did; 2366 2344 type Blocks = S::Blocks; 2367 - type Rev = S::Rev; 2368 - type Time = S::Time; 2369 2345 } 2370 2346 ///State transition - sets the `did` field to Set 2371 2347 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2372 2348 impl<S: State> sealed::Sealed for SetDid<S> {} 2373 2349 impl<S: State> State for SetDid<S> { 2350 + type Rev = S::Rev; 2351 + type Time = S::Time; 2374 2352 type Seq = S::Seq; 2375 2353 type Did = Set<members::did>; 2376 2354 type Blocks = S::Blocks; 2377 - type Rev = S::Rev; 2378 - type Time = S::Time; 2379 2355 } 2380 2356 ///State transition - sets the `blocks` field to Set 2381 2357 pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>); 2382 2358 impl<S: State> sealed::Sealed for SetBlocks<S> {} 2383 2359 impl<S: State> State for SetBlocks<S> { 2384 - type Seq = S::Seq; 2385 - type Did = S::Did; 2386 - type Blocks = Set<members::blocks>; 2387 2360 type Rev = S::Rev; 2388 2361 type Time = S::Time; 2389 - } 2390 - ///State transition - sets the `rev` field to Set 2391 - pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>); 2392 - impl<S: State> sealed::Sealed for SetRev<S> {} 2393 - impl<S: State> State for SetRev<S> { 2394 2362 type Seq = S::Seq; 2395 2363 type Did = S::Did; 2396 - type Blocks = S::Blocks; 2397 - type Rev = Set<members::rev>; 2398 - type Time = S::Time; 2399 - } 2400 - ///State transition - sets the `time` field to Set 2401 - pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 2402 - impl<S: State> sealed::Sealed for SetTime<S> {} 2403 - impl<S: State> State for SetTime<S> { 2404 - type Seq = S::Seq; 2405 - type Did = S::Did; 2406 - type Blocks = S::Blocks; 2407 - type Rev = S::Rev; 2408 - type Time = Set<members::time>; 2364 + type Blocks = Set<members::blocks>; 2409 2365 } 2410 2366 /// Marker types for field names 2411 2367 #[allow(non_camel_case_types)] 2412 2368 pub mod members { 2369 + ///Marker type for the `rev` field 2370 + pub struct rev(()); 2371 + ///Marker type for the `time` field 2372 + pub struct time(()); 2413 2373 ///Marker type for the `seq` field 2414 2374 pub struct seq(()); 2415 2375 ///Marker type for the `did` field 2416 2376 pub struct did(()); 2417 2377 ///Marker type for the `blocks` field 2418 2378 pub struct blocks(()); 2419 - ///Marker type for the `rev` field 2420 - pub struct rev(()); 2421 - ///Marker type for the `time` field 2422 - pub struct time(()); 2423 2379 } 2424 2380 } 2425 2381 ··· 2552 2508 impl<'a, S> SyncBuilder<'a, S> 2553 2509 where 2554 2510 S: sync_state::State, 2511 + S::Rev: sync_state::IsSet, 2512 + S::Time: sync_state::IsSet, 2555 2513 S::Seq: sync_state::IsSet, 2556 2514 S::Did: sync_state::IsSet, 2557 2515 S::Blocks: sync_state::IsSet, 2558 - S::Rev: sync_state::IsSet, 2559 - S::Time: sync_state::IsSet, 2560 2516 { 2561 2517 /// Build the final struct 2562 2518 pub fn build(self) -> Sync<'a> {
+13 -13
crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs
··· 692 692 } 693 693 /// State trait tracking which required fields have been set 694 694 pub trait State: sealed::Sealed { 695 - type Handle; 696 695 type Method; 696 + type Handle; 697 697 } 698 698 /// Empty state - all required fields are unset 699 699 pub struct Empty(()); 700 700 impl sealed::Sealed for Empty {} 701 701 impl State for Empty { 702 - type Handle = Unset; 703 702 type Method = Unset; 704 - } 705 - ///State transition - sets the `handle` field to Set 706 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 707 - impl<S: State> sealed::Sealed for SetHandle<S> {} 708 - impl<S: State> State for SetHandle<S> { 709 - type Handle = Set<members::handle>; 710 - type Method = S::Method; 703 + type Handle = Unset; 711 704 } 712 705 ///State transition - sets the `method` field to Set 713 706 pub struct SetMethod<S: State = Empty>(PhantomData<fn() -> S>); 714 707 impl<S: State> sealed::Sealed for SetMethod<S> {} 715 708 impl<S: State> State for SetMethod<S> { 716 - type Handle = S::Handle; 717 709 type Method = Set<members::method>; 710 + type Handle = S::Handle; 711 + } 712 + ///State transition - sets the `handle` field to Set 713 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 714 + impl<S: State> sealed::Sealed for SetHandle<S> {} 715 + impl<S: State> State for SetHandle<S> { 716 + type Method = S::Method; 717 + type Handle = Set<members::handle>; 718 718 } 719 719 /// Marker types for field names 720 720 #[allow(non_camel_case_types)] 721 721 pub mod members { 722 - ///Marker type for the `handle` field 723 - pub struct handle(()); 724 722 ///Marker type for the `method` field 725 723 pub struct method(()); 724 + ///Marker type for the `handle` field 725 + pub struct handle(()); 726 726 } 727 727 } 728 728 ··· 795 795 impl<'a, S> SuggestionBuilder<'a, S> 796 796 where 797 797 S: suggestion_state::State, 798 - S::Handle: suggestion_state::IsSet, 799 798 S::Method: suggestion_state::IsSet, 799 + S::Handle: suggestion_state::IsSet, 800 800 { 801 801 /// Build the final struct 802 802 pub fn build(self) -> Suggestion<'a> {
+29 -28
crates/weaver-api/src/sh_weaver/actor.rs
··· 25 25 pub did: jacquard_common::types::string::Did<'a>, 26 26 /// signed bytes of the corresponding notebook record in the author's repo 27 27 #[serde(skip_serializing_if = "std::option::Option::is_none")] 28 + #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")] 28 29 pub signature: std::option::Option<bytes::Bytes>, 29 30 } 30 31 ··· 1961 1962 } 1962 1963 /// State trait tracking which required fields have been set 1963 1964 pub trait State: sealed::Sealed { 1964 - type Did; 1965 1965 type Handle; 1966 + type Did; 1966 1967 } 1967 1968 /// Empty state - all required fields are unset 1968 1969 pub struct Empty(()); 1969 1970 impl sealed::Sealed for Empty {} 1970 1971 impl State for Empty { 1971 - type Did = Unset; 1972 1972 type Handle = Unset; 1973 - } 1974 - ///State transition - sets the `did` field to Set 1975 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 1976 - impl<S: State> sealed::Sealed for SetDid<S> {} 1977 - impl<S: State> State for SetDid<S> { 1978 - type Did = Set<members::did>; 1979 - type Handle = S::Handle; 1973 + type Did = Unset; 1980 1974 } 1981 1975 ///State transition - sets the `handle` field to Set 1982 1976 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 1983 1977 impl<S: State> sealed::Sealed for SetHandle<S> {} 1984 1978 impl<S: State> State for SetHandle<S> { 1985 - type Did = S::Did; 1986 1979 type Handle = Set<members::handle>; 1980 + type Did = S::Did; 1981 + } 1982 + ///State transition - sets the `did` field to Set 1983 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 1984 + impl<S: State> sealed::Sealed for SetDid<S> {} 1985 + impl<S: State> State for SetDid<S> { 1986 + type Handle = S::Handle; 1987 + type Did = Set<members::did>; 1987 1988 } 1988 1989 /// Marker types for field names 1989 1990 #[allow(non_camel_case_types)] 1990 1991 pub mod members { 1991 - ///Marker type for the `did` field 1992 - pub struct did(()); 1993 1992 ///Marker type for the `handle` field 1994 1993 pub struct handle(()); 1994 + ///Marker type for the `did` field 1995 + pub struct did(()); 1995 1996 } 1996 1997 } 1997 1998 ··· 2184 2185 impl<'a, S> ProfileViewBasicBuilder<'a, S> 2185 2186 where 2186 2187 S: profile_view_basic_state::State, 2187 - S::Did: profile_view_basic_state::IsSet, 2188 2188 S::Handle: profile_view_basic_state::IsSet, 2189 + S::Did: profile_view_basic_state::IsSet, 2189 2190 { 2190 2191 /// Build the final struct 2191 2192 pub fn build(self) -> ProfileViewBasic<'a> { ··· 2321 2322 } 2322 2323 /// State trait tracking which required fields have been set 2323 2324 pub trait State: sealed::Sealed { 2324 - type Bluesky; 2325 2325 type Did; 2326 + type Bluesky; 2326 2327 type Handle; 2327 2328 } 2328 2329 /// Empty state - all required fields are unset 2329 2330 pub struct Empty(()); 2330 2331 impl sealed::Sealed for Empty {} 2331 2332 impl State for Empty { 2332 - type Bluesky = Unset; 2333 2333 type Did = Unset; 2334 + type Bluesky = Unset; 2334 2335 type Handle = Unset; 2335 2336 } 2336 - ///State transition - sets the `bluesky` field to Set 2337 - pub struct SetBluesky<S: State = Empty>(PhantomData<fn() -> S>); 2338 - impl<S: State> sealed::Sealed for SetBluesky<S> {} 2339 - impl<S: State> State for SetBluesky<S> { 2340 - type Bluesky = Set<members::bluesky>; 2341 - type Did = S::Did; 2342 - type Handle = S::Handle; 2343 - } 2344 2337 ///State transition - sets the `did` field to Set 2345 2338 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2346 2339 impl<S: State> sealed::Sealed for SetDid<S> {} 2347 2340 impl<S: State> State for SetDid<S> { 2348 - type Bluesky = S::Bluesky; 2349 2341 type Did = Set<members::did>; 2342 + type Bluesky = S::Bluesky; 2343 + type Handle = S::Handle; 2344 + } 2345 + ///State transition - sets the `bluesky` field to Set 2346 + pub struct SetBluesky<S: State = Empty>(PhantomData<fn() -> S>); 2347 + impl<S: State> sealed::Sealed for SetBluesky<S> {} 2348 + impl<S: State> State for SetBluesky<S> { 2349 + type Did = S::Did; 2350 + type Bluesky = Set<members::bluesky>; 2350 2351 type Handle = S::Handle; 2351 2352 } 2352 2353 ///State transition - sets the `handle` field to Set 2353 2354 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 2354 2355 impl<S: State> sealed::Sealed for SetHandle<S> {} 2355 2356 impl<S: State> State for SetHandle<S> { 2356 - type Bluesky = S::Bluesky; 2357 2357 type Did = S::Did; 2358 + type Bluesky = S::Bluesky; 2358 2359 type Handle = Set<members::handle>; 2359 2360 } 2360 2361 /// Marker types for field names 2361 2362 #[allow(non_camel_case_types)] 2362 2363 pub mod members { 2363 - ///Marker type for the `bluesky` field 2364 - pub struct bluesky(()); 2365 2364 ///Marker type for the `did` field 2366 2365 pub struct did(()); 2366 + ///Marker type for the `bluesky` field 2367 + pub struct bluesky(()); 2367 2368 ///Marker type for the `handle` field 2368 2369 pub struct handle(()); 2369 2370 } ··· 2555 2556 impl<'a, S> TangledProfileViewBuilder<'a, S> 2556 2557 where 2557 2558 S: tangled_profile_view_state::State, 2558 - S::Bluesky: tangled_profile_view_state::IsSet, 2559 2559 S::Did: tangled_profile_view_state::IsSet, 2560 + S::Bluesky: tangled_profile_view_state::IsSet, 2560 2561 S::Handle: tangled_profile_view_state::IsSet, 2561 2562 { 2562 2563 /// Build the final struct
+15 -15
crates/weaver-api/src/sh_weaver/collab/invite.rs
··· 134 134 } 135 135 /// State trait tracking which required fields have been set 136 136 pub trait State: sealed::Sealed { 137 + type CreatedAt; 137 138 type Resource; 138 139 type Invitee; 139 - type CreatedAt; 140 140 } 141 141 /// Empty state - all required fields are unset 142 142 pub struct Empty(()); 143 143 impl sealed::Sealed for Empty {} 144 144 impl State for Empty { 145 + type CreatedAt = Unset; 145 146 type Resource = Unset; 146 147 type Invitee = Unset; 147 - type CreatedAt = Unset; 148 + } 149 + ///State transition - sets the `created_at` field to Set 150 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 151 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 152 + impl<S: State> State for SetCreatedAt<S> { 153 + type CreatedAt = Set<members::created_at>; 154 + type Resource = S::Resource; 155 + type Invitee = S::Invitee; 148 156 } 149 157 ///State transition - sets the `resource` field to Set 150 158 pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>); 151 159 impl<S: State> sealed::Sealed for SetResource<S> {} 152 160 impl<S: State> State for SetResource<S> { 161 + type CreatedAt = S::CreatedAt; 153 162 type Resource = Set<members::resource>; 154 163 type Invitee = S::Invitee; 155 - type CreatedAt = S::CreatedAt; 156 164 } 157 165 ///State transition - sets the `invitee` field to Set 158 166 pub struct SetInvitee<S: State = Empty>(PhantomData<fn() -> S>); 159 167 impl<S: State> sealed::Sealed for SetInvitee<S> {} 160 168 impl<S: State> State for SetInvitee<S> { 161 - type Resource = S::Resource; 162 - type Invitee = Set<members::invitee>; 163 169 type CreatedAt = S::CreatedAt; 164 - } 165 - ///State transition - sets the `created_at` field to Set 166 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 167 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 168 - impl<S: State> State for SetCreatedAt<S> { 169 170 type Resource = S::Resource; 170 - type Invitee = S::Invitee; 171 - type CreatedAt = Set<members::created_at>; 171 + type Invitee = Set<members::invitee>; 172 172 } 173 173 /// Marker types for field names 174 174 #[allow(non_camel_case_types)] 175 175 pub mod members { 176 + ///Marker type for the `created_at` field 177 + pub struct created_at(()); 176 178 ///Marker type for the `resource` field 177 179 pub struct resource(()); 178 180 ///Marker type for the `invitee` field 179 181 pub struct invitee(()); 180 - ///Marker type for the `created_at` field 181 - pub struct created_at(()); 182 182 } 183 183 } 184 184 ··· 328 328 impl<'a, S> InviteBuilder<'a, S> 329 329 where 330 330 S: invite_state::State, 331 + S::CreatedAt: invite_state::IsSet, 331 332 S::Resource: invite_state::IsSet, 332 333 S::Invitee: invite_state::IsSet, 333 - S::CreatedAt: invite_state::IsSet, 334 334 { 335 335 /// Build the final struct 336 336 pub fn build(self) -> Invite<'a> {
+2 -4
crates/weaver-api/src/sh_weaver/edit.rs
··· 193 193 description: None, 194 194 required: Some( 195 195 vec![ 196 - ::jacquard_common::smol_str::SmolStr::new_static("draft_key") 196 + ::jacquard_common::smol_str::SmolStr::new_static("draftKey") 197 197 ], 198 198 ), 199 199 nullable: None, ··· 201 201 #[allow(unused_mut)] 202 202 let mut map = ::std::collections::BTreeMap::new(); 203 203 map.insert( 204 - ::jacquard_common::smol_str::SmolStr::new_static( 205 - "draft_key", 206 - ), 204 + ::jacquard_common::smol_str::SmolStr::new_static("draftKey"), 207 205 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 208 206 description: None, 209 207 format: None,
+28 -28
crates/weaver-api/src/sh_weaver/edit/cursor.rs
··· 759 759 } 760 760 /// State trait tracking which required fields have been set 761 761 pub trait State: sealed::Sealed { 762 - type Container; 763 762 type Id; 763 + type Container; 764 764 } 765 765 /// Empty state - all required fields are unset 766 766 pub struct Empty(()); 767 767 impl sealed::Sealed for Empty {} 768 768 impl State for Empty { 769 - type Container = Unset; 770 769 type Id = Unset; 771 - } 772 - ///State transition - sets the `container` field to Set 773 - pub struct SetContainer<S: State = Empty>(PhantomData<fn() -> S>); 774 - impl<S: State> sealed::Sealed for SetContainer<S> {} 775 - impl<S: State> State for SetContainer<S> { 776 - type Container = Set<members::container>; 777 - type Id = S::Id; 770 + type Container = Unset; 778 771 } 779 772 ///State transition - sets the `id` field to Set 780 773 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 781 774 impl<S: State> sealed::Sealed for SetId<S> {} 782 775 impl<S: State> State for SetId<S> { 783 - type Container = S::Container; 784 776 type Id = Set<members::id>; 777 + type Container = S::Container; 778 + } 779 + ///State transition - sets the `container` field to Set 780 + pub struct SetContainer<S: State = Empty>(PhantomData<fn() -> S>); 781 + impl<S: State> sealed::Sealed for SetContainer<S> {} 782 + impl<S: State> State for SetContainer<S> { 783 + type Id = S::Id; 784 + type Container = Set<members::container>; 785 785 } 786 786 /// Marker types for field names 787 787 #[allow(non_camel_case_types)] 788 788 pub mod members { 789 - ///Marker type for the `container` field 790 - pub struct container(()); 791 789 ///Marker type for the `id` field 792 790 pub struct id(()); 791 + ///Marker type for the `container` field 792 + pub struct container(()); 793 793 } 794 794 } 795 795 ··· 882 882 impl<'a, S> CursorBuilder<'a, S> 883 883 where 884 884 S: cursor_state::State, 885 - S::Container: cursor_state::IsSet, 886 885 S::Id: cursor_state::IsSet, 886 + S::Container: cursor_state::IsSet, 887 887 { 888 888 /// Build the final struct 889 889 pub fn build(self) -> Cursor<'a> { ··· 1017 1017 } 1018 1018 /// State trait tracking which required fields have been set 1019 1019 pub trait State: sealed::Sealed { 1020 - type Peer; 1021 1020 type Counter; 1021 + type Peer; 1022 1022 type ContainerType; 1023 1023 } 1024 1024 /// Empty state - all required fields are unset 1025 1025 pub struct Empty(()); 1026 1026 impl sealed::Sealed for Empty {} 1027 1027 impl State for Empty { 1028 - type Peer = Unset; 1029 1028 type Counter = Unset; 1029 + type Peer = Unset; 1030 1030 type ContainerType = Unset; 1031 1031 } 1032 - ///State transition - sets the `peer` field to Set 1033 - pub struct SetPeer<S: State = Empty>(PhantomData<fn() -> S>); 1034 - impl<S: State> sealed::Sealed for SetPeer<S> {} 1035 - impl<S: State> State for SetPeer<S> { 1036 - type Peer = Set<members::peer>; 1037 - type Counter = S::Counter; 1038 - type ContainerType = S::ContainerType; 1039 - } 1040 1032 ///State transition - sets the `counter` field to Set 1041 1033 pub struct SetCounter<S: State = Empty>(PhantomData<fn() -> S>); 1042 1034 impl<S: State> sealed::Sealed for SetCounter<S> {} 1043 1035 impl<S: State> State for SetCounter<S> { 1044 - type Peer = S::Peer; 1045 1036 type Counter = Set<members::counter>; 1037 + type Peer = S::Peer; 1038 + type ContainerType = S::ContainerType; 1039 + } 1040 + ///State transition - sets the `peer` field to Set 1041 + pub struct SetPeer<S: State = Empty>(PhantomData<fn() -> S>); 1042 + impl<S: State> sealed::Sealed for SetPeer<S> {} 1043 + impl<S: State> State for SetPeer<S> { 1044 + type Counter = S::Counter; 1045 + type Peer = Set<members::peer>; 1046 1046 type ContainerType = S::ContainerType; 1047 1047 } 1048 1048 ///State transition - sets the `container_type` field to Set 1049 1049 pub struct SetContainerType<S: State = Empty>(PhantomData<fn() -> S>); 1050 1050 impl<S: State> sealed::Sealed for SetContainerType<S> {} 1051 1051 impl<S: State> State for SetContainerType<S> { 1052 - type Peer = S::Peer; 1053 1052 type Counter = S::Counter; 1053 + type Peer = S::Peer; 1054 1054 type ContainerType = Set<members::container_type>; 1055 1055 } 1056 1056 /// Marker types for field names 1057 1057 #[allow(non_camel_case_types)] 1058 1058 pub mod members { 1059 - ///Marker type for the `peer` field 1060 - pub struct peer(()); 1061 1059 ///Marker type for the `counter` field 1062 1060 pub struct counter(()); 1061 + ///Marker type for the `peer` field 1062 + pub struct peer(()); 1063 1063 ///Marker type for the `container_type` field 1064 1064 pub struct container_type(()); 1065 1065 } ··· 1154 1154 impl<'a, S> NormalContainerIdBuilder<'a, S> 1155 1155 where 1156 1156 S: normal_container_id_state::State, 1157 - S::Peer: normal_container_id_state::IsSet, 1158 1157 S::Counter: normal_container_id_state::IsSet, 1158 + S::Peer: normal_container_id_state::IsSet, 1159 1159 S::ContainerType: normal_container_id_state::IsSet, 1160 1160 { 1161 1161 /// Build the final struct
+19 -32
crates/weaver-api/src/sh_weaver/edit/diff.rs
··· 8 8 /// An edit record for a notebook. 9 9 #[jacquard_derive::lexicon] 10 10 #[derive( 11 - serde::Serialize, 12 - serde::Deserialize, 13 - Debug, 14 - Clone, 15 - PartialEq, 16 - Eq, 17 - jacquard_derive::IntoStatic 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 18 12 )] 19 13 #[serde(rename_all = "camelCase")] 20 14 pub struct Diff<'a> { ··· 24 18 pub doc: crate::sh_weaver::edit::DocRef<'a>, 25 19 /// An inline diff for for small edit batches. Either this or snapshot must be present to be valid 26 20 #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 + #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")] 27 22 pub inline_diff: std::option::Option<bytes::Bytes>, 28 23 #[serde(skip_serializing_if = "std::option::Option::is_none")] 29 24 #[serde(borrow)] ··· 38 33 39 34 pub mod diff_state { 40 35 41 - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 36 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 42 37 #[allow(unused)] 43 38 use ::core::marker::PhantomData; 44 39 mod sealed { ··· 46 41 } 47 42 /// State trait tracking which required fields have been set 48 43 pub trait State: sealed::Sealed { 49 - type Root; 50 44 type Doc; 45 + type Root; 51 46 } 52 47 /// Empty state - all required fields are unset 53 48 pub struct Empty(()); 54 49 impl sealed::Sealed for Empty {} 55 50 impl State for Empty { 51 + type Doc = Unset; 56 52 type Root = Unset; 57 - type Doc = Unset; 53 + } 54 + ///State transition - sets the `doc` field to Set 55 + pub struct SetDoc<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetDoc<S> {} 57 + impl<S: State> State for SetDoc<S> { 58 + type Doc = Set<members::doc>; 59 + type Root = S::Root; 58 60 } 59 61 ///State transition - sets the `root` field to Set 60 62 pub struct SetRoot<S: State = Empty>(PhantomData<fn() -> S>); 61 63 impl<S: State> sealed::Sealed for SetRoot<S> {} 62 64 impl<S: State> State for SetRoot<S> { 63 - type Root = Set<members::root>; 64 65 type Doc = S::Doc; 65 - } 66 - ///State transition - sets the `doc` field to Set 67 - pub struct SetDoc<S: State = Empty>(PhantomData<fn() -> S>); 68 - impl<S: State> sealed::Sealed for SetDoc<S> {} 69 - impl<S: State> State for SetDoc<S> { 70 - type Root = S::Root; 71 - type Doc = Set<members::doc>; 66 + type Root = Set<members::root>; 72 67 } 73 68 /// Marker types for field names 74 69 #[allow(non_camel_case_types)] 75 70 pub mod members { 71 + ///Marker type for the `doc` field 72 + pub struct doc(()); 76 73 ///Marker type for the `root` field 77 74 pub struct root(()); 78 - ///Marker type for the `doc` field 79 - pub struct doc(()); 80 75 } 81 76 } 82 77 ··· 223 218 impl<'a, S> DiffBuilder<'a, S> 224 219 where 225 220 S: diff_state::State, 226 - S::Root: diff_state::IsSet, 227 221 S::Doc: diff_state::IsSet, 222 + S::Root: diff_state::IsSet, 228 223 { 229 224 /// Build the final struct 230 225 pub fn build(self) -> Diff<'a> { ··· 273 268 274 269 /// Typed wrapper for GetRecord response with this collection's record type. 275 270 #[derive( 276 - serde::Serialize, 277 - serde::Deserialize, 278 - Debug, 279 - Clone, 280 - PartialEq, 281 - Eq, 282 - jacquard_derive::IntoStatic 271 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 283 272 )] 284 273 #[serde(rename_all = "camelCase")] 285 274 pub struct DiffGetRecordOutput<'a> { ··· 336 325 } 337 326 } 338 327 339 - fn lexicon_doc_sh_weaver_edit_diff() -> ::jacquard_lexicon::lexicon::LexiconDoc< 340 - 'static, 341 - > { 328 + fn lexicon_doc_sh_weaver_edit_diff() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 342 329 ::jacquard_lexicon::lexicon::LexiconDoc { 343 330 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 344 331 id: ::jacquard_common::CowStr::new_static("sh.weaver.edit.diff"), ··· 441 428 map 442 429 }, 443 430 } 444 - } 431 + }
+13 -13
crates/weaver-api/src/sh_weaver/embed.rs
··· 312 312 } 313 313 /// State trait tracking which required fields have been set 314 314 pub trait State: sealed::Sealed { 315 - type Width; 316 315 type Height; 316 + type Width; 317 317 } 318 318 /// Empty state - all required fields are unset 319 319 pub struct Empty(()); 320 320 impl sealed::Sealed for Empty {} 321 321 impl State for Empty { 322 - type Width = Unset; 323 322 type Height = Unset; 324 - } 325 - ///State transition - sets the `width` field to Set 326 - pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 327 - impl<S: State> sealed::Sealed for SetWidth<S> {} 328 - impl<S: State> State for SetWidth<S> { 329 - type Width = Set<members::width>; 330 - type Height = S::Height; 323 + type Width = Unset; 331 324 } 332 325 ///State transition - sets the `height` field to Set 333 326 pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 334 327 impl<S: State> sealed::Sealed for SetHeight<S> {} 335 328 impl<S: State> State for SetHeight<S> { 336 - type Width = S::Width; 337 329 type Height = Set<members::height>; 330 + type Width = S::Width; 331 + } 332 + ///State transition - sets the `width` field to Set 333 + pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 334 + impl<S: State> sealed::Sealed for SetWidth<S> {} 335 + impl<S: State> State for SetWidth<S> { 336 + type Height = S::Height; 337 + type Width = Set<members::width>; 338 338 } 339 339 /// Marker types for field names 340 340 #[allow(non_camel_case_types)] 341 341 pub mod members { 342 - ///Marker type for the `width` field 343 - pub struct width(()); 344 342 ///Marker type for the `height` field 345 343 pub struct height(()); 344 + ///Marker type for the `width` field 345 + pub struct width(()); 346 346 } 347 347 } 348 348 ··· 412 412 impl<'a, S> PixelSizeBuilder<'a, S> 413 413 where 414 414 S: pixel_size_state::State, 415 - S::Width: pixel_size_state::IsSet, 416 415 S::Height: pixel_size_state::IsSet, 416 + S::Width: pixel_size_state::IsSet, 417 417 { 418 418 /// Build the final struct 419 419 pub fn build(self) -> PixelSize<'a> {
+39 -39
crates/weaver-api/src/sh_weaver/embed/external.rs
··· 38 38 } 39 39 /// State trait tracking which required fields have been set 40 40 pub trait State: sealed::Sealed { 41 + type Description; 41 42 type Uri; 42 43 type Title; 43 - type Description; 44 44 } 45 45 /// Empty state - all required fields are unset 46 46 pub struct Empty(()); 47 47 impl sealed::Sealed for Empty {} 48 48 impl State for Empty { 49 + type Description = Unset; 49 50 type Uri = Unset; 50 51 type Title = Unset; 51 - type Description = Unset; 52 + } 53 + ///State transition - sets the `description` field to Set 54 + pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetDescription<S> {} 56 + impl<S: State> State for SetDescription<S> { 57 + type Description = Set<members::description>; 58 + type Uri = S::Uri; 59 + type Title = S::Title; 52 60 } 53 61 ///State transition - sets the `uri` field to Set 54 62 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 55 63 impl<S: State> sealed::Sealed for SetUri<S> {} 56 64 impl<S: State> State for SetUri<S> { 65 + type Description = S::Description; 57 66 type Uri = Set<members::uri>; 58 67 type Title = S::Title; 59 - type Description = S::Description; 60 68 } 61 69 ///State transition - sets the `title` field to Set 62 70 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 63 71 impl<S: State> sealed::Sealed for SetTitle<S> {} 64 72 impl<S: State> State for SetTitle<S> { 65 - type Uri = S::Uri; 66 - type Title = Set<members::title>; 67 73 type Description = S::Description; 68 - } 69 - ///State transition - sets the `description` field to Set 70 - pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 71 - impl<S: State> sealed::Sealed for SetDescription<S> {} 72 - impl<S: State> State for SetDescription<S> { 73 74 type Uri = S::Uri; 74 - type Title = S::Title; 75 - type Description = Set<members::description>; 75 + type Title = Set<members::title>; 76 76 } 77 77 /// Marker types for field names 78 78 #[allow(non_camel_case_types)] 79 79 pub mod members { 80 + ///Marker type for the `description` field 81 + pub struct description(()); 80 82 ///Marker type for the `uri` field 81 83 pub struct uri(()); 82 84 ///Marker type for the `title` field 83 85 pub struct title(()); 84 - ///Marker type for the `description` field 85 - pub struct description(()); 86 86 } 87 87 } 88 88 ··· 195 195 impl<'a, S> ExternalEmbedBuilder<'a, S> 196 196 where 197 197 S: external_embed_state::State, 198 + S::Description: external_embed_state::IsSet, 198 199 S::Uri: external_embed_state::IsSet, 199 200 S::Title: external_embed_state::IsSet, 200 - S::Description: external_embed_state::IsSet, 201 201 { 202 202 /// Build the final struct 203 203 pub fn build(self) -> ExternalEmbed<'a> { ··· 817 817 } 818 818 /// State trait tracking which required fields have been set 819 819 pub trait State: sealed::Sealed { 820 - type Uri; 821 - type Title; 822 820 type Description; 821 + type Title; 822 + type Uri; 823 823 } 824 824 /// Empty state - all required fields are unset 825 825 pub struct Empty(()); 826 826 impl sealed::Sealed for Empty {} 827 827 impl State for Empty { 828 + type Description = Unset; 829 + type Title = Unset; 828 830 type Uri = Unset; 829 - type Title = Unset; 830 - type Description = Unset; 831 831 } 832 - ///State transition - sets the `uri` field to Set 833 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 834 - impl<S: State> sealed::Sealed for SetUri<S> {} 835 - impl<S: State> State for SetUri<S> { 836 - type Uri = Set<members::uri>; 832 + ///State transition - sets the `description` field to Set 833 + pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 834 + impl<S: State> sealed::Sealed for SetDescription<S> {} 835 + impl<S: State> State for SetDescription<S> { 836 + type Description = Set<members::description>; 837 837 type Title = S::Title; 838 - type Description = S::Description; 838 + type Uri = S::Uri; 839 839 } 840 840 ///State transition - sets the `title` field to Set 841 841 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 842 842 impl<S: State> sealed::Sealed for SetTitle<S> {} 843 843 impl<S: State> State for SetTitle<S> { 844 - type Uri = S::Uri; 845 - type Title = Set<members::title>; 846 844 type Description = S::Description; 845 + type Title = Set<members::title>; 846 + type Uri = S::Uri; 847 847 } 848 - ///State transition - sets the `description` field to Set 849 - pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 850 - impl<S: State> sealed::Sealed for SetDescription<S> {} 851 - impl<S: State> State for SetDescription<S> { 852 - type Uri = S::Uri; 848 + ///State transition - sets the `uri` field to Set 849 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 850 + impl<S: State> sealed::Sealed for SetUri<S> {} 851 + impl<S: State> State for SetUri<S> { 852 + type Description = S::Description; 853 853 type Title = S::Title; 854 - type Description = Set<members::description>; 854 + type Uri = Set<members::uri>; 855 855 } 856 856 /// Marker types for field names 857 857 #[allow(non_camel_case_types)] 858 858 pub mod members { 859 + ///Marker type for the `description` field 860 + pub struct description(()); 861 + ///Marker type for the `title` field 862 + pub struct title(()); 859 863 ///Marker type for the `uri` field 860 864 pub struct uri(()); 861 - ///Marker type for the `title` field 862 - pub struct title(()); 863 - ///Marker type for the `description` field 864 - pub struct description(()); 865 865 } 866 866 } 867 867 ··· 974 974 impl<'a, S> ViewExternalBuilder<'a, S> 975 975 where 976 976 S: view_external_state::State, 977 - S::Uri: view_external_state::IsSet, 978 - S::Title: view_external_state::IsSet, 979 977 S::Description: view_external_state::IsSet, 978 + S::Title: view_external_state::IsSet, 979 + S::Uri: view_external_state::IsSet, 980 980 { 981 981 /// Build the final struct 982 982 pub fn build(self) -> ViewExternal<'a> {
+28 -28
crates/weaver-api/src/sh_weaver/embed/images.rs
··· 44 44 } 45 45 /// State trait tracking which required fields have been set 46 46 pub trait State: sealed::Sealed { 47 - type Image; 48 47 type Alt; 48 + type Image; 49 49 } 50 50 /// Empty state - all required fields are unset 51 51 pub struct Empty(()); 52 52 impl sealed::Sealed for Empty {} 53 53 impl State for Empty { 54 - type Image = Unset; 55 54 type Alt = Unset; 56 - } 57 - ///State transition - sets the `image` field to Set 58 - pub struct SetImage<S: State = Empty>(PhantomData<fn() -> S>); 59 - impl<S: State> sealed::Sealed for SetImage<S> {} 60 - impl<S: State> State for SetImage<S> { 61 - type Image = Set<members::image>; 62 - type Alt = S::Alt; 55 + type Image = Unset; 63 56 } 64 57 ///State transition - sets the `alt` field to Set 65 58 pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 66 59 impl<S: State> sealed::Sealed for SetAlt<S> {} 67 60 impl<S: State> State for SetAlt<S> { 68 - type Image = S::Image; 69 61 type Alt = Set<members::alt>; 62 + type Image = S::Image; 63 + } 64 + ///State transition - sets the `image` field to Set 65 + pub struct SetImage<S: State = Empty>(PhantomData<fn() -> S>); 66 + impl<S: State> sealed::Sealed for SetImage<S> {} 67 + impl<S: State> State for SetImage<S> { 68 + type Alt = S::Alt; 69 + type Image = Set<members::image>; 70 70 } 71 71 /// Marker types for field names 72 72 #[allow(non_camel_case_types)] 73 73 pub mod members { 74 - ///Marker type for the `image` field 75 - pub struct image(()); 76 74 ///Marker type for the `alt` field 77 75 pub struct alt(()); 76 + ///Marker type for the `image` field 77 + pub struct image(()); 78 78 } 79 79 } 80 80 ··· 195 195 impl<'a, S> ImageBuilder<'a, S> 196 196 where 197 197 S: image_state::State, 198 - S::Image: image_state::IsSet, 199 198 S::Alt: image_state::IsSet, 199 + S::Image: image_state::IsSet, 200 200 { 201 201 /// Build the final struct 202 202 pub fn build(self) -> Image<'a> { ··· 902 902 } 903 903 /// State trait tracking which required fields have been set 904 904 pub trait State: sealed::Sealed { 905 - type Thumb; 906 905 type Fullsize; 907 906 type Alt; 907 + type Thumb; 908 908 } 909 909 /// Empty state - all required fields are unset 910 910 pub struct Empty(()); 911 911 impl sealed::Sealed for Empty {} 912 912 impl State for Empty { 913 - type Thumb = Unset; 914 913 type Fullsize = Unset; 915 914 type Alt = Unset; 916 - } 917 - ///State transition - sets the `thumb` field to Set 918 - pub struct SetThumb<S: State = Empty>(PhantomData<fn() -> S>); 919 - impl<S: State> sealed::Sealed for SetThumb<S> {} 920 - impl<S: State> State for SetThumb<S> { 921 - type Thumb = Set<members::thumb>; 922 - type Fullsize = S::Fullsize; 923 - type Alt = S::Alt; 915 + type Thumb = Unset; 924 916 } 925 917 ///State transition - sets the `fullsize` field to Set 926 918 pub struct SetFullsize<S: State = Empty>(PhantomData<fn() -> S>); 927 919 impl<S: State> sealed::Sealed for SetFullsize<S> {} 928 920 impl<S: State> State for SetFullsize<S> { 929 - type Thumb = S::Thumb; 930 921 type Fullsize = Set<members::fullsize>; 931 922 type Alt = S::Alt; 923 + type Thumb = S::Thumb; 932 924 } 933 925 ///State transition - sets the `alt` field to Set 934 926 pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 935 927 impl<S: State> sealed::Sealed for SetAlt<S> {} 936 928 impl<S: State> State for SetAlt<S> { 937 - type Thumb = S::Thumb; 938 929 type Fullsize = S::Fullsize; 939 930 type Alt = Set<members::alt>; 931 + type Thumb = S::Thumb; 932 + } 933 + ///State transition - sets the `thumb` field to Set 934 + pub struct SetThumb<S: State = Empty>(PhantomData<fn() -> S>); 935 + impl<S: State> sealed::Sealed for SetThumb<S> {} 936 + impl<S: State> State for SetThumb<S> { 937 + type Fullsize = S::Fullsize; 938 + type Alt = S::Alt; 939 + type Thumb = Set<members::thumb>; 940 940 } 941 941 /// Marker types for field names 942 942 #[allow(non_camel_case_types)] 943 943 pub mod members { 944 - ///Marker type for the `thumb` field 945 - pub struct thumb(()); 946 944 ///Marker type for the `fullsize` field 947 945 pub struct fullsize(()); 948 946 ///Marker type for the `alt` field 949 947 pub struct alt(()); 948 + ///Marker type for the `thumb` field 949 + pub struct thumb(()); 950 950 } 951 951 } 952 952 ··· 1073 1073 impl<'a, S> ViewImageBuilder<'a, S> 1074 1074 where 1075 1075 S: view_image_state::State, 1076 - S::Thumb: view_image_state::IsSet, 1077 1076 S::Fullsize: view_image_state::IsSet, 1078 1077 S::Alt: view_image_state::IsSet, 1078 + S::Thumb: view_image_state::IsSet, 1079 1079 { 1080 1080 /// Build the final struct 1081 1081 pub fn build(self) -> ViewImage<'a> {
+26 -26
crates/weaver-api/src/sh_weaver/embed/record_with_media.rs
··· 33 33 } 34 34 /// State trait tracking which required fields have been set 35 35 pub trait State: sealed::Sealed { 36 - type Records; 37 36 type Media; 37 + type Records; 38 38 } 39 39 /// Empty state - all required fields are unset 40 40 pub struct Empty(()); 41 41 impl sealed::Sealed for Empty {} 42 42 impl State for Empty { 43 - type Records = Unset; 44 43 type Media = Unset; 45 - } 46 - ///State transition - sets the `records` field to Set 47 - pub struct SetRecords<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetRecords<S> {} 49 - impl<S: State> State for SetRecords<S> { 50 - type Records = Set<members::records>; 51 - type Media = S::Media; 44 + type Records = Unset; 52 45 } 53 46 ///State transition - sets the `media` field to Set 54 47 pub struct SetMedia<S: State = Empty>(PhantomData<fn() -> S>); 55 48 impl<S: State> sealed::Sealed for SetMedia<S> {} 56 49 impl<S: State> State for SetMedia<S> { 57 - type Records = S::Records; 58 50 type Media = Set<members::media>; 51 + type Records = S::Records; 52 + } 53 + ///State transition - sets the `records` field to Set 54 + pub struct SetRecords<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetRecords<S> {} 56 + impl<S: State> State for SetRecords<S> { 57 + type Media = S::Media; 58 + type Records = Set<members::records>; 59 59 } 60 60 /// Marker types for field names 61 61 #[allow(non_camel_case_types)] 62 62 pub mod members { 63 - ///Marker type for the `records` field 64 - pub struct records(()); 65 63 ///Marker type for the `media` field 66 64 pub struct media(()); 65 + ///Marker type for the `records` field 66 + pub struct records(()); 67 67 } 68 68 } 69 69 ··· 136 136 impl<'a, S> RecordWithMediaBuilder<'a, S> 137 137 where 138 138 S: record_with_media_state::State, 139 - S::Records: record_with_media_state::IsSet, 140 139 S::Media: record_with_media_state::IsSet, 140 + S::Records: record_with_media_state::IsSet, 141 141 { 142 142 /// Build the final struct 143 143 pub fn build(self) -> RecordWithMedia<'a> { ··· 323 323 } 324 324 /// State trait tracking which required fields have been set 325 325 pub trait State: sealed::Sealed { 326 - type Record; 327 326 type Media; 327 + type Record; 328 328 } 329 329 /// Empty state - all required fields are unset 330 330 pub struct Empty(()); 331 331 impl sealed::Sealed for Empty {} 332 332 impl State for Empty { 333 - type Record = Unset; 334 333 type Media = Unset; 335 - } 336 - ///State transition - sets the `record` field to Set 337 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 338 - impl<S: State> sealed::Sealed for SetRecord<S> {} 339 - impl<S: State> State for SetRecord<S> { 340 - type Record = Set<members::record>; 341 - type Media = S::Media; 334 + type Record = Unset; 342 335 } 343 336 ///State transition - sets the `media` field to Set 344 337 pub struct SetMedia<S: State = Empty>(PhantomData<fn() -> S>); 345 338 impl<S: State> sealed::Sealed for SetMedia<S> {} 346 339 impl<S: State> State for SetMedia<S> { 347 - type Record = S::Record; 348 340 type Media = Set<members::media>; 341 + type Record = S::Record; 342 + } 343 + ///State transition - sets the `record` field to Set 344 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 345 + impl<S: State> sealed::Sealed for SetRecord<S> {} 346 + impl<S: State> State for SetRecord<S> { 347 + type Media = S::Media; 348 + type Record = Set<members::record>; 349 349 } 350 350 /// Marker types for field names 351 351 #[allow(non_camel_case_types)] 352 352 pub mod members { 353 - ///Marker type for the `record` field 354 - pub struct record(()); 355 353 ///Marker type for the `media` field 356 354 pub struct media(()); 355 + ///Marker type for the `record` field 356 + pub struct record(()); 357 357 } 358 358 } 359 359 ··· 426 426 impl<'a, S> ViewBuilder<'a, S> 427 427 where 428 428 S: view_state::State, 429 - S::Record: view_state::IsSet, 430 429 S::Media: view_state::IsSet, 430 + S::Record: view_state::IsSet, 431 431 { 432 432 /// Build the final struct 433 433 pub fn build(self) -> View<'a> {
+73 -73
crates/weaver-api/src/sh_weaver/embed/records.rs
··· 1187 1187 } 1188 1188 /// State trait tracking which required fields have been set 1189 1189 pub trait State: sealed::Sealed { 1190 - type Uri; 1191 1190 type Blocked; 1192 1191 type Author; 1192 + type Uri; 1193 1193 } 1194 1194 /// Empty state - all required fields are unset 1195 1195 pub struct Empty(()); 1196 1196 impl sealed::Sealed for Empty {} 1197 1197 impl State for Empty { 1198 - type Uri = Unset; 1199 1198 type Blocked = Unset; 1200 1199 type Author = Unset; 1201 - } 1202 - ///State transition - sets the `uri` field to Set 1203 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1204 - impl<S: State> sealed::Sealed for SetUri<S> {} 1205 - impl<S: State> State for SetUri<S> { 1206 - type Uri = Set<members::uri>; 1207 - type Blocked = S::Blocked; 1208 - type Author = S::Author; 1200 + type Uri = Unset; 1209 1201 } 1210 1202 ///State transition - sets the `blocked` field to Set 1211 1203 pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>); 1212 1204 impl<S: State> sealed::Sealed for SetBlocked<S> {} 1213 1205 impl<S: State> State for SetBlocked<S> { 1214 - type Uri = S::Uri; 1215 1206 type Blocked = Set<members::blocked>; 1216 1207 type Author = S::Author; 1208 + type Uri = S::Uri; 1217 1209 } 1218 1210 ///State transition - sets the `author` field to Set 1219 1211 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1220 1212 impl<S: State> sealed::Sealed for SetAuthor<S> {} 1221 1213 impl<S: State> State for SetAuthor<S> { 1214 + type Blocked = S::Blocked; 1215 + type Author = Set<members::author>; 1222 1216 type Uri = S::Uri; 1217 + } 1218 + ///State transition - sets the `uri` field to Set 1219 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1220 + impl<S: State> sealed::Sealed for SetUri<S> {} 1221 + impl<S: State> State for SetUri<S> { 1223 1222 type Blocked = S::Blocked; 1224 - type Author = Set<members::author>; 1223 + type Author = S::Author; 1224 + type Uri = Set<members::uri>; 1225 1225 } 1226 1226 /// Marker types for field names 1227 1227 #[allow(non_camel_case_types)] 1228 1228 pub mod members { 1229 - ///Marker type for the `uri` field 1230 - pub struct uri(()); 1231 1229 ///Marker type for the `blocked` field 1232 1230 pub struct blocked(()); 1233 1231 ///Marker type for the `author` field 1234 1232 pub struct author(()); 1233 + ///Marker type for the `uri` field 1234 + pub struct uri(()); 1235 1235 } 1236 1236 } 1237 1237 ··· 1324 1324 impl<'a, S> ViewBlockedBuilder<'a, S> 1325 1325 where 1326 1326 S: view_blocked_state::State, 1327 - S::Uri: view_blocked_state::IsSet, 1328 1327 S::Blocked: view_blocked_state::IsSet, 1329 1328 S::Author: view_blocked_state::IsSet, 1329 + S::Uri: view_blocked_state::IsSet, 1330 1330 { 1331 1331 /// Build the final struct 1332 1332 pub fn build(self) -> ViewBlocked<'a> { ··· 1398 1398 } 1399 1399 /// State trait tracking which required fields have been set 1400 1400 pub trait State: sealed::Sealed { 1401 - type Uri; 1402 1401 type Detached; 1402 + type Uri; 1403 1403 } 1404 1404 /// Empty state - all required fields are unset 1405 1405 pub struct Empty(()); 1406 1406 impl sealed::Sealed for Empty {} 1407 1407 impl State for Empty { 1408 + type Detached = Unset; 1408 1409 type Uri = Unset; 1409 - type Detached = Unset; 1410 + } 1411 + ///State transition - sets the `detached` field to Set 1412 + pub struct SetDetached<S: State = Empty>(PhantomData<fn() -> S>); 1413 + impl<S: State> sealed::Sealed for SetDetached<S> {} 1414 + impl<S: State> State for SetDetached<S> { 1415 + type Detached = Set<members::detached>; 1416 + type Uri = S::Uri; 1410 1417 } 1411 1418 ///State transition - sets the `uri` field to Set 1412 1419 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1413 1420 impl<S: State> sealed::Sealed for SetUri<S> {} 1414 1421 impl<S: State> State for SetUri<S> { 1422 + type Detached = S::Detached; 1415 1423 type Uri = Set<members::uri>; 1416 - type Detached = S::Detached; 1417 - } 1418 - ///State transition - sets the `detached` field to Set 1419 - pub struct SetDetached<S: State = Empty>(PhantomData<fn() -> S>); 1420 - impl<S: State> sealed::Sealed for SetDetached<S> {} 1421 - impl<S: State> State for SetDetached<S> { 1422 - type Uri = S::Uri; 1423 - type Detached = Set<members::detached>; 1424 1424 } 1425 1425 /// Marker types for field names 1426 1426 #[allow(non_camel_case_types)] 1427 1427 pub mod members { 1428 + ///Marker type for the `detached` field 1429 + pub struct detached(()); 1428 1430 ///Marker type for the `uri` field 1429 1431 pub struct uri(()); 1430 - ///Marker type for the `detached` field 1431 - pub struct detached(()); 1432 1432 } 1433 1433 } 1434 1434 ··· 1501 1501 impl<'a, S> ViewDetachedBuilder<'a, S> 1502 1502 where 1503 1503 S: view_detached_state::State, 1504 - S::Uri: view_detached_state::IsSet, 1505 1504 S::Detached: view_detached_state::IsSet, 1505 + S::Uri: view_detached_state::IsSet, 1506 1506 { 1507 1507 /// Build the final struct 1508 1508 pub fn build(self) -> ViewDetached<'a> { ··· 1572 1572 } 1573 1573 /// State trait tracking which required fields have been set 1574 1574 pub trait State: sealed::Sealed { 1575 - type Uri; 1576 1575 type NotFound; 1576 + type Uri; 1577 1577 } 1578 1578 /// Empty state - all required fields are unset 1579 1579 pub struct Empty(()); 1580 1580 impl sealed::Sealed for Empty {} 1581 1581 impl State for Empty { 1582 + type NotFound = Unset; 1582 1583 type Uri = Unset; 1583 - type NotFound = Unset; 1584 - } 1585 - ///State transition - sets the `uri` field to Set 1586 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1587 - impl<S: State> sealed::Sealed for SetUri<S> {} 1588 - impl<S: State> State for SetUri<S> { 1589 - type Uri = Set<members::uri>; 1590 - type NotFound = S::NotFound; 1591 1584 } 1592 1585 ///State transition - sets the `not_found` field to Set 1593 1586 pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>); 1594 1587 impl<S: State> sealed::Sealed for SetNotFound<S> {} 1595 1588 impl<S: State> State for SetNotFound<S> { 1596 - type Uri = S::Uri; 1597 1589 type NotFound = Set<members::not_found>; 1590 + type Uri = S::Uri; 1591 + } 1592 + ///State transition - sets the `uri` field to Set 1593 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1594 + impl<S: State> sealed::Sealed for SetUri<S> {} 1595 + impl<S: State> State for SetUri<S> { 1596 + type NotFound = S::NotFound; 1597 + type Uri = Set<members::uri>; 1598 1598 } 1599 1599 /// Marker types for field names 1600 1600 #[allow(non_camel_case_types)] 1601 1601 pub mod members { 1602 + ///Marker type for the `not_found` field 1603 + pub struct not_found(()); 1602 1604 ///Marker type for the `uri` field 1603 1605 pub struct uri(()); 1604 - ///Marker type for the `not_found` field 1605 - pub struct not_found(()); 1606 1606 } 1607 1607 } 1608 1608 ··· 1675 1675 impl<'a, S> ViewNotFoundBuilder<'a, S> 1676 1676 where 1677 1677 S: view_not_found_state::State, 1678 - S::Uri: view_not_found_state::IsSet, 1679 1678 S::NotFound: view_not_found_state::IsSet, 1679 + S::Uri: view_not_found_state::IsSet, 1680 1680 { 1681 1681 /// Build the final struct 1682 1682 pub fn build(self) -> ViewNotFound<'a> { ··· 1769 1769 } 1770 1770 /// State trait tracking which required fields have been set 1771 1771 pub trait State: sealed::Sealed { 1772 - type Uri; 1773 1772 type Cid; 1774 1773 type Author; 1774 + type IndexedAt; 1775 1775 type Value; 1776 - type IndexedAt; 1776 + type Uri; 1777 1777 } 1778 1778 /// Empty state - all required fields are unset 1779 1779 pub struct Empty(()); 1780 1780 impl sealed::Sealed for Empty {} 1781 1781 impl State for Empty { 1782 - type Uri = Unset; 1783 1782 type Cid = Unset; 1784 1783 type Author = Unset; 1784 + type IndexedAt = Unset; 1785 1785 type Value = Unset; 1786 - type IndexedAt = Unset; 1787 - } 1788 - ///State transition - sets the `uri` field to Set 1789 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1790 - impl<S: State> sealed::Sealed for SetUri<S> {} 1791 - impl<S: State> State for SetUri<S> { 1792 - type Uri = Set<members::uri>; 1793 - type Cid = S::Cid; 1794 - type Author = S::Author; 1795 - type Value = S::Value; 1796 - type IndexedAt = S::IndexedAt; 1786 + type Uri = Unset; 1797 1787 } 1798 1788 ///State transition - sets the `cid` field to Set 1799 1789 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1800 1790 impl<S: State> sealed::Sealed for SetCid<S> {} 1801 1791 impl<S: State> State for SetCid<S> { 1802 - type Uri = S::Uri; 1803 1792 type Cid = Set<members::cid>; 1804 1793 type Author = S::Author; 1794 + type IndexedAt = S::IndexedAt; 1805 1795 type Value = S::Value; 1806 - type IndexedAt = S::IndexedAt; 1796 + type Uri = S::Uri; 1807 1797 } 1808 1798 ///State transition - sets the `author` field to Set 1809 1799 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>); 1810 1800 impl<S: State> sealed::Sealed for SetAuthor<S> {} 1811 1801 impl<S: State> State for SetAuthor<S> { 1802 + type Cid = S::Cid; 1803 + type Author = Set<members::author>; 1804 + type IndexedAt = S::IndexedAt; 1805 + type Value = S::Value; 1812 1806 type Uri = S::Uri; 1807 + } 1808 + ///State transition - sets the `indexed_at` field to Set 1809 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1810 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1811 + impl<S: State> State for SetIndexedAt<S> { 1813 1812 type Cid = S::Cid; 1814 - type Author = Set<members::author>; 1813 + type Author = S::Author; 1814 + type IndexedAt = Set<members::indexed_at>; 1815 1815 type Value = S::Value; 1816 - type IndexedAt = S::IndexedAt; 1816 + type Uri = S::Uri; 1817 1817 } 1818 1818 ///State transition - sets the `value` field to Set 1819 1819 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 1820 1820 impl<S: State> sealed::Sealed for SetValue<S> {} 1821 1821 impl<S: State> State for SetValue<S> { 1822 - type Uri = S::Uri; 1823 1822 type Cid = S::Cid; 1824 1823 type Author = S::Author; 1825 - type Value = Set<members::value>; 1826 1824 type IndexedAt = S::IndexedAt; 1827 - } 1828 - ///State transition - sets the `indexed_at` field to Set 1829 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1830 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1831 - impl<S: State> State for SetIndexedAt<S> { 1825 + type Value = Set<members::value>; 1832 1826 type Uri = S::Uri; 1827 + } 1828 + ///State transition - sets the `uri` field to Set 1829 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1830 + impl<S: State> sealed::Sealed for SetUri<S> {} 1831 + impl<S: State> State for SetUri<S> { 1833 1832 type Cid = S::Cid; 1834 1833 type Author = S::Author; 1834 + type IndexedAt = S::IndexedAt; 1835 1835 type Value = S::Value; 1836 - type IndexedAt = Set<members::indexed_at>; 1836 + type Uri = Set<members::uri>; 1837 1837 } 1838 1838 /// Marker types for field names 1839 1839 #[allow(non_camel_case_types)] 1840 1840 pub mod members { 1841 - ///Marker type for the `uri` field 1842 - pub struct uri(()); 1843 1841 ///Marker type for the `cid` field 1844 1842 pub struct cid(()); 1845 1843 ///Marker type for the `author` field 1846 1844 pub struct author(()); 1847 - ///Marker type for the `value` field 1848 - pub struct value(()); 1849 1845 ///Marker type for the `indexed_at` field 1850 1846 pub struct indexed_at(()); 1847 + ///Marker type for the `value` field 1848 + pub struct value(()); 1849 + ///Marker type for the `uri` field 1850 + pub struct uri(()); 1851 1851 } 1852 1852 } 1853 1853 ··· 2092 2092 impl<'a, S> ViewRecordBuilder<'a, S> 2093 2093 where 2094 2094 S: view_record_state::State, 2095 - S::Uri: view_record_state::IsSet, 2096 2095 S::Cid: view_record_state::IsSet, 2097 2096 S::Author: view_record_state::IsSet, 2098 - S::Value: view_record_state::IsSet, 2099 2097 S::IndexedAt: view_record_state::IsSet, 2098 + S::Value: view_record_state::IsSet, 2099 + S::Uri: view_record_state::IsSet, 2100 2100 { 2101 2101 /// Build the final struct 2102 2102 pub fn build(self) -> ViewRecord<'a> {
+26 -26
crates/weaver-api/src/sh_weaver/embed/video.rs
··· 32 32 } 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 - type Lang; 36 35 type File; 36 + type Lang; 37 37 } 38 38 /// Empty state - all required fields are unset 39 39 pub struct Empty(()); 40 40 impl sealed::Sealed for Empty {} 41 41 impl State for Empty { 42 - type Lang = Unset; 43 42 type File = Unset; 44 - } 45 - ///State transition - sets the `lang` field to Set 46 - pub struct SetLang<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetLang<S> {} 48 - impl<S: State> State for SetLang<S> { 49 - type Lang = Set<members::lang>; 50 - type File = S::File; 43 + type Lang = Unset; 51 44 } 52 45 ///State transition - sets the `file` field to Set 53 46 pub struct SetFile<S: State = Empty>(PhantomData<fn() -> S>); 54 47 impl<S: State> sealed::Sealed for SetFile<S> {} 55 48 impl<S: State> State for SetFile<S> { 56 - type Lang = S::Lang; 57 49 type File = Set<members::file>; 50 + type Lang = S::Lang; 51 + } 52 + ///State transition - sets the `lang` field to Set 53 + pub struct SetLang<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetLang<S> {} 55 + impl<S: State> State for SetLang<S> { 56 + type File = S::File; 57 + type Lang = Set<members::lang>; 58 58 } 59 59 /// Marker types for field names 60 60 #[allow(non_camel_case_types)] 61 61 pub mod members { 62 - ///Marker type for the `lang` field 63 - pub struct lang(()); 64 62 ///Marker type for the `file` field 65 63 pub struct file(()); 64 + ///Marker type for the `lang` field 65 + pub struct lang(()); 66 66 } 67 67 } 68 68 ··· 135 135 impl<'a, S> CaptionBuilder<'a, S> 136 136 where 137 137 S: caption_state::State, 138 - S::Lang: caption_state::IsSet, 139 138 S::File: caption_state::IsSet, 139 + S::Lang: caption_state::IsSet, 140 140 { 141 141 /// Build the final struct 142 142 pub fn build(self) -> Caption<'a> { ··· 940 940 } 941 941 /// State trait tracking which required fields have been set 942 942 pub trait State: sealed::Sealed { 943 - type Cid; 944 943 type Playlist; 944 + type Cid; 945 945 } 946 946 /// Empty state - all required fields are unset 947 947 pub struct Empty(()); 948 948 impl sealed::Sealed for Empty {} 949 949 impl State for Empty { 950 - type Cid = Unset; 951 950 type Playlist = Unset; 952 - } 953 - ///State transition - sets the `cid` field to Set 954 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 955 - impl<S: State> sealed::Sealed for SetCid<S> {} 956 - impl<S: State> State for SetCid<S> { 957 - type Cid = Set<members::cid>; 958 - type Playlist = S::Playlist; 951 + type Cid = Unset; 959 952 } 960 953 ///State transition - sets the `playlist` field to Set 961 954 pub struct SetPlaylist<S: State = Empty>(PhantomData<fn() -> S>); 962 955 impl<S: State> sealed::Sealed for SetPlaylist<S> {} 963 956 impl<S: State> State for SetPlaylist<S> { 964 - type Cid = S::Cid; 965 957 type Playlist = Set<members::playlist>; 958 + type Cid = S::Cid; 959 + } 960 + ///State transition - sets the `cid` field to Set 961 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 962 + impl<S: State> sealed::Sealed for SetCid<S> {} 963 + impl<S: State> State for SetCid<S> { 964 + type Playlist = S::Playlist; 965 + type Cid = Set<members::cid>; 966 966 } 967 967 /// Marker types for field names 968 968 #[allow(non_camel_case_types)] 969 969 pub mod members { 970 - ///Marker type for the `cid` field 971 - pub struct cid(()); 972 970 ///Marker type for the `playlist` field 973 971 pub struct playlist(()); 972 + ///Marker type for the `cid` field 973 + pub struct cid(()); 974 974 } 975 975 } 976 976 ··· 1108 1108 impl<'a, S> ViewBuilder<'a, S> 1109 1109 where 1110 1110 S: view_state::State, 1111 - S::Cid: view_state::IsSet, 1112 1111 S::Playlist: view_state::IsSet, 1112 + S::Cid: view_state::IsSet, 1113 1113 { 1114 1114 /// Build the final struct 1115 1115 pub fn build(self) -> View<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/graph/like.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Subject; 38 37 type CreatedAt; 38 + type Subject; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type Subject = Unset; 45 44 type CreatedAt = Unset; 46 - } 47 - ///State transition - sets the `subject` field to Set 48 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetSubject<S> {} 50 - impl<S: State> State for SetSubject<S> { 51 - type Subject = Set<members::subject>; 52 - type CreatedAt = S::CreatedAt; 45 + type Subject = Unset; 53 46 } 54 47 ///State transition - sets the `created_at` field to Set 55 48 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 57 50 impl<S: State> State for SetCreatedAt<S> { 58 - type Subject = S::Subject; 59 51 type CreatedAt = Set<members::created_at>; 52 + type Subject = S::Subject; 53 + } 54 + ///State transition - sets the `subject` field to Set 55 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetSubject<S> {} 57 + impl<S: State> State for SetSubject<S> { 58 + type CreatedAt = S::CreatedAt; 59 + type Subject = Set<members::subject>; 60 60 } 61 61 /// Marker types for field names 62 62 #[allow(non_camel_case_types)] 63 63 pub mod members { 64 - ///Marker type for the `subject` field 65 - pub struct subject(()); 66 64 ///Marker type for the `created_at` field 67 65 pub struct created_at(()); 66 + ///Marker type for the `subject` field 67 + pub struct subject(()); 68 68 } 69 69 } 70 70 ··· 137 137 impl<'a, S> LikeBuilder<'a, S> 138 138 where 139 139 S: like_state::State, 140 - S::Subject: like_state::IsSet, 141 140 S::CreatedAt: like_state::IsSet, 141 + S::Subject: like_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> Like<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/graph/listitem.rs
··· 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 40 type Subject; 41 - type List; 42 41 type CreatedAt; 42 + type List; 43 43 } 44 44 /// Empty state - all required fields are unset 45 45 pub struct Empty(()); 46 46 impl sealed::Sealed for Empty {} 47 47 impl State for Empty { 48 48 type Subject = Unset; 49 - type List = Unset; 50 49 type CreatedAt = Unset; 50 + type List = Unset; 51 51 } 52 52 ///State transition - sets the `subject` field to Set 53 53 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 54 54 impl<S: State> sealed::Sealed for SetSubject<S> {} 55 55 impl<S: State> State for SetSubject<S> { 56 56 type Subject = Set<members::subject>; 57 - type List = S::List; 58 57 type CreatedAt = S::CreatedAt; 59 - } 60 - ///State transition - sets the `list` field to Set 61 - pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 62 - impl<S: State> sealed::Sealed for SetList<S> {} 63 - impl<S: State> State for SetList<S> { 64 - type Subject = S::Subject; 65 - type List = Set<members::list>; 66 - type CreatedAt = S::CreatedAt; 58 + type List = S::List; 67 59 } 68 60 ///State transition - sets the `created_at` field to Set 69 61 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 70 62 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 71 63 impl<S: State> State for SetCreatedAt<S> { 72 64 type Subject = S::Subject; 73 - type List = S::List; 74 65 type CreatedAt = Set<members::created_at>; 66 + type List = S::List; 67 + } 68 + ///State transition - sets the `list` field to Set 69 + pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>); 70 + impl<S: State> sealed::Sealed for SetList<S> {} 71 + impl<S: State> State for SetList<S> { 72 + type Subject = S::Subject; 73 + type CreatedAt = S::CreatedAt; 74 + type List = Set<members::list>; 75 75 } 76 76 /// Marker types for field names 77 77 #[allow(non_camel_case_types)] 78 78 pub mod members { 79 79 ///Marker type for the `subject` field 80 80 pub struct subject(()); 81 + ///Marker type for the `created_at` field 82 + pub struct created_at(()); 81 83 ///Marker type for the `list` field 82 84 pub struct list(()); 83 - ///Marker type for the `created_at` field 84 - pub struct created_at(()); 85 85 } 86 86 } 87 87 ··· 175 175 where 176 176 S: listitem_state::State, 177 177 S::Subject: listitem_state::IsSet, 178 - S::List: listitem_state::IsSet, 179 178 S::CreatedAt: listitem_state::IsSet, 179 + S::List: listitem_state::IsSet, 180 180 { 181 181 /// Build the final struct 182 182 pub fn build(self) -> Listitem<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/graph/subscribe_accept.rs
··· 34 34 } 35 35 /// State trait tracking which required fields have been set 36 36 pub trait State: sealed::Sealed { 37 - type Subscribe; 38 37 type CreatedAt; 38 + type Subscribe; 39 39 } 40 40 /// Empty state - all required fields are unset 41 41 pub struct Empty(()); 42 42 impl sealed::Sealed for Empty {} 43 43 impl State for Empty { 44 - type Subscribe = Unset; 45 44 type CreatedAt = Unset; 46 - } 47 - ///State transition - sets the `subscribe` field to Set 48 - pub struct SetSubscribe<S: State = Empty>(PhantomData<fn() -> S>); 49 - impl<S: State> sealed::Sealed for SetSubscribe<S> {} 50 - impl<S: State> State for SetSubscribe<S> { 51 - type Subscribe = Set<members::subscribe>; 52 - type CreatedAt = S::CreatedAt; 45 + type Subscribe = Unset; 53 46 } 54 47 ///State transition - sets the `created_at` field to Set 55 48 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 56 49 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 57 50 impl<S: State> State for SetCreatedAt<S> { 58 - type Subscribe = S::Subscribe; 59 51 type CreatedAt = Set<members::created_at>; 52 + type Subscribe = S::Subscribe; 53 + } 54 + ///State transition - sets the `subscribe` field to Set 55 + pub struct SetSubscribe<S: State = Empty>(PhantomData<fn() -> S>); 56 + impl<S: State> sealed::Sealed for SetSubscribe<S> {} 57 + impl<S: State> State for SetSubscribe<S> { 58 + type CreatedAt = S::CreatedAt; 59 + type Subscribe = Set<members::subscribe>; 60 60 } 61 61 /// Marker types for field names 62 62 #[allow(non_camel_case_types)] 63 63 pub mod members { 64 - ///Marker type for the `subscribe` field 65 - pub struct subscribe(()); 66 64 ///Marker type for the `created_at` field 67 65 pub struct created_at(()); 66 + ///Marker type for the `subscribe` field 67 + pub struct subscribe(()); 68 68 } 69 69 } 70 70 ··· 137 137 impl<'a, S> SubscribeAcceptBuilder<'a, S> 138 138 where 139 139 S: subscribe_accept_state::State, 140 - S::Subscribe: subscribe_accept_state::IsSet, 141 140 S::CreatedAt: subscribe_accept_state::IsSet, 141 + S::Subscribe: subscribe_accept_state::IsSet, 142 142 { 143 143 /// Build the final struct 144 144 pub fn build(self) -> SubscribeAccept<'a> {
+78 -78
crates/weaver-api/src/sh_weaver/notebook.rs
··· 1367 1367 } 1368 1368 /// State trait tracking which required fields have been set 1369 1369 pub trait State: sealed::Sealed { 1370 - type Uri; 1371 1370 type Cid; 1372 1371 type Authors; 1373 1372 type Record; 1374 1373 type IndexedAt; 1374 + type Uri; 1375 1375 } 1376 1376 /// Empty state - all required fields are unset 1377 1377 pub struct Empty(()); 1378 1378 impl sealed::Sealed for Empty {} 1379 1379 impl State for Empty { 1380 - type Uri = Unset; 1381 1380 type Cid = Unset; 1382 1381 type Authors = Unset; 1383 1382 type Record = Unset; 1384 1383 type IndexedAt = Unset; 1385 - } 1386 - ///State transition - sets the `uri` field to Set 1387 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1388 - impl<S: State> sealed::Sealed for SetUri<S> {} 1389 - impl<S: State> State for SetUri<S> { 1390 - type Uri = Set<members::uri>; 1391 - type Cid = S::Cid; 1392 - type Authors = S::Authors; 1393 - type Record = S::Record; 1394 - type IndexedAt = S::IndexedAt; 1384 + type Uri = Unset; 1395 1385 } 1396 1386 ///State transition - sets the `cid` field to Set 1397 1387 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1398 1388 impl<S: State> sealed::Sealed for SetCid<S> {} 1399 1389 impl<S: State> State for SetCid<S> { 1400 - type Uri = S::Uri; 1401 1390 type Cid = Set<members::cid>; 1402 1391 type Authors = S::Authors; 1403 1392 type Record = S::Record; 1404 1393 type IndexedAt = S::IndexedAt; 1394 + type Uri = S::Uri; 1405 1395 } 1406 1396 ///State transition - sets the `authors` field to Set 1407 1397 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 1408 1398 impl<S: State> sealed::Sealed for SetAuthors<S> {} 1409 1399 impl<S: State> State for SetAuthors<S> { 1410 - type Uri = S::Uri; 1411 1400 type Cid = S::Cid; 1412 1401 type Authors = Set<members::authors>; 1413 1402 type Record = S::Record; 1414 1403 type IndexedAt = S::IndexedAt; 1404 + type Uri = S::Uri; 1415 1405 } 1416 1406 ///State transition - sets the `record` field to Set 1417 1407 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 1418 1408 impl<S: State> sealed::Sealed for SetRecord<S> {} 1419 1409 impl<S: State> State for SetRecord<S> { 1420 - type Uri = S::Uri; 1421 1410 type Cid = S::Cid; 1422 1411 type Authors = S::Authors; 1423 1412 type Record = Set<members::record>; 1424 1413 type IndexedAt = S::IndexedAt; 1414 + type Uri = S::Uri; 1425 1415 } 1426 1416 ///State transition - sets the `indexed_at` field to Set 1427 1417 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1428 1418 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1429 1419 impl<S: State> State for SetIndexedAt<S> { 1430 - type Uri = S::Uri; 1431 1420 type Cid = S::Cid; 1432 1421 type Authors = S::Authors; 1433 1422 type Record = S::Record; 1434 1423 type IndexedAt = Set<members::indexed_at>; 1424 + type Uri = S::Uri; 1425 + } 1426 + ///State transition - sets the `uri` field to Set 1427 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1428 + impl<S: State> sealed::Sealed for SetUri<S> {} 1429 + impl<S: State> State for SetUri<S> { 1430 + type Cid = S::Cid; 1431 + type Authors = S::Authors; 1432 + type Record = S::Record; 1433 + type IndexedAt = S::IndexedAt; 1434 + type Uri = Set<members::uri>; 1435 1435 } 1436 1436 /// Marker types for field names 1437 1437 #[allow(non_camel_case_types)] 1438 1438 pub mod members { 1439 - ///Marker type for the `uri` field 1440 - pub struct uri(()); 1441 1439 ///Marker type for the `cid` field 1442 1440 pub struct cid(()); 1443 1441 ///Marker type for the `authors` field ··· 1446 1444 pub struct record(()); 1447 1445 ///Marker type for the `indexed_at` field 1448 1446 pub struct indexed_at(()); 1447 + ///Marker type for the `uri` field 1448 + pub struct uri(()); 1449 1449 } 1450 1450 } 1451 1451 ··· 1689 1689 impl<'a, S> EntryViewBuilder<'a, S> 1690 1690 where 1691 1691 S: entry_view_state::State, 1692 - S::Uri: entry_view_state::IsSet, 1693 1692 S::Cid: entry_view_state::IsSet, 1694 1693 S::Authors: entry_view_state::IsSet, 1695 1694 S::Record: entry_view_state::IsSet, 1696 1695 S::IndexedAt: entry_view_state::IsSet, 1696 + S::Uri: entry_view_state::IsSet, 1697 1697 { 1698 1698 /// Build the final struct 1699 1699 pub fn build(self) -> EntryView<'a> { ··· 1799 1799 } 1800 1800 /// State trait tracking which required fields have been set 1801 1801 pub trait State: sealed::Sealed { 1802 - type Uri; 1802 + type Record; 1803 1803 type Cid; 1804 + type Uri; 1804 1805 type Authors; 1805 - type Record; 1806 1806 type IndexedAt; 1807 1807 } 1808 1808 /// Empty state - all required fields are unset 1809 1809 pub struct Empty(()); 1810 1810 impl sealed::Sealed for Empty {} 1811 1811 impl State for Empty { 1812 - type Uri = Unset; 1812 + type Record = Unset; 1813 1813 type Cid = Unset; 1814 + type Uri = Unset; 1814 1815 type Authors = Unset; 1815 - type Record = Unset; 1816 1816 type IndexedAt = Unset; 1817 1817 } 1818 - ///State transition - sets the `uri` field to Set 1819 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1820 - impl<S: State> sealed::Sealed for SetUri<S> {} 1821 - impl<S: State> State for SetUri<S> { 1822 - type Uri = Set<members::uri>; 1818 + ///State transition - sets the `record` field to Set 1819 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 1820 + impl<S: State> sealed::Sealed for SetRecord<S> {} 1821 + impl<S: State> State for SetRecord<S> { 1822 + type Record = Set<members::record>; 1823 1823 type Cid = S::Cid; 1824 + type Uri = S::Uri; 1824 1825 type Authors = S::Authors; 1825 - type Record = S::Record; 1826 1826 type IndexedAt = S::IndexedAt; 1827 1827 } 1828 1828 ///State transition - sets the `cid` field to Set 1829 1829 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 1830 1830 impl<S: State> sealed::Sealed for SetCid<S> {} 1831 1831 impl<S: State> State for SetCid<S> { 1832 + type Record = S::Record; 1833 + type Cid = Set<members::cid>; 1832 1834 type Uri = S::Uri; 1833 - type Cid = Set<members::cid>; 1834 1835 type Authors = S::Authors; 1836 + type IndexedAt = S::IndexedAt; 1837 + } 1838 + ///State transition - sets the `uri` field to Set 1839 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 1840 + impl<S: State> sealed::Sealed for SetUri<S> {} 1841 + impl<S: State> State for SetUri<S> { 1835 1842 type Record = S::Record; 1843 + type Cid = S::Cid; 1844 + type Uri = Set<members::uri>; 1845 + type Authors = S::Authors; 1836 1846 type IndexedAt = S::IndexedAt; 1837 1847 } 1838 1848 ///State transition - sets the `authors` field to Set 1839 1849 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 1840 1850 impl<S: State> sealed::Sealed for SetAuthors<S> {} 1841 1851 impl<S: State> State for SetAuthors<S> { 1842 - type Uri = S::Uri; 1843 - type Cid = S::Cid; 1844 - type Authors = Set<members::authors>; 1845 1852 type Record = S::Record; 1846 - type IndexedAt = S::IndexedAt; 1847 - } 1848 - ///State transition - sets the `record` field to Set 1849 - pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 1850 - impl<S: State> sealed::Sealed for SetRecord<S> {} 1851 - impl<S: State> State for SetRecord<S> { 1853 + type Cid = S::Cid; 1852 1854 type Uri = S::Uri; 1853 - type Cid = S::Cid; 1854 - type Authors = S::Authors; 1855 - type Record = Set<members::record>; 1855 + type Authors = Set<members::authors>; 1856 1856 type IndexedAt = S::IndexedAt; 1857 1857 } 1858 1858 ///State transition - sets the `indexed_at` field to Set 1859 1859 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 1860 1860 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 1861 1861 impl<S: State> State for SetIndexedAt<S> { 1862 + type Record = S::Record; 1863 + type Cid = S::Cid; 1862 1864 type Uri = S::Uri; 1863 - type Cid = S::Cid; 1864 1865 type Authors = S::Authors; 1865 - type Record = S::Record; 1866 1866 type IndexedAt = Set<members::indexed_at>; 1867 1867 } 1868 1868 /// Marker types for field names 1869 1869 #[allow(non_camel_case_types)] 1870 1870 pub mod members { 1871 + ///Marker type for the `record` field 1872 + pub struct record(()); 1873 + ///Marker type for the `cid` field 1874 + pub struct cid(()); 1871 1875 ///Marker type for the `uri` field 1872 1876 pub struct uri(()); 1873 - ///Marker type for the `cid` field 1874 - pub struct cid(()); 1875 1877 ///Marker type for the `authors` field 1876 1878 pub struct authors(()); 1877 - ///Marker type for the `record` field 1878 - pub struct record(()); 1879 1879 ///Marker type for the `indexed_at` field 1880 1880 pub struct indexed_at(()); 1881 1881 } ··· 2100 2100 impl<'a, S> NotebookViewBuilder<'a, S> 2101 2101 where 2102 2102 S: notebook_view_state::State, 2103 - S::Uri: notebook_view_state::IsSet, 2103 + S::Record: notebook_view_state::IsSet, 2104 2104 S::Cid: notebook_view_state::IsSet, 2105 + S::Uri: notebook_view_state::IsSet, 2105 2106 S::Authors: notebook_view_state::IsSet, 2106 - S::Record: notebook_view_state::IsSet, 2107 2107 S::IndexedAt: notebook_view_state::IsSet, 2108 2108 { 2109 2109 /// Build the final struct ··· 2198 2198 } 2199 2199 /// State trait tracking which required fields have been set 2200 2200 pub trait State: sealed::Sealed { 2201 - type Did; 2201 + type GrantedAt; 2202 2202 type Scope; 2203 + type Did; 2203 2204 type Source; 2204 - type GrantedAt; 2205 2205 } 2206 2206 /// Empty state - all required fields are unset 2207 2207 pub struct Empty(()); 2208 2208 impl sealed::Sealed for Empty {} 2209 2209 impl State for Empty { 2210 - type Did = Unset; 2210 + type GrantedAt = Unset; 2211 2211 type Scope = Unset; 2212 + type Did = Unset; 2212 2213 type Source = Unset; 2213 - type GrantedAt = Unset; 2214 2214 } 2215 - ///State transition - sets the `did` field to Set 2216 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2217 - impl<S: State> sealed::Sealed for SetDid<S> {} 2218 - impl<S: State> State for SetDid<S> { 2219 - type Did = Set<members::did>; 2215 + ///State transition - sets the `granted_at` field to Set 2216 + pub struct SetGrantedAt<S: State = Empty>(PhantomData<fn() -> S>); 2217 + impl<S: State> sealed::Sealed for SetGrantedAt<S> {} 2218 + impl<S: State> State for SetGrantedAt<S> { 2219 + type GrantedAt = Set<members::granted_at>; 2220 2220 type Scope = S::Scope; 2221 + type Did = S::Did; 2221 2222 type Source = S::Source; 2222 - type GrantedAt = S::GrantedAt; 2223 2223 } 2224 2224 ///State transition - sets the `scope` field to Set 2225 2225 pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 2226 2226 impl<S: State> sealed::Sealed for SetScope<S> {} 2227 2227 impl<S: State> State for SetScope<S> { 2228 + type GrantedAt = S::GrantedAt; 2229 + type Scope = Set<members::scope>; 2228 2230 type Did = S::Did; 2229 - type Scope = Set<members::scope>; 2230 2231 type Source = S::Source; 2232 + } 2233 + ///State transition - sets the `did` field to Set 2234 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2235 + impl<S: State> sealed::Sealed for SetDid<S> {} 2236 + impl<S: State> State for SetDid<S> { 2231 2237 type GrantedAt = S::GrantedAt; 2238 + type Scope = S::Scope; 2239 + type Did = Set<members::did>; 2240 + type Source = S::Source; 2232 2241 } 2233 2242 ///State transition - sets the `source` field to Set 2234 2243 pub struct SetSource<S: State = Empty>(PhantomData<fn() -> S>); 2235 2244 impl<S: State> sealed::Sealed for SetSource<S> {} 2236 2245 impl<S: State> State for SetSource<S> { 2237 - type Did = S::Did; 2246 + type GrantedAt = S::GrantedAt; 2238 2247 type Scope = S::Scope; 2248 + type Did = S::Did; 2239 2249 type Source = Set<members::source>; 2240 - type GrantedAt = S::GrantedAt; 2241 - } 2242 - ///State transition - sets the `granted_at` field to Set 2243 - pub struct SetGrantedAt<S: State = Empty>(PhantomData<fn() -> S>); 2244 - impl<S: State> sealed::Sealed for SetGrantedAt<S> {} 2245 - impl<S: State> State for SetGrantedAt<S> { 2246 - type Did = S::Did; 2247 - type Scope = S::Scope; 2248 - type Source = S::Source; 2249 - type GrantedAt = Set<members::granted_at>; 2250 2250 } 2251 2251 /// Marker types for field names 2252 2252 #[allow(non_camel_case_types)] 2253 2253 pub mod members { 2254 - ///Marker type for the `did` field 2255 - pub struct did(()); 2254 + ///Marker type for the `granted_at` field 2255 + pub struct granted_at(()); 2256 2256 ///Marker type for the `scope` field 2257 2257 pub struct scope(()); 2258 + ///Marker type for the `did` field 2259 + pub struct did(()); 2258 2260 ///Marker type for the `source` field 2259 2261 pub struct source(()); 2260 - ///Marker type for the `granted_at` field 2261 - pub struct granted_at(()); 2262 2262 } 2263 2263 } 2264 2264 ··· 2371 2371 impl<'a, S> PermissionGrantBuilder<'a, S> 2372 2372 where 2373 2373 S: permission_grant_state::State, 2374 - S::Did: permission_grant_state::IsSet, 2374 + S::GrantedAt: permission_grant_state::IsSet, 2375 2375 S::Scope: permission_grant_state::IsSet, 2376 + S::Did: permission_grant_state::IsSet, 2376 2377 S::Source: permission_grant_state::IsSet, 2377 - S::GrantedAt: permission_grant_state::IsSet, 2378 2378 { 2379 2379 /// Build the final struct 2380 2380 pub fn build(self) -> PermissionGrant<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/notebook/book.rs
··· 52 52 } 53 53 /// State trait tracking which required fields have been set 54 54 pub trait State: sealed::Sealed { 55 - type Authors; 56 55 type EntryList; 56 + type Authors; 57 57 } 58 58 /// Empty state - all required fields are unset 59 59 pub struct Empty(()); 60 60 impl sealed::Sealed for Empty {} 61 61 impl State for Empty { 62 - type Authors = Unset; 63 62 type EntryList = Unset; 64 - } 65 - ///State transition - sets the `authors` field to Set 66 - pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 67 - impl<S: State> sealed::Sealed for SetAuthors<S> {} 68 - impl<S: State> State for SetAuthors<S> { 69 - type Authors = Set<members::authors>; 70 - type EntryList = S::EntryList; 63 + type Authors = Unset; 71 64 } 72 65 ///State transition - sets the `entry_list` field to Set 73 66 pub struct SetEntryList<S: State = Empty>(PhantomData<fn() -> S>); 74 67 impl<S: State> sealed::Sealed for SetEntryList<S> {} 75 68 impl<S: State> State for SetEntryList<S> { 76 - type Authors = S::Authors; 77 69 type EntryList = Set<members::entry_list>; 70 + type Authors = S::Authors; 71 + } 72 + ///State transition - sets the `authors` field to Set 73 + pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 74 + impl<S: State> sealed::Sealed for SetAuthors<S> {} 75 + impl<S: State> State for SetAuthors<S> { 76 + type EntryList = S::EntryList; 77 + type Authors = Set<members::authors>; 78 78 } 79 79 /// Marker types for field names 80 80 #[allow(non_camel_case_types)] 81 81 pub mod members { 82 - ///Marker type for the `authors` field 83 - pub struct authors(()); 84 82 ///Marker type for the `entry_list` field 85 83 pub struct entry_list(()); 84 + ///Marker type for the `authors` field 85 + pub struct authors(()); 86 86 } 87 87 } 88 88 ··· 275 275 impl<'a, S> BookBuilder<'a, S> 276 276 where 277 277 S: book_state::State, 278 - S::Authors: book_state::IsSet, 279 278 S::EntryList: book_state::IsSet, 279 + S::Authors: book_state::IsSet, 280 280 { 281 281 /// Build the final struct 282 282 pub fn build(self) -> Book<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs
··· 38 38 } 39 39 /// State trait tracking which required fields have been set 40 40 pub trait State: sealed::Sealed { 41 - type Name; 42 41 type Variant; 43 42 type Colours; 43 + type Name; 44 44 } 45 45 /// Empty state - all required fields are unset 46 46 pub struct Empty(()); 47 47 impl sealed::Sealed for Empty {} 48 48 impl State for Empty { 49 - type Name = Unset; 50 49 type Variant = Unset; 51 50 type Colours = Unset; 52 - } 53 - ///State transition - sets the `name` field to Set 54 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 55 - impl<S: State> sealed::Sealed for SetName<S> {} 56 - impl<S: State> State for SetName<S> { 57 - type Name = Set<members::name>; 58 - type Variant = S::Variant; 59 - type Colours = S::Colours; 51 + type Name = Unset; 60 52 } 61 53 ///State transition - sets the `variant` field to Set 62 54 pub struct SetVariant<S: State = Empty>(PhantomData<fn() -> S>); 63 55 impl<S: State> sealed::Sealed for SetVariant<S> {} 64 56 impl<S: State> State for SetVariant<S> { 65 - type Name = S::Name; 66 57 type Variant = Set<members::variant>; 67 58 type Colours = S::Colours; 59 + type Name = S::Name; 68 60 } 69 61 ///State transition - sets the `colours` field to Set 70 62 pub struct SetColours<S: State = Empty>(PhantomData<fn() -> S>); 71 63 impl<S: State> sealed::Sealed for SetColours<S> {} 72 64 impl<S: State> State for SetColours<S> { 73 - type Name = S::Name; 74 65 type Variant = S::Variant; 75 66 type Colours = Set<members::colours>; 67 + type Name = S::Name; 68 + } 69 + ///State transition - sets the `name` field to Set 70 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 71 + impl<S: State> sealed::Sealed for SetName<S> {} 72 + impl<S: State> State for SetName<S> { 73 + type Variant = S::Variant; 74 + type Colours = S::Colours; 75 + type Name = Set<members::name>; 76 76 } 77 77 /// Marker types for field names 78 78 #[allow(non_camel_case_types)] 79 79 pub mod members { 80 - ///Marker type for the `name` field 81 - pub struct name(()); 82 80 ///Marker type for the `variant` field 83 81 pub struct variant(()); 84 82 ///Marker type for the `colours` field 85 83 pub struct colours(()); 84 + ///Marker type for the `name` field 85 + pub struct name(()); 86 86 } 87 87 } 88 88 ··· 175 175 impl<'a, S> ColourSchemeBuilder<'a, S> 176 176 where 177 177 S: colour_scheme_state::State, 178 - S::Name: colour_scheme_state::IsSet, 179 178 S::Variant: colour_scheme_state::IsSet, 180 179 S::Colours: colour_scheme_state::IsSet, 180 + S::Name: colour_scheme_state::IsSet, 181 181 { 182 182 /// Build the final struct 183 183 pub fn build(self) -> ColourScheme<'a> {
+26 -26
crates/weaver-api/src/sh_weaver/notebook/entry.rs
··· 53 53 /// State trait tracking which required fields have been set 54 54 pub trait State: sealed::Sealed { 55 55 type Content; 56 - type Title; 57 - type Path; 58 56 type CreatedAt; 57 + type Path; 58 + type Title; 59 59 } 60 60 /// Empty state - all required fields are unset 61 61 pub struct Empty(()); 62 62 impl sealed::Sealed for Empty {} 63 63 impl State for Empty { 64 64 type Content = Unset; 65 - type Title = Unset; 66 - type Path = Unset; 67 65 type CreatedAt = Unset; 66 + type Path = Unset; 67 + type Title = Unset; 68 68 } 69 69 ///State transition - sets the `content` field to Set 70 70 pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 71 71 impl<S: State> sealed::Sealed for SetContent<S> {} 72 72 impl<S: State> State for SetContent<S> { 73 73 type Content = Set<members::content>; 74 - type Title = S::Title; 75 - type Path = S::Path; 76 74 type CreatedAt = S::CreatedAt; 75 + type Path = S::Path; 76 + type Title = S::Title; 77 77 } 78 - ///State transition - sets the `title` field to Set 79 - pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 80 - impl<S: State> sealed::Sealed for SetTitle<S> {} 81 - impl<S: State> State for SetTitle<S> { 78 + ///State transition - sets the `created_at` field to Set 79 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 80 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 81 + impl<S: State> State for SetCreatedAt<S> { 82 82 type Content = S::Content; 83 - type Title = Set<members::title>; 83 + type CreatedAt = Set<members::created_at>; 84 84 type Path = S::Path; 85 - type CreatedAt = S::CreatedAt; 85 + type Title = S::Title; 86 86 } 87 87 ///State transition - sets the `path` field to Set 88 88 pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>); 89 89 impl<S: State> sealed::Sealed for SetPath<S> {} 90 90 impl<S: State> State for SetPath<S> { 91 91 type Content = S::Content; 92 - type Title = S::Title; 92 + type CreatedAt = S::CreatedAt; 93 93 type Path = Set<members::path>; 94 - type CreatedAt = S::CreatedAt; 94 + type Title = S::Title; 95 95 } 96 - ///State transition - sets the `created_at` field to Set 97 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 98 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 99 - impl<S: State> State for SetCreatedAt<S> { 96 + ///State transition - sets the `title` field to Set 97 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 98 + impl<S: State> sealed::Sealed for SetTitle<S> {} 99 + impl<S: State> State for SetTitle<S> { 100 100 type Content = S::Content; 101 - type Title = S::Title; 101 + type CreatedAt = S::CreatedAt; 102 102 type Path = S::Path; 103 - type CreatedAt = Set<members::created_at>; 103 + type Title = Set<members::title>; 104 104 } 105 105 /// Marker types for field names 106 106 #[allow(non_camel_case_types)] 107 107 pub mod members { 108 108 ///Marker type for the `content` field 109 109 pub struct content(()); 110 - ///Marker type for the `title` field 111 - pub struct title(()); 112 - ///Marker type for the `path` field 113 - pub struct path(()); 114 110 ///Marker type for the `created_at` field 115 111 pub struct created_at(()); 112 + ///Marker type for the `path` field 113 + pub struct path(()); 114 + ///Marker type for the `title` field 115 + pub struct title(()); 116 116 } 117 117 } 118 118 ··· 300 300 where 301 301 S: entry_state::State, 302 302 S::Content: entry_state::IsSet, 303 - S::Title: entry_state::IsSet, 304 - S::Path: entry_state::IsSet, 305 303 S::CreatedAt: entry_state::IsSet, 304 + S::Path: entry_state::IsSet, 305 + S::Title: entry_state::IsSet, 306 306 { 307 307 /// Build the final struct 308 308 pub fn build(self) -> Entry<'a> {
+13 -13
crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs
··· 32 32 } 33 33 /// State trait tracking which required fields have been set 34 34 pub trait State: sealed::Sealed { 35 - type Actor; 36 35 type Title; 36 + type Actor; 37 37 } 38 38 /// Empty state - all required fields are unset 39 39 pub struct Empty(()); 40 40 impl sealed::Sealed for Empty {} 41 41 impl State for Empty { 42 - type Actor = Unset; 43 42 type Title = Unset; 44 - } 45 - ///State transition - sets the `actor` field to Set 46 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetActor<S> {} 48 - impl<S: State> State for SetActor<S> { 49 - type Actor = Set<members::actor>; 50 - type Title = S::Title; 43 + type Actor = Unset; 51 44 } 52 45 ///State transition - sets the `title` field to Set 53 46 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 54 47 impl<S: State> sealed::Sealed for SetTitle<S> {} 55 48 impl<S: State> State for SetTitle<S> { 56 - type Actor = S::Actor; 57 49 type Title = Set<members::title>; 50 + type Actor = S::Actor; 51 + } 52 + ///State transition - sets the `actor` field to Set 53 + pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetActor<S> {} 55 + impl<S: State> State for SetActor<S> { 56 + type Title = S::Title; 57 + type Actor = Set<members::actor>; 58 58 } 59 59 /// Marker types for field names 60 60 #[allow(non_camel_case_types)] 61 61 pub mod members { 62 - ///Marker type for the `actor` field 63 - pub struct actor(()); 64 62 ///Marker type for the `title` field 65 63 pub struct title(()); 64 + ///Marker type for the `actor` field 65 + pub struct actor(()); 66 66 } 67 67 } 68 68 ··· 135 135 impl<'a, S> GetNotebookByTitleBuilder<'a, S> 136 136 where 137 137 S: get_notebook_by_title_state::State, 138 - S::Actor: get_notebook_by_title_state::IsSet, 139 138 S::Title: get_notebook_by_title_state::IsSet, 139 + S::Actor: get_notebook_by_title_state::IsSet, 140 140 { 141 141 /// Build the final struct 142 142 pub fn build(self) -> GetNotebookByTitle<'a> {
+15 -15
crates/weaver-api/src/sh_weaver/notebook/page.rs
··· 44 44 } 45 45 /// State trait tracking which required fields have been set 46 46 pub trait State: sealed::Sealed { 47 - type Notebook; 48 47 type Authors; 49 48 type EntryList; 49 + type Notebook; 50 50 } 51 51 /// Empty state - all required fields are unset 52 52 pub struct Empty(()); 53 53 impl sealed::Sealed for Empty {} 54 54 impl State for Empty { 55 - type Notebook = Unset; 56 55 type Authors = Unset; 57 56 type EntryList = Unset; 58 - } 59 - ///State transition - sets the `notebook` field to Set 60 - pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 61 - impl<S: State> sealed::Sealed for SetNotebook<S> {} 62 - impl<S: State> State for SetNotebook<S> { 63 - type Notebook = Set<members::notebook>; 64 - type Authors = S::Authors; 65 - type EntryList = S::EntryList; 57 + type Notebook = Unset; 66 58 } 67 59 ///State transition - sets the `authors` field to Set 68 60 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 69 61 impl<S: State> sealed::Sealed for SetAuthors<S> {} 70 62 impl<S: State> State for SetAuthors<S> { 71 - type Notebook = S::Notebook; 72 63 type Authors = Set<members::authors>; 73 64 type EntryList = S::EntryList; 65 + type Notebook = S::Notebook; 74 66 } 75 67 ///State transition - sets the `entry_list` field to Set 76 68 pub struct SetEntryList<S: State = Empty>(PhantomData<fn() -> S>); 77 69 impl<S: State> sealed::Sealed for SetEntryList<S> {} 78 70 impl<S: State> State for SetEntryList<S> { 79 - type Notebook = S::Notebook; 80 71 type Authors = S::Authors; 81 72 type EntryList = Set<members::entry_list>; 73 + type Notebook = S::Notebook; 74 + } 75 + ///State transition - sets the `notebook` field to Set 76 + pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetNotebook<S> {} 78 + impl<S: State> State for SetNotebook<S> { 79 + type Authors = S::Authors; 80 + type EntryList = S::EntryList; 81 + type Notebook = Set<members::notebook>; 82 82 } 83 83 /// Marker types for field names 84 84 #[allow(non_camel_case_types)] 85 85 pub mod members { 86 - ///Marker type for the `notebook` field 87 - pub struct notebook(()); 88 86 ///Marker type for the `authors` field 89 87 pub struct authors(()); 90 88 ///Marker type for the `entry_list` field 91 89 pub struct entry_list(()); 90 + ///Marker type for the `notebook` field 91 + pub struct notebook(()); 92 92 } 93 93 } 94 94 ··· 221 221 impl<'a, S> PageBuilder<'a, S> 222 222 where 223 223 S: page_state::State, 224 - S::Notebook: page_state::IsSet, 225 224 S::Authors: page_state::IsSet, 226 225 S::EntryList: page_state::IsSet, 226 + S::Notebook: page_state::IsSet, 227 227 { 228 228 /// Build the final struct 229 229 pub fn build(self) -> Page<'a> {
+62 -62
crates/weaver-api/src/sh_weaver/notebook/theme.rs
··· 36 36 } 37 37 /// State trait tracking which required fields have been set 38 38 pub trait State: sealed::Sealed { 39 - type Name; 40 39 type Did; 41 40 type Content; 41 + type Name; 42 42 } 43 43 /// Empty state - all required fields are unset 44 44 pub struct Empty(()); 45 45 impl sealed::Sealed for Empty {} 46 46 impl State for Empty { 47 - type Name = Unset; 48 47 type Did = Unset; 49 48 type Content = Unset; 50 - } 51 - ///State transition - sets the `name` field to Set 52 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetName<S> {} 54 - impl<S: State> State for SetName<S> { 55 - type Name = Set<members::name>; 56 - type Did = S::Did; 57 - type Content = S::Content; 49 + type Name = Unset; 58 50 } 59 51 ///State transition - sets the `did` field to Set 60 52 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 61 53 impl<S: State> sealed::Sealed for SetDid<S> {} 62 54 impl<S: State> State for SetDid<S> { 63 - type Name = S::Name; 64 55 type Did = Set<members::did>; 65 56 type Content = S::Content; 57 + type Name = S::Name; 66 58 } 67 59 ///State transition - sets the `content` field to Set 68 60 pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 69 61 impl<S: State> sealed::Sealed for SetContent<S> {} 70 62 impl<S: State> State for SetContent<S> { 71 - type Name = S::Name; 72 63 type Did = S::Did; 73 64 type Content = Set<members::content>; 65 + type Name = S::Name; 66 + } 67 + ///State transition - sets the `name` field to Set 68 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 69 + impl<S: State> sealed::Sealed for SetName<S> {} 70 + impl<S: State> State for SetName<S> { 71 + type Did = S::Did; 72 + type Content = S::Content; 73 + type Name = Set<members::name>; 74 74 } 75 75 /// Marker types for field names 76 76 #[allow(non_camel_case_types)] 77 77 pub mod members { 78 - ///Marker type for the `name` field 79 - pub struct name(()); 80 78 ///Marker type for the `did` field 81 79 pub struct did(()); 82 80 ///Marker type for the `content` field 83 81 pub struct content(()); 82 + ///Marker type for the `name` field 83 + pub struct name(()); 84 84 } 85 85 } 86 86 ··· 173 173 impl<'a, S> CodeThemeFileBuilder<'a, S> 174 174 where 175 175 S: code_theme_file_state::State, 176 - S::Name: code_theme_file_state::IsSet, 177 176 S::Did: code_theme_file_state::IsSet, 178 177 S::Content: code_theme_file_state::IsSet, 178 + S::Name: code_theme_file_state::IsSet, 179 179 { 180 180 /// Build the final struct 181 181 pub fn build(self) -> CodeThemeFile<'a> { ··· 1067 1067 } 1068 1068 /// State trait tracking which required fields have been set 1069 1069 pub trait State: sealed::Sealed { 1070 - type DarkScheme; 1071 - type LightScheme; 1072 1070 type Fonts; 1071 + type LightCodeTheme; 1072 + type LightScheme; 1073 1073 type Spacing; 1074 1074 type DarkCodeTheme; 1075 - type LightCodeTheme; 1075 + type DarkScheme; 1076 1076 } 1077 1077 /// Empty state - all required fields are unset 1078 1078 pub struct Empty(()); 1079 1079 impl sealed::Sealed for Empty {} 1080 1080 impl State for Empty { 1081 - type DarkScheme = Unset; 1081 + type Fonts = Unset; 1082 + type LightCodeTheme = Unset; 1082 1083 type LightScheme = Unset; 1083 - type Fonts = Unset; 1084 1084 type Spacing = Unset; 1085 1085 type DarkCodeTheme = Unset; 1086 - type LightCodeTheme = Unset; 1086 + type DarkScheme = Unset; 1087 1087 } 1088 - ///State transition - sets the `dark_scheme` field to Set 1089 - pub struct SetDarkScheme<S: State = Empty>(PhantomData<fn() -> S>); 1090 - impl<S: State> sealed::Sealed for SetDarkScheme<S> {} 1091 - impl<S: State> State for SetDarkScheme<S> { 1092 - type DarkScheme = Set<members::dark_scheme>; 1088 + ///State transition - sets the `fonts` field to Set 1089 + pub struct SetFonts<S: State = Empty>(PhantomData<fn() -> S>); 1090 + impl<S: State> sealed::Sealed for SetFonts<S> {} 1091 + impl<S: State> State for SetFonts<S> { 1092 + type Fonts = Set<members::fonts>; 1093 + type LightCodeTheme = S::LightCodeTheme; 1093 1094 type LightScheme = S::LightScheme; 1095 + type Spacing = S::Spacing; 1096 + type DarkCodeTheme = S::DarkCodeTheme; 1097 + type DarkScheme = S::DarkScheme; 1098 + } 1099 + ///State transition - sets the `light_code_theme` field to Set 1100 + pub struct SetLightCodeTheme<S: State = Empty>(PhantomData<fn() -> S>); 1101 + impl<S: State> sealed::Sealed for SetLightCodeTheme<S> {} 1102 + impl<S: State> State for SetLightCodeTheme<S> { 1094 1103 type Fonts = S::Fonts; 1104 + type LightCodeTheme = Set<members::light_code_theme>; 1105 + type LightScheme = S::LightScheme; 1095 1106 type Spacing = S::Spacing; 1096 1107 type DarkCodeTheme = S::DarkCodeTheme; 1097 - type LightCodeTheme = S::LightCodeTheme; 1108 + type DarkScheme = S::DarkScheme; 1098 1109 } 1099 1110 ///State transition - sets the `light_scheme` field to Set 1100 1111 pub struct SetLightScheme<S: State = Empty>(PhantomData<fn() -> S>); 1101 1112 impl<S: State> sealed::Sealed for SetLightScheme<S> {} 1102 1113 impl<S: State> State for SetLightScheme<S> { 1103 - type DarkScheme = S::DarkScheme; 1104 - type LightScheme = Set<members::light_scheme>; 1105 1114 type Fonts = S::Fonts; 1106 - type Spacing = S::Spacing; 1107 - type DarkCodeTheme = S::DarkCodeTheme; 1108 1115 type LightCodeTheme = S::LightCodeTheme; 1109 - } 1110 - ///State transition - sets the `fonts` field to Set 1111 - pub struct SetFonts<S: State = Empty>(PhantomData<fn() -> S>); 1112 - impl<S: State> sealed::Sealed for SetFonts<S> {} 1113 - impl<S: State> State for SetFonts<S> { 1114 - type DarkScheme = S::DarkScheme; 1115 - type LightScheme = S::LightScheme; 1116 - type Fonts = Set<members::fonts>; 1116 + type LightScheme = Set<members::light_scheme>; 1117 1117 type Spacing = S::Spacing; 1118 1118 type DarkCodeTheme = S::DarkCodeTheme; 1119 - type LightCodeTheme = S::LightCodeTheme; 1119 + type DarkScheme = S::DarkScheme; 1120 1120 } 1121 1121 ///State transition - sets the `spacing` field to Set 1122 1122 pub struct SetSpacing<S: State = Empty>(PhantomData<fn() -> S>); 1123 1123 impl<S: State> sealed::Sealed for SetSpacing<S> {} 1124 1124 impl<S: State> State for SetSpacing<S> { 1125 - type DarkScheme = S::DarkScheme; 1125 + type Fonts = S::Fonts; 1126 + type LightCodeTheme = S::LightCodeTheme; 1126 1127 type LightScheme = S::LightScheme; 1127 - type Fonts = S::Fonts; 1128 1128 type Spacing = Set<members::spacing>; 1129 1129 type DarkCodeTheme = S::DarkCodeTheme; 1130 - type LightCodeTheme = S::LightCodeTheme; 1130 + type DarkScheme = S::DarkScheme; 1131 1131 } 1132 1132 ///State transition - sets the `dark_code_theme` field to Set 1133 1133 pub struct SetDarkCodeTheme<S: State = Empty>(PhantomData<fn() -> S>); 1134 1134 impl<S: State> sealed::Sealed for SetDarkCodeTheme<S> {} 1135 1135 impl<S: State> State for SetDarkCodeTheme<S> { 1136 - type DarkScheme = S::DarkScheme; 1137 - type LightScheme = S::LightScheme; 1138 1136 type Fonts = S::Fonts; 1137 + type LightCodeTheme = S::LightCodeTheme; 1138 + type LightScheme = S::LightScheme; 1139 1139 type Spacing = S::Spacing; 1140 1140 type DarkCodeTheme = Set<members::dark_code_theme>; 1141 - type LightCodeTheme = S::LightCodeTheme; 1142 - } 1143 - ///State transition - sets the `light_code_theme` field to Set 1144 - pub struct SetLightCodeTheme<S: State = Empty>(PhantomData<fn() -> S>); 1145 - impl<S: State> sealed::Sealed for SetLightCodeTheme<S> {} 1146 - impl<S: State> State for SetLightCodeTheme<S> { 1147 1141 type DarkScheme = S::DarkScheme; 1142 + } 1143 + ///State transition - sets the `dark_scheme` field to Set 1144 + pub struct SetDarkScheme<S: State = Empty>(PhantomData<fn() -> S>); 1145 + impl<S: State> sealed::Sealed for SetDarkScheme<S> {} 1146 + impl<S: State> State for SetDarkScheme<S> { 1147 + type Fonts = S::Fonts; 1148 + type LightCodeTheme = S::LightCodeTheme; 1148 1149 type LightScheme = S::LightScheme; 1149 - type Fonts = S::Fonts; 1150 1150 type Spacing = S::Spacing; 1151 1151 type DarkCodeTheme = S::DarkCodeTheme; 1152 - type LightCodeTheme = Set<members::light_code_theme>; 1152 + type DarkScheme = Set<members::dark_scheme>; 1153 1153 } 1154 1154 /// Marker types for field names 1155 1155 #[allow(non_camel_case_types)] 1156 1156 pub mod members { 1157 - ///Marker type for the `dark_scheme` field 1158 - pub struct dark_scheme(()); 1157 + ///Marker type for the `fonts` field 1158 + pub struct fonts(()); 1159 + ///Marker type for the `light_code_theme` field 1160 + pub struct light_code_theme(()); 1159 1161 ///Marker type for the `light_scheme` field 1160 1162 pub struct light_scheme(()); 1161 - ///Marker type for the `fonts` field 1162 - pub struct fonts(()); 1163 1163 ///Marker type for the `spacing` field 1164 1164 pub struct spacing(()); 1165 1165 ///Marker type for the `dark_code_theme` field 1166 1166 pub struct dark_code_theme(()); 1167 - ///Marker type for the `light_code_theme` field 1168 - pub struct light_code_theme(()); 1167 + ///Marker type for the `dark_scheme` field 1168 + pub struct dark_scheme(()); 1169 1169 } 1170 1170 } 1171 1171 ··· 1338 1338 impl<'a, S> ThemeBuilder<'a, S> 1339 1339 where 1340 1340 S: theme_state::State, 1341 - S::DarkScheme: theme_state::IsSet, 1342 - S::LightScheme: theme_state::IsSet, 1343 1341 S::Fonts: theme_state::IsSet, 1342 + S::LightCodeTheme: theme_state::IsSet, 1343 + S::LightScheme: theme_state::IsSet, 1344 1344 S::Spacing: theme_state::IsSet, 1345 1345 S::DarkCodeTheme: theme_state::IsSet, 1346 - S::LightCodeTheme: theme_state::IsSet, 1346 + S::DarkScheme: theme_state::IsSet, 1347 1347 { 1348 1348 /// Build the final struct 1349 1349 pub fn build(self) -> Theme<'a> {
+58 -58
crates/weaver-api/src/tools_ozone/communication.rs
··· 55 55 } 56 56 /// State trait tracking which required fields have been set 57 57 pub trait State: sealed::Sealed { 58 - type Id; 59 - type Name; 60 58 type ContentMarkdown; 59 + type Id; 61 60 type Disabled; 62 - type LastUpdatedBy; 63 61 type CreatedAt; 64 62 type UpdatedAt; 63 + type Name; 64 + type LastUpdatedBy; 65 65 } 66 66 /// Empty state - all required fields are unset 67 67 pub struct Empty(()); 68 68 impl sealed::Sealed for Empty {} 69 69 impl State for Empty { 70 - type Id = Unset; 71 - type Name = Unset; 72 70 type ContentMarkdown = Unset; 71 + type Id = Unset; 73 72 type Disabled = Unset; 74 - type LastUpdatedBy = Unset; 75 73 type CreatedAt = Unset; 76 74 type UpdatedAt = Unset; 75 + type Name = Unset; 76 + type LastUpdatedBy = Unset; 77 + } 78 + ///State transition - sets the `content_markdown` field to Set 79 + pub struct SetContentMarkdown<S: State = Empty>(PhantomData<fn() -> S>); 80 + impl<S: State> sealed::Sealed for SetContentMarkdown<S> {} 81 + impl<S: State> State for SetContentMarkdown<S> { 82 + type ContentMarkdown = Set<members::content_markdown>; 83 + type Id = S::Id; 84 + type Disabled = S::Disabled; 85 + type CreatedAt = S::CreatedAt; 86 + type UpdatedAt = S::UpdatedAt; 87 + type Name = S::Name; 88 + type LastUpdatedBy = S::LastUpdatedBy; 77 89 } 78 90 ///State transition - sets the `id` field to Set 79 91 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 80 92 impl<S: State> sealed::Sealed for SetId<S> {} 81 93 impl<S: State> State for SetId<S> { 94 + type ContentMarkdown = S::ContentMarkdown; 82 95 type Id = Set<members::id>; 83 - type Name = S::Name; 84 - type ContentMarkdown = S::ContentMarkdown; 85 96 type Disabled = S::Disabled; 86 - type LastUpdatedBy = S::LastUpdatedBy; 87 97 type CreatedAt = S::CreatedAt; 88 98 type UpdatedAt = S::UpdatedAt; 89 - } 90 - ///State transition - sets the `name` field to Set 91 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 92 - impl<S: State> sealed::Sealed for SetName<S> {} 93 - impl<S: State> State for SetName<S> { 94 - type Id = S::Id; 95 - type Name = Set<members::name>; 96 - type ContentMarkdown = S::ContentMarkdown; 97 - type Disabled = S::Disabled; 98 - type LastUpdatedBy = S::LastUpdatedBy; 99 - type CreatedAt = S::CreatedAt; 100 - type UpdatedAt = S::UpdatedAt; 101 - } 102 - ///State transition - sets the `content_markdown` field to Set 103 - pub struct SetContentMarkdown<S: State = Empty>(PhantomData<fn() -> S>); 104 - impl<S: State> sealed::Sealed for SetContentMarkdown<S> {} 105 - impl<S: State> State for SetContentMarkdown<S> { 106 - type Id = S::Id; 107 99 type Name = S::Name; 108 - type ContentMarkdown = Set<members::content_markdown>; 109 - type Disabled = S::Disabled; 110 100 type LastUpdatedBy = S::LastUpdatedBy; 111 - type CreatedAt = S::CreatedAt; 112 - type UpdatedAt = S::UpdatedAt; 113 101 } 114 102 ///State transition - sets the `disabled` field to Set 115 103 pub struct SetDisabled<S: State = Empty>(PhantomData<fn() -> S>); 116 104 impl<S: State> sealed::Sealed for SetDisabled<S> {} 117 105 impl<S: State> State for SetDisabled<S> { 118 - type Id = S::Id; 119 - type Name = S::Name; 120 106 type ContentMarkdown = S::ContentMarkdown; 107 + type Id = S::Id; 121 108 type Disabled = Set<members::disabled>; 122 - type LastUpdatedBy = S::LastUpdatedBy; 123 109 type CreatedAt = S::CreatedAt; 124 110 type UpdatedAt = S::UpdatedAt; 125 - } 126 - ///State transition - sets the `last_updated_by` field to Set 127 - pub struct SetLastUpdatedBy<S: State = Empty>(PhantomData<fn() -> S>); 128 - impl<S: State> sealed::Sealed for SetLastUpdatedBy<S> {} 129 - impl<S: State> State for SetLastUpdatedBy<S> { 130 - type Id = S::Id; 131 111 type Name = S::Name; 132 - type ContentMarkdown = S::ContentMarkdown; 133 - type Disabled = S::Disabled; 134 - type LastUpdatedBy = Set<members::last_updated_by>; 135 - type CreatedAt = S::CreatedAt; 136 - type UpdatedAt = S::UpdatedAt; 112 + type LastUpdatedBy = S::LastUpdatedBy; 137 113 } 138 114 ///State transition - sets the `created_at` field to Set 139 115 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 140 116 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 141 117 impl<S: State> State for SetCreatedAt<S> { 118 + type ContentMarkdown = S::ContentMarkdown; 142 119 type Id = S::Id; 143 - type Name = S::Name; 144 - type ContentMarkdown = S::ContentMarkdown; 145 120 type Disabled = S::Disabled; 146 - type LastUpdatedBy = S::LastUpdatedBy; 147 121 type CreatedAt = Set<members::created_at>; 148 122 type UpdatedAt = S::UpdatedAt; 123 + type Name = S::Name; 124 + type LastUpdatedBy = S::LastUpdatedBy; 149 125 } 150 126 ///State transition - sets the `updated_at` field to Set 151 127 pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 152 128 impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 153 129 impl<S: State> State for SetUpdatedAt<S> { 130 + type ContentMarkdown = S::ContentMarkdown; 154 131 type Id = S::Id; 132 + type Disabled = S::Disabled; 133 + type CreatedAt = S::CreatedAt; 134 + type UpdatedAt = Set<members::updated_at>; 155 135 type Name = S::Name; 136 + type LastUpdatedBy = S::LastUpdatedBy; 137 + } 138 + ///State transition - sets the `name` field to Set 139 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 140 + impl<S: State> sealed::Sealed for SetName<S> {} 141 + impl<S: State> State for SetName<S> { 156 142 type ContentMarkdown = S::ContentMarkdown; 143 + type Id = S::Id; 157 144 type Disabled = S::Disabled; 145 + type CreatedAt = S::CreatedAt; 146 + type UpdatedAt = S::UpdatedAt; 147 + type Name = Set<members::name>; 158 148 type LastUpdatedBy = S::LastUpdatedBy; 149 + } 150 + ///State transition - sets the `last_updated_by` field to Set 151 + pub struct SetLastUpdatedBy<S: State = Empty>(PhantomData<fn() -> S>); 152 + impl<S: State> sealed::Sealed for SetLastUpdatedBy<S> {} 153 + impl<S: State> State for SetLastUpdatedBy<S> { 154 + type ContentMarkdown = S::ContentMarkdown; 155 + type Id = S::Id; 156 + type Disabled = S::Disabled; 159 157 type CreatedAt = S::CreatedAt; 160 - type UpdatedAt = Set<members::updated_at>; 158 + type UpdatedAt = S::UpdatedAt; 159 + type Name = S::Name; 160 + type LastUpdatedBy = Set<members::last_updated_by>; 161 161 } 162 162 /// Marker types for field names 163 163 #[allow(non_camel_case_types)] 164 164 pub mod members { 165 + ///Marker type for the `content_markdown` field 166 + pub struct content_markdown(()); 165 167 ///Marker type for the `id` field 166 168 pub struct id(()); 167 - ///Marker type for the `name` field 168 - pub struct name(()); 169 - ///Marker type for the `content_markdown` field 170 - pub struct content_markdown(()); 171 169 ///Marker type for the `disabled` field 172 170 pub struct disabled(()); 173 - ///Marker type for the `last_updated_by` field 174 - pub struct last_updated_by(()); 175 171 ///Marker type for the `created_at` field 176 172 pub struct created_at(()); 177 173 ///Marker type for the `updated_at` field 178 174 pub struct updated_at(()); 175 + ///Marker type for the `name` field 176 + pub struct name(()); 177 + ///Marker type for the `last_updated_by` field 178 + pub struct last_updated_by(()); 179 179 } 180 180 } 181 181 ··· 395 395 impl<'a, S> TemplateViewBuilder<'a, S> 396 396 where 397 397 S: template_view_state::State, 398 + S::ContentMarkdown: template_view_state::IsSet, 398 399 S::Id: template_view_state::IsSet, 399 - S::Name: template_view_state::IsSet, 400 - S::ContentMarkdown: template_view_state::IsSet, 401 400 S::Disabled: template_view_state::IsSet, 402 - S::LastUpdatedBy: template_view_state::IsSet, 403 401 S::CreatedAt: template_view_state::IsSet, 404 402 S::UpdatedAt: template_view_state::IsSet, 403 + S::Name: template_view_state::IsSet, 404 + S::LastUpdatedBy: template_view_state::IsSet, 405 405 { 406 406 /// Build the final struct 407 407 pub fn build(self) -> TemplateView<'a> {
+15 -15
crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs
··· 462 462 } 463 463 /// State trait tracking which required fields have been set 464 464 pub trait State: sealed::Sealed { 465 + type CreatedAt; 465 466 type Details; 466 467 type CreatedBy; 467 - type CreatedAt; 468 468 } 469 469 /// Empty state - all required fields are unset 470 470 pub struct Empty(()); 471 471 impl sealed::Sealed for Empty {} 472 472 impl State for Empty { 473 + type CreatedAt = Unset; 473 474 type Details = Unset; 474 475 type CreatedBy = Unset; 475 - type CreatedAt = Unset; 476 + } 477 + ///State transition - sets the `created_at` field to Set 478 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 479 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 480 + impl<S: State> State for SetCreatedAt<S> { 481 + type CreatedAt = Set<members::created_at>; 482 + type Details = S::Details; 483 + type CreatedBy = S::CreatedBy; 476 484 } 477 485 ///State transition - sets the `details` field to Set 478 486 pub struct SetDetails<S: State = Empty>(PhantomData<fn() -> S>); 479 487 impl<S: State> sealed::Sealed for SetDetails<S> {} 480 488 impl<S: State> State for SetDetails<S> { 489 + type CreatedAt = S::CreatedAt; 481 490 type Details = Set<members::details>; 482 491 type CreatedBy = S::CreatedBy; 483 - type CreatedAt = S::CreatedAt; 484 492 } 485 493 ///State transition - sets the `created_by` field to Set 486 494 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 487 495 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 488 496 impl<S: State> State for SetCreatedBy<S> { 489 - type Details = S::Details; 490 - type CreatedBy = Set<members::created_by>; 491 497 type CreatedAt = S::CreatedAt; 492 - } 493 - ///State transition - sets the `created_at` field to Set 494 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 495 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 496 - impl<S: State> State for SetCreatedAt<S> { 497 498 type Details = S::Details; 498 - type CreatedBy = S::CreatedBy; 499 - type CreatedAt = Set<members::created_at>; 499 + type CreatedBy = Set<members::created_by>; 500 500 } 501 501 /// Marker types for field names 502 502 #[allow(non_camel_case_types)] 503 503 pub mod members { 504 + ///Marker type for the `created_at` field 505 + pub struct created_at(()); 504 506 ///Marker type for the `details` field 505 507 pub struct details(()); 506 508 ///Marker type for the `created_by` field 507 509 pub struct created_by(()); 508 - ///Marker type for the `created_at` field 509 - pub struct created_at(()); 510 510 } 511 511 } 512 512 ··· 599 599 impl<'a, S> EventBuilder<'a, S> 600 600 where 601 601 S: event_state::State, 602 + S::CreatedAt: event_state::IsSet, 602 603 S::Details: event_state::IsSet, 603 604 S::CreatedBy: event_state::IsSet, 604 - S::CreatedAt: event_state::IsSet, 605 605 { 606 606 /// Build the final struct 607 607 pub fn build(self) -> Event<'a> {
+499 -499
crates/weaver-api/src/tools_ozone/moderation.rs
··· 55 55 } 56 56 /// State trait tracking which required fields have been set 57 57 pub trait State: sealed::Sealed { 58 - type Timestamp; 59 58 type Active; 59 + type Timestamp; 60 60 } 61 61 /// Empty state - all required fields are unset 62 62 pub struct Empty(()); 63 63 impl sealed::Sealed for Empty {} 64 64 impl State for Empty { 65 - type Timestamp = Unset; 66 65 type Active = Unset; 67 - } 68 - ///State transition - sets the `timestamp` field to Set 69 - pub struct SetTimestamp<S: State = Empty>(PhantomData<fn() -> S>); 70 - impl<S: State> sealed::Sealed for SetTimestamp<S> {} 71 - impl<S: State> State for SetTimestamp<S> { 72 - type Timestamp = Set<members::timestamp>; 73 - type Active = S::Active; 66 + type Timestamp = Unset; 74 67 } 75 68 ///State transition - sets the `active` field to Set 76 69 pub struct SetActive<S: State = Empty>(PhantomData<fn() -> S>); 77 70 impl<S: State> sealed::Sealed for SetActive<S> {} 78 71 impl<S: State> State for SetActive<S> { 79 - type Timestamp = S::Timestamp; 80 72 type Active = Set<members::active>; 73 + type Timestamp = S::Timestamp; 74 + } 75 + ///State transition - sets the `timestamp` field to Set 76 + pub struct SetTimestamp<S: State = Empty>(PhantomData<fn() -> S>); 77 + impl<S: State> sealed::Sealed for SetTimestamp<S> {} 78 + impl<S: State> State for SetTimestamp<S> { 79 + type Active = S::Active; 80 + type Timestamp = Set<members::timestamp>; 81 81 } 82 82 /// Marker types for field names 83 83 #[allow(non_camel_case_types)] 84 84 pub mod members { 85 - ///Marker type for the `timestamp` field 86 - pub struct timestamp(()); 87 85 ///Marker type for the `active` field 88 86 pub struct active(()); 87 + ///Marker type for the `timestamp` field 88 + pub struct timestamp(()); 89 89 } 90 90 } 91 91 ··· 192 192 impl<'a, S> AccountEventBuilder<'a, S> 193 193 where 194 194 S: account_event_state::State, 195 - S::Timestamp: account_event_state::IsSet, 196 195 S::Active: account_event_state::IsSet, 196 + S::Timestamp: account_event_state::IsSet, 197 197 { 198 198 /// Build the final struct 199 199 pub fn build(self) -> AccountEvent<'a> { ··· 5097 5097 } 5098 5098 /// State trait tracking which required fields have been set 5099 5099 pub trait State: sealed::Sealed { 5100 - type CreatedAt; 5101 5100 type Status; 5102 5101 type AttemptId; 5102 + type CreatedAt; 5103 5103 } 5104 5104 /// Empty state - all required fields are unset 5105 5105 pub struct Empty(()); 5106 5106 impl sealed::Sealed for Empty {} 5107 5107 impl State for Empty { 5108 - type CreatedAt = Unset; 5109 5108 type Status = Unset; 5110 5109 type AttemptId = Unset; 5111 - } 5112 - ///State transition - sets the `created_at` field to Set 5113 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 5114 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 5115 - impl<S: State> State for SetCreatedAt<S> { 5116 - type CreatedAt = Set<members::created_at>; 5117 - type Status = S::Status; 5118 - type AttemptId = S::AttemptId; 5110 + type CreatedAt = Unset; 5119 5111 } 5120 5112 ///State transition - sets the `status` field to Set 5121 5113 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 5122 5114 impl<S: State> sealed::Sealed for SetStatus<S> {} 5123 5115 impl<S: State> State for SetStatus<S> { 5124 - type CreatedAt = S::CreatedAt; 5125 5116 type Status = Set<members::status>; 5126 5117 type AttemptId = S::AttemptId; 5118 + type CreatedAt = S::CreatedAt; 5127 5119 } 5128 5120 ///State transition - sets the `attempt_id` field to Set 5129 5121 pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>); 5130 5122 impl<S: State> sealed::Sealed for SetAttemptId<S> {} 5131 5123 impl<S: State> State for SetAttemptId<S> { 5132 - type CreatedAt = S::CreatedAt; 5133 5124 type Status = S::Status; 5134 5125 type AttemptId = Set<members::attempt_id>; 5126 + type CreatedAt = S::CreatedAt; 5127 + } 5128 + ///State transition - sets the `created_at` field to Set 5129 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 5130 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 5131 + impl<S: State> State for SetCreatedAt<S> { 5132 + type Status = S::Status; 5133 + type AttemptId = S::AttemptId; 5134 + type CreatedAt = Set<members::created_at>; 5135 5135 } 5136 5136 /// Marker types for field names 5137 5137 #[allow(non_camel_case_types)] 5138 5138 pub mod members { 5139 - ///Marker type for the `created_at` field 5140 - pub struct created_at(()); 5141 5139 ///Marker type for the `status` field 5142 5140 pub struct status(()); 5143 5141 ///Marker type for the `attempt_id` field 5144 5142 pub struct attempt_id(()); 5143 + ///Marker type for the `created_at` field 5144 + pub struct created_at(()); 5145 5145 } 5146 5146 } 5147 5147 ··· 5379 5379 impl<'a, S> AgeAssuranceEventBuilder<'a, S> 5380 5380 where 5381 5381 S: age_assurance_event_state::State, 5382 - S::CreatedAt: age_assurance_event_state::IsSet, 5383 5382 S::Status: age_assurance_event_state::IsSet, 5384 5383 S::AttemptId: age_assurance_event_state::IsSet, 5384 + S::CreatedAt: age_assurance_event_state::IsSet, 5385 5385 { 5386 5386 /// Build the final struct 5387 5387 pub fn build(self) -> AgeAssuranceEvent<'a> { ··· 5518 5518 } 5519 5519 /// State trait tracking which required fields have been set 5520 5520 pub trait State: sealed::Sealed { 5521 - type Cid; 5522 5521 type MimeType; 5523 5522 type Size; 5524 5523 type CreatedAt; 5524 + type Cid; 5525 5525 } 5526 5526 /// Empty state - all required fields are unset 5527 5527 pub struct Empty(()); 5528 5528 impl sealed::Sealed for Empty {} 5529 5529 impl State for Empty { 5530 - type Cid = Unset; 5531 5530 type MimeType = Unset; 5532 5531 type Size = Unset; 5533 5532 type CreatedAt = Unset; 5534 - } 5535 - ///State transition - sets the `cid` field to Set 5536 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 5537 - impl<S: State> sealed::Sealed for SetCid<S> {} 5538 - impl<S: State> State for SetCid<S> { 5539 - type Cid = Set<members::cid>; 5540 - type MimeType = S::MimeType; 5541 - type Size = S::Size; 5542 - type CreatedAt = S::CreatedAt; 5533 + type Cid = Unset; 5543 5534 } 5544 5535 ///State transition - sets the `mime_type` field to Set 5545 5536 pub struct SetMimeType<S: State = Empty>(PhantomData<fn() -> S>); 5546 5537 impl<S: State> sealed::Sealed for SetMimeType<S> {} 5547 5538 impl<S: State> State for SetMimeType<S> { 5548 - type Cid = S::Cid; 5549 5539 type MimeType = Set<members::mime_type>; 5550 5540 type Size = S::Size; 5551 5541 type CreatedAt = S::CreatedAt; 5542 + type Cid = S::Cid; 5552 5543 } 5553 5544 ///State transition - sets the `size` field to Set 5554 5545 pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>); 5555 5546 impl<S: State> sealed::Sealed for SetSize<S> {} 5556 5547 impl<S: State> State for SetSize<S> { 5557 - type Cid = S::Cid; 5558 5548 type MimeType = S::MimeType; 5559 5549 type Size = Set<members::size>; 5560 5550 type CreatedAt = S::CreatedAt; 5551 + type Cid = S::Cid; 5561 5552 } 5562 5553 ///State transition - sets the `created_at` field to Set 5563 5554 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 5564 5555 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 5565 5556 impl<S: State> State for SetCreatedAt<S> { 5557 + type MimeType = S::MimeType; 5558 + type Size = S::Size; 5559 + type CreatedAt = Set<members::created_at>; 5566 5560 type Cid = S::Cid; 5561 + } 5562 + ///State transition - sets the `cid` field to Set 5563 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 5564 + impl<S: State> sealed::Sealed for SetCid<S> {} 5565 + impl<S: State> State for SetCid<S> { 5567 5566 type MimeType = S::MimeType; 5568 5567 type Size = S::Size; 5569 - type CreatedAt = Set<members::created_at>; 5568 + type CreatedAt = S::CreatedAt; 5569 + type Cid = Set<members::cid>; 5570 5570 } 5571 5571 /// Marker types for field names 5572 5572 #[allow(non_camel_case_types)] 5573 5573 pub mod members { 5574 - ///Marker type for the `cid` field 5575 - pub struct cid(()); 5576 5574 ///Marker type for the `mime_type` field 5577 5575 pub struct mime_type(()); 5578 5576 ///Marker type for the `size` field 5579 5577 pub struct size(()); 5580 5578 ///Marker type for the `created_at` field 5581 5579 pub struct created_at(()); 5580 + ///Marker type for the `cid` field 5581 + pub struct cid(()); 5582 5582 } 5583 5583 } 5584 5584 ··· 5725 5725 impl<'a, S> BlobViewBuilder<'a, S> 5726 5726 where 5727 5727 S: blob_view_state::State, 5728 - S::Cid: blob_view_state::IsSet, 5729 5728 S::MimeType: blob_view_state::IsSet, 5730 5729 S::Size: blob_view_state::IsSet, 5731 5730 S::CreatedAt: blob_view_state::IsSet, 5731 + S::Cid: blob_view_state::IsSet, 5732 5732 { 5733 5733 /// Build the final struct 5734 5734 pub fn build(self) -> BlobView<'a> { ··· 7725 7725 /// State trait tracking which required fields have been set 7726 7726 pub trait State: sealed::Sealed { 7727 7727 type Id; 7728 - type Event; 7729 - type Subject; 7730 - type SubjectBlobCids; 7731 7728 type CreatedBy; 7732 7729 type CreatedAt; 7730 + type Subject; 7731 + type SubjectBlobCids; 7732 + type Event; 7733 7733 } 7734 7734 /// Empty state - all required fields are unset 7735 7735 pub struct Empty(()); 7736 7736 impl sealed::Sealed for Empty {} 7737 7737 impl State for Empty { 7738 7738 type Id = Unset; 7739 - type Event = Unset; 7739 + type CreatedBy = Unset; 7740 + type CreatedAt = Unset; 7740 7741 type Subject = Unset; 7741 7742 type SubjectBlobCids = Unset; 7742 - type CreatedBy = Unset; 7743 - type CreatedAt = Unset; 7743 + type Event = Unset; 7744 7744 } 7745 7745 ///State transition - sets the `id` field to Set 7746 7746 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 7747 7747 impl<S: State> sealed::Sealed for SetId<S> {} 7748 7748 impl<S: State> State for SetId<S> { 7749 7749 type Id = Set<members::id>; 7750 - type Event = S::Event; 7750 + type CreatedBy = S::CreatedBy; 7751 + type CreatedAt = S::CreatedAt; 7751 7752 type Subject = S::Subject; 7752 7753 type SubjectBlobCids = S::SubjectBlobCids; 7753 - type CreatedBy = S::CreatedBy; 7754 - type CreatedAt = S::CreatedAt; 7754 + type Event = S::Event; 7755 7755 } 7756 - ///State transition - sets the `event` field to Set 7757 - pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 7758 - impl<S: State> sealed::Sealed for SetEvent<S> {} 7759 - impl<S: State> State for SetEvent<S> { 7756 + ///State transition - sets the `created_by` field to Set 7757 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 7758 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 7759 + impl<S: State> State for SetCreatedBy<S> { 7760 7760 type Id = S::Id; 7761 - type Event = Set<members::event>; 7761 + type CreatedBy = Set<members::created_by>; 7762 + type CreatedAt = S::CreatedAt; 7762 7763 type Subject = S::Subject; 7763 7764 type SubjectBlobCids = S::SubjectBlobCids; 7765 + type Event = S::Event; 7766 + } 7767 + ///State transition - sets the `created_at` field to Set 7768 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 7769 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 7770 + impl<S: State> State for SetCreatedAt<S> { 7771 + type Id = S::Id; 7764 7772 type CreatedBy = S::CreatedBy; 7765 - type CreatedAt = S::CreatedAt; 7773 + type CreatedAt = Set<members::created_at>; 7774 + type Subject = S::Subject; 7775 + type SubjectBlobCids = S::SubjectBlobCids; 7776 + type Event = S::Event; 7766 7777 } 7767 7778 ///State transition - sets the `subject` field to Set 7768 7779 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 7769 7780 impl<S: State> sealed::Sealed for SetSubject<S> {} 7770 7781 impl<S: State> State for SetSubject<S> { 7771 7782 type Id = S::Id; 7772 - type Event = S::Event; 7783 + type CreatedBy = S::CreatedBy; 7784 + type CreatedAt = S::CreatedAt; 7773 7785 type Subject = Set<members::subject>; 7774 7786 type SubjectBlobCids = S::SubjectBlobCids; 7775 - type CreatedBy = S::CreatedBy; 7776 - type CreatedAt = S::CreatedAt; 7787 + type Event = S::Event; 7777 7788 } 7778 7789 ///State transition - sets the `subject_blob_cids` field to Set 7779 7790 pub struct SetSubjectBlobCids<S: State = Empty>(PhantomData<fn() -> S>); 7780 7791 impl<S: State> sealed::Sealed for SetSubjectBlobCids<S> {} 7781 7792 impl<S: State> State for SetSubjectBlobCids<S> { 7782 7793 type Id = S::Id; 7783 - type Event = S::Event; 7794 + type CreatedBy = S::CreatedBy; 7795 + type CreatedAt = S::CreatedAt; 7784 7796 type Subject = S::Subject; 7785 7797 type SubjectBlobCids = Set<members::subject_blob_cids>; 7786 - type CreatedBy = S::CreatedBy; 7787 - type CreatedAt = S::CreatedAt; 7798 + type Event = S::Event; 7788 7799 } 7789 - ///State transition - sets the `created_by` field to Set 7790 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 7791 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 7792 - impl<S: State> State for SetCreatedBy<S> { 7800 + ///State transition - sets the `event` field to Set 7801 + pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 7802 + impl<S: State> sealed::Sealed for SetEvent<S> {} 7803 + impl<S: State> State for SetEvent<S> { 7793 7804 type Id = S::Id; 7794 - type Event = S::Event; 7795 - type Subject = S::Subject; 7796 - type SubjectBlobCids = S::SubjectBlobCids; 7797 - type CreatedBy = Set<members::created_by>; 7805 + type CreatedBy = S::CreatedBy; 7798 7806 type CreatedAt = S::CreatedAt; 7799 - } 7800 - ///State transition - sets the `created_at` field to Set 7801 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 7802 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 7803 - impl<S: State> State for SetCreatedAt<S> { 7804 - type Id = S::Id; 7805 - type Event = S::Event; 7806 7807 type Subject = S::Subject; 7807 7808 type SubjectBlobCids = S::SubjectBlobCids; 7808 - type CreatedBy = S::CreatedBy; 7809 - type CreatedAt = Set<members::created_at>; 7809 + type Event = Set<members::event>; 7810 7810 } 7811 7811 /// Marker types for field names 7812 7812 #[allow(non_camel_case_types)] 7813 7813 pub mod members { 7814 7814 ///Marker type for the `id` field 7815 7815 pub struct id(()); 7816 - ///Marker type for the `event` field 7817 - pub struct event(()); 7816 + ///Marker type for the `created_by` field 7817 + pub struct created_by(()); 7818 + ///Marker type for the `created_at` field 7819 + pub struct created_at(()); 7818 7820 ///Marker type for the `subject` field 7819 7821 pub struct subject(()); 7820 7822 ///Marker type for the `subject_blob_cids` field 7821 7823 pub struct subject_blob_cids(()); 7822 - ///Marker type for the `created_by` field 7823 - pub struct created_by(()); 7824 - ///Marker type for the `created_at` field 7825 - pub struct created_at(()); 7824 + ///Marker type for the `event` field 7825 + pub struct event(()); 7826 7826 } 7827 7827 } 7828 7828 ··· 8046 8046 where 8047 8047 S: mod_event_view_state::State, 8048 8048 S::Id: mod_event_view_state::IsSet, 8049 - S::Event: mod_event_view_state::IsSet, 8050 - S::Subject: mod_event_view_state::IsSet, 8051 - S::SubjectBlobCids: mod_event_view_state::IsSet, 8052 8049 S::CreatedBy: mod_event_view_state::IsSet, 8053 8050 S::CreatedAt: mod_event_view_state::IsSet, 8051 + S::Subject: mod_event_view_state::IsSet, 8052 + S::SubjectBlobCids: mod_event_view_state::IsSet, 8053 + S::Event: mod_event_view_state::IsSet, 8054 8054 { 8055 8055 /// Build the final struct 8056 8056 pub fn build(self) -> ModEventView<'a> { ··· 8244 8244 } 8245 8245 /// State trait tracking which required fields have been set 8246 8246 pub trait State: sealed::Sealed { 8247 - type Id; 8248 - type Event; 8249 - type Subject; 8250 8247 type SubjectBlobs; 8251 8248 type CreatedBy; 8252 8249 type CreatedAt; 8250 + type Id; 8251 + type Subject; 8252 + type Event; 8253 8253 } 8254 8254 /// Empty state - all required fields are unset 8255 8255 pub struct Empty(()); 8256 8256 impl sealed::Sealed for Empty {} 8257 8257 impl State for Empty { 8258 - type Id = Unset; 8259 - type Event = Unset; 8260 - type Subject = Unset; 8261 8258 type SubjectBlobs = Unset; 8262 8259 type CreatedBy = Unset; 8263 8260 type CreatedAt = Unset; 8264 - } 8265 - ///State transition - sets the `id` field to Set 8266 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 8267 - impl<S: State> sealed::Sealed for SetId<S> {} 8268 - impl<S: State> State for SetId<S> { 8269 - type Id = Set<members::id>; 8270 - type Event = S::Event; 8271 - type Subject = S::Subject; 8272 - type SubjectBlobs = S::SubjectBlobs; 8273 - type CreatedBy = S::CreatedBy; 8274 - type CreatedAt = S::CreatedAt; 8275 - } 8276 - ///State transition - sets the `event` field to Set 8277 - pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 8278 - impl<S: State> sealed::Sealed for SetEvent<S> {} 8279 - impl<S: State> State for SetEvent<S> { 8280 - type Id = S::Id; 8281 - type Event = Set<members::event>; 8282 - type Subject = S::Subject; 8283 - type SubjectBlobs = S::SubjectBlobs; 8284 - type CreatedBy = S::CreatedBy; 8285 - type CreatedAt = S::CreatedAt; 8286 - } 8287 - ///State transition - sets the `subject` field to Set 8288 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 8289 - impl<S: State> sealed::Sealed for SetSubject<S> {} 8290 - impl<S: State> State for SetSubject<S> { 8291 - type Id = S::Id; 8292 - type Event = S::Event; 8293 - type Subject = Set<members::subject>; 8294 - type SubjectBlobs = S::SubjectBlobs; 8295 - type CreatedBy = S::CreatedBy; 8296 - type CreatedAt = S::CreatedAt; 8261 + type Id = Unset; 8262 + type Subject = Unset; 8263 + type Event = Unset; 8297 8264 } 8298 8265 ///State transition - sets the `subject_blobs` field to Set 8299 8266 pub struct SetSubjectBlobs<S: State = Empty>(PhantomData<fn() -> S>); 8300 8267 impl<S: State> sealed::Sealed for SetSubjectBlobs<S> {} 8301 8268 impl<S: State> State for SetSubjectBlobs<S> { 8302 - type Id = S::Id; 8303 - type Event = S::Event; 8304 - type Subject = S::Subject; 8305 8269 type SubjectBlobs = Set<members::subject_blobs>; 8306 8270 type CreatedBy = S::CreatedBy; 8307 8271 type CreatedAt = S::CreatedAt; 8272 + type Id = S::Id; 8273 + type Subject = S::Subject; 8274 + type Event = S::Event; 8308 8275 } 8309 8276 ///State transition - sets the `created_by` field to Set 8310 8277 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 8311 8278 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 8312 8279 impl<S: State> State for SetCreatedBy<S> { 8313 - type Id = S::Id; 8314 - type Event = S::Event; 8315 - type Subject = S::Subject; 8316 8280 type SubjectBlobs = S::SubjectBlobs; 8317 8281 type CreatedBy = Set<members::created_by>; 8318 8282 type CreatedAt = S::CreatedAt; 8283 + type Id = S::Id; 8284 + type Subject = S::Subject; 8285 + type Event = S::Event; 8319 8286 } 8320 8287 ///State transition - sets the `created_at` field to Set 8321 8288 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 8322 8289 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 8323 8290 impl<S: State> State for SetCreatedAt<S> { 8291 + type SubjectBlobs = S::SubjectBlobs; 8292 + type CreatedBy = S::CreatedBy; 8293 + type CreatedAt = Set<members::created_at>; 8324 8294 type Id = S::Id; 8295 + type Subject = S::Subject; 8325 8296 type Event = S::Event; 8297 + } 8298 + ///State transition - sets the `id` field to Set 8299 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 8300 + impl<S: State> sealed::Sealed for SetId<S> {} 8301 + impl<S: State> State for SetId<S> { 8302 + type SubjectBlobs = S::SubjectBlobs; 8303 + type CreatedBy = S::CreatedBy; 8304 + type CreatedAt = S::CreatedAt; 8305 + type Id = Set<members::id>; 8326 8306 type Subject = S::Subject; 8307 + type Event = S::Event; 8308 + } 8309 + ///State transition - sets the `subject` field to Set 8310 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 8311 + impl<S: State> sealed::Sealed for SetSubject<S> {} 8312 + impl<S: State> State for SetSubject<S> { 8327 8313 type SubjectBlobs = S::SubjectBlobs; 8328 8314 type CreatedBy = S::CreatedBy; 8329 - type CreatedAt = Set<members::created_at>; 8315 + type CreatedAt = S::CreatedAt; 8316 + type Id = S::Id; 8317 + type Subject = Set<members::subject>; 8318 + type Event = S::Event; 8319 + } 8320 + ///State transition - sets the `event` field to Set 8321 + pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 8322 + impl<S: State> sealed::Sealed for SetEvent<S> {} 8323 + impl<S: State> State for SetEvent<S> { 8324 + type SubjectBlobs = S::SubjectBlobs; 8325 + type CreatedBy = S::CreatedBy; 8326 + type CreatedAt = S::CreatedAt; 8327 + type Id = S::Id; 8328 + type Subject = S::Subject; 8329 + type Event = Set<members::event>; 8330 8330 } 8331 8331 /// Marker types for field names 8332 8332 #[allow(non_camel_case_types)] 8333 8333 pub mod members { 8334 - ///Marker type for the `id` field 8335 - pub struct id(()); 8336 - ///Marker type for the `event` field 8337 - pub struct event(()); 8338 - ///Marker type for the `subject` field 8339 - pub struct subject(()); 8340 8334 ///Marker type for the `subject_blobs` field 8341 8335 pub struct subject_blobs(()); 8342 8336 ///Marker type for the `created_by` field 8343 8337 pub struct created_by(()); 8344 8338 ///Marker type for the `created_at` field 8345 8339 pub struct created_at(()); 8340 + ///Marker type for the `id` field 8341 + pub struct id(()); 8342 + ///Marker type for the `subject` field 8343 + pub struct subject(()); 8344 + ///Marker type for the `event` field 8345 + pub struct event(()); 8346 8346 } 8347 8347 } 8348 8348 ··· 8515 8515 impl<'a, S> ModEventViewDetailBuilder<'a, S> 8516 8516 where 8517 8517 S: mod_event_view_detail_state::State, 8518 - S::Id: mod_event_view_detail_state::IsSet, 8519 - S::Event: mod_event_view_detail_state::IsSet, 8520 - S::Subject: mod_event_view_detail_state::IsSet, 8521 8518 S::SubjectBlobs: mod_event_view_detail_state::IsSet, 8522 8519 S::CreatedBy: mod_event_view_detail_state::IsSet, 8523 8520 S::CreatedAt: mod_event_view_detail_state::IsSet, 8521 + S::Id: mod_event_view_detail_state::IsSet, 8522 + S::Subject: mod_event_view_detail_state::IsSet, 8523 + S::Event: mod_event_view_detail_state::IsSet, 8524 8524 { 8525 8525 /// Build the final struct 8526 8526 pub fn build(self) -> ModEventViewDetail<'a> { ··· 9088 9088 } 9089 9089 /// State trait tracking which required fields have been set 9090 9090 pub trait State: sealed::Sealed { 9091 - type Uri; 9092 9091 type Cid; 9093 - type Value; 9094 9092 type BlobCids; 9095 - type IndexedAt; 9096 9093 type Moderation; 9094 + type Value; 9095 + type Uri; 9097 9096 type Repo; 9097 + type IndexedAt; 9098 9098 } 9099 9099 /// Empty state - all required fields are unset 9100 9100 pub struct Empty(()); 9101 9101 impl sealed::Sealed for Empty {} 9102 9102 impl State for Empty { 9103 - type Uri = Unset; 9104 9103 type Cid = Unset; 9105 - type Value = Unset; 9106 9104 type BlobCids = Unset; 9107 - type IndexedAt = Unset; 9108 9105 type Moderation = Unset; 9106 + type Value = Unset; 9107 + type Uri = Unset; 9109 9108 type Repo = Unset; 9110 - } 9111 - ///State transition - sets the `uri` field to Set 9112 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 9113 - impl<S: State> sealed::Sealed for SetUri<S> {} 9114 - impl<S: State> State for SetUri<S> { 9115 - type Uri = Set<members::uri>; 9116 - type Cid = S::Cid; 9117 - type Value = S::Value; 9118 - type BlobCids = S::BlobCids; 9119 - type IndexedAt = S::IndexedAt; 9120 - type Moderation = S::Moderation; 9121 - type Repo = S::Repo; 9109 + type IndexedAt = Unset; 9122 9110 } 9123 9111 ///State transition - sets the `cid` field to Set 9124 9112 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 9125 9113 impl<S: State> sealed::Sealed for SetCid<S> {} 9126 9114 impl<S: State> State for SetCid<S> { 9127 - type Uri = S::Uri; 9128 9115 type Cid = Set<members::cid>; 9129 - type Value = S::Value; 9130 9116 type BlobCids = S::BlobCids; 9131 - type IndexedAt = S::IndexedAt; 9132 9117 type Moderation = S::Moderation; 9133 - type Repo = S::Repo; 9134 - } 9135 - ///State transition - sets the `value` field to Set 9136 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 9137 - impl<S: State> sealed::Sealed for SetValue<S> {} 9138 - impl<S: State> State for SetValue<S> { 9118 + type Value = S::Value; 9139 9119 type Uri = S::Uri; 9140 - type Cid = S::Cid; 9141 - type Value = Set<members::value>; 9142 - type BlobCids = S::BlobCids; 9120 + type Repo = S::Repo; 9143 9121 type IndexedAt = S::IndexedAt; 9144 - type Moderation = S::Moderation; 9145 - type Repo = S::Repo; 9146 9122 } 9147 9123 ///State transition - sets the `blob_cids` field to Set 9148 9124 pub struct SetBlobCids<S: State = Empty>(PhantomData<fn() -> S>); 9149 9125 impl<S: State> sealed::Sealed for SetBlobCids<S> {} 9150 9126 impl<S: State> State for SetBlobCids<S> { 9151 - type Uri = S::Uri; 9152 9127 type Cid = S::Cid; 9153 - type Value = S::Value; 9154 9128 type BlobCids = Set<members::blob_cids>; 9155 - type IndexedAt = S::IndexedAt; 9156 9129 type Moderation = S::Moderation; 9157 - type Repo = S::Repo; 9158 - } 9159 - ///State transition - sets the `indexed_at` field to Set 9160 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 9161 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 9162 - impl<S: State> State for SetIndexedAt<S> { 9130 + type Value = S::Value; 9163 9131 type Uri = S::Uri; 9164 - type Cid = S::Cid; 9165 - type Value = S::Value; 9166 - type BlobCids = S::BlobCids; 9167 - type IndexedAt = Set<members::indexed_at>; 9168 - type Moderation = S::Moderation; 9169 9132 type Repo = S::Repo; 9133 + type IndexedAt = S::IndexedAt; 9170 9134 } 9171 9135 ///State transition - sets the `moderation` field to Set 9172 9136 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 9173 9137 impl<S: State> sealed::Sealed for SetModeration<S> {} 9174 9138 impl<S: State> State for SetModeration<S> { 9139 + type Cid = S::Cid; 9140 + type BlobCids = S::BlobCids; 9141 + type Moderation = Set<members::moderation>; 9142 + type Value = S::Value; 9175 9143 type Uri = S::Uri; 9144 + type Repo = S::Repo; 9145 + type IndexedAt = S::IndexedAt; 9146 + } 9147 + ///State transition - sets the `value` field to Set 9148 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 9149 + impl<S: State> sealed::Sealed for SetValue<S> {} 9150 + impl<S: State> State for SetValue<S> { 9176 9151 type Cid = S::Cid; 9177 - type Value = S::Value; 9178 9152 type BlobCids = S::BlobCids; 9153 + type Moderation = S::Moderation; 9154 + type Value = Set<members::value>; 9155 + type Uri = S::Uri; 9156 + type Repo = S::Repo; 9179 9157 type IndexedAt = S::IndexedAt; 9180 - type Moderation = Set<members::moderation>; 9158 + } 9159 + ///State transition - sets the `uri` field to Set 9160 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 9161 + impl<S: State> sealed::Sealed for SetUri<S> {} 9162 + impl<S: State> State for SetUri<S> { 9163 + type Cid = S::Cid; 9164 + type BlobCids = S::BlobCids; 9165 + type Moderation = S::Moderation; 9166 + type Value = S::Value; 9167 + type Uri = Set<members::uri>; 9181 9168 type Repo = S::Repo; 9169 + type IndexedAt = S::IndexedAt; 9182 9170 } 9183 9171 ///State transition - sets the `repo` field to Set 9184 9172 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 9185 9173 impl<S: State> sealed::Sealed for SetRepo<S> {} 9186 9174 impl<S: State> State for SetRepo<S> { 9187 - type Uri = S::Uri; 9188 9175 type Cid = S::Cid; 9189 - type Value = S::Value; 9190 9176 type BlobCids = S::BlobCids; 9191 - type IndexedAt = S::IndexedAt; 9192 9177 type Moderation = S::Moderation; 9178 + type Value = S::Value; 9179 + type Uri = S::Uri; 9193 9180 type Repo = Set<members::repo>; 9181 + type IndexedAt = S::IndexedAt; 9182 + } 9183 + ///State transition - sets the `indexed_at` field to Set 9184 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 9185 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 9186 + impl<S: State> State for SetIndexedAt<S> { 9187 + type Cid = S::Cid; 9188 + type BlobCids = S::BlobCids; 9189 + type Moderation = S::Moderation; 9190 + type Value = S::Value; 9191 + type Uri = S::Uri; 9192 + type Repo = S::Repo; 9193 + type IndexedAt = Set<members::indexed_at>; 9194 9194 } 9195 9195 /// Marker types for field names 9196 9196 #[allow(non_camel_case_types)] 9197 9197 pub mod members { 9198 - ///Marker type for the `uri` field 9199 - pub struct uri(()); 9200 9198 ///Marker type for the `cid` field 9201 9199 pub struct cid(()); 9202 - ///Marker type for the `value` field 9203 - pub struct value(()); 9204 9200 ///Marker type for the `blob_cids` field 9205 9201 pub struct blob_cids(()); 9206 - ///Marker type for the `indexed_at` field 9207 - pub struct indexed_at(()); 9208 9202 ///Marker type for the `moderation` field 9209 9203 pub struct moderation(()); 9204 + ///Marker type for the `value` field 9205 + pub struct value(()); 9206 + ///Marker type for the `uri` field 9207 + pub struct uri(()); 9210 9208 ///Marker type for the `repo` field 9211 9209 pub struct repo(()); 9210 + ///Marker type for the `indexed_at` field 9211 + pub struct indexed_at(()); 9212 9212 } 9213 9213 } 9214 9214 ··· 9381 9381 impl<'a, S> RecordViewBuilder<'a, S> 9382 9382 where 9383 9383 S: record_view_state::State, 9384 - S::Uri: record_view_state::IsSet, 9385 9384 S::Cid: record_view_state::IsSet, 9386 - S::Value: record_view_state::IsSet, 9387 9385 S::BlobCids: record_view_state::IsSet, 9388 - S::IndexedAt: record_view_state::IsSet, 9389 9386 S::Moderation: record_view_state::IsSet, 9387 + S::Value: record_view_state::IsSet, 9388 + S::Uri: record_view_state::IsSet, 9390 9389 S::Repo: record_view_state::IsSet, 9390 + S::IndexedAt: record_view_state::IsSet, 9391 9391 { 9392 9392 /// Build the final struct 9393 9393 pub fn build(self) -> RecordView<'a> { ··· 9480 9480 } 9481 9481 /// State trait tracking which required fields have been set 9482 9482 pub trait State: sealed::Sealed { 9483 - type Uri; 9484 - type Cid; 9485 9483 type Value; 9484 + type Uri; 9485 + type IndexedAt; 9486 9486 type Blobs; 9487 - type IndexedAt; 9488 9487 type Moderation; 9489 9488 type Repo; 9489 + type Cid; 9490 9490 } 9491 9491 /// Empty state - all required fields are unset 9492 9492 pub struct Empty(()); 9493 9493 impl sealed::Sealed for Empty {} 9494 9494 impl State for Empty { 9495 + type Value = Unset; 9495 9496 type Uri = Unset; 9496 - type Cid = Unset; 9497 - type Value = Unset; 9498 - type Blobs = Unset; 9499 9497 type IndexedAt = Unset; 9498 + type Blobs = Unset; 9500 9499 type Moderation = Unset; 9501 9500 type Repo = Unset; 9501 + type Cid = Unset; 9502 + } 9503 + ///State transition - sets the `value` field to Set 9504 + pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 9505 + impl<S: State> sealed::Sealed for SetValue<S> {} 9506 + impl<S: State> State for SetValue<S> { 9507 + type Value = Set<members::value>; 9508 + type Uri = S::Uri; 9509 + type IndexedAt = S::IndexedAt; 9510 + type Blobs = S::Blobs; 9511 + type Moderation = S::Moderation; 9512 + type Repo = S::Repo; 9513 + type Cid = S::Cid; 9502 9514 } 9503 9515 ///State transition - sets the `uri` field to Set 9504 9516 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 9505 9517 impl<S: State> sealed::Sealed for SetUri<S> {} 9506 9518 impl<S: State> State for SetUri<S> { 9507 - type Uri = Set<members::uri>; 9508 - type Cid = S::Cid; 9509 9519 type Value = S::Value; 9510 - type Blobs = S::Blobs; 9520 + type Uri = Set<members::uri>; 9511 9521 type IndexedAt = S::IndexedAt; 9512 - type Moderation = S::Moderation; 9513 - type Repo = S::Repo; 9514 - } 9515 - ///State transition - sets the `cid` field to Set 9516 - pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 9517 - impl<S: State> sealed::Sealed for SetCid<S> {} 9518 - impl<S: State> State for SetCid<S> { 9519 - type Uri = S::Uri; 9520 - type Cid = Set<members::cid>; 9521 - type Value = S::Value; 9522 9522 type Blobs = S::Blobs; 9523 - type IndexedAt = S::IndexedAt; 9524 9523 type Moderation = S::Moderation; 9525 9524 type Repo = S::Repo; 9525 + type Cid = S::Cid; 9526 9526 } 9527 - ///State transition - sets the `value` field to Set 9528 - pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 9529 - impl<S: State> sealed::Sealed for SetValue<S> {} 9530 - impl<S: State> State for SetValue<S> { 9527 + ///State transition - sets the `indexed_at` field to Set 9528 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 9529 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 9530 + impl<S: State> State for SetIndexedAt<S> { 9531 + type Value = S::Value; 9531 9532 type Uri = S::Uri; 9532 - type Cid = S::Cid; 9533 - type Value = Set<members::value>; 9533 + type IndexedAt = Set<members::indexed_at>; 9534 9534 type Blobs = S::Blobs; 9535 - type IndexedAt = S::IndexedAt; 9536 9535 type Moderation = S::Moderation; 9537 9536 type Repo = S::Repo; 9537 + type Cid = S::Cid; 9538 9538 } 9539 9539 ///State transition - sets the `blobs` field to Set 9540 9540 pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>); 9541 9541 impl<S: State> sealed::Sealed for SetBlobs<S> {} 9542 9542 impl<S: State> State for SetBlobs<S> { 9543 + type Value = S::Value; 9543 9544 type Uri = S::Uri; 9544 - type Cid = S::Cid; 9545 - type Value = S::Value; 9545 + type IndexedAt = S::IndexedAt; 9546 9546 type Blobs = Set<members::blobs>; 9547 - type IndexedAt = S::IndexedAt; 9548 9547 type Moderation = S::Moderation; 9549 9548 type Repo = S::Repo; 9550 - } 9551 - ///State transition - sets the `indexed_at` field to Set 9552 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 9553 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 9554 - impl<S: State> State for SetIndexedAt<S> { 9555 - type Uri = S::Uri; 9556 9549 type Cid = S::Cid; 9557 - type Value = S::Value; 9558 - type Blobs = S::Blobs; 9559 - type IndexedAt = Set<members::indexed_at>; 9560 - type Moderation = S::Moderation; 9561 - type Repo = S::Repo; 9562 9550 } 9563 9551 ///State transition - sets the `moderation` field to Set 9564 9552 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 9565 9553 impl<S: State> sealed::Sealed for SetModeration<S> {} 9566 9554 impl<S: State> State for SetModeration<S> { 9555 + type Value = S::Value; 9567 9556 type Uri = S::Uri; 9568 - type Cid = S::Cid; 9569 - type Value = S::Value; 9570 - type Blobs = S::Blobs; 9571 9557 type IndexedAt = S::IndexedAt; 9558 + type Blobs = S::Blobs; 9572 9559 type Moderation = Set<members::moderation>; 9573 9560 type Repo = S::Repo; 9561 + type Cid = S::Cid; 9574 9562 } 9575 9563 ///State transition - sets the `repo` field to Set 9576 9564 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>); 9577 9565 impl<S: State> sealed::Sealed for SetRepo<S> {} 9578 9566 impl<S: State> State for SetRepo<S> { 9567 + type Value = S::Value; 9579 9568 type Uri = S::Uri; 9569 + type IndexedAt = S::IndexedAt; 9570 + type Blobs = S::Blobs; 9571 + type Moderation = S::Moderation; 9572 + type Repo = Set<members::repo>; 9580 9573 type Cid = S::Cid; 9574 + } 9575 + ///State transition - sets the `cid` field to Set 9576 + pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 9577 + impl<S: State> sealed::Sealed for SetCid<S> {} 9578 + impl<S: State> State for SetCid<S> { 9581 9579 type Value = S::Value; 9580 + type Uri = S::Uri; 9581 + type IndexedAt = S::IndexedAt; 9582 9582 type Blobs = S::Blobs; 9583 - type IndexedAt = S::IndexedAt; 9584 9583 type Moderation = S::Moderation; 9585 - type Repo = Set<members::repo>; 9584 + type Repo = S::Repo; 9585 + type Cid = Set<members::cid>; 9586 9586 } 9587 9587 /// Marker types for field names 9588 9588 #[allow(non_camel_case_types)] 9589 9589 pub mod members { 9590 + ///Marker type for the `value` field 9591 + pub struct value(()); 9590 9592 ///Marker type for the `uri` field 9591 9593 pub struct uri(()); 9592 - ///Marker type for the `cid` field 9593 - pub struct cid(()); 9594 - ///Marker type for the `value` field 9595 - pub struct value(()); 9594 + ///Marker type for the `indexed_at` field 9595 + pub struct indexed_at(()); 9596 9596 ///Marker type for the `blobs` field 9597 9597 pub struct blobs(()); 9598 - ///Marker type for the `indexed_at` field 9599 - pub struct indexed_at(()); 9600 9598 ///Marker type for the `moderation` field 9601 9599 pub struct moderation(()); 9602 9600 ///Marker type for the `repo` field 9603 9601 pub struct repo(()); 9602 + ///Marker type for the `cid` field 9603 + pub struct cid(()); 9604 9604 } 9605 9605 } 9606 9606 ··· 9793 9793 impl<'a, S> RecordViewDetailBuilder<'a, S> 9794 9794 where 9795 9795 S: record_view_detail_state::State, 9796 - S::Uri: record_view_detail_state::IsSet, 9797 - S::Cid: record_view_detail_state::IsSet, 9798 9796 S::Value: record_view_detail_state::IsSet, 9799 - S::Blobs: record_view_detail_state::IsSet, 9797 + S::Uri: record_view_detail_state::IsSet, 9800 9798 S::IndexedAt: record_view_detail_state::IsSet, 9799 + S::Blobs: record_view_detail_state::IsSet, 9801 9800 S::Moderation: record_view_detail_state::IsSet, 9802 9801 S::Repo: record_view_detail_state::IsSet, 9802 + S::Cid: record_view_detail_state::IsSet, 9803 9803 { 9804 9804 /// Build the final struct 9805 9805 pub fn build(self) -> RecordViewDetail<'a> { ··· 10100 10100 } 10101 10101 /// State trait tracking which required fields have been set 10102 10102 pub trait State: sealed::Sealed { 10103 - type Did; 10103 + type IndexedAt; 10104 10104 type Handle; 10105 + type Did; 10105 10106 type RelatedRecords; 10106 - type IndexedAt; 10107 10107 type Moderation; 10108 10108 } 10109 10109 /// Empty state - all required fields are unset 10110 10110 pub struct Empty(()); 10111 10111 impl sealed::Sealed for Empty {} 10112 10112 impl State for Empty { 10113 - type Did = Unset; 10113 + type IndexedAt = Unset; 10114 10114 type Handle = Unset; 10115 + type Did = Unset; 10115 10116 type RelatedRecords = Unset; 10116 - type IndexedAt = Unset; 10117 10117 type Moderation = Unset; 10118 10118 } 10119 - ///State transition - sets the `did` field to Set 10120 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 10121 - impl<S: State> sealed::Sealed for SetDid<S> {} 10122 - impl<S: State> State for SetDid<S> { 10123 - type Did = Set<members::did>; 10119 + ///State transition - sets the `indexed_at` field to Set 10120 + pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 10121 + impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 10122 + impl<S: State> State for SetIndexedAt<S> { 10123 + type IndexedAt = Set<members::indexed_at>; 10124 10124 type Handle = S::Handle; 10125 + type Did = S::Did; 10125 10126 type RelatedRecords = S::RelatedRecords; 10126 - type IndexedAt = S::IndexedAt; 10127 10127 type Moderation = S::Moderation; 10128 10128 } 10129 10129 ///State transition - sets the `handle` field to Set 10130 10130 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 10131 10131 impl<S: State> sealed::Sealed for SetHandle<S> {} 10132 10132 impl<S: State> State for SetHandle<S> { 10133 - type Did = S::Did; 10133 + type IndexedAt = S::IndexedAt; 10134 10134 type Handle = Set<members::handle>; 10135 + type Did = S::Did; 10135 10136 type RelatedRecords = S::RelatedRecords; 10137 + type Moderation = S::Moderation; 10138 + } 10139 + ///State transition - sets the `did` field to Set 10140 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 10141 + impl<S: State> sealed::Sealed for SetDid<S> {} 10142 + impl<S: State> State for SetDid<S> { 10136 10143 type IndexedAt = S::IndexedAt; 10144 + type Handle = S::Handle; 10145 + type Did = Set<members::did>; 10146 + type RelatedRecords = S::RelatedRecords; 10137 10147 type Moderation = S::Moderation; 10138 10148 } 10139 10149 ///State transition - sets the `related_records` field to Set 10140 10150 pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>); 10141 10151 impl<S: State> sealed::Sealed for SetRelatedRecords<S> {} 10142 10152 impl<S: State> State for SetRelatedRecords<S> { 10153 + type IndexedAt = S::IndexedAt; 10154 + type Handle = S::Handle; 10143 10155 type Did = S::Did; 10144 - type Handle = S::Handle; 10145 10156 type RelatedRecords = Set<members::related_records>; 10146 - type IndexedAt = S::IndexedAt; 10147 - type Moderation = S::Moderation; 10148 - } 10149 - ///State transition - sets the `indexed_at` field to Set 10150 - pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 10151 - impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 10152 - impl<S: State> State for SetIndexedAt<S> { 10153 - type Did = S::Did; 10154 - type Handle = S::Handle; 10155 - type RelatedRecords = S::RelatedRecords; 10156 - type IndexedAt = Set<members::indexed_at>; 10157 10157 type Moderation = S::Moderation; 10158 10158 } 10159 10159 ///State transition - sets the `moderation` field to Set 10160 10160 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>); 10161 10161 impl<S: State> sealed::Sealed for SetModeration<S> {} 10162 10162 impl<S: State> State for SetModeration<S> { 10163 - type Did = S::Did; 10163 + type IndexedAt = S::IndexedAt; 10164 10164 type Handle = S::Handle; 10165 + type Did = S::Did; 10165 10166 type RelatedRecords = S::RelatedRecords; 10166 - type IndexedAt = S::IndexedAt; 10167 10167 type Moderation = Set<members::moderation>; 10168 10168 } 10169 10169 /// Marker types for field names 10170 10170 #[allow(non_camel_case_types)] 10171 10171 pub mod members { 10172 - ///Marker type for the `did` field 10173 - pub struct did(()); 10172 + ///Marker type for the `indexed_at` field 10173 + pub struct indexed_at(()); 10174 10174 ///Marker type for the `handle` field 10175 10175 pub struct handle(()); 10176 + ///Marker type for the `did` field 10177 + pub struct did(()); 10176 10178 ///Marker type for the `related_records` field 10177 10179 pub struct related_records(()); 10178 - ///Marker type for the `indexed_at` field 10179 - pub struct indexed_at(()); 10180 10180 ///Marker type for the `moderation` field 10181 10181 pub struct moderation(()); 10182 10182 } ··· 10434 10434 impl<'a, S> RepoViewBuilder<'a, S> 10435 10435 where 10436 10436 S: repo_view_state::State, 10437 - S::Did: repo_view_state::IsSet, 10437 + S::IndexedAt: repo_view_state::IsSet, 10438 10438 S::Handle: repo_view_state::IsSet, 10439 + S::Did: repo_view_state::IsSet, 10439 10440 S::RelatedRecords: repo_view_state::IsSet, 10440 - S::IndexedAt: repo_view_state::IsSet, 10441 10441 S::Moderation: repo_view_state::IsSet, 10442 10442 { 10443 10443 /// Build the final struct ··· 10561 10561 /// State trait tracking which required fields have been set 10562 10562 pub trait State: sealed::Sealed { 10563 10563 type Did; 10564 - type Handle; 10565 10564 type RelatedRecords; 10566 10565 type IndexedAt; 10566 + type Handle; 10567 10567 type Moderation; 10568 10568 } 10569 10569 /// Empty state - all required fields are unset ··· 10571 10571 impl sealed::Sealed for Empty {} 10572 10572 impl State for Empty { 10573 10573 type Did = Unset; 10574 - type Handle = Unset; 10575 10574 type RelatedRecords = Unset; 10576 10575 type IndexedAt = Unset; 10576 + type Handle = Unset; 10577 10577 type Moderation = Unset; 10578 10578 } 10579 10579 ///State transition - sets the `did` field to Set ··· 10581 10581 impl<S: State> sealed::Sealed for SetDid<S> {} 10582 10582 impl<S: State> State for SetDid<S> { 10583 10583 type Did = Set<members::did>; 10584 - type Handle = S::Handle; 10585 10584 type RelatedRecords = S::RelatedRecords; 10586 10585 type IndexedAt = S::IndexedAt; 10587 - type Moderation = S::Moderation; 10588 - } 10589 - ///State transition - sets the `handle` field to Set 10590 - pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 10591 - impl<S: State> sealed::Sealed for SetHandle<S> {} 10592 - impl<S: State> State for SetHandle<S> { 10593 - type Did = S::Did; 10594 - type Handle = Set<members::handle>; 10595 - type RelatedRecords = S::RelatedRecords; 10596 - type IndexedAt = S::IndexedAt; 10586 + type Handle = S::Handle; 10597 10587 type Moderation = S::Moderation; 10598 10588 } 10599 10589 ///State transition - sets the `related_records` field to Set ··· 10601 10591 impl<S: State> sealed::Sealed for SetRelatedRecords<S> {} 10602 10592 impl<S: State> State for SetRelatedRecords<S> { 10603 10593 type Did = S::Did; 10604 - type Handle = S::Handle; 10605 10594 type RelatedRecords = Set<members::related_records>; 10606 10595 type IndexedAt = S::IndexedAt; 10596 + type Handle = S::Handle; 10607 10597 type Moderation = S::Moderation; 10608 10598 } 10609 10599 ///State transition - sets the `indexed_at` field to Set ··· 10611 10601 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 10612 10602 impl<S: State> State for SetIndexedAt<S> { 10613 10603 type Did = S::Did; 10604 + type RelatedRecords = S::RelatedRecords; 10605 + type IndexedAt = Set<members::indexed_at>; 10614 10606 type Handle = S::Handle; 10607 + type Moderation = S::Moderation; 10608 + } 10609 + ///State transition - sets the `handle` field to Set 10610 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 10611 + impl<S: State> sealed::Sealed for SetHandle<S> {} 10612 + impl<S: State> State for SetHandle<S> { 10613 + type Did = S::Did; 10615 10614 type RelatedRecords = S::RelatedRecords; 10616 - type IndexedAt = Set<members::indexed_at>; 10615 + type IndexedAt = S::IndexedAt; 10616 + type Handle = Set<members::handle>; 10617 10617 type Moderation = S::Moderation; 10618 10618 } 10619 10619 ///State transition - sets the `moderation` field to Set ··· 10621 10621 impl<S: State> sealed::Sealed for SetModeration<S> {} 10622 10622 impl<S: State> State for SetModeration<S> { 10623 10623 type Did = S::Did; 10624 - type Handle = S::Handle; 10625 10624 type RelatedRecords = S::RelatedRecords; 10626 10625 type IndexedAt = S::IndexedAt; 10626 + type Handle = S::Handle; 10627 10627 type Moderation = Set<members::moderation>; 10628 10628 } 10629 10629 /// Marker types for field names ··· 10631 10631 pub mod members { 10632 10632 ///Marker type for the `did` field 10633 10633 pub struct did(()); 10634 - ///Marker type for the `handle` field 10635 - pub struct handle(()); 10636 10634 ///Marker type for the `related_records` field 10637 10635 pub struct related_records(()); 10638 10636 ///Marker type for the `indexed_at` field 10639 10637 pub struct indexed_at(()); 10638 + ///Marker type for the `handle` field 10639 + pub struct handle(()); 10640 10640 ///Marker type for the `moderation` field 10641 10641 pub struct moderation(()); 10642 10642 } ··· 10958 10958 where 10959 10959 S: repo_view_detail_state::State, 10960 10960 S::Did: repo_view_detail_state::IsSet, 10961 - S::Handle: repo_view_detail_state::IsSet, 10962 10961 S::RelatedRecords: repo_view_detail_state::IsSet, 10963 10962 S::IndexedAt: repo_view_detail_state::IsSet, 10963 + S::Handle: repo_view_detail_state::IsSet, 10964 10964 S::Moderation: repo_view_detail_state::IsSet, 10965 10965 { 10966 10966 /// Build the final struct ··· 11208 11208 } 11209 11209 /// State trait tracking which required fields have been set 11210 11210 pub trait State: sealed::Sealed { 11211 - type Did; 11212 11211 type AccountReportCount; 11213 11212 type RecordReportCount; 11214 11213 type ReportedAccountCount; 11215 - type ReportedRecordCount; 11216 - type TakendownAccountCount; 11217 - type TakendownRecordCount; 11218 11214 type LabeledAccountCount; 11215 + type TakendownAccountCount; 11219 11216 type LabeledRecordCount; 11217 + type Did; 11218 + type TakendownRecordCount; 11219 + type ReportedRecordCount; 11220 11220 } 11221 11221 /// Empty state - all required fields are unset 11222 11222 pub struct Empty(()); 11223 11223 impl sealed::Sealed for Empty {} 11224 11224 impl State for Empty { 11225 - type Did = Unset; 11226 11225 type AccountReportCount = Unset; 11227 11226 type RecordReportCount = Unset; 11228 11227 type ReportedAccountCount = Unset; 11229 - type ReportedRecordCount = Unset; 11230 - type TakendownAccountCount = Unset; 11231 - type TakendownRecordCount = Unset; 11232 11228 type LabeledAccountCount = Unset; 11229 + type TakendownAccountCount = Unset; 11233 11230 type LabeledRecordCount = Unset; 11234 - } 11235 - ///State transition - sets the `did` field to Set 11236 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 11237 - impl<S: State> sealed::Sealed for SetDid<S> {} 11238 - impl<S: State> State for SetDid<S> { 11239 - type Did = Set<members::did>; 11240 - type AccountReportCount = S::AccountReportCount; 11241 - type RecordReportCount = S::RecordReportCount; 11242 - type ReportedAccountCount = S::ReportedAccountCount; 11243 - type ReportedRecordCount = S::ReportedRecordCount; 11244 - type TakendownAccountCount = S::TakendownAccountCount; 11245 - type TakendownRecordCount = S::TakendownRecordCount; 11246 - type LabeledAccountCount = S::LabeledAccountCount; 11247 - type LabeledRecordCount = S::LabeledRecordCount; 11231 + type Did = Unset; 11232 + type TakendownRecordCount = Unset; 11233 + type ReportedRecordCount = Unset; 11248 11234 } 11249 11235 ///State transition - sets the `account_report_count` field to Set 11250 11236 pub struct SetAccountReportCount<S: State = Empty>(PhantomData<fn() -> S>); 11251 11237 impl<S: State> sealed::Sealed for SetAccountReportCount<S> {} 11252 11238 impl<S: State> State for SetAccountReportCount<S> { 11253 - type Did = S::Did; 11254 11239 type AccountReportCount = Set<members::account_report_count>; 11255 11240 type RecordReportCount = S::RecordReportCount; 11256 11241 type ReportedAccountCount = S::ReportedAccountCount; 11257 - type ReportedRecordCount = S::ReportedRecordCount; 11242 + type LabeledAccountCount = S::LabeledAccountCount; 11258 11243 type TakendownAccountCount = S::TakendownAccountCount; 11259 - type TakendownRecordCount = S::TakendownRecordCount; 11260 - type LabeledAccountCount = S::LabeledAccountCount; 11261 11244 type LabeledRecordCount = S::LabeledRecordCount; 11245 + type Did = S::Did; 11246 + type TakendownRecordCount = S::TakendownRecordCount; 11247 + type ReportedRecordCount = S::ReportedRecordCount; 11262 11248 } 11263 11249 ///State transition - sets the `record_report_count` field to Set 11264 11250 pub struct SetRecordReportCount<S: State = Empty>(PhantomData<fn() -> S>); 11265 11251 impl<S: State> sealed::Sealed for SetRecordReportCount<S> {} 11266 11252 impl<S: State> State for SetRecordReportCount<S> { 11267 - type Did = S::Did; 11268 11253 type AccountReportCount = S::AccountReportCount; 11269 11254 type RecordReportCount = Set<members::record_report_count>; 11270 11255 type ReportedAccountCount = S::ReportedAccountCount; 11271 - type ReportedRecordCount = S::ReportedRecordCount; 11272 - type TakendownAccountCount = S::TakendownAccountCount; 11273 - type TakendownRecordCount = S::TakendownRecordCount; 11274 11256 type LabeledAccountCount = S::LabeledAccountCount; 11257 + type TakendownAccountCount = S::TakendownAccountCount; 11275 11258 type LabeledRecordCount = S::LabeledRecordCount; 11259 + type Did = S::Did; 11260 + type TakendownRecordCount = S::TakendownRecordCount; 11261 + type ReportedRecordCount = S::ReportedRecordCount; 11276 11262 } 11277 11263 ///State transition - sets the `reported_account_count` field to Set 11278 11264 pub struct SetReportedAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11279 11265 impl<S: State> sealed::Sealed for SetReportedAccountCount<S> {} 11280 11266 impl<S: State> State for SetReportedAccountCount<S> { 11281 - type Did = S::Did; 11282 11267 type AccountReportCount = S::AccountReportCount; 11283 11268 type RecordReportCount = S::RecordReportCount; 11284 11269 type ReportedAccountCount = Set<members::reported_account_count>; 11285 - type ReportedRecordCount = S::ReportedRecordCount; 11270 + type LabeledAccountCount = S::LabeledAccountCount; 11286 11271 type TakendownAccountCount = S::TakendownAccountCount; 11287 - type TakendownRecordCount = S::TakendownRecordCount; 11288 - type LabeledAccountCount = S::LabeledAccountCount; 11289 11272 type LabeledRecordCount = S::LabeledRecordCount; 11273 + type Did = S::Did; 11274 + type TakendownRecordCount = S::TakendownRecordCount; 11275 + type ReportedRecordCount = S::ReportedRecordCount; 11290 11276 } 11291 - ///State transition - sets the `reported_record_count` field to Set 11292 - pub struct SetReportedRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11293 - impl<S: State> sealed::Sealed for SetReportedRecordCount<S> {} 11294 - impl<S: State> State for SetReportedRecordCount<S> { 11295 - type Did = S::Did; 11277 + ///State transition - sets the `labeled_account_count` field to Set 11278 + pub struct SetLabeledAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11279 + impl<S: State> sealed::Sealed for SetLabeledAccountCount<S> {} 11280 + impl<S: State> State for SetLabeledAccountCount<S> { 11296 11281 type AccountReportCount = S::AccountReportCount; 11297 11282 type RecordReportCount = S::RecordReportCount; 11298 11283 type ReportedAccountCount = S::ReportedAccountCount; 11299 - type ReportedRecordCount = Set<members::reported_record_count>; 11284 + type LabeledAccountCount = Set<members::labeled_account_count>; 11300 11285 type TakendownAccountCount = S::TakendownAccountCount; 11301 - type TakendownRecordCount = S::TakendownRecordCount; 11302 - type LabeledAccountCount = S::LabeledAccountCount; 11303 11286 type LabeledRecordCount = S::LabeledRecordCount; 11287 + type Did = S::Did; 11288 + type TakendownRecordCount = S::TakendownRecordCount; 11289 + type ReportedRecordCount = S::ReportedRecordCount; 11304 11290 } 11305 11291 ///State transition - sets the `takendown_account_count` field to Set 11306 11292 pub struct SetTakendownAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11307 11293 impl<S: State> sealed::Sealed for SetTakendownAccountCount<S> {} 11308 11294 impl<S: State> State for SetTakendownAccountCount<S> { 11309 - type Did = S::Did; 11310 11295 type AccountReportCount = S::AccountReportCount; 11311 11296 type RecordReportCount = S::RecordReportCount; 11312 11297 type ReportedAccountCount = S::ReportedAccountCount; 11313 - type ReportedRecordCount = S::ReportedRecordCount; 11298 + type LabeledAccountCount = S::LabeledAccountCount; 11314 11299 type TakendownAccountCount = Set<members::takendown_account_count>; 11300 + type LabeledRecordCount = S::LabeledRecordCount; 11301 + type Did = S::Did; 11315 11302 type TakendownRecordCount = S::TakendownRecordCount; 11303 + type ReportedRecordCount = S::ReportedRecordCount; 11304 + } 11305 + ///State transition - sets the `labeled_record_count` field to Set 11306 + pub struct SetLabeledRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11307 + impl<S: State> sealed::Sealed for SetLabeledRecordCount<S> {} 11308 + impl<S: State> State for SetLabeledRecordCount<S> { 11309 + type AccountReportCount = S::AccountReportCount; 11310 + type RecordReportCount = S::RecordReportCount; 11311 + type ReportedAccountCount = S::ReportedAccountCount; 11316 11312 type LabeledAccountCount = S::LabeledAccountCount; 11313 + type TakendownAccountCount = S::TakendownAccountCount; 11314 + type LabeledRecordCount = Set<members::labeled_record_count>; 11315 + type Did = S::Did; 11316 + type TakendownRecordCount = S::TakendownRecordCount; 11317 + type ReportedRecordCount = S::ReportedRecordCount; 11318 + } 11319 + ///State transition - sets the `did` field to Set 11320 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 11321 + impl<S: State> sealed::Sealed for SetDid<S> {} 11322 + impl<S: State> State for SetDid<S> { 11323 + type AccountReportCount = S::AccountReportCount; 11324 + type RecordReportCount = S::RecordReportCount; 11325 + type ReportedAccountCount = S::ReportedAccountCount; 11326 + type LabeledAccountCount = S::LabeledAccountCount; 11327 + type TakendownAccountCount = S::TakendownAccountCount; 11317 11328 type LabeledRecordCount = S::LabeledRecordCount; 11329 + type Did = Set<members::did>; 11330 + type TakendownRecordCount = S::TakendownRecordCount; 11331 + type ReportedRecordCount = S::ReportedRecordCount; 11318 11332 } 11319 11333 ///State transition - sets the `takendown_record_count` field to Set 11320 11334 pub struct SetTakendownRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11321 11335 impl<S: State> sealed::Sealed for SetTakendownRecordCount<S> {} 11322 11336 impl<S: State> State for SetTakendownRecordCount<S> { 11323 - type Did = S::Did; 11324 11337 type AccountReportCount = S::AccountReportCount; 11325 11338 type RecordReportCount = S::RecordReportCount; 11326 11339 type ReportedAccountCount = S::ReportedAccountCount; 11327 - type ReportedRecordCount = S::ReportedRecordCount; 11328 - type TakendownAccountCount = S::TakendownAccountCount; 11329 - type TakendownRecordCount = Set<members::takendown_record_count>; 11330 11340 type LabeledAccountCount = S::LabeledAccountCount; 11341 + type TakendownAccountCount = S::TakendownAccountCount; 11331 11342 type LabeledRecordCount = S::LabeledRecordCount; 11343 + type Did = S::Did; 11344 + type TakendownRecordCount = Set<members::takendown_record_count>; 11345 + type ReportedRecordCount = S::ReportedRecordCount; 11332 11346 } 11333 - ///State transition - sets the `labeled_account_count` field to Set 11334 - pub struct SetLabeledAccountCount<S: State = Empty>(PhantomData<fn() -> S>); 11335 - impl<S: State> sealed::Sealed for SetLabeledAccountCount<S> {} 11336 - impl<S: State> State for SetLabeledAccountCount<S> { 11337 - type Did = S::Did; 11347 + ///State transition - sets the `reported_record_count` field to Set 11348 + pub struct SetReportedRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11349 + impl<S: State> sealed::Sealed for SetReportedRecordCount<S> {} 11350 + impl<S: State> State for SetReportedRecordCount<S> { 11338 11351 type AccountReportCount = S::AccountReportCount; 11339 11352 type RecordReportCount = S::RecordReportCount; 11340 11353 type ReportedAccountCount = S::ReportedAccountCount; 11341 - type ReportedRecordCount = S::ReportedRecordCount; 11354 + type LabeledAccountCount = S::LabeledAccountCount; 11342 11355 type TakendownAccountCount = S::TakendownAccountCount; 11343 - type TakendownRecordCount = S::TakendownRecordCount; 11344 - type LabeledAccountCount = Set<members::labeled_account_count>; 11345 11356 type LabeledRecordCount = S::LabeledRecordCount; 11346 - } 11347 - ///State transition - sets the `labeled_record_count` field to Set 11348 - pub struct SetLabeledRecordCount<S: State = Empty>(PhantomData<fn() -> S>); 11349 - impl<S: State> sealed::Sealed for SetLabeledRecordCount<S> {} 11350 - impl<S: State> State for SetLabeledRecordCount<S> { 11351 11357 type Did = S::Did; 11352 - type AccountReportCount = S::AccountReportCount; 11353 - type RecordReportCount = S::RecordReportCount; 11354 - type ReportedAccountCount = S::ReportedAccountCount; 11355 - type ReportedRecordCount = S::ReportedRecordCount; 11356 - type TakendownAccountCount = S::TakendownAccountCount; 11357 11358 type TakendownRecordCount = S::TakendownRecordCount; 11358 - type LabeledAccountCount = S::LabeledAccountCount; 11359 - type LabeledRecordCount = Set<members::labeled_record_count>; 11359 + type ReportedRecordCount = Set<members::reported_record_count>; 11360 11360 } 11361 11361 /// Marker types for field names 11362 11362 #[allow(non_camel_case_types)] 11363 11363 pub mod members { 11364 - ///Marker type for the `did` field 11365 - pub struct did(()); 11366 11364 ///Marker type for the `account_report_count` field 11367 11365 pub struct account_report_count(()); 11368 11366 ///Marker type for the `record_report_count` field 11369 11367 pub struct record_report_count(()); 11370 11368 ///Marker type for the `reported_account_count` field 11371 11369 pub struct reported_account_count(()); 11372 - ///Marker type for the `reported_record_count` field 11373 - pub struct reported_record_count(()); 11370 + ///Marker type for the `labeled_account_count` field 11371 + pub struct labeled_account_count(()); 11374 11372 ///Marker type for the `takendown_account_count` field 11375 11373 pub struct takendown_account_count(()); 11374 + ///Marker type for the `labeled_record_count` field 11375 + pub struct labeled_record_count(()); 11376 + ///Marker type for the `did` field 11377 + pub struct did(()); 11376 11378 ///Marker type for the `takendown_record_count` field 11377 11379 pub struct takendown_record_count(()); 11378 - ///Marker type for the `labeled_account_count` field 11379 - pub struct labeled_account_count(()); 11380 - ///Marker type for the `labeled_record_count` field 11381 - pub struct labeled_record_count(()); 11380 + ///Marker type for the `reported_record_count` field 11381 + pub struct reported_record_count(()); 11382 11382 } 11383 11383 } 11384 11384 ··· 11601 11601 impl<'a, S> ReporterStatsBuilder<'a, S> 11602 11602 where 11603 11603 S: reporter_stats_state::State, 11604 - S::Did: reporter_stats_state::IsSet, 11605 11604 S::AccountReportCount: reporter_stats_state::IsSet, 11606 11605 S::RecordReportCount: reporter_stats_state::IsSet, 11607 11606 S::ReportedAccountCount: reporter_stats_state::IsSet, 11608 - S::ReportedRecordCount: reporter_stats_state::IsSet, 11607 + S::LabeledAccountCount: reporter_stats_state::IsSet, 11609 11608 S::TakendownAccountCount: reporter_stats_state::IsSet, 11609 + S::LabeledRecordCount: reporter_stats_state::IsSet, 11610 + S::Did: reporter_stats_state::IsSet, 11610 11611 S::TakendownRecordCount: reporter_stats_state::IsSet, 11611 - S::LabeledAccountCount: reporter_stats_state::IsSet, 11612 - S::LabeledRecordCount: reporter_stats_state::IsSet, 11612 + S::ReportedRecordCount: reporter_stats_state::IsSet, 11613 11613 { 11614 11614 /// Build the final struct 11615 11615 pub fn build(self) -> ReporterStats<'a> { ··· 11888 11888 /// State trait tracking which required fields have been set 11889 11889 pub trait State: sealed::Sealed { 11890 11890 type Id; 11891 - type Action; 11892 - type Did; 11891 + type Status; 11893 11892 type CreatedBy; 11893 + type Action; 11894 11894 type CreatedAt; 11895 - type Status; 11895 + type Did; 11896 11896 } 11897 11897 /// Empty state - all required fields are unset 11898 11898 pub struct Empty(()); 11899 11899 impl sealed::Sealed for Empty {} 11900 11900 impl State for Empty { 11901 11901 type Id = Unset; 11902 - type Action = Unset; 11903 - type Did = Unset; 11902 + type Status = Unset; 11904 11903 type CreatedBy = Unset; 11904 + type Action = Unset; 11905 11905 type CreatedAt = Unset; 11906 - type Status = Unset; 11906 + type Did = Unset; 11907 11907 } 11908 11908 ///State transition - sets the `id` field to Set 11909 11909 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 11910 11910 impl<S: State> sealed::Sealed for SetId<S> {} 11911 11911 impl<S: State> State for SetId<S> { 11912 11912 type Id = Set<members::id>; 11913 - type Action = S::Action; 11914 - type Did = S::Did; 11913 + type Status = S::Status; 11915 11914 type CreatedBy = S::CreatedBy; 11915 + type Action = S::Action; 11916 11916 type CreatedAt = S::CreatedAt; 11917 - type Status = S::Status; 11917 + type Did = S::Did; 11918 11918 } 11919 - ///State transition - sets the `action` field to Set 11920 - pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 11921 - impl<S: State> sealed::Sealed for SetAction<S> {} 11922 - impl<S: State> State for SetAction<S> { 11919 + ///State transition - sets the `status` field to Set 11920 + pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 11921 + impl<S: State> sealed::Sealed for SetStatus<S> {} 11922 + impl<S: State> State for SetStatus<S> { 11923 11923 type Id = S::Id; 11924 - type Action = Set<members::action>; 11925 - type Did = S::Did; 11924 + type Status = Set<members::status>; 11926 11925 type CreatedBy = S::CreatedBy; 11927 - type CreatedAt = S::CreatedAt; 11928 - type Status = S::Status; 11929 - } 11930 - ///State transition - sets the `did` field to Set 11931 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 11932 - impl<S: State> sealed::Sealed for SetDid<S> {} 11933 - impl<S: State> State for SetDid<S> { 11934 - type Id = S::Id; 11935 11926 type Action = S::Action; 11936 - type Did = Set<members::did>; 11937 - type CreatedBy = S::CreatedBy; 11938 11927 type CreatedAt = S::CreatedAt; 11939 - type Status = S::Status; 11928 + type Did = S::Did; 11940 11929 } 11941 11930 ///State transition - sets the `created_by` field to Set 11942 11931 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 11943 11932 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 11944 11933 impl<S: State> State for SetCreatedBy<S> { 11945 11934 type Id = S::Id; 11946 - type Action = S::Action; 11947 - type Did = S::Did; 11935 + type Status = S::Status; 11948 11936 type CreatedBy = Set<members::created_by>; 11937 + type Action = S::Action; 11949 11938 type CreatedAt = S::CreatedAt; 11939 + type Did = S::Did; 11940 + } 11941 + ///State transition - sets the `action` field to Set 11942 + pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 11943 + impl<S: State> sealed::Sealed for SetAction<S> {} 11944 + impl<S: State> State for SetAction<S> { 11945 + type Id = S::Id; 11950 11946 type Status = S::Status; 11947 + type CreatedBy = S::CreatedBy; 11948 + type Action = Set<members::action>; 11949 + type CreatedAt = S::CreatedAt; 11950 + type Did = S::Did; 11951 11951 } 11952 11952 ///State transition - sets the `created_at` field to Set 11953 11953 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 11954 11954 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 11955 11955 impl<S: State> State for SetCreatedAt<S> { 11956 11956 type Id = S::Id; 11957 - type Action = S::Action; 11958 - type Did = S::Did; 11957 + type Status = S::Status; 11959 11958 type CreatedBy = S::CreatedBy; 11959 + type Action = S::Action; 11960 11960 type CreatedAt = Set<members::created_at>; 11961 - type Status = S::Status; 11961 + type Did = S::Did; 11962 11962 } 11963 - ///State transition - sets the `status` field to Set 11964 - pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>); 11965 - impl<S: State> sealed::Sealed for SetStatus<S> {} 11966 - impl<S: State> State for SetStatus<S> { 11963 + ///State transition - sets the `did` field to Set 11964 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 11965 + impl<S: State> sealed::Sealed for SetDid<S> {} 11966 + impl<S: State> State for SetDid<S> { 11967 11967 type Id = S::Id; 11968 - type Action = S::Action; 11969 - type Did = S::Did; 11968 + type Status = S::Status; 11970 11969 type CreatedBy = S::CreatedBy; 11970 + type Action = S::Action; 11971 11971 type CreatedAt = S::CreatedAt; 11972 - type Status = Set<members::status>; 11972 + type Did = Set<members::did>; 11973 11973 } 11974 11974 /// Marker types for field names 11975 11975 #[allow(non_camel_case_types)] 11976 11976 pub mod members { 11977 11977 ///Marker type for the `id` field 11978 11978 pub struct id(()); 11979 + ///Marker type for the `status` field 11980 + pub struct status(()); 11981 + ///Marker type for the `created_by` field 11982 + pub struct created_by(()); 11979 11983 ///Marker type for the `action` field 11980 11984 pub struct action(()); 11985 + ///Marker type for the `created_at` field 11986 + pub struct created_at(()); 11981 11987 ///Marker type for the `did` field 11982 11988 pub struct did(()); 11983 - ///Marker type for the `created_by` field 11984 - pub struct created_by(()); 11985 - ///Marker type for the `created_at` field 11986 - pub struct created_at(()); 11987 - ///Marker type for the `status` field 11988 - pub struct status(()); 11989 11989 } 11990 11990 } 11991 11991 ··· 12323 12323 where 12324 12324 S: scheduled_action_view_state::State, 12325 12325 S::Id: scheduled_action_view_state::IsSet, 12326 + S::Status: scheduled_action_view_state::IsSet, 12327 + S::CreatedBy: scheduled_action_view_state::IsSet, 12326 12328 S::Action: scheduled_action_view_state::IsSet, 12327 - S::Did: scheduled_action_view_state::IsSet, 12328 - S::CreatedBy: scheduled_action_view_state::IsSet, 12329 12329 S::CreatedAt: scheduled_action_view_state::IsSet, 12330 - S::Status: scheduled_action_view_state::IsSet, 12330 + S::Did: scheduled_action_view_state::IsSet, 12331 12331 { 12332 12332 /// Build the final struct 12333 12333 pub fn build(self) -> ScheduledActionView<'a> { ··· 12617 12617 } 12618 12618 /// State trait tracking which required fields have been set 12619 12619 pub trait State: sealed::Sealed { 12620 - type Id; 12621 - type Subject; 12622 - type CreatedAt; 12623 12620 type UpdatedAt; 12624 12621 type ReviewState; 12622 + type Id; 12623 + type CreatedAt; 12624 + type Subject; 12625 12625 } 12626 12626 /// Empty state - all required fields are unset 12627 12627 pub struct Empty(()); 12628 12628 impl sealed::Sealed for Empty {} 12629 12629 impl State for Empty { 12630 + type UpdatedAt = Unset; 12631 + type ReviewState = Unset; 12630 12632 type Id = Unset; 12633 + type CreatedAt = Unset; 12631 12634 type Subject = Unset; 12632 - type CreatedAt = Unset; 12633 - type UpdatedAt = Unset; 12634 - type ReviewState = Unset; 12635 + } 12636 + ///State transition - sets the `updated_at` field to Set 12637 + pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 12638 + impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 12639 + impl<S: State> State for SetUpdatedAt<S> { 12640 + type UpdatedAt = Set<members::updated_at>; 12641 + type ReviewState = S::ReviewState; 12642 + type Id = S::Id; 12643 + type CreatedAt = S::CreatedAt; 12644 + type Subject = S::Subject; 12645 + } 12646 + ///State transition - sets the `review_state` field to Set 12647 + pub struct SetReviewState<S: State = Empty>(PhantomData<fn() -> S>); 12648 + impl<S: State> sealed::Sealed for SetReviewState<S> {} 12649 + impl<S: State> State for SetReviewState<S> { 12650 + type UpdatedAt = S::UpdatedAt; 12651 + type ReviewState = Set<members::review_state>; 12652 + type Id = S::Id; 12653 + type CreatedAt = S::CreatedAt; 12654 + type Subject = S::Subject; 12635 12655 } 12636 12656 ///State transition - sets the `id` field to Set 12637 12657 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 12638 12658 impl<S: State> sealed::Sealed for SetId<S> {} 12639 12659 impl<S: State> State for SetId<S> { 12640 - type Id = Set<members::id>; 12641 - type Subject = S::Subject; 12642 - type CreatedAt = S::CreatedAt; 12643 12660 type UpdatedAt = S::UpdatedAt; 12644 12661 type ReviewState = S::ReviewState; 12645 - } 12646 - ///State transition - sets the `subject` field to Set 12647 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 12648 - impl<S: State> sealed::Sealed for SetSubject<S> {} 12649 - impl<S: State> State for SetSubject<S> { 12650 - type Id = S::Id; 12651 - type Subject = Set<members::subject>; 12662 + type Id = Set<members::id>; 12652 12663 type CreatedAt = S::CreatedAt; 12653 - type UpdatedAt = S::UpdatedAt; 12654 - type ReviewState = S::ReviewState; 12664 + type Subject = S::Subject; 12655 12665 } 12656 12666 ///State transition - sets the `created_at` field to Set 12657 12667 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 12658 12668 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 12659 12669 impl<S: State> State for SetCreatedAt<S> { 12660 - type Id = S::Id; 12661 - type Subject = S::Subject; 12662 - type CreatedAt = Set<members::created_at>; 12663 12670 type UpdatedAt = S::UpdatedAt; 12664 12671 type ReviewState = S::ReviewState; 12665 - } 12666 - ///State transition - sets the `updated_at` field to Set 12667 - pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 12668 - impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 12669 - impl<S: State> State for SetUpdatedAt<S> { 12670 12672 type Id = S::Id; 12673 + type CreatedAt = Set<members::created_at>; 12671 12674 type Subject = S::Subject; 12672 - type CreatedAt = S::CreatedAt; 12673 - type UpdatedAt = Set<members::updated_at>; 12674 - type ReviewState = S::ReviewState; 12675 12675 } 12676 - ///State transition - sets the `review_state` field to Set 12677 - pub struct SetReviewState<S: State = Empty>(PhantomData<fn() -> S>); 12678 - impl<S: State> sealed::Sealed for SetReviewState<S> {} 12679 - impl<S: State> State for SetReviewState<S> { 12676 + ///State transition - sets the `subject` field to Set 12677 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 12678 + impl<S: State> sealed::Sealed for SetSubject<S> {} 12679 + impl<S: State> State for SetSubject<S> { 12680 + type UpdatedAt = S::UpdatedAt; 12681 + type ReviewState = S::ReviewState; 12680 12682 type Id = S::Id; 12681 - type Subject = S::Subject; 12682 12683 type CreatedAt = S::CreatedAt; 12683 - type UpdatedAt = S::UpdatedAt; 12684 - type ReviewState = Set<members::review_state>; 12684 + type Subject = Set<members::subject>; 12685 12685 } 12686 12686 /// Marker types for field names 12687 12687 #[allow(non_camel_case_types)] 12688 12688 pub mod members { 12689 + ///Marker type for the `updated_at` field 12690 + pub struct updated_at(()); 12691 + ///Marker type for the `review_state` field 12692 + pub struct review_state(()); 12689 12693 ///Marker type for the `id` field 12690 12694 pub struct id(()); 12695 + ///Marker type for the `created_at` field 12696 + pub struct created_at(()); 12691 12697 ///Marker type for the `subject` field 12692 12698 pub struct subject(()); 12693 - ///Marker type for the `created_at` field 12694 - pub struct created_at(()); 12695 - ///Marker type for the `updated_at` field 12696 - pub struct updated_at(()); 12697 - ///Marker type for the `review_state` field 12698 - pub struct review_state(()); 12699 12699 } 12700 12700 } 12701 12701 ··· 13230 13230 impl<'a, S> SubjectStatusViewBuilder<'a, S> 13231 13231 where 13232 13232 S: subject_status_view_state::State, 13233 + S::UpdatedAt: subject_status_view_state::IsSet, 13234 + S::ReviewState: subject_status_view_state::IsSet, 13233 13235 S::Id: subject_status_view_state::IsSet, 13234 - S::Subject: subject_status_view_state::IsSet, 13235 13236 S::CreatedAt: subject_status_view_state::IsSet, 13236 - S::UpdatedAt: subject_status_view_state::IsSet, 13237 - S::ReviewState: subject_status_view_state::IsSet, 13237 + S::Subject: subject_status_view_state::IsSet, 13238 13238 { 13239 13239 /// Build the final struct 13240 13240 pub fn build(self) -> SubjectStatusView<'a> { ··· 13746 13746 } 13747 13747 /// State trait tracking which required fields have been set 13748 13748 pub trait State: sealed::Sealed { 13749 - type Width; 13750 13749 type Height; 13750 + type Width; 13751 13751 type Length; 13752 13752 } 13753 13753 /// Empty state - all required fields are unset 13754 13754 pub struct Empty(()); 13755 13755 impl sealed::Sealed for Empty {} 13756 13756 impl State for Empty { 13757 - type Width = Unset; 13758 13757 type Height = Unset; 13758 + type Width = Unset; 13759 13759 type Length = Unset; 13760 13760 } 13761 - ///State transition - sets the `width` field to Set 13762 - pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 13763 - impl<S: State> sealed::Sealed for SetWidth<S> {} 13764 - impl<S: State> State for SetWidth<S> { 13765 - type Width = Set<members::width>; 13766 - type Height = S::Height; 13767 - type Length = S::Length; 13768 - } 13769 13761 ///State transition - sets the `height` field to Set 13770 13762 pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>); 13771 13763 impl<S: State> sealed::Sealed for SetHeight<S> {} 13772 13764 impl<S: State> State for SetHeight<S> { 13773 - type Width = S::Width; 13774 13765 type Height = Set<members::height>; 13766 + type Width = S::Width; 13767 + type Length = S::Length; 13768 + } 13769 + ///State transition - sets the `width` field to Set 13770 + pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>); 13771 + impl<S: State> sealed::Sealed for SetWidth<S> {} 13772 + impl<S: State> State for SetWidth<S> { 13773 + type Height = S::Height; 13774 + type Width = Set<members::width>; 13775 13775 type Length = S::Length; 13776 13776 } 13777 13777 ///State transition - sets the `length` field to Set 13778 13778 pub struct SetLength<S: State = Empty>(PhantomData<fn() -> S>); 13779 13779 impl<S: State> sealed::Sealed for SetLength<S> {} 13780 13780 impl<S: State> State for SetLength<S> { 13781 - type Width = S::Width; 13782 13781 type Height = S::Height; 13782 + type Width = S::Width; 13783 13783 type Length = Set<members::length>; 13784 13784 } 13785 13785 /// Marker types for field names 13786 13786 #[allow(non_camel_case_types)] 13787 13787 pub mod members { 13788 + ///Marker type for the `height` field 13789 + pub struct height(()); 13788 13790 ///Marker type for the `width` field 13789 13791 pub struct width(()); 13790 - ///Marker type for the `height` field 13791 - pub struct height(()); 13792 13792 ///Marker type for the `length` field 13793 13793 pub struct length(()); 13794 13794 } ··· 13883 13883 impl<'a, S> VideoDetailsBuilder<'a, S> 13884 13884 where 13885 13885 S: video_details_state::State, 13886 - S::Width: video_details_state::IsSet, 13887 13886 S::Height: video_details_state::IsSet, 13887 + S::Width: video_details_state::IsSet, 13888 13888 S::Length: video_details_state::IsSet, 13889 13889 { 13890 13890 /// Build the final struct
+13 -13
crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs
··· 37 37 } 38 38 /// State trait tracking which required fields have been set 39 39 pub trait State: sealed::Sealed { 40 - type Succeeded; 41 40 type Failed; 41 + type Succeeded; 42 42 } 43 43 /// Empty state - all required fields are unset 44 44 pub struct Empty(()); 45 45 impl sealed::Sealed for Empty {} 46 46 impl State for Empty { 47 - type Succeeded = Unset; 48 47 type Failed = Unset; 49 - } 50 - ///State transition - sets the `succeeded` field to Set 51 - pub struct SetSucceeded<S: State = Empty>(PhantomData<fn() -> S>); 52 - impl<S: State> sealed::Sealed for SetSucceeded<S> {} 53 - impl<S: State> State for SetSucceeded<S> { 54 - type Succeeded = Set<members::succeeded>; 55 - type Failed = S::Failed; 48 + type Succeeded = Unset; 56 49 } 57 50 ///State transition - sets the `failed` field to Set 58 51 pub struct SetFailed<S: State = Empty>(PhantomData<fn() -> S>); 59 52 impl<S: State> sealed::Sealed for SetFailed<S> {} 60 53 impl<S: State> State for SetFailed<S> { 61 - type Succeeded = S::Succeeded; 62 54 type Failed = Set<members::failed>; 55 + type Succeeded = S::Succeeded; 56 + } 57 + ///State transition - sets the `succeeded` field to Set 58 + pub struct SetSucceeded<S: State = Empty>(PhantomData<fn() -> S>); 59 + impl<S: State> sealed::Sealed for SetSucceeded<S> {} 60 + impl<S: State> State for SetSucceeded<S> { 61 + type Failed = S::Failed; 62 + type Succeeded = Set<members::succeeded>; 63 63 } 64 64 /// Marker types for field names 65 65 #[allow(non_camel_case_types)] 66 66 pub mod members { 67 - ///Marker type for the `succeeded` field 68 - pub struct succeeded(()); 69 67 ///Marker type for the `failed` field 70 68 pub struct failed(()); 69 + ///Marker type for the `succeeded` field 70 + pub struct succeeded(()); 71 71 } 72 72 } 73 73 ··· 152 152 impl<'a, S> CancellationResultsBuilder<'a, S> 153 153 where 154 154 S: cancellation_results_state::State, 155 - S::Succeeded: cancellation_results_state::IsSet, 156 155 S::Failed: cancellation_results_state::IsSet, 156 + S::Succeeded: cancellation_results_state::IsSet, 157 157 { 158 158 /// Build the final struct 159 159 pub fn build(self) -> CancellationResults<'a> {
+24 -24
crates/weaver-api/src/tools_ozone/moderation/emit_event.rs
··· 47 47 } 48 48 /// State trait tracking which required fields have been set 49 49 pub trait State: sealed::Sealed { 50 - type Event; 51 - type Subject; 52 50 type CreatedBy; 51 + type Subject; 52 + type Event; 53 53 } 54 54 /// Empty state - all required fields are unset 55 55 pub struct Empty(()); 56 56 impl sealed::Sealed for Empty {} 57 57 impl State for Empty { 58 + type CreatedBy = Unset; 59 + type Subject = Unset; 58 60 type Event = Unset; 59 - type Subject = Unset; 60 - type CreatedBy = Unset; 61 61 } 62 - ///State transition - sets the `event` field to Set 63 - pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 64 - impl<S: State> sealed::Sealed for SetEvent<S> {} 65 - impl<S: State> State for SetEvent<S> { 66 - type Event = Set<members::event>; 62 + ///State transition - sets the `created_by` field to Set 63 + pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 65 + impl<S: State> State for SetCreatedBy<S> { 66 + type CreatedBy = Set<members::created_by>; 67 67 type Subject = S::Subject; 68 - type CreatedBy = S::CreatedBy; 68 + type Event = S::Event; 69 69 } 70 70 ///State transition - sets the `subject` field to Set 71 71 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 72 72 impl<S: State> sealed::Sealed for SetSubject<S> {} 73 73 impl<S: State> State for SetSubject<S> { 74 - type Event = S::Event; 75 - type Subject = Set<members::subject>; 76 74 type CreatedBy = S::CreatedBy; 75 + type Subject = Set<members::subject>; 76 + type Event = S::Event; 77 77 } 78 - ///State transition - sets the `created_by` field to Set 79 - pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 80 - impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 81 - impl<S: State> State for SetCreatedBy<S> { 82 - type Event = S::Event; 78 + ///State transition - sets the `event` field to Set 79 + pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>); 80 + impl<S: State> sealed::Sealed for SetEvent<S> {} 81 + impl<S: State> State for SetEvent<S> { 82 + type CreatedBy = S::CreatedBy; 83 83 type Subject = S::Subject; 84 - type CreatedBy = Set<members::created_by>; 84 + type Event = Set<members::event>; 85 85 } 86 86 /// Marker types for field names 87 87 #[allow(non_camel_case_types)] 88 88 pub mod members { 89 + ///Marker type for the `created_by` field 90 + pub struct created_by(()); 91 + ///Marker type for the `subject` field 92 + pub struct subject(()); 89 93 ///Marker type for the `event` field 90 94 pub struct event(()); 91 - ///Marker type for the `subject` field 92 - pub struct subject(()); 93 - ///Marker type for the `created_by` field 94 - pub struct created_by(()); 95 95 } 96 96 } 97 97 ··· 244 244 impl<'a, S> EmitEventBuilder<'a, S> 245 245 where 246 246 S: emit_event_state::State, 247 - S::Event: emit_event_state::IsSet, 248 - S::Subject: emit_event_state::IsSet, 249 247 S::CreatedBy: emit_event_state::IsSet, 248 + S::Subject: emit_event_state::IsSet, 249 + S::Event: emit_event_state::IsSet, 250 250 { 251 251 /// Build the final struct 252 252 pub fn build(self) -> EmitEvent<'a> {
+15 -15
crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs
··· 575 575 } 576 576 /// State trait tracking which required fields have been set 577 577 pub trait State: sealed::Sealed { 578 + type Count; 578 579 type EventSubjectType; 579 580 type EventType; 580 - type Count; 581 581 } 582 582 /// Empty state - all required fields are unset 583 583 pub struct Empty(()); 584 584 impl sealed::Sealed for Empty {} 585 585 impl State for Empty { 586 + type Count = Unset; 586 587 type EventSubjectType = Unset; 587 588 type EventType = Unset; 588 - type Count = Unset; 589 + } 590 + ///State transition - sets the `count` field to Set 591 + pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 592 + impl<S: State> sealed::Sealed for SetCount<S> {} 593 + impl<S: State> State for SetCount<S> { 594 + type Count = Set<members::count>; 595 + type EventSubjectType = S::EventSubjectType; 596 + type EventType = S::EventType; 589 597 } 590 598 ///State transition - sets the `event_subject_type` field to Set 591 599 pub struct SetEventSubjectType<S: State = Empty>(PhantomData<fn() -> S>); 592 600 impl<S: State> sealed::Sealed for SetEventSubjectType<S> {} 593 601 impl<S: State> State for SetEventSubjectType<S> { 602 + type Count = S::Count; 594 603 type EventSubjectType = Set<members::event_subject_type>; 595 604 type EventType = S::EventType; 596 - type Count = S::Count; 597 605 } 598 606 ///State transition - sets the `event_type` field to Set 599 607 pub struct SetEventType<S: State = Empty>(PhantomData<fn() -> S>); 600 608 impl<S: State> sealed::Sealed for SetEventType<S> {} 601 609 impl<S: State> State for SetEventType<S> { 602 - type EventSubjectType = S::EventSubjectType; 603 - type EventType = Set<members::event_type>; 604 610 type Count = S::Count; 605 - } 606 - ///State transition - sets the `count` field to Set 607 - pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>); 608 - impl<S: State> sealed::Sealed for SetCount<S> {} 609 - impl<S: State> State for SetCount<S> { 610 611 type EventSubjectType = S::EventSubjectType; 611 - type EventType = S::EventType; 612 - type Count = Set<members::count>; 612 + type EventType = Set<members::event_type>; 613 613 } 614 614 /// Marker types for field names 615 615 #[allow(non_camel_case_types)] 616 616 pub mod members { 617 + ///Marker type for the `count` field 618 + pub struct count(()); 617 619 ///Marker type for the `event_subject_type` field 618 620 pub struct event_subject_type(()); 619 621 ///Marker type for the `event_type` field 620 622 pub struct event_type(()); 621 - ///Marker type for the `count` field 622 - pub struct count(()); 623 623 } 624 624 } 625 625 ··· 715 715 impl<'a, S> TimelineItemSummaryBuilder<'a, S> 716 716 where 717 717 S: timeline_item_summary_state::State, 718 + S::Count: timeline_item_summary_state::IsSet, 718 719 S::EventSubjectType: timeline_item_summary_state::IsSet, 719 720 S::EventType: timeline_item_summary_state::IsSet, 720 - S::Count: timeline_item_summary_state::IsSet, 721 721 { 722 722 /// Build the final struct 723 723 pub fn build(self) -> TimelineItemSummary<'a> {
+17 -17
crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs
··· 762 762 /// State trait tracking which required fields have been set 763 763 pub trait State: sealed::Sealed { 764 764 type Action; 765 - type Subjects; 766 765 type CreatedBy; 767 766 type Scheduling; 767 + type Subjects; 768 768 } 769 769 /// Empty state - all required fields are unset 770 770 pub struct Empty(()); 771 771 impl sealed::Sealed for Empty {} 772 772 impl State for Empty { 773 773 type Action = Unset; 774 - type Subjects = Unset; 775 774 type CreatedBy = Unset; 776 775 type Scheduling = Unset; 776 + type Subjects = Unset; 777 777 } 778 778 ///State transition - sets the `action` field to Set 779 779 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 780 780 impl<S: State> sealed::Sealed for SetAction<S> {} 781 781 impl<S: State> State for SetAction<S> { 782 782 type Action = Set<members::action>; 783 - type Subjects = S::Subjects; 784 783 type CreatedBy = S::CreatedBy; 785 784 type Scheduling = S::Scheduling; 786 - } 787 - ///State transition - sets the `subjects` field to Set 788 - pub struct SetSubjects<S: State = Empty>(PhantomData<fn() -> S>); 789 - impl<S: State> sealed::Sealed for SetSubjects<S> {} 790 - impl<S: State> State for SetSubjects<S> { 791 - type Action = S::Action; 792 - type Subjects = Set<members::subjects>; 793 - type CreatedBy = S::CreatedBy; 794 - type Scheduling = S::Scheduling; 785 + type Subjects = S::Subjects; 795 786 } 796 787 ///State transition - sets the `created_by` field to Set 797 788 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 798 789 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 799 790 impl<S: State> State for SetCreatedBy<S> { 800 791 type Action = S::Action; 801 - type Subjects = S::Subjects; 802 792 type CreatedBy = Set<members::created_by>; 803 793 type Scheduling = S::Scheduling; 794 + type Subjects = S::Subjects; 804 795 } 805 796 ///State transition - sets the `scheduling` field to Set 806 797 pub struct SetScheduling<S: State = Empty>(PhantomData<fn() -> S>); 807 798 impl<S: State> sealed::Sealed for SetScheduling<S> {} 808 799 impl<S: State> State for SetScheduling<S> { 809 800 type Action = S::Action; 810 - type Subjects = S::Subjects; 811 801 type CreatedBy = S::CreatedBy; 812 802 type Scheduling = Set<members::scheduling>; 803 + type Subjects = S::Subjects; 804 + } 805 + ///State transition - sets the `subjects` field to Set 806 + pub struct SetSubjects<S: State = Empty>(PhantomData<fn() -> S>); 807 + impl<S: State> sealed::Sealed for SetSubjects<S> {} 808 + impl<S: State> State for SetSubjects<S> { 809 + type Action = S::Action; 810 + type CreatedBy = S::CreatedBy; 811 + type Scheduling = S::Scheduling; 812 + type Subjects = Set<members::subjects>; 813 813 } 814 814 /// Marker types for field names 815 815 #[allow(non_camel_case_types)] 816 816 pub mod members { 817 817 ///Marker type for the `action` field 818 818 pub struct action(()); 819 - ///Marker type for the `subjects` field 820 - pub struct subjects(()); 821 819 ///Marker type for the `created_by` field 822 820 pub struct created_by(()); 823 821 ///Marker type for the `scheduling` field 824 822 pub struct scheduling(()); 823 + ///Marker type for the `subjects` field 824 + pub struct subjects(()); 825 825 } 826 826 } 827 827 ··· 961 961 where 962 962 S: schedule_action_state::State, 963 963 S::Action: schedule_action_state::IsSet, 964 - S::Subjects: schedule_action_state::IsSet, 965 964 S::CreatedBy: schedule_action_state::IsSet, 966 965 S::Scheduling: schedule_action_state::IsSet, 966 + S::Subjects: schedule_action_state::IsSet, 967 967 { 968 968 /// Build the final struct 969 969 pub fn build(self) -> ScheduleAction<'a> {
+122 -122
crates/weaver-api/src/tools_ozone/safelink.rs
··· 138 138 } 139 139 /// State trait tracking which required fields have been set 140 140 pub trait State: sealed::Sealed { 141 - type Id; 142 141 type EventType; 142 + type Id; 143 143 type Url; 144 - type Pattern; 145 - type Action; 146 144 type Reason; 145 + type Pattern; 147 146 type CreatedBy; 148 147 type CreatedAt; 148 + type Action; 149 149 } 150 150 /// Empty state - all required fields are unset 151 151 pub struct Empty(()); 152 152 impl sealed::Sealed for Empty {} 153 153 impl State for Empty { 154 - type Id = Unset; 155 154 type EventType = Unset; 155 + type Id = Unset; 156 156 type Url = Unset; 157 - type Pattern = Unset; 158 - type Action = Unset; 159 157 type Reason = Unset; 158 + type Pattern = Unset; 160 159 type CreatedBy = Unset; 161 160 type CreatedAt = Unset; 162 - } 163 - ///State transition - sets the `id` field to Set 164 - pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 165 - impl<S: State> sealed::Sealed for SetId<S> {} 166 - impl<S: State> State for SetId<S> { 167 - type Id = Set<members::id>; 168 - type EventType = S::EventType; 169 - type Url = S::Url; 170 - type Pattern = S::Pattern; 171 - type Action = S::Action; 172 - type Reason = S::Reason; 173 - type CreatedBy = S::CreatedBy; 174 - type CreatedAt = S::CreatedAt; 161 + type Action = Unset; 175 162 } 176 163 ///State transition - sets the `event_type` field to Set 177 164 pub struct SetEventType<S: State = Empty>(PhantomData<fn() -> S>); 178 165 impl<S: State> sealed::Sealed for SetEventType<S> {} 179 166 impl<S: State> State for SetEventType<S> { 180 - type Id = S::Id; 181 167 type EventType = Set<members::event_type>; 168 + type Id = S::Id; 182 169 type Url = S::Url; 170 + type Reason = S::Reason; 183 171 type Pattern = S::Pattern; 172 + type CreatedBy = S::CreatedBy; 173 + type CreatedAt = S::CreatedAt; 184 174 type Action = S::Action; 175 + } 176 + ///State transition - sets the `id` field to Set 177 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 178 + impl<S: State> sealed::Sealed for SetId<S> {} 179 + impl<S: State> State for SetId<S> { 180 + type EventType = S::EventType; 181 + type Id = Set<members::id>; 182 + type Url = S::Url; 185 183 type Reason = S::Reason; 184 + type Pattern = S::Pattern; 186 185 type CreatedBy = S::CreatedBy; 187 186 type CreatedAt = S::CreatedAt; 187 + type Action = S::Action; 188 188 } 189 189 ///State transition - sets the `url` field to Set 190 190 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 191 191 impl<S: State> sealed::Sealed for SetUrl<S> {} 192 192 impl<S: State> State for SetUrl<S> { 193 - type Id = S::Id; 194 193 type EventType = S::EventType; 194 + type Id = S::Id; 195 195 type Url = Set<members::url>; 196 + type Reason = S::Reason; 196 197 type Pattern = S::Pattern; 198 + type CreatedBy = S::CreatedBy; 199 + type CreatedAt = S::CreatedAt; 197 200 type Action = S::Action; 198 - type Reason = S::Reason; 201 + } 202 + ///State transition - sets the `reason` field to Set 203 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 204 + impl<S: State> sealed::Sealed for SetReason<S> {} 205 + impl<S: State> State for SetReason<S> { 206 + type EventType = S::EventType; 207 + type Id = S::Id; 208 + type Url = S::Url; 209 + type Reason = Set<members::reason>; 210 + type Pattern = S::Pattern; 199 211 type CreatedBy = S::CreatedBy; 200 212 type CreatedAt = S::CreatedAt; 213 + type Action = S::Action; 201 214 } 202 215 ///State transition - sets the `pattern` field to Set 203 216 pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 204 217 impl<S: State> sealed::Sealed for SetPattern<S> {} 205 218 impl<S: State> State for SetPattern<S> { 206 - type Id = S::Id; 207 219 type EventType = S::EventType; 208 - type Url = S::Url; 209 - type Pattern = Set<members::pattern>; 210 - type Action = S::Action; 211 - type Reason = S::Reason; 212 - type CreatedBy = S::CreatedBy; 213 - type CreatedAt = S::CreatedAt; 214 - } 215 - ///State transition - sets the `action` field to Set 216 - pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 217 - impl<S: State> sealed::Sealed for SetAction<S> {} 218 - impl<S: State> State for SetAction<S> { 219 220 type Id = S::Id; 220 - type EventType = S::EventType; 221 221 type Url = S::Url; 222 - type Pattern = S::Pattern; 223 - type Action = Set<members::action>; 224 222 type Reason = S::Reason; 223 + type Pattern = Set<members::pattern>; 225 224 type CreatedBy = S::CreatedBy; 226 225 type CreatedAt = S::CreatedAt; 227 - } 228 - ///State transition - sets the `reason` field to Set 229 - pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 230 - impl<S: State> sealed::Sealed for SetReason<S> {} 231 - impl<S: State> State for SetReason<S> { 232 - type Id = S::Id; 233 - type EventType = S::EventType; 234 - type Url = S::Url; 235 - type Pattern = S::Pattern; 236 226 type Action = S::Action; 237 - type Reason = Set<members::reason>; 238 - type CreatedBy = S::CreatedBy; 239 - type CreatedAt = S::CreatedAt; 240 227 } 241 228 ///State transition - sets the `created_by` field to Set 242 229 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 243 230 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 244 231 impl<S: State> State for SetCreatedBy<S> { 245 - type Id = S::Id; 246 232 type EventType = S::EventType; 233 + type Id = S::Id; 247 234 type Url = S::Url; 235 + type Reason = S::Reason; 248 236 type Pattern = S::Pattern; 249 - type Action = S::Action; 250 - type Reason = S::Reason; 251 237 type CreatedBy = Set<members::created_by>; 252 238 type CreatedAt = S::CreatedAt; 239 + type Action = S::Action; 253 240 } 254 241 ///State transition - sets the `created_at` field to Set 255 242 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 256 243 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 257 244 impl<S: State> State for SetCreatedAt<S> { 258 - type Id = S::Id; 259 245 type EventType = S::EventType; 246 + type Id = S::Id; 260 247 type Url = S::Url; 248 + type Reason = S::Reason; 261 249 type Pattern = S::Pattern; 250 + type CreatedBy = S::CreatedBy; 251 + type CreatedAt = Set<members::created_at>; 262 252 type Action = S::Action; 253 + } 254 + ///State transition - sets the `action` field to Set 255 + pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 256 + impl<S: State> sealed::Sealed for SetAction<S> {} 257 + impl<S: State> State for SetAction<S> { 258 + type EventType = S::EventType; 259 + type Id = S::Id; 260 + type Url = S::Url; 263 261 type Reason = S::Reason; 262 + type Pattern = S::Pattern; 264 263 type CreatedBy = S::CreatedBy; 265 - type CreatedAt = Set<members::created_at>; 264 + type CreatedAt = S::CreatedAt; 265 + type Action = Set<members::action>; 266 266 } 267 267 /// Marker types for field names 268 268 #[allow(non_camel_case_types)] 269 269 pub mod members { 270 - ///Marker type for the `id` field 271 - pub struct id(()); 272 270 ///Marker type for the `event_type` field 273 271 pub struct event_type(()); 272 + ///Marker type for the `id` field 273 + pub struct id(()); 274 274 ///Marker type for the `url` field 275 275 pub struct url(()); 276 + ///Marker type for the `reason` field 277 + pub struct reason(()); 276 278 ///Marker type for the `pattern` field 277 279 pub struct pattern(()); 278 - ///Marker type for the `action` field 279 - pub struct action(()); 280 - ///Marker type for the `reason` field 281 - pub struct reason(()); 282 280 ///Marker type for the `created_by` field 283 281 pub struct created_by(()); 284 282 ///Marker type for the `created_at` field 285 283 pub struct created_at(()); 284 + ///Marker type for the `action` field 285 + pub struct action(()); 286 286 } 287 287 } 288 288 ··· 502 502 impl<'a, S> EventBuilder<'a, S> 503 503 where 504 504 S: event_state::State, 505 - S::Id: event_state::IsSet, 506 505 S::EventType: event_state::IsSet, 506 + S::Id: event_state::IsSet, 507 507 S::Url: event_state::IsSet, 508 - S::Pattern: event_state::IsSet, 509 - S::Action: event_state::IsSet, 510 508 S::Reason: event_state::IsSet, 509 + S::Pattern: event_state::IsSet, 511 510 S::CreatedBy: event_state::IsSet, 512 511 S::CreatedAt: event_state::IsSet, 512 + S::Action: event_state::IsSet, 513 513 { 514 514 /// Build the final struct 515 515 pub fn build(self) -> Event<'a> { ··· 1233 1233 } 1234 1234 /// State trait tracking which required fields have been set 1235 1235 pub trait State: sealed::Sealed { 1236 - type Url; 1237 - type Pattern; 1238 - type Action; 1239 1236 type Reason; 1237 + type Url; 1240 1238 type CreatedBy; 1241 1239 type CreatedAt; 1240 + type Action; 1242 1241 type UpdatedAt; 1242 + type Pattern; 1243 1243 } 1244 1244 /// Empty state - all required fields are unset 1245 1245 pub struct Empty(()); 1246 1246 impl sealed::Sealed for Empty {} 1247 1247 impl State for Empty { 1248 - type Url = Unset; 1249 - type Pattern = Unset; 1250 - type Action = Unset; 1251 1248 type Reason = Unset; 1249 + type Url = Unset; 1252 1250 type CreatedBy = Unset; 1253 1251 type CreatedAt = Unset; 1252 + type Action = Unset; 1254 1253 type UpdatedAt = Unset; 1255 - } 1256 - ///State transition - sets the `url` field to Set 1257 - pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 1258 - impl<S: State> sealed::Sealed for SetUrl<S> {} 1259 - impl<S: State> State for SetUrl<S> { 1260 - type Url = Set<members::url>; 1261 - type Pattern = S::Pattern; 1262 - type Action = S::Action; 1263 - type Reason = S::Reason; 1264 - type CreatedBy = S::CreatedBy; 1265 - type CreatedAt = S::CreatedAt; 1266 - type UpdatedAt = S::UpdatedAt; 1254 + type Pattern = Unset; 1267 1255 } 1268 - ///State transition - sets the `pattern` field to Set 1269 - pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 1270 - impl<S: State> sealed::Sealed for SetPattern<S> {} 1271 - impl<S: State> State for SetPattern<S> { 1256 + ///State transition - sets the `reason` field to Set 1257 + pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 1258 + impl<S: State> sealed::Sealed for SetReason<S> {} 1259 + impl<S: State> State for SetReason<S> { 1260 + type Reason = Set<members::reason>; 1272 1261 type Url = S::Url; 1273 - type Pattern = Set<members::pattern>; 1274 - type Action = S::Action; 1275 - type Reason = S::Reason; 1276 1262 type CreatedBy = S::CreatedBy; 1277 1263 type CreatedAt = S::CreatedAt; 1264 + type Action = S::Action; 1278 1265 type UpdatedAt = S::UpdatedAt; 1279 - } 1280 - ///State transition - sets the `action` field to Set 1281 - pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 1282 - impl<S: State> sealed::Sealed for SetAction<S> {} 1283 - impl<S: State> State for SetAction<S> { 1284 - type Url = S::Url; 1285 1266 type Pattern = S::Pattern; 1286 - type Action = Set<members::action>; 1267 + } 1268 + ///State transition - sets the `url` field to Set 1269 + pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 1270 + impl<S: State> sealed::Sealed for SetUrl<S> {} 1271 + impl<S: State> State for SetUrl<S> { 1287 1272 type Reason = S::Reason; 1273 + type Url = Set<members::url>; 1288 1274 type CreatedBy = S::CreatedBy; 1289 1275 type CreatedAt = S::CreatedAt; 1290 - type UpdatedAt = S::UpdatedAt; 1291 - } 1292 - ///State transition - sets the `reason` field to Set 1293 - pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 1294 - impl<S: State> sealed::Sealed for SetReason<S> {} 1295 - impl<S: State> State for SetReason<S> { 1296 - type Url = S::Url; 1297 - type Pattern = S::Pattern; 1298 1276 type Action = S::Action; 1299 - type Reason = Set<members::reason>; 1300 - type CreatedBy = S::CreatedBy; 1301 - type CreatedAt = S::CreatedAt; 1302 1277 type UpdatedAt = S::UpdatedAt; 1278 + type Pattern = S::Pattern; 1303 1279 } 1304 1280 ///State transition - sets the `created_by` field to Set 1305 1281 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 1306 1282 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 1307 1283 impl<S: State> State for SetCreatedBy<S> { 1308 - type Url = S::Url; 1309 - type Pattern = S::Pattern; 1310 - type Action = S::Action; 1311 1284 type Reason = S::Reason; 1285 + type Url = S::Url; 1312 1286 type CreatedBy = Set<members::created_by>; 1313 1287 type CreatedAt = S::CreatedAt; 1288 + type Action = S::Action; 1314 1289 type UpdatedAt = S::UpdatedAt; 1290 + type Pattern = S::Pattern; 1315 1291 } 1316 1292 ///State transition - sets the `created_at` field to Set 1317 1293 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1318 1294 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1319 1295 impl<S: State> State for SetCreatedAt<S> { 1296 + type Reason = S::Reason; 1320 1297 type Url = S::Url; 1321 - type Pattern = S::Pattern; 1298 + type CreatedBy = S::CreatedBy; 1299 + type CreatedAt = Set<members::created_at>; 1322 1300 type Action = S::Action; 1301 + type UpdatedAt = S::UpdatedAt; 1302 + type Pattern = S::Pattern; 1303 + } 1304 + ///State transition - sets the `action` field to Set 1305 + pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 1306 + impl<S: State> sealed::Sealed for SetAction<S> {} 1307 + impl<S: State> State for SetAction<S> { 1323 1308 type Reason = S::Reason; 1309 + type Url = S::Url; 1324 1310 type CreatedBy = S::CreatedBy; 1325 - type CreatedAt = Set<members::created_at>; 1311 + type CreatedAt = S::CreatedAt; 1312 + type Action = Set<members::action>; 1326 1313 type UpdatedAt = S::UpdatedAt; 1314 + type Pattern = S::Pattern; 1327 1315 } 1328 1316 ///State transition - sets the `updated_at` field to Set 1329 1317 pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1330 1318 impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 1331 1319 impl<S: State> State for SetUpdatedAt<S> { 1320 + type Reason = S::Reason; 1332 1321 type Url = S::Url; 1322 + type CreatedBy = S::CreatedBy; 1323 + type CreatedAt = S::CreatedAt; 1324 + type Action = S::Action; 1325 + type UpdatedAt = Set<members::updated_at>; 1333 1326 type Pattern = S::Pattern; 1334 - type Action = S::Action; 1327 + } 1328 + ///State transition - sets the `pattern` field to Set 1329 + pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 1330 + impl<S: State> sealed::Sealed for SetPattern<S> {} 1331 + impl<S: State> State for SetPattern<S> { 1335 1332 type Reason = S::Reason; 1333 + type Url = S::Url; 1336 1334 type CreatedBy = S::CreatedBy; 1337 1335 type CreatedAt = S::CreatedAt; 1338 - type UpdatedAt = Set<members::updated_at>; 1336 + type Action = S::Action; 1337 + type UpdatedAt = S::UpdatedAt; 1338 + type Pattern = Set<members::pattern>; 1339 1339 } 1340 1340 /// Marker types for field names 1341 1341 #[allow(non_camel_case_types)] 1342 1342 pub mod members { 1343 - ///Marker type for the `url` field 1344 - pub struct url(()); 1345 - ///Marker type for the `pattern` field 1346 - pub struct pattern(()); 1347 - ///Marker type for the `action` field 1348 - pub struct action(()); 1349 1343 ///Marker type for the `reason` field 1350 1344 pub struct reason(()); 1345 + ///Marker type for the `url` field 1346 + pub struct url(()); 1351 1347 ///Marker type for the `created_by` field 1352 1348 pub struct created_by(()); 1353 1349 ///Marker type for the `created_at` field 1354 1350 pub struct created_at(()); 1351 + ///Marker type for the `action` field 1352 + pub struct action(()); 1355 1353 ///Marker type for the `updated_at` field 1356 1354 pub struct updated_at(()); 1355 + ///Marker type for the `pattern` field 1356 + pub struct pattern(()); 1357 1357 } 1358 1358 } 1359 1359 ··· 1543 1543 impl<'a, S> UrlRuleBuilder<'a, S> 1544 1544 where 1545 1545 S: url_rule_state::State, 1546 - S::Url: url_rule_state::IsSet, 1547 - S::Pattern: url_rule_state::IsSet, 1548 - S::Action: url_rule_state::IsSet, 1549 1546 S::Reason: url_rule_state::IsSet, 1547 + S::Url: url_rule_state::IsSet, 1550 1548 S::CreatedBy: url_rule_state::IsSet, 1551 1549 S::CreatedAt: url_rule_state::IsSet, 1550 + S::Action: url_rule_state::IsSet, 1552 1551 S::UpdatedAt: url_rule_state::IsSet, 1552 + S::Pattern: url_rule_state::IsSet, 1553 1553 { 1554 1554 /// Build the final struct 1555 1555 pub fn build(self) -> UrlRule<'a> {
+17 -17
crates/weaver-api/src/tools_ozone/safelink/add_rule.rs
··· 48 48 pub trait State: sealed::Sealed { 49 49 type Url; 50 50 type Pattern; 51 - type Action; 52 51 type Reason; 52 + type Action; 53 53 } 54 54 /// Empty state - all required fields are unset 55 55 pub struct Empty(()); ··· 57 57 impl State for Empty { 58 58 type Url = Unset; 59 59 type Pattern = Unset; 60 - type Action = Unset; 61 60 type Reason = Unset; 61 + type Action = Unset; 62 62 } 63 63 ///State transition - sets the `url` field to Set 64 64 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); ··· 66 66 impl<S: State> State for SetUrl<S> { 67 67 type Url = Set<members::url>; 68 68 type Pattern = S::Pattern; 69 - type Action = S::Action; 70 69 type Reason = S::Reason; 70 + type Action = S::Action; 71 71 } 72 72 ///State transition - sets the `pattern` field to Set 73 73 pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); ··· 75 75 impl<S: State> State for SetPattern<S> { 76 76 type Url = S::Url; 77 77 type Pattern = Set<members::pattern>; 78 - type Action = S::Action; 79 - type Reason = S::Reason; 80 - } 81 - ///State transition - sets the `action` field to Set 82 - pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 83 - impl<S: State> sealed::Sealed for SetAction<S> {} 84 - impl<S: State> State for SetAction<S> { 85 - type Url = S::Url; 86 - type Pattern = S::Pattern; 87 - type Action = Set<members::action>; 88 78 type Reason = S::Reason; 79 + type Action = S::Action; 89 80 } 90 81 ///State transition - sets the `reason` field to Set 91 82 pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); ··· 93 84 impl<S: State> State for SetReason<S> { 94 85 type Url = S::Url; 95 86 type Pattern = S::Pattern; 96 - type Action = S::Action; 97 87 type Reason = Set<members::reason>; 88 + type Action = S::Action; 89 + } 90 + ///State transition - sets the `action` field to Set 91 + pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 92 + impl<S: State> sealed::Sealed for SetAction<S> {} 93 + impl<S: State> State for SetAction<S> { 94 + type Url = S::Url; 95 + type Pattern = S::Pattern; 96 + type Reason = S::Reason; 97 + type Action = Set<members::action>; 98 98 } 99 99 /// Marker types for field names 100 100 #[allow(non_camel_case_types)] ··· 103 103 pub struct url(()); 104 104 ///Marker type for the `pattern` field 105 105 pub struct pattern(()); 106 + ///Marker type for the `reason` field 107 + pub struct reason(()); 106 108 ///Marker type for the `action` field 107 109 pub struct action(()); 108 - ///Marker type for the `reason` field 109 - pub struct reason(()); 110 110 } 111 111 } 112 112 ··· 258 258 S: add_rule_state::State, 259 259 S::Url: add_rule_state::IsSet, 260 260 S::Pattern: add_rule_state::IsSet, 261 - S::Action: add_rule_state::IsSet, 262 261 S::Reason: add_rule_state::IsSet, 262 + S::Action: add_rule_state::IsSet, 263 263 { 264 264 /// Build the final struct 265 265 pub fn build(self) -> AddRule<'a> {
+13 -13
crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs
··· 42 42 } 43 43 /// State trait tracking which required fields have been set 44 44 pub trait State: sealed::Sealed { 45 - type Url; 46 45 type Pattern; 46 + type Url; 47 47 } 48 48 /// Empty state - all required fields are unset 49 49 pub struct Empty(()); 50 50 impl sealed::Sealed for Empty {} 51 51 impl State for Empty { 52 - type Url = Unset; 53 52 type Pattern = Unset; 54 - } 55 - ///State transition - sets the `url` field to Set 56 - pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 57 - impl<S: State> sealed::Sealed for SetUrl<S> {} 58 - impl<S: State> State for SetUrl<S> { 59 - type Url = Set<members::url>; 60 - type Pattern = S::Pattern; 53 + type Url = Unset; 61 54 } 62 55 ///State transition - sets the `pattern` field to Set 63 56 pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); 64 57 impl<S: State> sealed::Sealed for SetPattern<S> {} 65 58 impl<S: State> State for SetPattern<S> { 66 - type Url = S::Url; 67 59 type Pattern = Set<members::pattern>; 60 + type Url = S::Url; 61 + } 62 + ///State transition - sets the `url` field to Set 63 + pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetUrl<S> {} 65 + impl<S: State> State for SetUrl<S> { 66 + type Pattern = S::Pattern; 67 + type Url = Set<members::url>; 68 68 } 69 69 /// Marker types for field names 70 70 #[allow(non_camel_case_types)] 71 71 pub mod members { 72 - ///Marker type for the `url` field 73 - pub struct url(()); 74 72 ///Marker type for the `pattern` field 75 73 pub struct pattern(()); 74 + ///Marker type for the `url` field 75 + pub struct url(()); 76 76 } 77 77 } 78 78 ··· 182 182 impl<'a, S> RemoveRuleBuilder<'a, S> 183 183 where 184 184 S: remove_rule_state::State, 185 - S::Url: remove_rule_state::IsSet, 186 185 S::Pattern: remove_rule_state::IsSet, 186 + S::Url: remove_rule_state::IsSet, 187 187 { 188 188 /// Build the final struct 189 189 pub fn build(self) -> RemoveRule<'a> {
+17 -17
crates/weaver-api/src/tools_ozone/safelink/update_rule.rs
··· 48 48 pub trait State: sealed::Sealed { 49 49 type Url; 50 50 type Pattern; 51 - type Action; 52 51 type Reason; 52 + type Action; 53 53 } 54 54 /// Empty state - all required fields are unset 55 55 pub struct Empty(()); ··· 57 57 impl State for Empty { 58 58 type Url = Unset; 59 59 type Pattern = Unset; 60 - type Action = Unset; 61 60 type Reason = Unset; 61 + type Action = Unset; 62 62 } 63 63 ///State transition - sets the `url` field to Set 64 64 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); ··· 66 66 impl<S: State> State for SetUrl<S> { 67 67 type Url = Set<members::url>; 68 68 type Pattern = S::Pattern; 69 - type Action = S::Action; 70 69 type Reason = S::Reason; 70 + type Action = S::Action; 71 71 } 72 72 ///State transition - sets the `pattern` field to Set 73 73 pub struct SetPattern<S: State = Empty>(PhantomData<fn() -> S>); ··· 75 75 impl<S: State> State for SetPattern<S> { 76 76 type Url = S::Url; 77 77 type Pattern = Set<members::pattern>; 78 - type Action = S::Action; 79 - type Reason = S::Reason; 80 - } 81 - ///State transition - sets the `action` field to Set 82 - pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 83 - impl<S: State> sealed::Sealed for SetAction<S> {} 84 - impl<S: State> State for SetAction<S> { 85 - type Url = S::Url; 86 - type Pattern = S::Pattern; 87 - type Action = Set<members::action>; 88 78 type Reason = S::Reason; 79 + type Action = S::Action; 89 80 } 90 81 ///State transition - sets the `reason` field to Set 91 82 pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); ··· 93 84 impl<S: State> State for SetReason<S> { 94 85 type Url = S::Url; 95 86 type Pattern = S::Pattern; 96 - type Action = S::Action; 97 87 type Reason = Set<members::reason>; 88 + type Action = S::Action; 89 + } 90 + ///State transition - sets the `action` field to Set 91 + pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>); 92 + impl<S: State> sealed::Sealed for SetAction<S> {} 93 + impl<S: State> State for SetAction<S> { 94 + type Url = S::Url; 95 + type Pattern = S::Pattern; 96 + type Reason = S::Reason; 97 + type Action = Set<members::action>; 98 98 } 99 99 /// Marker types for field names 100 100 #[allow(non_camel_case_types)] ··· 103 103 pub struct url(()); 104 104 ///Marker type for the `pattern` field 105 105 pub struct pattern(()); 106 + ///Marker type for the `reason` field 107 + pub struct reason(()); 106 108 ///Marker type for the `action` field 107 109 pub struct action(()); 108 - ///Marker type for the `reason` field 109 - pub struct reason(()); 110 110 } 111 111 } 112 112 ··· 258 258 S: update_rule_state::State, 259 259 S::Url: update_rule_state::IsSet, 260 260 S::Pattern: update_rule_state::IsSet, 261 - S::Action: update_rule_state::IsSet, 262 261 S::Reason: update_rule_state::IsSet, 262 + S::Action: update_rule_state::IsSet, 263 263 { 264 264 /// Build the final struct 265 265 pub fn build(self) -> UpdateRule<'a> {
+30 -30
crates/weaver-api/src/tools_ozone/set.rs
··· 300 300 } 301 301 /// State trait tracking which required fields have been set 302 302 pub trait State: sealed::Sealed { 303 - type Name; 304 303 type SetSize; 305 - type CreatedAt; 306 304 type UpdatedAt; 305 + type Name; 306 + type CreatedAt; 307 307 } 308 308 /// Empty state - all required fields are unset 309 309 pub struct Empty(()); 310 310 impl sealed::Sealed for Empty {} 311 311 impl State for Empty { 312 - type Name = Unset; 313 312 type SetSize = Unset; 314 - type CreatedAt = Unset; 315 313 type UpdatedAt = Unset; 316 - } 317 - ///State transition - sets the `name` field to Set 318 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 319 - impl<S: State> sealed::Sealed for SetName<S> {} 320 - impl<S: State> State for SetName<S> { 321 - type Name = Set<members::name>; 322 - type SetSize = S::SetSize; 323 - type CreatedAt = S::CreatedAt; 324 - type UpdatedAt = S::UpdatedAt; 314 + type Name = Unset; 315 + type CreatedAt = Unset; 325 316 } 326 317 ///State transition - sets the `set_size` field to Set 327 318 pub struct SetSetSize<S: State = Empty>(PhantomData<fn() -> S>); 328 319 impl<S: State> sealed::Sealed for SetSetSize<S> {} 329 320 impl<S: State> State for SetSetSize<S> { 330 - type Name = S::Name; 331 321 type SetSize = Set<members::set_size>; 332 - type CreatedAt = S::CreatedAt; 333 322 type UpdatedAt = S::UpdatedAt; 334 - } 335 - ///State transition - sets the `created_at` field to Set 336 - pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 337 - impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 338 - impl<S: State> State for SetCreatedAt<S> { 339 323 type Name = S::Name; 340 - type SetSize = S::SetSize; 341 - type CreatedAt = Set<members::created_at>; 342 - type UpdatedAt = S::UpdatedAt; 324 + type CreatedAt = S::CreatedAt; 343 325 } 344 326 ///State transition - sets the `updated_at` field to Set 345 327 pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 346 328 impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 347 329 impl<S: State> State for SetUpdatedAt<S> { 330 + type SetSize = S::SetSize; 331 + type UpdatedAt = Set<members::updated_at>; 348 332 type Name = S::Name; 333 + type CreatedAt = S::CreatedAt; 334 + } 335 + ///State transition - sets the `name` field to Set 336 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 337 + impl<S: State> sealed::Sealed for SetName<S> {} 338 + impl<S: State> State for SetName<S> { 349 339 type SetSize = S::SetSize; 340 + type UpdatedAt = S::UpdatedAt; 341 + type Name = Set<members::name>; 350 342 type CreatedAt = S::CreatedAt; 351 - type UpdatedAt = Set<members::updated_at>; 343 + } 344 + ///State transition - sets the `created_at` field to Set 345 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 346 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 347 + impl<S: State> State for SetCreatedAt<S> { 348 + type SetSize = S::SetSize; 349 + type UpdatedAt = S::UpdatedAt; 350 + type Name = S::Name; 351 + type CreatedAt = Set<members::created_at>; 352 352 } 353 353 /// Marker types for field names 354 354 #[allow(non_camel_case_types)] 355 355 pub mod members { 356 - ///Marker type for the `name` field 357 - pub struct name(()); 358 356 ///Marker type for the `set_size` field 359 357 pub struct set_size(()); 358 + ///Marker type for the `updated_at` field 359 + pub struct updated_at(()); 360 + ///Marker type for the `name` field 361 + pub struct name(()); 360 362 ///Marker type for the `created_at` field 361 363 pub struct created_at(()); 362 - ///Marker type for the `updated_at` field 363 - pub struct updated_at(()); 364 364 } 365 365 } 366 366 ··· 493 493 impl<'a, S> SetViewBuilder<'a, S> 494 494 where 495 495 S: set_view_state::State, 496 - S::Name: set_view_state::IsSet, 497 496 S::SetSize: set_view_state::IsSet, 498 - S::CreatedAt: set_view_state::IsSet, 499 497 S::UpdatedAt: set_view_state::IsSet, 498 + S::Name: set_view_state::IsSet, 499 + S::CreatedAt: set_view_state::IsSet, 500 500 { 501 501 /// Build the final struct 502 502 pub fn build(self) -> SetView<'a> {
+13 -13
crates/weaver-api/src/tools_ozone/set/add_values.rs
··· 35 35 } 36 36 /// State trait tracking which required fields have been set 37 37 pub trait State: sealed::Sealed { 38 - type Name; 39 38 type Values; 39 + type Name; 40 40 } 41 41 /// Empty state - all required fields are unset 42 42 pub struct Empty(()); 43 43 impl sealed::Sealed for Empty {} 44 44 impl State for Empty { 45 - type Name = Unset; 46 45 type Values = Unset; 47 - } 48 - ///State transition - sets the `name` field to Set 49 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 50 - impl<S: State> sealed::Sealed for SetName<S> {} 51 - impl<S: State> State for SetName<S> { 52 - type Name = Set<members::name>; 53 - type Values = S::Values; 46 + type Name = Unset; 54 47 } 55 48 ///State transition - sets the `values` field to Set 56 49 pub struct SetValues<S: State = Empty>(PhantomData<fn() -> S>); 57 50 impl<S: State> sealed::Sealed for SetValues<S> {} 58 51 impl<S: State> State for SetValues<S> { 59 - type Name = S::Name; 60 52 type Values = Set<members::values>; 53 + type Name = S::Name; 54 + } 55 + ///State transition - sets the `name` field to Set 56 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetName<S> {} 58 + impl<S: State> State for SetName<S> { 59 + type Values = S::Values; 60 + type Name = Set<members::name>; 61 61 } 62 62 /// Marker types for field names 63 63 #[allow(non_camel_case_types)] 64 64 pub mod members { 65 - ///Marker type for the `name` field 66 - pub struct name(()); 67 65 ///Marker type for the `values` field 68 66 pub struct values(()); 67 + ///Marker type for the `name` field 68 + pub struct name(()); 69 69 } 70 70 } 71 71 ··· 138 138 impl<'a, S> AddValuesBuilder<'a, S> 139 139 where 140 140 S: add_values_state::State, 141 - S::Name: add_values_state::IsSet, 142 141 S::Values: add_values_state::IsSet, 142 + S::Name: add_values_state::IsSet, 143 143 { 144 144 /// Build the final struct 145 145 pub fn build(self) -> AddValues<'a> {
+34 -34
crates/weaver-api/src/tools_ozone/setting.rs
··· 55 55 } 56 56 /// State trait tracking which required fields have been set 57 57 pub trait State: sealed::Sealed { 58 - type Key; 58 + type Did; 59 59 type Value; 60 - type Did; 61 60 type Scope; 62 61 type CreatedBy; 63 62 type LastUpdatedBy; 63 + type Key; 64 64 } 65 65 /// Empty state - all required fields are unset 66 66 pub struct Empty(()); 67 67 impl sealed::Sealed for Empty {} 68 68 impl State for Empty { 69 - type Key = Unset; 69 + type Did = Unset; 70 70 type Value = Unset; 71 - type Did = Unset; 72 71 type Scope = Unset; 73 72 type CreatedBy = Unset; 74 73 type LastUpdatedBy = Unset; 74 + type Key = Unset; 75 75 } 76 - ///State transition - sets the `key` field to Set 77 - pub struct SetKey<S: State = Empty>(PhantomData<fn() -> S>); 78 - impl<S: State> sealed::Sealed for SetKey<S> {} 79 - impl<S: State> State for SetKey<S> { 80 - type Key = Set<members::key>; 76 + ///State transition - sets the `did` field to Set 77 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 78 + impl<S: State> sealed::Sealed for SetDid<S> {} 79 + impl<S: State> State for SetDid<S> { 80 + type Did = Set<members::did>; 81 81 type Value = S::Value; 82 - type Did = S::Did; 83 82 type Scope = S::Scope; 84 83 type CreatedBy = S::CreatedBy; 85 84 type LastUpdatedBy = S::LastUpdatedBy; 85 + type Key = S::Key; 86 86 } 87 87 ///State transition - sets the `value` field to Set 88 88 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 89 89 impl<S: State> sealed::Sealed for SetValue<S> {} 90 90 impl<S: State> State for SetValue<S> { 91 - type Key = S::Key; 92 - type Value = Set<members::value>; 93 91 type Did = S::Did; 92 + type Value = Set<members::value>; 94 93 type Scope = S::Scope; 95 94 type CreatedBy = S::CreatedBy; 96 95 type LastUpdatedBy = S::LastUpdatedBy; 97 - } 98 - ///State transition - sets the `did` field to Set 99 - pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 100 - impl<S: State> sealed::Sealed for SetDid<S> {} 101 - impl<S: State> State for SetDid<S> { 102 96 type Key = S::Key; 103 - type Value = S::Value; 104 - type Did = Set<members::did>; 105 - type Scope = S::Scope; 106 - type CreatedBy = S::CreatedBy; 107 - type LastUpdatedBy = S::LastUpdatedBy; 108 97 } 109 98 ///State transition - sets the `scope` field to Set 110 99 pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 111 100 impl<S: State> sealed::Sealed for SetScope<S> {} 112 101 impl<S: State> State for SetScope<S> { 113 - type Key = S::Key; 102 + type Did = S::Did; 114 103 type Value = S::Value; 115 - type Did = S::Did; 116 104 type Scope = Set<members::scope>; 117 105 type CreatedBy = S::CreatedBy; 118 106 type LastUpdatedBy = S::LastUpdatedBy; 107 + type Key = S::Key; 119 108 } 120 109 ///State transition - sets the `created_by` field to Set 121 110 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 122 111 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 123 112 impl<S: State> State for SetCreatedBy<S> { 124 - type Key = S::Key; 113 + type Did = S::Did; 125 114 type Value = S::Value; 126 - type Did = S::Did; 127 115 type Scope = S::Scope; 128 116 type CreatedBy = Set<members::created_by>; 129 117 type LastUpdatedBy = S::LastUpdatedBy; 118 + type Key = S::Key; 130 119 } 131 120 ///State transition - sets the `last_updated_by` field to Set 132 121 pub struct SetLastUpdatedBy<S: State = Empty>(PhantomData<fn() -> S>); 133 122 impl<S: State> sealed::Sealed for SetLastUpdatedBy<S> {} 134 123 impl<S: State> State for SetLastUpdatedBy<S> { 135 - type Key = S::Key; 124 + type Did = S::Did; 136 125 type Value = S::Value; 137 - type Did = S::Did; 138 126 type Scope = S::Scope; 139 127 type CreatedBy = S::CreatedBy; 140 128 type LastUpdatedBy = Set<members::last_updated_by>; 129 + type Key = S::Key; 130 + } 131 + ///State transition - sets the `key` field to Set 132 + pub struct SetKey<S: State = Empty>(PhantomData<fn() -> S>); 133 + impl<S: State> sealed::Sealed for SetKey<S> {} 134 + impl<S: State> State for SetKey<S> { 135 + type Did = S::Did; 136 + type Value = S::Value; 137 + type Scope = S::Scope; 138 + type CreatedBy = S::CreatedBy; 139 + type LastUpdatedBy = S::LastUpdatedBy; 140 + type Key = Set<members::key>; 141 141 } 142 142 /// Marker types for field names 143 143 #[allow(non_camel_case_types)] 144 144 pub mod members { 145 - ///Marker type for the `key` field 146 - pub struct key(()); 147 - ///Marker type for the `value` field 148 - pub struct value(()); 149 145 ///Marker type for the `did` field 150 146 pub struct did(()); 147 + ///Marker type for the `value` field 148 + pub struct value(()); 151 149 ///Marker type for the `scope` field 152 150 pub struct scope(()); 153 151 ///Marker type for the `created_by` field 154 152 pub struct created_by(()); 155 153 ///Marker type for the `last_updated_by` field 156 154 pub struct last_updated_by(()); 155 + ///Marker type for the `key` field 156 + pub struct key(()); 157 157 } 158 158 } 159 159 ··· 397 397 impl<'a, S> DefsOptionBuilder<'a, S> 398 398 where 399 399 S: defs_option_state::State, 400 - S::Key: defs_option_state::IsSet, 400 + S::Did: defs_option_state::IsSet, 401 401 S::Value: defs_option_state::IsSet, 402 - S::Did: defs_option_state::IsSet, 403 402 S::Scope: defs_option_state::IsSet, 404 403 S::CreatedBy: defs_option_state::IsSet, 405 404 S::LastUpdatedBy: defs_option_state::IsSet, 405 + S::Key: defs_option_state::IsSet, 406 406 { 407 407 /// Build the final struct 408 408 pub fn build(self) -> DefsOption<'a> {
+15 -15
crates/weaver-api/src/tools_ozone/setting/upsert_option.rs
··· 42 42 /// State trait tracking which required fields have been set 43 43 pub trait State: sealed::Sealed { 44 44 type Key; 45 - type Scope; 46 45 type Value; 46 + type Scope; 47 47 } 48 48 /// Empty state - all required fields are unset 49 49 pub struct Empty(()); 50 50 impl sealed::Sealed for Empty {} 51 51 impl State for Empty { 52 52 type Key = Unset; 53 - type Scope = Unset; 54 53 type Value = Unset; 54 + type Scope = Unset; 55 55 } 56 56 ///State transition - sets the `key` field to Set 57 57 pub struct SetKey<S: State = Empty>(PhantomData<fn() -> S>); 58 58 impl<S: State> sealed::Sealed for SetKey<S> {} 59 59 impl<S: State> State for SetKey<S> { 60 60 type Key = Set<members::key>; 61 - type Scope = S::Scope; 62 61 type Value = S::Value; 63 - } 64 - ///State transition - sets the `scope` field to Set 65 - pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 66 - impl<S: State> sealed::Sealed for SetScope<S> {} 67 - impl<S: State> State for SetScope<S> { 68 - type Key = S::Key; 69 - type Scope = Set<members::scope>; 70 - type Value = S::Value; 62 + type Scope = S::Scope; 71 63 } 72 64 ///State transition - sets the `value` field to Set 73 65 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>); 74 66 impl<S: State> sealed::Sealed for SetValue<S> {} 75 67 impl<S: State> State for SetValue<S> { 76 68 type Key = S::Key; 77 - type Scope = S::Scope; 78 69 type Value = Set<members::value>; 70 + type Scope = S::Scope; 71 + } 72 + ///State transition - sets the `scope` field to Set 73 + pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 74 + impl<S: State> sealed::Sealed for SetScope<S> {} 75 + impl<S: State> State for SetScope<S> { 76 + type Key = S::Key; 77 + type Value = S::Value; 78 + type Scope = Set<members::scope>; 79 79 } 80 80 /// Marker types for field names 81 81 #[allow(non_camel_case_types)] 82 82 pub mod members { 83 83 ///Marker type for the `key` field 84 84 pub struct key(()); 85 + ///Marker type for the `value` field 86 + pub struct value(()); 85 87 ///Marker type for the `scope` field 86 88 pub struct scope(()); 87 - ///Marker type for the `value` field 88 - pub struct value(()); 89 89 } 90 90 } 91 91 ··· 219 219 where 220 220 S: upsert_option_state::State, 221 221 S::Key: upsert_option_state::IsSet, 222 - S::Scope: upsert_option_state::IsSet, 223 222 S::Value: upsert_option_state::IsSet, 223 + S::Scope: upsert_option_state::IsSet, 224 224 { 225 225 /// Build the final struct 226 226 pub fn build(self) -> UpsertOption<'a> {
+47 -47
crates/weaver-api/src/tools_ozone/verification.rs
··· 74 74 } 75 75 /// State trait tracking which required fields have been set 76 76 pub trait State: sealed::Sealed { 77 - type Issuer; 78 - type Uri; 79 77 type Subject; 80 - type Handle; 78 + type Uri; 81 79 type DisplayName; 80 + type Issuer; 81 + type Handle; 82 82 type CreatedAt; 83 83 } 84 84 /// Empty state - all required fields are unset 85 85 pub struct Empty(()); 86 86 impl sealed::Sealed for Empty {} 87 87 impl State for Empty { 88 - type Issuer = Unset; 88 + type Subject = Unset; 89 89 type Uri = Unset; 90 - type Subject = Unset; 91 - type Handle = Unset; 92 90 type DisplayName = Unset; 91 + type Issuer = Unset; 92 + type Handle = Unset; 93 93 type CreatedAt = Unset; 94 94 } 95 - ///State transition - sets the `issuer` field to Set 96 - pub struct SetIssuer<S: State = Empty>(PhantomData<fn() -> S>); 97 - impl<S: State> sealed::Sealed for SetIssuer<S> {} 98 - impl<S: State> State for SetIssuer<S> { 99 - type Issuer = Set<members::issuer>; 95 + ///State transition - sets the `subject` field to Set 96 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 97 + impl<S: State> sealed::Sealed for SetSubject<S> {} 98 + impl<S: State> State for SetSubject<S> { 99 + type Subject = Set<members::subject>; 100 100 type Uri = S::Uri; 101 - type Subject = S::Subject; 102 - type Handle = S::Handle; 103 101 type DisplayName = S::DisplayName; 102 + type Issuer = S::Issuer; 103 + type Handle = S::Handle; 104 104 type CreatedAt = S::CreatedAt; 105 105 } 106 106 ///State transition - sets the `uri` field to Set 107 107 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 108 108 impl<S: State> sealed::Sealed for SetUri<S> {} 109 109 impl<S: State> State for SetUri<S> { 110 + type Subject = S::Subject; 111 + type Uri = Set<members::uri>; 112 + type DisplayName = S::DisplayName; 110 113 type Issuer = S::Issuer; 111 - type Uri = Set<members::uri>; 112 - type Subject = S::Subject; 113 114 type Handle = S::Handle; 114 - type DisplayName = S::DisplayName; 115 115 type CreatedAt = S::CreatedAt; 116 116 } 117 - ///State transition - sets the `subject` field to Set 118 - pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 119 - impl<S: State> sealed::Sealed for SetSubject<S> {} 120 - impl<S: State> State for SetSubject<S> { 121 - type Issuer = S::Issuer; 117 + ///State transition - sets the `display_name` field to Set 118 + pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 119 + impl<S: State> sealed::Sealed for SetDisplayName<S> {} 120 + impl<S: State> State for SetDisplayName<S> { 121 + type Subject = S::Subject; 122 122 type Uri = S::Uri; 123 - type Subject = Set<members::subject>; 123 + type DisplayName = Set<members::display_name>; 124 + type Issuer = S::Issuer; 124 125 type Handle = S::Handle; 126 + type CreatedAt = S::CreatedAt; 127 + } 128 + ///State transition - sets the `issuer` field to Set 129 + pub struct SetIssuer<S: State = Empty>(PhantomData<fn() -> S>); 130 + impl<S: State> sealed::Sealed for SetIssuer<S> {} 131 + impl<S: State> State for SetIssuer<S> { 132 + type Subject = S::Subject; 133 + type Uri = S::Uri; 125 134 type DisplayName = S::DisplayName; 135 + type Issuer = Set<members::issuer>; 136 + type Handle = S::Handle; 126 137 type CreatedAt = S::CreatedAt; 127 138 } 128 139 ///State transition - sets the `handle` field to Set 129 140 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 130 141 impl<S: State> sealed::Sealed for SetHandle<S> {} 131 142 impl<S: State> State for SetHandle<S> { 132 - type Issuer = S::Issuer; 133 - type Uri = S::Uri; 134 143 type Subject = S::Subject; 135 - type Handle = Set<members::handle>; 144 + type Uri = S::Uri; 136 145 type DisplayName = S::DisplayName; 137 - type CreatedAt = S::CreatedAt; 138 - } 139 - ///State transition - sets the `display_name` field to Set 140 - pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>); 141 - impl<S: State> sealed::Sealed for SetDisplayName<S> {} 142 - impl<S: State> State for SetDisplayName<S> { 143 146 type Issuer = S::Issuer; 144 - type Uri = S::Uri; 145 - type Subject = S::Subject; 146 - type Handle = S::Handle; 147 - type DisplayName = Set<members::display_name>; 147 + type Handle = Set<members::handle>; 148 148 type CreatedAt = S::CreatedAt; 149 149 } 150 150 ///State transition - sets the `created_at` field to Set 151 151 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 152 152 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 153 153 impl<S: State> State for SetCreatedAt<S> { 154 + type Subject = S::Subject; 155 + type Uri = S::Uri; 156 + type DisplayName = S::DisplayName; 154 157 type Issuer = S::Issuer; 155 - type Uri = S::Uri; 156 - type Subject = S::Subject; 157 158 type Handle = S::Handle; 158 - type DisplayName = S::DisplayName; 159 159 type CreatedAt = Set<members::created_at>; 160 160 } 161 161 /// Marker types for field names 162 162 #[allow(non_camel_case_types)] 163 163 pub mod members { 164 - ///Marker type for the `issuer` field 165 - pub struct issuer(()); 164 + ///Marker type for the `subject` field 165 + pub struct subject(()); 166 166 ///Marker type for the `uri` field 167 167 pub struct uri(()); 168 - ///Marker type for the `subject` field 169 - pub struct subject(()); 168 + ///Marker type for the `display_name` field 169 + pub struct display_name(()); 170 + ///Marker type for the `issuer` field 171 + pub struct issuer(()); 170 172 ///Marker type for the `handle` field 171 173 pub struct handle(()); 172 - ///Marker type for the `display_name` field 173 - pub struct display_name(()); 174 174 ///Marker type for the `created_at` field 175 175 pub struct created_at(()); 176 176 } ··· 479 479 impl<'a, S> VerificationViewBuilder<'a, S> 480 480 where 481 481 S: verification_view_state::State, 482 - S::Issuer: verification_view_state::IsSet, 483 - S::Uri: verification_view_state::IsSet, 484 482 S::Subject: verification_view_state::IsSet, 485 - S::Handle: verification_view_state::IsSet, 483 + S::Uri: verification_view_state::IsSet, 486 484 S::DisplayName: verification_view_state::IsSet, 485 + S::Issuer: verification_view_state::IsSet, 486 + S::Handle: verification_view_state::IsSet, 487 487 S::CreatedAt: verification_view_state::IsSet, 488 488 { 489 489 /// Build the final struct
+13 -13
crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs
··· 236 236 } 237 237 /// State trait tracking which required fields have been set 238 238 pub trait State: sealed::Sealed { 239 - type Uri; 240 239 type Error; 240 + type Uri; 241 241 } 242 242 /// Empty state - all required fields are unset 243 243 pub struct Empty(()); 244 244 impl sealed::Sealed for Empty {} 245 245 impl State for Empty { 246 - type Uri = Unset; 247 246 type Error = Unset; 248 - } 249 - ///State transition - sets the `uri` field to Set 250 - pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 251 - impl<S: State> sealed::Sealed for SetUri<S> {} 252 - impl<S: State> State for SetUri<S> { 253 - type Uri = Set<members::uri>; 254 - type Error = S::Error; 247 + type Uri = Unset; 255 248 } 256 249 ///State transition - sets the `error` field to Set 257 250 pub struct SetError<S: State = Empty>(PhantomData<fn() -> S>); 258 251 impl<S: State> sealed::Sealed for SetError<S> {} 259 252 impl<S: State> State for SetError<S> { 260 - type Uri = S::Uri; 261 253 type Error = Set<members::error>; 254 + type Uri = S::Uri; 255 + } 256 + ///State transition - sets the `uri` field to Set 257 + pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 258 + impl<S: State> sealed::Sealed for SetUri<S> {} 259 + impl<S: State> State for SetUri<S> { 260 + type Error = S::Error; 261 + type Uri = Set<members::uri>; 262 262 } 263 263 /// Marker types for field names 264 264 #[allow(non_camel_case_types)] 265 265 pub mod members { 266 - ///Marker type for the `uri` field 267 - pub struct uri(()); 268 266 ///Marker type for the `error` field 269 267 pub struct error(()); 268 + ///Marker type for the `uri` field 269 + pub struct uri(()); 270 270 } 271 271 } 272 272 ··· 339 339 impl<'a, S> RevokeErrorBuilder<'a, S> 340 340 where 341 341 S: revoke_error_state::State, 342 - S::Uri: revoke_error_state::IsSet, 343 342 S::Error: revoke_error_state::IsSet, 343 + S::Uri: revoke_error_state::IsSet, 344 344 { 345 345 /// Build the final struct 346 346 pub fn build(self) -> RevokeError<'a> {
+2
crates/weaver-app/Cargo.toml
··· 55 55 web-time = "1.1" 56 56 urlencoding = "2.1" 57 57 tracing-subscriber = { version = "0.3", default-features = false, features = ["std", "registry"] } 58 + dioxus-sdk = { version = "0.7", features = ["time"] } 58 59 59 60 # OG image generation (server-only) 60 61 resvg = { version = "0.44", optional = true } ··· 82 83 js-sys = "0.3" 83 84 gloo-storage = "0.3" 84 85 gloo-timers = "0.3" 86 + 85 87 lol_alloc = "0.4.1" 86 88 87 89 [build-dependencies]
+31 -3
crates/weaver-app/assets/styling/editor.css
··· 727 727 color: var(--color-warning); 728 728 } 729 729 730 + /* Remote changes available - collaborator updates */ 731 + .sync-status.remote-changes { 732 + background: color-mix(in srgb, var(--color-primary) 20%, transparent); 733 + color: var(--color-primary); 734 + animation: pulse-subtle 2s ease-in-out infinite; 735 + } 736 + 737 + .sync-status.remote-changes:hover { 738 + animation: none; 739 + } 740 + 730 741 /* Error state */ 731 742 .sync-status.error { 732 743 background: color-mix(in srgb, var(--color-error) 15%, transparent); ··· 745 756 opacity: 0.6; 746 757 } 747 758 759 + @keyframes pulse-subtle { 760 + 0%, 761 + 100% { 762 + opacity: 1; 763 + } 764 + 50% { 765 + opacity: 0.7; 766 + } 767 + } 768 + 748 769 /* ========================================================================== 749 770 COLLABORATORS 750 771 ========================================================================== */ ··· 764 785 .collab-avatar { 765 786 width: 24px; 766 787 height: 24px; 767 - border: 1px solid var(--color-border); 768 788 background: var(--color-surface); 769 789 color: var(--color-muted); 770 790 display: flex; 791 + border-radius: 4px; 771 792 align-items: center; 772 793 justify-content: center; 773 794 font-size: 11px; ··· 776 797 text-transform: uppercase; 777 798 margin-left: -6px; 778 799 position: relative; 779 - transition: border-color 0.15s ease; 800 + overflow: hidden; 801 + } 802 + 803 + .collab-avatar-img { 804 + width: 100%; 805 + height: 100%; 806 + 807 + object-fit: cover; 780 808 } 781 809 782 810 .collab-avatar:first-child { ··· 791 819 792 820 .collab-avatar.collab-add { 793 821 background: transparent; 794 - border-style: dashed; 822 + border: 1px solid var(--color-border); 795 823 color: var(--color-muted); 796 824 font-size: 14px; 797 825 }
+27 -8
crates/weaver-app/public/sw.js
··· 23 23 Promise.all([ 24 24 clients.claim(), 25 25 // Clean up old cache versions 26 - caches.keys().then((names) => 27 - Promise.all( 28 - names 29 - .filter((name) => name.startsWith("weaver-blobs-") && name !== CACHE_NAME) 30 - .map((name) => caches.delete(name)) 31 - ) 32 - ), 33 - ]) 26 + caches 27 + .keys() 28 + .then((names) => 29 + Promise.all( 30 + names 31 + .filter((name) => name.startsWith("weaver-blobs-") && name !== CACHE_NAME) 32 + .map((name) => caches.delete(name)), 33 + ), 34 + ), 35 + ]), 34 36 ); 35 37 }); 36 38 ··· 41 43 // Store blob URL mappings 42 44 for (const [name, url] of Object.entries(event.data.blobs)) { 43 45 const key = `${notebook}/image/${name}`; 46 + urlMappings.set(key, url); 47 + } 48 + } 49 + if (event.data.type === "register_rkey_mappings") { 50 + const rkey = event.data.rkey; 51 + const ident = event.data.ident; 52 + // Store blob URL mappings 53 + for (const [name, url] of Object.entries(event.data.blobs)) { 54 + const key = `/image/${ident}/${rkey}/${name}`; 44 55 urlMappings.set(key, url); 45 56 } 46 57 } ··· 82 93 83 94 // Check legacy mappings (for /{notebook}/image/{name} format) 84 95 if (pathParts.length >= 3 && pathParts[pathParts.length - 2] === "image") { 96 + const legacyKey = pathParts.join("/"); 97 + const mapping = urlMappings.get(legacyKey); 98 + if (mapping) { 99 + event.respondWith(handleBlobRequest(mapping, cacheKey)); 100 + return; 101 + } 102 + } 103 + if (pathParts.length >= 4 && pathParts[0] === "image") { 85 104 const legacyKey = pathParts.join("/"); 86 105 const mapping = urlMappings.get(legacyKey); 87 106 if (mapping) {
+81 -1
crates/weaver-app/src/components/collab/api.rs
··· 4 4 use jacquard::IntoStatic; 5 5 use jacquard::prelude::*; 6 6 use jacquard::types::collection::Collection; 7 - use jacquard::types::string::{AtUri, Cid, Datetime, Did, Nsid}; 7 + use jacquard::types::string::{AtUri, Cid, Datetime, Did, Nsid, RecordKey}; 8 8 use jacquard::types::uri::Uri; 9 9 use reqwest::Url; 10 + use std::collections::HashSet; 10 11 use weaver_api::com_atproto::repo::list_records::ListRecords; 11 12 use weaver_api::com_atproto::repo::strong_ref::StrongRef; 12 13 use weaver_api::sh_weaver::collab::{accept::Accept, invite::Invite}; 14 + use weaver_api::sh_weaver::notebook::entry::Entry; 13 15 use weaver_common::WeaverError; 14 16 use weaver_common::constellation::GetBacklinksQuery; 15 17 ··· 243 245 244 246 Ok(invites) 245 247 } 248 + 249 + /// Find all participants (owner + collaborators) for a resource by its rkey. 250 + /// 251 + /// This works regardless of which copy of the entry you're viewing because it 252 + /// queries for invites by rkey pattern, then collects all involved DIDs. 253 + pub async fn find_all_participants( 254 + fetcher: &Fetcher, 255 + resource_uri: &AtUri<'_>, 256 + ) -> Result<Vec<Did<'static>>, WeaverError> { 257 + let Some(rkey) = resource_uri.rkey() else { 258 + return Ok(vec![]); 259 + }; 260 + 261 + let constellation_url = Url::parse(CONSTELLATION_URL) 262 + .map_err(|e| WeaverError::InvalidNotebook(format!("Invalid constellation URL: {}", e)))?; 263 + 264 + // Query for all invite records that reference entries with this rkey 265 + // We search for invites where resource.uri contains the rkey 266 + // The source pattern matches the JSON path in the invite record 267 + let query = GetBacklinksQuery { 268 + subject: Uri::At(resource_uri.clone().into_static()), 269 + source: format!("{}:resource.uri", Invite::NSID).into(), 270 + cursor: None, 271 + did: vec![], 272 + limit: 100, 273 + }; 274 + 275 + let mut participants: HashSet<Did<'static>> = HashSet::new(); 276 + 277 + // First try with the exact URI 278 + if let Ok(response) = fetcher.client.xrpc(constellation_url.clone()).send(&query).await { 279 + if let Ok(output) = response.into_output() { 280 + for record_id in &output.records { 281 + // The inviter (owner) is the DID that created the invite 282 + participants.insert(record_id.did.clone().into_static()); 283 + 284 + // Now we need to fetch the invite to get the invitee 285 + let uri_string = format!( 286 + "at://{}/{}/{}", 287 + record_id.did, 288 + Invite::NSID, 289 + record_id.rkey.as_ref() 290 + ); 291 + if let Ok(invite_uri) = AtUri::new(&uri_string) { 292 + if let Ok(response) = fetcher.get_record::<Invite>(&invite_uri).await { 293 + if let Ok(record) = response.into_output() { 294 + let invite = &record.value; 295 + // Check if this invite was accepted 296 + if check_invite_accepted(fetcher, &invite_uri.into_static()).await { 297 + participants.insert(invite.invitee.clone().into_static()); 298 + } 299 + } 300 + } 301 + } 302 + } 303 + } 304 + } 305 + 306 + // Also try querying with the owner's URI if we can determine it 307 + // This handles the case where we're viewing from a collaborator's copy 308 + let authority_did = match resource_uri.authority() { 309 + jacquard::types::ident::AtIdentifier::Did(d) => Some(d.clone().into_static()), 310 + _ => None, 311 + }; 312 + 313 + if let Some(ref did) = authority_did { 314 + participants.insert(did.clone()); 315 + } 316 + 317 + // If no participants found via invites, return just the current entry's authority 318 + if participants.is_empty() { 319 + if let Some(did) = authority_did { 320 + return Ok(vec![did]); 321 + } 322 + } 323 + 324 + Ok(participants.into_iter().collect()) 325 + }
+75 -17
crates/weaver-app/src/components/collab/avatars.rs
··· 1 1 //! Collaborator avatars display for the editor meta row. 2 2 3 + use std::sync::Arc; 4 + 3 5 use crate::auth::AuthState; 4 6 use crate::fetch::Fetcher; 5 7 use dioxus::prelude::*; 8 + use jacquard::types::ident::AtIdentifier; 6 9 use jacquard::types::string::AtUri; 10 + use weaver_api::sh_weaver::actor::{ProfileDataView, ProfileDataViewInner}; 7 11 8 - use super::api::{fetch_sent_invites, SentInvite}; 12 + use super::api::find_all_participants; 9 13 use super::CollaboratorsPanel; 10 14 11 15 /// Props for the CollaboratorAvatars component. ··· 21 25 } 22 26 23 27 /// Shows collaborator avatars with a button to manage collaborators. 28 + /// Displays all participants (collaborators with accepted invites) regardless of 29 + /// whether you're the owner or a collaborator. 24 30 #[component] 25 31 pub fn CollaboratorAvatars(props: CollaboratorAvatarsProps) -> Element { 26 32 let auth_state = use_context::<Signal<AuthState>>(); ··· 29 35 30 36 let resource_uri = props.resource_uri.clone(); 31 37 32 - // Fetch collaborators for this resource 38 + // Fetch all participants (owner + collaborators) with their profiles 33 39 let collaborators = { 34 40 let fetcher = fetcher.clone(); 35 41 let resource_uri = resource_uri.clone(); 36 42 use_resource(move || { 37 43 let fetcher = fetcher.clone(); 38 44 let resource_uri = resource_uri.clone(); 39 - let _auth = auth_state.read().did.clone(); 45 + let _auth = auth_state.read().did.clone(); // Reactivity trigger 40 46 async move { 41 - fetch_sent_invites(&fetcher) 47 + let dids = find_all_participants(&fetcher, &resource_uri) 42 48 .await 43 - .ok() 44 - .unwrap_or_default() 45 - .into_iter() 46 - .filter(|i| i.resource_uri == resource_uri && i.accepted) 47 - .collect::<Vec<SentInvite>>() 49 + .unwrap_or_default(); 50 + 51 + // Fetch profile for each participant 52 + let mut profiles = Vec::new(); 53 + for did in dids { 54 + let ident = AtIdentifier::Did(did); 55 + if let Ok(profile) = fetcher.fetch_profile(&ident).await { 56 + profiles.push(profile); 57 + } 58 + } 59 + profiles 48 60 } 49 61 }) 50 62 }; 51 63 52 - let collabs: Vec<SentInvite> = collaborators().unwrap_or_default(); 64 + let collabs: Vec<Arc<ProfileDataView<'static>>> = collaborators().unwrap_or_default(); 53 65 let collab_count = collabs.len(); 54 66 55 67 rsx! { ··· 57 69 onclick: move |_| show_panel.set(true), 58 70 59 71 // Show up to 3 avatar circles 60 - for (i, collab) in collabs.iter().take(3).enumerate() { 61 - div { 62 - class: "collab-avatar", 63 - style: "z-index: {3 - i}", 64 - title: "{collab.invitee}", 65 - // First letter of DID as placeholder 66 - {collab.invitee.as_ref().chars().last().unwrap_or('?').to_string()} 72 + for (i, profile) in collabs.iter().take(3).enumerate() { 73 + { 74 + let (avatar, display_name, handle) = match &profile.inner { 75 + ProfileDataViewInner::ProfileView(p) => ( 76 + p.avatar.as_ref(), 77 + p.display_name.as_ref().map(|s| s.as_ref()), 78 + p.handle.as_ref(), 79 + ), 80 + ProfileDataViewInner::ProfileViewDetailed(p) => ( 81 + p.avatar.as_ref(), 82 + p.display_name.as_ref().map(|s| s.as_ref()), 83 + p.handle.as_ref(), 84 + ), 85 + ProfileDataViewInner::TangledProfileView(p) => ( 86 + None, 87 + None, 88 + p.handle.as_ref(), 89 + ), 90 + _ => (None, None, "unknown"), 91 + }; 92 + let title = display_name.unwrap_or(handle); 93 + let initials = get_initials(display_name, handle); 94 + 95 + rsx! { 96 + div { 97 + class: "collab-avatar", 98 + style: "z-index: {3 - i}", 99 + title: "{title}", 100 + 101 + if let Some(avatar_url) = avatar { 102 + img { 103 + class: "collab-avatar-img", 104 + src: avatar_url.as_ref(), 105 + alt: "{title}", 106 + } 107 + } else { 108 + "{initials}" 109 + } 110 + } 111 + } 67 112 } 68 113 } 69 114 ··· 91 136 } 92 137 } 93 138 } 139 + 140 + /// Get initials from display name or handle. 141 + fn get_initials(display_name: Option<&str>, handle: &str) -> String { 142 + if let Some(name) = display_name { 143 + name.split_whitespace() 144 + .take(2) 145 + .filter_map(|w| w.chars().next()) 146 + .collect::<String>() 147 + .to_uppercase() 148 + } else { 149 + handle.chars().next().unwrap_or('?').to_uppercase().to_string() 150 + } 151 + }
+183 -15
crates/weaver-app/src/components/editor/component.rs
··· 5 5 use jacquard::cowstr::ToCowStr; 6 6 use jacquard::identity::resolver::IdentityResolver; 7 7 use jacquard::smol_str::SmolStr; 8 + use jacquard::types::aturi::AtUri; 8 9 use jacquard::types::blob::BlobRef; 9 10 use jacquard::types::ident::AtIdentifier; 10 11 use weaver_api::sh_weaver::embed::images::Image; ··· 150 151 // Restore images 151 152 if let Some(ref images) = embeds.images { 152 153 let images_list = embeds_map 153 - .get_or_create_container("images", loro::LoroList::new()) 154 + .get_or_create_container( 155 + "images", 156 + loro::LoroList::new(), 157 + ) 154 158 .expect("images list"); 155 159 for image in &images.images { 156 160 // Serialize image to JSON and add to list ··· 164 168 // Restore record embeds 165 169 if let Some(ref records) = embeds.records { 166 170 let records_list = embeds_map 167 - .get_or_create_container("records", loro::LoroList::new()) 171 + .get_or_create_container( 172 + "records", 173 + loro::LoroList::new(), 174 + ) 168 175 .expect("records list"); 169 176 for record in &records.records { 170 177 let json = serde_json::to_value(record) ··· 176 183 177 184 doc.commit(); 178 185 186 + // Pre-warm blob cache for images 187 + if let Some(ref embeds) = loaded.entry.embeds { 188 + if let Some(ref images) = embeds.images { 189 + let ident: &str = match uri.authority() { 190 + AtIdentifier::Did(d) => d.as_ref(), 191 + AtIdentifier::Handle(h) => h.as_ref(), 192 + }; 193 + for image in &images.images { 194 + let cid = image.image.blob().cid(); 195 + let name = image.name.as_ref().map(|n| n.as_ref()); 196 + if let Err(e) = crate::data::cache_blob( 197 + ident.into(), 198 + cid.as_ref().into(), 199 + name.map(|n| n.into()), 200 + ) 201 + .await 202 + { 203 + tracing::warn!( 204 + "Failed to pre-warm blob cache for {}: {}", 205 + cid, 206 + e 207 + ); 208 + } 209 + } 210 + } 211 + } 212 + 213 + // Pre-fetch embeds for initial render 214 + let mut resolved_content = 215 + weaver_common::ResolvedContent::default(); 216 + if let Some(ref embeds) = loaded.entry.embeds { 217 + if let Some(ref records) = embeds.records { 218 + for record in &records.records { 219 + // name is the key used in markdown, fallback to record.uri 220 + let key_uri = if let Some(ref name) = record.name { 221 + match jacquard::types::string::AtUri::new( 222 + name.as_ref(), 223 + ) { 224 + Ok(uri) => uri.into_static(), 225 + Err(_) => continue, 226 + } 227 + } else { 228 + record.record.uri.clone().into_static() 229 + }; 230 + 231 + match weaver_renderer::atproto::fetch_and_render( 232 + &record.record.uri, 233 + &fetcher, 234 + ) 235 + .await 236 + { 237 + Ok(html) => { 238 + resolved_content.add_embed(key_uri, html, None); 239 + } 240 + Err(e) => { 241 + tracing::warn!( 242 + "Failed to pre-fetch embed {}: {}", 243 + record.record.uri, 244 + e 245 + ); 246 + } 247 + } 248 + } 249 + } 250 + } 251 + if resolved_content.embed_content.is_empty() { 252 + use weaver_common::{ExtractedRef, collect_refs_from_markdown}; 253 + 254 + let text = doc.get_text("content"); 255 + let markdown = text.to_string(); 256 + 257 + if !markdown.is_empty() { 258 + tracing::debug!( 259 + "Falling back to markdown parsing for embeds" 260 + ); 261 + let refs = collect_refs_from_markdown(&markdown); 262 + 263 + for extracted in refs { 264 + if let ExtractedRef::AtEmbed { uri, .. } = extracted { 265 + let key_uri = match AtUri::new(&uri) { 266 + Ok(u) => u.into_static(), 267 + Err(_) => continue, 268 + }; 269 + 270 + match weaver_renderer::atproto::fetch_and_render( 271 + &key_uri, &fetcher, 272 + ) 273 + .await 274 + { 275 + Ok(html) => { 276 + tracing::debug!( 277 + "Pre-fetched embed from markdown: {}", 278 + uri 279 + ); 280 + resolved_content 281 + .add_embed(key_uri, html, None); 282 + } 283 + Err(e) => { 284 + tracing::warn!( 285 + "Failed to pre-fetch embed {}: {}", 286 + uri, 287 + e 288 + ); 289 + } 290 + } 291 + } 292 + } 293 + } 294 + } 295 + 179 296 return LoadResult::Loaded(LoadedDocState { 180 297 doc, 181 298 entry_ref: Some(loaded.entry_ref), 182 299 edit_root: None, 183 300 last_diff: None, 184 301 synced_version: None, // Fresh from entry, never synced 302 + resolved_content, 185 303 }); 186 304 } 187 305 Err(e) => { ··· 205 323 edit_root: None, 206 324 last_diff: None, 207 325 synced_version: None, // New doc, never synced 326 + resolved_content: weaver_common::ResolvedContent::default(), 208 327 }) 209 328 } 210 329 Err(e) => { ··· 300 419 EditorImageResolver::default() 301 420 } 302 421 }); 303 - let resolved_content = use_signal(weaver_common::ResolvedContent::default); 422 + // Use pre-resolved content from loaded state (avoids embed pop-in) 423 + let resolved_content = use_signal(|| loaded_state.resolved_content.clone()); 304 424 305 425 let doc_for_memo = document.clone(); 306 426 let doc_for_refs = document.clone(); 307 - let paragraphs = use_memo(move || { 427 + let entry_index_for_memo = entry_index.clone(); 428 + let mut paragraphs = use_memo(move || { 308 429 let edit = doc_for_memo.last_edit(); 309 430 let cache = render_cache.peek(); 310 431 let resolver = image_resolver(); 311 432 let resolved = resolved_content(); 312 433 434 + tracing::debug!( 435 + "Rendering with {} pre-resolved embeds", 436 + resolved.embed_content.len() 437 + ); 438 + 313 439 let (paras, new_cache, refs) = render::render_paragraphs_incremental( 314 440 doc_for_memo.loro_text(), 315 441 Some(&cache), 316 442 edit.as_ref(), 317 443 Some(&resolver), 318 - entry_index.as_ref(), 444 + entry_index_for_memo.as_ref(), 319 445 &resolved, 320 446 ); 321 447 let mut doc_for_spawn = doc_for_refs.clone(); ··· 364 490 continue; 365 491 }; 366 492 367 - match weaver_renderer::atproto::fetch_and_render(&at_uri, &fetcher) 368 - .await 369 - { 493 + match weaver_renderer::atproto::fetch_and_render(&at_uri, &fetcher).await { 370 494 Ok(html) => { 371 - resolved_content_for_fetch.with_mut(|rc| { 372 - rc.add_embed(at_uri.into_static(), html, None); 373 - }); 495 + let mut rc = resolved_content_for_fetch.write(); 496 + rc.add_embed(at_uri.into_static(), html, None); 374 497 } 375 498 Err(e) => { 376 499 tracing::warn!("failed to fetch embed {}: {}", uri_str, e); ··· 430 553 // Use peek() to avoid creating reactive dependency on cached_paragraphs 431 554 let prev = cached_paragraphs.peek().clone(); 432 555 433 - let cursor_para_updated = update_paragraph_dom(editor_id, &prev, &new_paras, cursor_offset); 556 + let cursor_para_updated = 557 + update_paragraph_dom(editor_id, &prev, &new_paras, cursor_offset, false); 434 558 435 559 // Only restore cursor if we actually re-rendered the paragraph it's in 436 560 if cursor_para_updated { ··· 726 850 } 727 851 } 728 852 729 - SyncStatus { 730 - document: document.clone(), 731 - draft_key: draft_key.to_string(), 853 + { 854 + // Enable collaborative sync for any published entry (both owners and collaborators) 855 + let is_published = document.entry_ref().is_some(); 856 + 857 + // Refresh callback: fetch and merge collaborator changes 858 + let on_refresh = if is_published { 859 + let fetcher_for_refresh = fetcher.clone(); 860 + let mut doc_for_refresh = document.clone(); 861 + let entry_uri = document.entry_ref().map(|r| r.uri.clone().into_static()); 862 + 863 + Some(EventHandler::new(move |_| { 864 + let fetcher = fetcher_for_refresh.clone(); 865 + let mut doc = doc_for_refresh.clone(); 866 + let uri = entry_uri.clone(); 867 + 868 + spawn(async move { 869 + if let Some(uri) = uri { 870 + match super::sync::load_all_edit_states_from_pds(&fetcher, &uri).await { 871 + Ok(Some(pds_state)) => { 872 + if let Err(e) = doc.import_updates(&pds_state.root_snapshot) { 873 + tracing::error!("Failed to import collaborator updates: {:?}", e); 874 + } else { 875 + tracing::info!("Successfully merged collaborator updates"); 876 + } 877 + } 878 + Ok(None) => { 879 + tracing::debug!("No collaborator updates found"); 880 + } 881 + Err(e) => { 882 + tracing::error!("Failed to fetch collaborator updates: {}", e); 883 + } 884 + } 885 + } 886 + }); 887 + })) 888 + } else { 889 + None 890 + }; 891 + 892 + rsx! { 893 + SyncStatus { 894 + document: document.clone(), 895 + draft_key: draft_key.to_string(), 896 + on_refresh, 897 + is_collaborative: is_published, 898 + } 899 + } 732 900 } 733 901 734 902 PublishButton {
+51 -15
crates/weaver-app/src/components/editor/document.rs
··· 104 104 /// Version vector at the time of last sync to PDS. 105 105 /// Used to export only changes since last sync. 106 106 /// None if never synced. 107 - last_synced_version: Option<VersionVector>, 107 + /// Signal so cloned docs share the same sync state. 108 + last_synced_version: Signal<Option<VersionVector>>, 108 109 109 110 // --- Editor state (non-reactive) --- 110 111 /// Undo manager for the document. ··· 176 177 177 178 /// Information about the most recent edit, used for incremental rendering optimization. 178 179 /// Derives PartialEq so it can be used with Dioxus memos for change detection. 179 - #[derive(Clone, Debug, Default, PartialEq)] 180 + #[derive(Clone, Debug, PartialEq)] 180 181 pub struct EditInfo { 181 182 /// Character offset where the edit occurred 182 183 pub edit_char_pos: usize, ··· 193 194 /// Used to detect stale edit info - if current doc length doesn't match, 194 195 /// the edit info is from a previous render cycle and shouldn't be used. 195 196 pub doc_len_after: usize, 197 + /// When this edit occurred. Used for idle detection in collaborative sync. 198 + pub timestamp: web_time::Instant, 196 199 } 197 200 198 201 /// Max distance from line start where block syntax can appear. ··· 202 205 /// Pre-loaded document state that can be created outside of reactive context. 203 206 /// 204 207 /// This struct holds the raw LoroDoc (which is safe outside reactive context) 205 - /// along with sync state metadata. Use `EditorDocument::from_loaded_state()` 208 + /// along with sync state metadata. Use `EditorDocument::from_loaded_state()` 206 209 /// inside a `use_hook` to convert this into a reactive EditorDocument. 207 210 /// 208 211 /// Note: Clone is a shallow/reference clone for LoroDoc (Arc-backed). ··· 221 224 /// Used to determine what changes need to be synced. 222 225 /// None if never synced to PDS. 223 226 pub synced_version: Option<VersionVector>, 227 + /// Pre-resolved embed content fetched during load. 228 + /// Avoids embed pop-in on initial render. 229 + pub resolved_content: weaver_common::ResolvedContent, 224 230 } 225 231 226 232 impl PartialEq for LoadedDocState { ··· 304 310 entry_ref: Signal::new(None), 305 311 edit_root: Signal::new(None), 306 312 last_diff: Signal::new(None), 307 - last_synced_version: None, 313 + last_synced_version: Signal::new(None), 308 314 undo_mgr: Rc::new(RefCell::new(undo_mgr)), 309 315 loro_cursor, 310 316 // Reactive editor state - wrapped in Signals ··· 347 353 doc.add_image(&img.clone().into_static(), None); 348 354 } 349 355 } 356 + 357 + if let Some(ref records) = embeds.records { 358 + for record in &records.records { 359 + doc.add_record(&record.clone().into_static()); 360 + } 361 + } 350 362 } 351 363 352 364 // Set the entry_ref so subsequent publishes update this record ··· 580 592 images_list.push(json).ok(); 581 593 } 582 594 595 + pub fn add_record(&mut self, record: &RecordEmbed<'_>) { 596 + // Serialize the Record embed to serde_json::Value 597 + let json = serde_json::to_value(record).expect("Record serializes"); 598 + 599 + // Insert into the record list 600 + let record_list = self.get_records_list(); 601 + record_list.push(json).ok(); 602 + } 603 + 604 + pub fn remove_record(&mut self, index: usize) { 605 + let record_list = self.get_records_list(); 606 + if index < record_list.len() { 607 + record_list.delete(index, 1).ok(); 608 + } 609 + } 610 + 583 611 /// Remove an image by index. 584 612 pub fn remove_image(&mut self, index: usize) { 585 613 let images_list = self.get_images_list(); ··· 639 667 } 640 668 641 669 /// Convert a LoroValue at the given index to a RecordEmbed. 642 - fn loro_value_to_record_embed(&self, list: &LoroList, index: usize) -> Option<RecordEmbed<'static>> { 670 + fn loro_value_to_record_embed( 671 + &self, 672 + list: &LoroList, 673 + index: usize, 674 + ) -> Option<RecordEmbed<'static>> { 643 675 let value = list.get(index)?; 644 676 let loro_value = value.as_value()?; 645 677 let json = loro_value.to_json_value(); 646 - from_json_value::<RecordEmbed>(json).ok().map(|r| r.into_static()) 678 + from_json_value::<RecordEmbed>(json) 679 + .ok() 680 + .map(|r| r.into_static()) 647 681 } 648 682 649 683 /// Insert text into content and record edit info for incremental rendering. ··· 659 693 contains_newline: text.contains('\n'), 660 694 in_block_syntax_zone, 661 695 doc_len_after: len_after, 696 + timestamp: web_time::Instant::now(), 662 697 })); 663 698 result 664 699 } ··· 676 711 contains_newline: text.contains('\n'), 677 712 in_block_syntax_zone, 678 713 doc_len_after: len_after, 714 + timestamp: web_time::Instant::now(), 679 715 })); 680 716 result 681 717 } ··· 694 730 contains_newline, 695 731 in_block_syntax_zone, 696 732 doc_len_after: self.content.len_unicode(), 733 + timestamp: web_time::Instant::now(), 697 734 })); 698 735 result 699 736 } ··· 720 757 contains_newline: delete_has_newline || text.contains('\n'), 721 758 in_block_syntax_zone, 722 759 doc_len_after: len_after, 760 + timestamp: web_time::Instant::now(), 723 761 })); 724 762 Ok(()) 725 763 } ··· 873 911 874 912 /// Check if there are unsynced changes since the last PDS sync. 875 913 pub fn has_unsynced_changes(&self) -> bool { 876 - match &self.last_synced_version { 914 + match &*self.last_synced_version.read() { 877 915 Some(synced_vv) => self.doc.oplog_vv() != *synced_vv, 878 916 None => true, // Never synced, so there are changes 879 917 } ··· 883 921 /// Returns None if there are no changes to export. 884 922 /// After successful upload, call `mark_synced()` to update the sync marker. 885 923 pub fn export_updates_since_sync(&self) -> Option<Vec<u8>> { 886 - let from_vv = self.last_synced_version.clone().unwrap_or_default(); 924 + let from_vv = self.last_synced_version.read().clone().unwrap_or_default(); 887 925 let current_vv = self.doc.oplog_vv(); 888 926 889 927 // No changes since last sync ··· 909 947 /// Mark the current state as synced. 910 948 /// Call this after successfully uploading a diff to the PDS. 911 949 pub fn mark_synced(&mut self) { 912 - self.last_synced_version = Some(self.doc.oplog_vv()); 950 + self.last_synced_version.set(Some(self.doc.oplog_vv())); 913 951 } 914 952 915 953 /// Import updates from a PDS diff blob. ··· 929 967 ) { 930 968 self.edit_root.set(Some(edit_root)); 931 969 self.last_diff.set(last_diff); 932 - self.last_synced_version = Some(self.doc.oplog_vv()); 970 + self.last_synced_version.set(Some(self.doc.oplog_vv())); 933 971 } 934 972 935 973 /// Create a new EditorDocument from a binary snapshot. ··· 1001 1039 entry_ref: Signal::new(None), 1002 1040 edit_root: Signal::new(None), 1003 1041 last_diff: Signal::new(None), 1004 - last_synced_version: None, 1042 + last_synced_version: Signal::new(None), 1005 1043 undo_mgr: Rc::new(RefCell::new(undo_mgr)), 1006 1044 loro_cursor, 1007 1045 // Reactive editor state - wrapped in Signals ··· 1047 1085 }; 1048 1086 let loro_cursor = content.get_cursor(cursor_offset, Side::default()); 1049 1087 1050 - // Use the synced version from state (tracks the PDS version vector) 1051 - let last_synced_version = state.synced_version; 1052 - 1053 1088 Self { 1054 1089 doc, 1055 1090 content, ··· 1061 1096 entry_ref: Signal::new(state.entry_ref), 1062 1097 edit_root: Signal::new(state.edit_root), 1063 1098 last_diff: Signal::new(state.last_diff), 1064 - last_synced_version, 1099 + // Use the synced version from state (tracks the PDS version vector) 1100 + last_synced_version: Signal::new(state.synced_version), 1065 1101 undo_mgr: Rc::new(RefCell::new(undo_mgr)), 1066 1102 loro_cursor, 1067 1103 cursor: Signal::new(cursor_state),
+15 -6
crates/weaver-app/src/components/editor/dom_sync.rs
··· 279 279 old_paragraphs: &[ParagraphRender], 280 280 new_paragraphs: &[ParagraphRender], 281 281 cursor_offset: usize, 282 + force: bool, 282 283 ) -> bool { 283 284 use wasm_bindgen::JsCast; 284 285 ··· 311 312 let para_id = format!("para-{}", idx); 312 313 313 314 if let Some(old_para) = old_paragraphs.get(idx) { 314 - if new_para.source_hash != old_para.source_hash { 315 + if force || new_para.source_hash != old_para.source_hash { 315 316 // Changed - clear and update innerHTML 316 317 // We clear first to ensure any browser-added content (from IME composition, 317 318 // contenteditable quirks, etc.) is fully removed before setting new content 318 319 if let Some(elem) = document.get_element_by_id(&para_id) { 319 - elem.set_text_content(None); // Clear completely 320 - elem.set_inner_html(&new_para.html); 320 + if force && cursor_para_idx.is_some() { 321 + // skip re-rendering where the cursor is if we're forcing it 322 + // we don't want to fuck up what the user is doing 323 + } else { 324 + elem.set_text_content(None); // Clear completely 325 + elem.set_inner_html(&new_para.html); 326 + } 321 327 } 322 328 323 - if Some(idx) == cursor_para_idx { 324 - cursor_para_updated = true; 329 + if !force { 330 + if Some(idx) == cursor_para_idx { 331 + cursor_para_updated = true; 332 + } 325 333 } 326 334 } 327 335 } else { ··· 342 350 if new_paragraphs.len() < old_paragraphs.len() { 343 351 cursor_para_updated = true; 344 352 } 353 + // TODO: i think this is the cause of a number of bits of cursor jank 345 354 for idx in new_paragraphs.len()..old_paragraphs.len() { 346 355 let para_id = format!("para-{}", idx); 347 356 if let Some(elem) = document.get_element_by_id(&para_id) { ··· 358 367 _old_paragraphs: &[ParagraphRender], 359 368 _new_paragraphs: &[ParagraphRender], 360 369 _cursor_offset: usize, 370 + _force: bool, 361 371 ) -> bool { 362 372 false 363 373 } 364 -
+57 -12
crates/weaver-app/src/components/editor/publish.rs
··· 274 274 PublishResult::Updated(uri) 275 275 } 276 276 } else if let Some(existing_ref) = doc.entry_ref() { 277 - // Update existing free-floating entry - use existing rkey for path rewriting 278 - let did = fetcher 277 + // Update existing entry (either owner or collaborator) 278 + let current_did = fetcher 279 279 .current_did() 280 280 .await 281 281 .ok_or_else(|| WeaverError::InvalidNotebook("Not authenticated".into()))?; ··· 285 285 .rkey() 286 286 .ok_or_else(|| WeaverError::InvalidNotebook("Entry URI missing rkey".into()))?; 287 287 288 + // Check if we're the owner or a collaborator 289 + let owner_did = match existing_ref.uri.authority() { 290 + AtIdentifier::Did(d) => d.clone(), 291 + AtIdentifier::Handle(h) => fetcher 292 + .client 293 + .resolve_handle(h) 294 + .await 295 + .map_err(|e| WeaverError::InvalidNotebook(format!("Failed to resolve handle: {}", e)))?, 296 + }; 297 + let is_collaborator = owner_did != current_did; 298 + 288 299 // Rewrite draft image paths to published paths 289 300 let content = rewrite_draft_paths(&doc.content(), rkey.0.as_str()); 290 301 ··· 300 311 301 312 let collection = Nsid::new(ENTRY_NSID).map_err(|e| WeaverError::AtprotoString(e))?; 302 313 314 + // Collaborator: create/update in THEIR repo with SAME rkey 315 + // Owner: update in their own repo 303 316 let request = PutRecord::new() 304 - .repo(AtIdentifier::Did(did)) 317 + .repo(AtIdentifier::Did(current_did.clone())) 305 318 .collection(collection) 306 319 .rkey(rkey.clone()) 307 320 .record(entry_data) ··· 315 328 .into_output() 316 329 .map_err(|e| WeaverError::InvalidNotebook(e.to_string()))?; 317 330 318 - // Update entry_ref with new CID 319 - let updated_ref = StrongRef::new() 320 - .uri(output.uri.clone().into_static()) 321 - .cid(output.cid.into_static()) 322 - .build(); 323 - doc.set_entry_ref(Some(updated_ref)); 324 - 325 - PublishResult::Updated(output.uri.into_static()) 331 + if is_collaborator { 332 + // Collaborator: don't update doc.entry_ref() - it still points to original 333 + // Their version is a parallel record at at://{collab_did}/sh.weaver.notebook.entry/{same_rkey} 334 + tracing::info!( 335 + "Collaborator published version: {} (original: {})", 336 + output.uri, 337 + existing_ref.uri 338 + ); 339 + PublishResult::Created(output.uri.into_static()) 340 + } else { 341 + // Owner: update entry_ref with new CID 342 + let updated_ref = StrongRef::new() 343 + .uri(output.uri.clone().into_static()) 344 + .cid(output.cid.into_static()) 345 + .build(); 346 + doc.set_entry_ref(Some(updated_ref)); 347 + PublishResult::Updated(output.uri.into_static()) 348 + } 326 349 } else { 327 350 // Create new free-floating entry - pre-generate rkey for path rewriting 328 351 let did = fetcher ··· 457 480 // Check if we're editing an existing entry 458 481 let is_editing_existing = doc.entry_ref().is_some(); 459 482 483 + // Check if we're publishing as a collaborator (editing someone else's entry) 484 + let is_collaborator = { 485 + let entry_ref = doc.entry_ref(); 486 + let current_did = auth_state.read().did.clone(); 487 + match (entry_ref, current_did) { 488 + (Some(ref r), Some(ref current)) => { 489 + match r.uri.authority() { 490 + AtIdentifier::Did(owner_did) => owner_did != current, 491 + AtIdentifier::Handle(_) => false, // Can't determine without async resolve 492 + } 493 + } 494 + _ => false, 495 + } 496 + }; 497 + 460 498 // Validate that we have required fields 461 499 let can_publish = !doc.title().trim().is_empty() && !doc.content().trim().is_empty(); 462 500 ··· 558 596 } 559 597 } else { 560 598 div { class: "publish-form", 561 - if is_editing_existing { 599 + if is_collaborator { 600 + div { class: "publish-info publish-collab-info", 601 + p { "Publishing as collaborator" } 602 + p { class: "publish-collab-detail", 603 + "This creates a version in your repository." 604 + } 605 + } 606 + } else if is_editing_existing { 562 607 div { class: "publish-info", 563 608 p { "Updating existing entry" } 564 609 }
+7 -35
crates/weaver-app/src/components/editor/render.rs
··· 72 72 } 73 73 } 74 74 75 - /// Adjust a cached paragraph's positions after an earlier edit. 76 - fn adjust_paragraph_positions( 77 - cached: &CachedParagraph, 78 - char_delta: isize, 79 - byte_delta: isize, 80 - ) -> ParagraphRender { 81 - let mut adjusted_map = cached.offset_map.clone(); 82 - for mapping in &mut adjusted_map { 83 - mapping.char_range.start = apply_delta(mapping.char_range.start, char_delta); 84 - mapping.char_range.end = apply_delta(mapping.char_range.end, char_delta); 85 - mapping.byte_range.start = apply_delta(mapping.byte_range.start, byte_delta); 86 - mapping.byte_range.end = apply_delta(mapping.byte_range.end, byte_delta); 87 - } 88 - 89 - let mut adjusted_syntax = cached.syntax_spans.clone(); 90 - for span in &mut adjusted_syntax { 91 - span.adjust_positions(char_delta); 92 - } 93 - 94 - ParagraphRender { 95 - byte_range: apply_delta(cached.byte_range.start, byte_delta) 96 - ..apply_delta(cached.byte_range.end, byte_delta), 97 - char_range: apply_delta(cached.char_range.start, char_delta) 98 - ..apply_delta(cached.char_range.end, char_delta), 99 - html: cached.html.clone(), 100 - offset_map: adjusted_map, 101 - syntax_spans: adjusted_syntax, 102 - source_hash: cached.source_hash, 103 - } 104 - } 105 - 106 75 /// Render markdown with incremental caching. 107 76 /// 108 77 /// Uses cached paragraph renders when possible, only re-rendering changed paragraphs. ··· 163 132 // Need cache and non-boundary-affecting edit info (for edit position) 164 133 let current_len = text.len_unicode(); 165 134 166 - let use_fast_path = cache.is_some() 167 - && edit.is_some() 168 - && !is_boundary_affecting(edit.unwrap()); 135 + let use_fast_path = cache.is_some() && edit.is_some() && !is_boundary_affecting(edit.unwrap()); 169 136 170 137 tracing::debug!( 171 138 target: "weaver::render", ··· 320 287 // Include cached refs in all_refs 321 288 all_refs.extend(cached.collected_refs.clone()); 322 289 323 - (cached.html.clone(), adjusted_map, adjusted_syntax, cached.collected_refs.clone()) 290 + ( 291 + cached.html.clone(), 292 + adjusted_map, 293 + adjusted_syntax, 294 + cached.collected_refs.clone(), 295 + ) 324 296 } else { 325 297 // Fresh render needed - create detached LoroDoc for this paragraph 326 298 let para_doc = loro::LoroDoc::new();
+407 -73
crates/weaver-app/src/components/editor/sync.rs
··· 18 18 19 19 use std::collections::BTreeMap; 20 20 21 + use super::document::{EditorDocument, LoadedDocState}; 22 + use crate::fetch::Fetcher; 21 23 use jacquard::bytes::Bytes; 22 24 use jacquard::cowstr::ToCowStr; 23 25 use jacquard::prelude::*; ··· 30 32 use jacquard::types::uri::Uri; 31 33 use jacquard::url::Url; 32 34 use jacquard::{CowStr, IntoStatic, to_data}; 35 + use loro::LoroDoc; 36 + use loro::ToJson; 33 37 use weaver_api::com_atproto::repo::create_record::CreateRecord; 34 38 use weaver_api::com_atproto::repo::strong_ref::StrongRef; 35 39 use weaver_api::com_atproto::sync::get_blob::GetBlob; ··· 40 44 use weaver_common::constellation::{GetBacklinksQuery, RecordId}; 41 45 use weaver_common::{WeaverError, WeaverExt}; 42 46 43 - use crate::fetch::Fetcher; 44 - 45 - use super::document::{EditorDocument, LoadedDocState}; 46 - use loro::LoroDoc; 47 - 48 47 const ROOT_NSID: &str = "sh.weaver.edit.root"; 49 48 const DIFF_NSID: &str = "sh.weaver.edit.diff"; 50 49 const DRAFT_NSID: &str = "sh.weaver.edit.draft"; 51 50 const CONSTELLATION_URL: &str = "https://constellation.microcosm.blue"; 52 51 52 + /// Extract record embeds from a LoroDoc and pre-fetch their rendered content. 53 + /// 54 + /// Reads the embeds.records list from the document, extracts RecordEmbed entries, 55 + /// and fetches/renders each one to populate a ResolvedContent map. 56 + /// Also pre-warms the blob cache for images if `owner_ident` is provided. 57 + async fn prefetch_embeds_from_doc( 58 + doc: &LoroDoc, 59 + fetcher: &Fetcher, 60 + owner_ident: Option<&str>, 61 + ) -> weaver_common::ResolvedContent { 62 + use weaver_api::sh_weaver::embed::images::Image; 63 + use weaver_api::sh_weaver::embed::records::RecordEmbed; 64 + 65 + let mut resolved = weaver_common::ResolvedContent::default(); 66 + 67 + let embeds_map = doc.get_map("embeds"); 68 + 69 + // Pre-warm blob cache for images 70 + if let Some(ident) = owner_ident { 71 + if let Ok(images_container) = 72 + embeds_map.get_or_create_container("images", loro::LoroList::new()) 73 + { 74 + for i in 0..images_container.len() { 75 + let Some(value) = images_container.get(i) else { 76 + continue; 77 + }; 78 + let Some(loro_value) = value.as_value() else { 79 + continue; 80 + }; 81 + let json = loro_value.to_json_value(); 82 + let Ok(image) = jacquard::from_json_value::<Image>(json) else { 83 + continue; 84 + }; 85 + 86 + let cid = image.image.blob().cid(); 87 + let name = image.name.as_ref().map(|n| n.as_ref()); 88 + if let Err(e) = crate::data::cache_blob( 89 + ident.into(), 90 + cid.as_ref().into(), 91 + name.map(|n| n.into()), 92 + ) 93 + .await 94 + { 95 + tracing::warn!("Failed to pre-warm blob cache for {}: {}", cid, e); 96 + } 97 + } 98 + } 99 + } 100 + 101 + // Strategy 1: Get embeds from Loro embeds map -> records list 102 + 103 + if let Ok(records_container) = 104 + embeds_map.get_or_create_container("records", loro::LoroList::new()) 105 + { 106 + tracing::debug!("Loro embeds map records len: {}", records_container.len()); 107 + 108 + for i in 0..records_container.len() { 109 + let Some(value) = records_container.get(i) else { 110 + continue; 111 + }; 112 + let Some(loro_value) = value.as_value() else { 113 + continue; 114 + }; 115 + let json = loro_value.to_json_value(); 116 + let Ok(record_embed) = jacquard::from_json_value::<RecordEmbed>(json) else { 117 + continue; 118 + }; 119 + 120 + // name is the key used in markdown, fallback to record.uri 121 + let key_uri = if let Some(ref name) = record_embed.name { 122 + match AtUri::new(name.as_ref()) { 123 + Ok(uri) => uri.into_static(), 124 + Err(_) => continue, 125 + } 126 + } else { 127 + record_embed.record.uri.clone().into_static() 128 + }; 129 + 130 + // Fetch and render 131 + match weaver_renderer::atproto::fetch_and_render(&record_embed.record.uri, fetcher) 132 + .await 133 + { 134 + Ok(html) => { 135 + tracing::debug!("Pre-fetched embed from Loro map: {}", key_uri); 136 + resolved.add_embed(key_uri, html, None); 137 + } 138 + Err(e) => { 139 + tracing::warn!( 140 + "Failed to pre-fetch embed {}: {}", 141 + record_embed.record.uri, 142 + e 143 + ); 144 + } 145 + } 146 + } 147 + } 148 + 149 + // Strategy 2: If no embeds found in Loro map, parse markdown text 150 + if resolved.embed_content.is_empty() { 151 + use weaver_common::{collect_refs_from_markdown, ExtractedRef}; 152 + 153 + let text = doc.get_text("content"); 154 + let markdown = text.to_string(); 155 + 156 + if !markdown.is_empty() { 157 + tracing::debug!("Falling back to markdown parsing for embeds"); 158 + let refs = collect_refs_from_markdown(&markdown); 159 + 160 + for extracted in refs { 161 + if let ExtractedRef::AtEmbed { uri, .. } = extracted { 162 + let key_uri = match AtUri::new(&uri) { 163 + Ok(u) => u.into_static(), 164 + Err(_) => continue, 165 + }; 166 + 167 + match weaver_renderer::atproto::fetch_and_render(&key_uri, fetcher).await { 168 + Ok(html) => { 169 + tracing::debug!("Pre-fetched embed from markdown: {}", uri); 170 + resolved.add_embed(key_uri, html, None); 171 + } 172 + Err(e) => { 173 + tracing::warn!("Failed to pre-fetch embed {}: {}", uri, e); 174 + } 175 + } 176 + } 177 + } 178 + } 179 + } 180 + 181 + resolved 182 + } 183 + 53 184 /// Build a DocRef for either a published entry or an unpublished draft. 54 185 /// 55 186 /// If entry_uri and entry_cid are provided, creates an EntryRef. ··· 82 213 tid.to_string() 83 214 } else if draft_key.starts_with("at://") { 84 215 // Editing existing entry: use the entry's rkey 85 - draft_key 86 - .split('/') 87 - .last() 88 - .unwrap_or(draft_key) 89 - .to_string() 216 + draft_key.split('/').last().unwrap_or(draft_key).to_string() 90 217 } else if draft_key.starts_with("did:") && draft_key.contains(':') { 91 218 // Old canonical format "did:xxx:rkey" - extract rkey 92 219 draft_key ··· 158 285 159 286 let query = GetBacklinksQuery { 160 287 subject: Uri::At(entry_uri.clone().into_static()), 161 - source: format!("{}:.doc.value.entry.uri", ROOT_NSID).into(), 288 + source: format!("{}:doc.value.entry.uri", ROOT_NSID).into(), 162 289 cursor: None, 163 290 did: vec![], 164 291 limit: 1, ··· 178 305 Ok(output.records.into_iter().next().map(|r| r.into_static())) 179 306 } 180 307 308 + /// Find ALL edit.root records across collaborators for an entry. 309 + /// 310 + /// 1. Gets list of collaborators via permissions 311 + /// 2. Queries Constellation for edit.root in each collaborator's repo 312 + /// 3. Returns all found roots for CRDT merge 313 + pub async fn find_all_edit_roots_for_entry( 314 + fetcher: &Fetcher, 315 + entry_uri: &AtUri<'_>, 316 + ) -> Result<Vec<RecordId<'static>>, WeaverError> { 317 + // Get collaborators from permissions 318 + let collaborators = fetcher 319 + .get_client() 320 + .find_collaborators_for_resource(entry_uri) 321 + .await 322 + .unwrap_or_default(); 323 + 324 + // Include the entry owner 325 + let owner_did = match entry_uri.authority() { 326 + AtIdentifier::Did(d) => d.clone().into_static(), 327 + AtIdentifier::Handle(h) => fetcher 328 + .client 329 + .resolve_handle(h) 330 + .await 331 + .map_err(|e| WeaverError::InvalidNotebook(format!("Failed to resolve handle: {}", e)))? 332 + .into_static(), 333 + }; 334 + 335 + let all_dids: Vec<Did<'static>> = std::iter::once(owner_did) 336 + .chain(collaborators.into_iter()) 337 + .collect(); 338 + 339 + let constellation_url = Url::parse(CONSTELLATION_URL) 340 + .map_err(|e| WeaverError::InvalidNotebook(format!("Invalid constellation URL: {}", e)))?; 341 + 342 + let mut all_roots = Vec::new(); 343 + 344 + // Query for edit.root records from this DID that reference entry_uri 345 + let query = GetBacklinksQuery { 346 + subject: Uri::At(entry_uri.clone().into_static()), 347 + source: format!("{}:doc.value.entry.uri", ROOT_NSID).into(), 348 + cursor: None, 349 + did: all_dids.clone(), 350 + limit: 10, 351 + }; 352 + 353 + let response = fetcher 354 + .get_client() 355 + .xrpc(constellation_url.clone()) 356 + .send(&query) 357 + .await; 358 + 359 + if let Ok(response) = response { 360 + if let Ok(output) = response.into_output() { 361 + all_roots.extend(output.records.into_iter().map(|r| r.into_static())); 362 + } else { 363 + tracing::warn!("Failed to parse response for edit root query"); 364 + } 365 + } else { 366 + tracing::warn!("Failed to fetch edit root query"); 367 + } 368 + 369 + tracing::debug!( 370 + "find_all_edit_roots_for_entry: found {} roots across {} collaborators", 371 + all_roots.len(), 372 + all_dids.len() 373 + ); 374 + 375 + Ok(all_roots) 376 + } 377 + 181 378 /// Find the edit root for a draft using constellation backlinks. 182 379 /// 183 380 /// Queries constellation for `sh.weaver.edit.root` records that reference ··· 193 390 194 391 let query = GetBacklinksQuery { 195 392 subject: Uri::At(draft_uri.clone().into_static()), 196 - source: format!("{}:.doc.value.draft_key", ROOT_NSID).into(), 393 + source: format!("{}:doc.value.draft_key", ROOT_NSID).into(), 197 394 cursor: None, 198 395 did: vec![], 199 396 limit: 1, ··· 221 418 let rkey = if let Some(tid) = draft_key.strip_prefix("new:") { 222 419 tid.to_string() 223 420 } else if draft_key.starts_with("at://") { 224 - draft_key 225 - .split('/') 226 - .last() 227 - .unwrap_or(draft_key) 228 - .to_string() 421 + draft_key.split('/').last().unwrap_or(draft_key).to_string() 229 422 } else { 230 423 draft_key.to_string() 231 424 }; ··· 240 433 if let Some(tid) = draft_key.strip_prefix("new:") { 241 434 tid.to_string() 242 435 } else if draft_key.starts_with("at://") { 243 - draft_key 244 - .split('/') 245 - .last() 246 - .unwrap_or(draft_key) 247 - .to_string() 436 + draft_key.split('/').last().unwrap_or(draft_key).to_string() 248 437 } else { 249 438 draft_key.to_string() 250 439 } ··· 267 456 let draft_data = to_data(&draft) 268 457 .map_err(|e| WeaverError::InvalidNotebook(format!("Failed to serialize draft: {}", e)))?; 269 458 270 - let record_key = RecordKey::any(rkey) 271 - .map_err(|e| WeaverError::InvalidNotebook(e.to_string()))?; 459 + let record_key = 460 + RecordKey::any(rkey).map_err(|e| WeaverError::InvalidNotebook(e.to_string()))?; 272 461 273 462 let collection = Nsid::new(DRAFT_NSID).map_err(WeaverError::AtprotoString)?; 274 463 ··· 331 520 WeaverError::InvalidNotebook(format!("Failed to parse list records response: {}", e)) 332 521 })?; 333 522 334 - tracing::debug!("list_drafts_from_pds: found {} records", output.records.len()); 523 + tracing::debug!( 524 + "list_drafts_from_pds: found {} records", 525 + output.records.len() 526 + ); 335 527 336 528 let mut drafts = Vec::new(); 337 529 for record in output.records { ··· 344 536 tracing::debug!(" Draft record: uri={}, rkey={}", record.uri, rkey); 345 537 346 538 // Parse the draft record to get createdAt 347 - let created_at = jacquard::from_data::<weaver_api::sh_weaver::edit::draft::Draft>(&record.value) 348 - .map(|d| d.created_at.to_string()) 349 - .unwrap_or_default(); 539 + let created_at = 540 + jacquard::from_data::<weaver_api::sh_weaver::edit::draft::Draft>(&record.value) 541 + .map(|d| d.created_at.to_string()) 542 + .unwrap_or_default(); 350 543 351 544 drafts.push(RemoteDraft { 352 545 uri: record.uri.into_static(), ··· 373 566 loop { 374 567 let query = GetBacklinksQuery { 375 568 subject: Uri::At(root_uri.clone().into_static()), 376 - source: format!("{}:.root.uri", DIFF_NSID).into(), 569 + source: format!("{}:root.uri", DIFF_NSID).into(), 377 570 cursor: cursor.map(Into::into), 378 571 did: vec![], 379 572 limit: 100, ··· 733 926 load_edit_state_from_root_id(fetcher, root_id).await 734 927 } 735 928 929 + /// Load edit state from ALL collaborator repos for an entry, returning merged state. 930 + /// 931 + /// For each edit.root found across collaborators: 932 + /// - Fetches the root snapshot 933 + /// - Finds and fetches all diffs for that root 934 + /// - Merges all Loro states into one unified document 935 + /// 936 + /// Returns merged state suitable for CRDT collaboration. 937 + pub async fn load_all_edit_states_from_pds( 938 + fetcher: &Fetcher, 939 + entry_uri: &AtUri<'_>, 940 + ) -> Result<Option<PdsEditState>, WeaverError> { 941 + let all_roots = find_all_edit_roots_for_entry(fetcher, entry_uri).await?; 942 + 943 + if all_roots.is_empty() { 944 + return Ok(None); 945 + } 946 + 947 + // We'll merge all snapshots and diffs into one unified LoroDoc 948 + let merged_doc = LoroDoc::new(); 949 + let mut our_root_ref: Option<StrongRef<'static>> = None; 950 + let mut our_last_diff_ref: Option<StrongRef<'static>> = None; 951 + 952 + // Get current user's DID to identify "our" root for sync state tracking 953 + let current_did = fetcher.current_did().await; 954 + 955 + for root_id in all_roots { 956 + // Save the DID before consuming root_id 957 + let root_did = root_id.did.clone(); 958 + 959 + // Load state from this root 960 + if let Some(pds_state) = load_edit_state_from_root_id(fetcher, root_id).await? { 961 + // Import root snapshot into merged doc 962 + if let Err(e) = merged_doc.import(&pds_state.root_snapshot) { 963 + tracing::warn!("Failed to import root snapshot from {}: {:?}", root_did, e); 964 + continue; 965 + } 966 + 967 + // Import all diffs 968 + for diff in &pds_state.diff_updates { 969 + if let Err(e) = merged_doc.import(diff) { 970 + tracing::warn!("Failed to import diff from {}: {:?}", root_did, e); 971 + } 972 + } 973 + 974 + // Track "our" root/diff refs for sync state (used when syncing back) 975 + // We want to track our own edit.root so subsequent diffs go to the right place 976 + let is_our_root = current_did.as_ref().is_some_and(|did| root_did == *did); 977 + 978 + if is_our_root { 979 + // This is our own root - use it for sync state 980 + our_root_ref = Some(pds_state.root_ref); 981 + our_last_diff_ref = pds_state.last_diff_ref; 982 + } else if our_root_ref.is_none() { 983 + // We don't have our own root yet - use the first one we find 984 + // (this handles the case where we're a new collaborator with no edit state) 985 + our_root_ref = Some(pds_state.root_ref); 986 + our_last_diff_ref = pds_state.last_diff_ref; 987 + } 988 + } 989 + } 990 + 991 + // Export merged state as new snapshot 992 + let merged_snapshot = merged_doc.export(loro::ExportMode::Snapshot).map_err(|e| { 993 + WeaverError::InvalidNotebook(format!("Failed to export merged snapshot: {}", e)) 994 + })?; 995 + 996 + tracing::debug!( 997 + "load_all_edit_states_from_pds: merged document, snapshot size = {} bytes", 998 + merged_snapshot.len() 999 + ); 1000 + 1001 + // If we found any roots, return the merged state 1002 + // Note: our_root_ref might be from another collaborator if we haven't created our own yet 1003 + Ok(our_root_ref.map(|root_ref| PdsEditState { 1004 + root_ref, 1005 + last_diff_ref: our_last_diff_ref, 1006 + root_snapshot: merged_snapshot.into(), 1007 + diff_updates: vec![], // Already merged into snapshot 1008 + })) 1009 + } 1010 + 736 1011 /// Internal helper to load edit state given a root record ID. 737 1012 async fn load_edit_state_from_root_id( 738 1013 fetcher: &Fetcher, ··· 797 1072 798 1073 for diff_id in &diff_ids { 799 1074 let rkey_str: &str = diff_id.rkey.as_ref(); 800 - let diff_uri = AtUri::new(&format!( 801 - "at://{}/{}/{}", 802 - diff_id.did, 803 - DIFF_NSID, 804 - rkey_str 805 - )) 806 - .map_err(|e| WeaverError::InvalidNotebook(format!("Invalid diff URI: {}", e)))? 807 - .into_static(); 1075 + let diff_uri = AtUri::new(&format!("at://{}/{}/{}", diff_id.did, DIFF_NSID, rkey_str)) 1076 + .map_err(|e| WeaverError::InvalidNotebook(format!("Invalid diff URI: {}", e)))? 1077 + .into_static(); 808 1078 809 1079 let diff_response = fetcher 810 1080 .client ··· 878 1148 // Load snapshot + entry_ref from localStorage 879 1149 let local_data = load_snapshot_from_storage(draft_key); 880 1150 881 - // Load from PDS - try entry URI first, then draft discovery 1151 + // Load from PDS - for entries use multi-repo loading (all collaborators), 1152 + // for drafts use single-repo loading (draft sharing requires knowing the URI) 882 1153 let pds_state = if let Some(uri) = entry_uri { 883 - // Published entry: query by entry URI 884 - load_edit_state_from_pds(fetcher, uri).await? 1154 + // Published entry: load from ALL collaborators (multi-repo CRDT merge) 1155 + load_all_edit_states_from_pds(fetcher, uri).await? 885 1156 } else if let Some(did) = fetcher.current_did().await { 886 - // Unpublished draft: try to discover via draft URI 1157 + // Unpublished draft: single-repo for now 1158 + // (draft sharing would require collaborator to know the draft URI) 887 1159 let draft_uri = build_draft_uri(&did, draft_key); 888 1160 load_edit_state_from_draft(fetcher, &draft_uri).await? 889 1161 } else { 890 1162 // Not authenticated, can't query PDS 891 1163 None 892 1164 }; 1165 + 1166 + // Extract owner identity from entry URI for blob cache warming 1167 + let owner_ident: Option<String> = entry_uri.map(|uri| match uri.authority() { 1168 + AtIdentifier::Did(d) => d.as_ref().to_string(), 1169 + AtIdentifier::Handle(h) => h.as_ref().to_string(), 1170 + }); 893 1171 894 1172 match (local_data, pds_state) { 895 1173 (None, None) => Ok(None), ··· 902 1180 tracing::warn!("Failed to import local snapshot: {:?}", e); 903 1181 } 904 1182 1183 + let resolved_content = 1184 + prefetch_embeds_from_doc(&doc, fetcher, owner_ident.as_deref()).await; 1185 + 905 1186 Ok(Some(LoadedDocState { 906 1187 doc, 907 1188 entry_ref: local.entry_ref, // Restored from localStorage 908 1189 edit_root: None, 909 1190 last_diff: None, 910 1191 synced_version: None, // Local-only, never synced to PDS 1192 + resolved_content, 911 1193 })) 912 1194 } 913 1195 ··· 931 1213 // Capture the version after loading all PDS state - this is our sync baseline 932 1214 let synced_version = Some(doc.oplog_vv()); 933 1215 1216 + let resolved_content = 1217 + prefetch_embeds_from_doc(&doc, fetcher, owner_ident.as_deref()).await; 1218 + 934 1219 Ok(Some(LoadedDocState { 935 1220 doc, 936 1221 entry_ref: None, // Entry ref comes from the entry itself, not edit state 937 1222 edit_root: Some(pds.root_ref), 938 1223 last_diff: pds.last_diff_ref, 939 1224 synced_version, // Just loaded from PDS, fully synced 1225 + resolved_content, 940 1226 })) 941 1227 } 942 1228 ··· 978 1264 979 1265 // Use the PDS version as our sync baseline - any local changes 980 1266 // beyond this will be detected as unsynced 1267 + let resolved_content = 1268 + prefetch_embeds_from_doc(&doc, fetcher, owner_ident.as_deref()).await; 1269 + 981 1270 Ok(Some(LoadedDocState { 982 1271 doc, 983 1272 entry_ref: local.entry_ref, // Restored from localStorage 984 1273 edit_root: Some(pds.root_ref), 985 1274 last_diff: pds.last_diff_ref, 986 1275 synced_version: Some(pds_version), 1276 + resolved_content, 987 1277 })) 988 1278 } 989 1279 } ··· 1005 1295 Syncing, 1006 1296 /// Has local changes not yet synced 1007 1297 Unsynced, 1298 + /// Remote collaborator changes available 1299 + RemoteChanges, 1008 1300 /// Last sync failed 1009 1301 Error, 1010 1302 /// Not authenticated or sync disabled ··· 1021 1313 /// Auto-sync interval in milliseconds (0 to disable) 1022 1314 #[props(default = 30_000)] 1023 1315 pub auto_sync_interval_ms: u32, 1316 + /// Callback to refresh/reload document from collaborators 1317 + #[props(default)] 1318 + pub on_refresh: Option<EventHandler<()>>, 1319 + /// Whether this is a collaborative document (has collaborators) 1320 + #[props(default = false)] 1321 + pub is_collaborative: bool, 1024 1322 } 1025 1323 1026 1324 /// Sync status indicator with auto-sync functionality. ··· 1050 1348 // Auto-sync trigger signal - set to true to trigger a sync 1051 1349 let mut trigger_sync = use_signal(|| false); 1052 1350 1053 - // Auto-sync timer (WASM only) - just sets the trigger, doesn't access signals directly 1054 - #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] 1351 + // Auto-sync timer - triggers sync when there are unsynced changes 1055 1352 { 1056 - let auto_sync_interval = props.auto_sync_interval_ms; 1353 + let auto_sync_interval_ms = props.auto_sync_interval_ms; 1057 1354 let doc_for_check = doc.clone(); 1058 1355 1059 - use_effect(move || { 1060 - if auto_sync_interval == 0 { 1356 + dioxus_sdk::time::use_interval( 1357 + std::time::Duration::from_millis(auto_sync_interval_ms as u64), 1358 + move |_| { 1359 + if auto_sync_interval_ms == 0 { 1360 + return; 1361 + } 1362 + // Only trigger if there are unsynced changes 1363 + if doc_for_check.has_unsynced_changes() { 1364 + trigger_sync.set(true); 1365 + } 1366 + }, 1367 + ); 1368 + } 1369 + 1370 + // Collaborator poll timer - checks for collaborator updates periodically 1371 + // For collaborative documents, poll every 60s 1372 + // - If user has been idle ≥30s: auto-trigger refresh 1373 + // - If user is actively editing: show RemoteChanges state 1374 + { 1375 + let is_collaborative = props.is_collaborative; 1376 + let on_refresh = props.on_refresh.clone(); 1377 + let doc_for_idle = doc.clone(); 1378 + 1379 + dioxus_sdk::time::use_interval(std::time::Duration::from_secs(60), move |_| { 1380 + if !is_collaborative { 1061 1381 return; 1062 1382 } 1063 1383 1064 - let doc = doc_for_check.clone(); 1384 + let idle_threshold = std::time::Duration::from_secs(30); 1065 1385 1066 - let interval = gloo_timers::callback::Interval::new(auto_sync_interval, move || { 1067 - // Only trigger if there are unsynced changes and we're not already syncing 1068 - if doc.has_unsynced_changes() { 1069 - // This just sets a signal - the actual sync happens in use_future below 1070 - trigger_sync.set(true); 1071 - } 1072 - }); 1386 + // Check time since last edit 1387 + let is_idle = match doc_for_idle.last_edit() { 1388 + Some(edit_info) => edit_info.timestamp.elapsed() >= idle_threshold, 1389 + None => true, // No edits yet = idle 1390 + }; 1073 1391 1074 - interval.forget(); 1392 + if is_idle { 1393 + // User is idle - safe to auto-refresh 1394 + if let Some(ref handler) = on_refresh { 1395 + handler.call(()); 1396 + } 1397 + } else { 1398 + // User is actively editing - show remote changes indicator 1399 + sync_state.set(SyncState::RemoteChanges); 1400 + } 1075 1401 }); 1076 1402 } 1077 - 1078 - #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] 1079 - let mut trigger_sync = use_signal(|| false); 1080 1403 1081 1404 // Update sync state when document changes 1082 1405 // Note: We use peek() to avoid creating a reactive dependency on sync_state ··· 1157 1480 }); 1158 1481 }); 1159 1482 1160 - // Manual sync handler - just sets the trigger if there are changes 1161 - let doc_for_manual = doc.clone(); 1162 - let on_manual_sync = move |_| { 1163 - if *sync_state.peek() == SyncState::Syncing { 1164 - return; // Already syncing 1165 - } 1166 - if !doc_for_manual.has_unsynced_changes() { 1167 - // Already synced 1168 - sync_state.set(SyncState::Synced); 1169 - return; 1170 - } 1171 - trigger_sync.set(true); 1172 - }; 1173 - 1174 1483 // Determine display state (drafts can sync too via DraftRef) 1175 1484 let display_state = if !is_authenticated { 1176 1485 SyncState::Disabled ··· 1182 1491 SyncState::Synced => ("✓", "Synced", "sync-status synced"), 1183 1492 SyncState::Syncing => ("◌", "Syncing...", "sync-status syncing"), 1184 1493 SyncState::Unsynced => ("●", "Unsynced", "sync-status unsynced"), 1494 + SyncState::RemoteChanges => ("↓", "Updates", "sync-status remote-changes"), 1185 1495 SyncState::Error => ("✕", "Sync error", "sync-status error"), 1186 1496 SyncState::Disabled => ("○", "Sync disabled", "sync-status disabled"), 1187 1497 }; 1188 1498 1499 + // Combined sync handler - pulls remote changes first if needed, then pushes local 1500 + let doc_for_sync = doc.clone(); 1501 + let on_sync_click = { 1502 + let on_refresh = props.on_refresh.clone(); 1503 + let current_state = display_state; 1504 + move |_: dioxus::events::MouseEvent| { 1505 + if *sync_state.peek() == SyncState::Syncing { 1506 + return; // Already syncing 1507 + } 1508 + // If there are remote changes, pull them first 1509 + if current_state == SyncState::RemoteChanges { 1510 + if let Some(ref handler) = on_refresh { 1511 + handler.call(()); 1512 + } 1513 + } 1514 + // Trigger sync if there are local changes 1515 + if doc_for_sync.has_unsynced_changes() { 1516 + trigger_sync.set(true); 1517 + } else if current_state != SyncState::RemoteChanges { 1518 + sync_state.set(SyncState::Synced); 1519 + } 1520 + } 1521 + }; 1522 + 1189 1523 rsx! { 1190 1524 div { 1191 1525 class: "{class}", 1192 1526 title: if let Some(ref err) = *last_error.read() { err.clone() } else { label.to_string() }, 1193 - onclick: on_manual_sync, 1527 + onclick: on_sync_click, 1194 1528 1195 1529 span { class: "sync-icon", "{icon}" } 1196 1530 span { class: "sync-label", "{label}" }
+2
crates/weaver-app/src/components/editor/writer.rs
··· 6 6 //! Uses Parser::into_offset_iter() to track gaps between events, which 7 7 //! represent consumed formatting characters. 8 8 9 + use crate::data::cache_blob; 10 + 9 11 use super::offset_map::{OffsetMapping, RenderResult}; 10 12 use jacquard::types::{ident::AtIdentifier, string::Rkey}; 11 13 use loro::LoroText;
+7 -6
crates/weaver-app/src/components/entry.rs
··· 3 3 use crate::Route; 4 4 #[cfg(feature = "server")] 5 5 use crate::blobcache::BlobCache; 6 - use crate::{ 7 - components::EntryActions, 8 - data::use_handle, 9 - }; 6 + use crate::{components::EntryActions, data::use_handle}; 10 7 use dioxus::prelude::*; 11 8 use jacquard::types::aturi::AtUri; 12 9 use jacquard::{IntoStatic, types::string::Handle}; ··· 577 574 let formatted_date = entry.created_at.as_ref().format("%B %d, %Y").to_string(); 578 575 579 576 // Get first author if we're showing it 580 - let first_author = if show_author { entry_view.authors.first() } else { None }; 577 + let first_author = if show_author { 578 + entry_view.authors.first() 579 + } else { 580 + None 581 + }; 581 582 582 583 // Check edit access via permissions 583 584 let auth_state = use_context::<Signal<AuthState>>(); ··· 771 772 if !entry_view.authors.is_empty() { 772 773 div { class: "entry-authors", 773 774 for (i, author) in entry_view.authors.iter().enumerate() { 774 - if i > 0 { span { ", " } } 775 + if i > 0 { span { " " } } 775 776 { 776 777 use weaver_api::sh_weaver::actor::ProfileDataViewInner; 777 778
+29 -17
crates/weaver-app/src/data.rs
··· 126 126 let (_book_entry_view, entry_record) = (&entry.0, &entry.1); 127 127 if let Some(embeds) = &entry_record.embeds { 128 128 if let Some(images) = &embeds.images { 129 - #[cfg(all( 130 - target_family = "wasm", 131 - target_os = "unknown", 132 - not(feature = "fullstack-server") 133 - ))] 129 + #[cfg(all(target_family = "wasm", target_os = "unknown",))] 134 130 { 135 131 let _ = crate::service_worker::register_entry_blobs( 136 132 &ident(), ··· 899 895 use jacquard::types::aturi::AtUri; 900 896 // Extract ident from the entry's at-uri 901 897 if let Ok(at_uri) = AtUri::new(view.uri.as_ref()) { 902 - let ident = at_uri.authority().to_smolstr(); 898 + let ident = at_uri.authority(); 903 899 for image in &images.images { 904 900 let cid = image.image.blob().cid(); 905 901 cache_blob( 906 - ident.clone(), 902 + ident.clone().to_smolstr(), 907 903 cid.to_smolstr(), 908 904 image.name.as_ref().map(|n| n.to_smolstr()), 909 905 ) 910 906 .await 911 907 .ok(); 908 + } 909 + #[cfg(all(target_family = "wasm", target_os = "unknown",))] 910 + { 911 + tracing::info!("Registering standalone entry blobs"); 912 + let _ = 913 + crate::service_worker::register_standalone_entry_blobs( 914 + &ident, 915 + at_uri.rkey().unwrap().0.as_str(), 916 + images, 917 + &fetcher, 918 + ) 919 + .await; 912 920 } 913 921 } 914 922 } ··· 1205 1213 /// - `None` if the user is not authenticated or permissions not yet loaded 1206 1214 /// 1207 1215 /// This checks the ACL-based permissions (who CAN edit), not authors (who contributed). 1208 - pub fn use_can_edit( 1209 - permissions: Memo<Option<PermissionsState<'static>>>, 1210 - ) -> Memo<Option<bool>> { 1216 + pub fn use_can_edit(permissions: Memo<Option<PermissionsState<'static>>>) -> Memo<Option<bool>> { 1211 1217 let auth_state = use_context::<Signal<AuthState>>(); 1212 1218 1213 1219 use_memo(move || { ··· 1215 1221 let perms = permissions()?; 1216 1222 1217 1223 // Check if current user's DID is in the editors list 1218 - let can_edit = perms 1219 - .editors 1220 - .iter() 1221 - .any(|grant| grant.did == current_did); 1224 + let can_edit = perms.editors.iter().any(|grant| grant.did == current_did); 1222 1225 1223 1226 Some(can_edit) 1224 1227 }) ··· 1250 1253 /// 1251 1254 /// This performs an async check that queries Constellation for collaboration records. 1252 1255 /// Use this when you have a resource URI but not the pre-populated authors list. 1253 - pub fn use_can_edit_resource( 1254 - resource_uri: ReadSignal<AtUri<'static>>, 1255 - ) -> Resource<Option<bool>> { 1256 + pub fn use_can_edit_resource(resource_uri: ReadSignal<AtUri<'static>>) -> Resource<Option<bool>> { 1256 1257 let auth_state = use_context::<Signal<AuthState>>(); 1257 1258 let fetcher = use_context::<crate::fetch::Fetcher>(); 1258 1259 ··· 1316 1317 use jacquard::types::aturi::AtUri; 1317 1318 if let Ok(at_uri) = AtUri::new(data.entry_view.uri.as_ref()) { 1318 1319 let ident_str = at_uri.authority().to_smolstr(); 1320 + #[cfg(all(target_family = "wasm", target_os = "unknown"))] 1321 + { 1322 + tracing::debug!("Registering standalone entry blobs"); 1323 + let _ = crate::service_worker::register_standalone_entry_blobs( 1324 + &ident(), 1325 + rkey().as_str(), 1326 + images, 1327 + &fetcher, 1328 + ) 1329 + .await; 1330 + } 1319 1331 for image in &images.images { 1320 1332 let cid = image.image.blob().cid(); 1321 1333 cache_blob(
+15 -18
crates/weaver-app/src/main.rs
··· 105 105 const FAVICON: Asset = asset!("/assets/weaver_photo_sm.jpg"); 106 106 const MAIN_CSS: Asset = asset!("/assets/styling/main.css"); 107 107 108 - #[cfg(not(feature = "fullstack-server"))] 109 - #[cfg(feature = "server")] 110 - async fn serve_sw() -> impl axum::response::IntoResponse { 111 - use axum::response::IntoResponse; 112 - let sw_js = include_str!("../assets/sw.js"); 113 - ( 114 - [(axum::http::header::CONTENT_TYPE, "application/javascript")], 115 - sw_js, 116 - ) 117 - .into_response() 118 - } 108 + // #[cfg(all(feature = "fullstack-server", feature = "server"))] 109 + // async fn serve_sw() -> axum::response::Response { 110 + // use axum::response::IntoResponse; 111 + // let sw_js = include_bytes!("../public/sw.js"); 112 + // ( 113 + // [(axum::http::header::CONTENT_TYPE, "application/javascript")], 114 + // sw_js, 115 + // ) 116 + // .into_response() 117 + // } 119 118 120 119 pub static CONFIG: LazyLock<Config> = LazyLock::new(|| Config { 121 120 oauth: OAuthConfig::from_env().as_metadata(), ··· 188 187 let blob_cache = Arc::new(BlobCache::new(fetcher.clone())); 189 188 axum::Router::new() 190 189 .route("/favicon.ico", get(favicon)) 190 + //.route("/sw.js", get(serve_sw)) 191 191 // Server side render the application, serve static assets, and register server functions 192 192 .serve_dioxus_application( 193 193 ServeConfig::builder(), // Enable incremental rendering ··· 264 264 #[cfg(not(all(target_family = "wasm", target_os = "unknown")))] 265 265 let restore_result: Option<auth::RestoreResult> = None; 266 266 267 - #[cfg(all( 268 - target_family = "wasm", 269 - target_os = "unknown", 270 - not(feature = "fullstack-server") 271 - ))] 267 + #[cfg(all(target_family = "wasm", target_os = "unknown",))] 272 268 { 273 269 use_effect(move || { 274 270 let fetcher = fetcher.clone(); ··· 325 321 #[cfg(all(feature = "fullstack-server", feature = "server"))] 326 322 pub async fn favicon() -> axum::response::Response { 327 323 use axum::{http::header::CONTENT_TYPE, response::IntoResponse}; 328 - let bytes = include_bytes!("../assets/weaver_photo_sm.jpg"); 329 - ([(CONTENT_TYPE, "image/jpg")], bytes).into_response() 324 + let favicon_bytes = include_bytes!("../assets/weaver_photo_sm.jpg"); 325 + 326 + ([(CONTENT_TYPE, "image/jpg")], favicon_bytes).into_response() 330 327 } 331 328 332 329 // #[server(endpoint = "static_routes", output = server_fn::codec::Json)]
+88
crates/weaver-app/src/service_worker.rs
··· 74 74 Ok(()) 75 75 } 76 76 77 + /// Register blob mappings from entry images with the service worker 78 + #[cfg(all(target_family = "wasm", target_os = "unknown"))] 79 + pub async fn register_standalone_entry_blobs( 80 + ident: &jacquard::types::ident::AtIdentifier<'_>, 81 + rkey: &str, 82 + images: &weaver_api::sh_weaver::embed::images::Images<'_>, 83 + fetcher: &crate::fetch::Fetcher, 84 + ) -> Result<(), JsValue> { 85 + use jacquard::prelude::IdentityResolver; 86 + use std::collections::HashMap; 87 + 88 + tracing::debug!("registering blobs for {}", rkey); 89 + let mut blob_mappings = HashMap::new(); 90 + 91 + // Resolve DID and PDS URL 92 + let (did, pds_url) = match ident { 93 + jacquard::types::ident::AtIdentifier::Did(d) => { 94 + let pds = fetcher.client.pds_for_did(d).await.ok(); 95 + (d.clone(), pds) 96 + } 97 + jacquard::types::ident::AtIdentifier::Handle(h) => { 98 + if let Ok((did, pds)) = fetcher.client.pds_for_handle(h).await { 99 + (did, Some(pds)) 100 + } else { 101 + return Ok(()); 102 + } 103 + } 104 + }; 105 + 106 + if let Some(pds_url) = pds_url { 107 + for image in &images.images { 108 + let cid = image.image.blob().cid(); 109 + 110 + if let Some(name) = &image.name { 111 + let blob_url = format!( 112 + "{}xrpc/com.atproto.sync.getBlob?did={}&cid={}", 113 + pds_url.as_str(), 114 + did.as_ref(), 115 + cid.as_ref() 116 + ); 117 + blob_mappings.insert(name.as_ref().to_string(), blob_url); 118 + } 119 + } 120 + } 121 + 122 + // Send mappings to service worker 123 + if !blob_mappings.is_empty() { 124 + send_blob_rkey_mappings(rkey, ident.as_str(), blob_mappings)?; 125 + } 126 + //} 127 + 128 + Ok(()) 129 + } 130 + 77 131 #[cfg(all(target_family = "wasm", target_os = "unknown"))] 78 132 fn send_blob_mappings( 79 133 notebook: &str, ··· 102 156 103 157 controller.post_message(&msg)?; 104 158 tracing::debug!("sent blob mappings for {}", notebook); 159 + 160 + Ok(()) 161 + } 162 + 163 + #[cfg(all(target_family = "wasm", target_os = "unknown"))] 164 + fn send_blob_rkey_mappings( 165 + rkey: &str, 166 + ident: &str, 167 + mappings: std::collections::HashMap<String, String>, 168 + ) -> Result<(), JsValue> { 169 + let window = web_sys::window().ok_or_else(|| JsValue::from_str("no window"))?; 170 + let navigator = window.navigator(); 171 + let sw_container = navigator.service_worker(); 172 + 173 + tracing::debug!("sending blob mappings for {}", rkey); 174 + let controller = sw_container 175 + .controller() 176 + .ok_or_else(|| JsValue::from_str("no service worker controller"))?; 177 + 178 + // Build message object 179 + let msg = js_sys::Object::new(); 180 + js_sys::Reflect::set(&msg, &"type".into(), &"register_rkey_mappings".into())?; 181 + js_sys::Reflect::set(&msg, &"rkey".into(), &rkey.into())?; 182 + js_sys::Reflect::set(&msg, &"ident".into(), &ident.into())?; 183 + 184 + // Convert HashMap to JS Object 185 + let blobs_obj = js_sys::Object::new(); 186 + for (name, url) in mappings { 187 + js_sys::Reflect::set(&blobs_obj, &name.into(), &url.into())?; 188 + } 189 + js_sys::Reflect::set(&msg, &"blobs".into(), &blobs_obj)?; 190 + 191 + controller.post_message(&msg)?; 192 + tracing::debug!("sent blob mappings for {}", rkey); 105 193 106 194 Ok(()) 107 195 }
+197 -171
crates/weaver-common/src/agent.rs
··· 1 - use weaver_api::app_bsky::actor::get_profile::GetProfile; 2 1 // Re-export view types for use elsewhere 3 2 pub use weaver_api::sh_weaver::notebook::{ 4 3 AuthorListView, BookEntryRef, BookEntryView, EntryView, NotebookView, PermissionGrant, ··· 18 17 use jacquard::types::tid::Tid; 19 18 use jacquard::types::uri::Uri; 20 19 use jacquard::url::Url; 21 - use jacquard::xrpc::Response; 22 - use jacquard::{CowStr, IntoStatic, xrpc}; 20 + use jacquard::{CowStr, IntoStatic}; 23 21 use mime_sniffer::MimeTypeSniffer; 24 22 use std::path::Path; 25 - use weaver_api::com_atproto::repo::get_record::GetRecordResponse; 26 23 use weaver_api::com_atproto::repo::strong_ref::StrongRef; 27 24 use weaver_api::sh_weaver::notebook::entry; 28 25 use weaver_api::sh_weaver::publish::blob::Blob as PublishedBlob; ··· 67 64 /// - `agent.upload_blob()` - Upload a single blob 68 65 /// 69 66 /// This trait is for multi-step workflows that coordinate between multiple operations. 70 - //#[cfg_attr(not(target_arch = "wasm32"), trait_variant::make(Send))] 71 67 pub trait WeaverExt: AgentSessionExt + XrpcExt + Send + Sync + Sized { 72 68 /// Publish a blob to the user's PDS 73 69 /// ··· 112 108 uri: &'a AtUri<'a>, 113 109 ) -> impl Future<Output = Result<StrongRef<'static>, WeaverError>> + 'a { 114 110 async move { 115 - let rkey = uri.rkey().ok_or_else(|| { 116 - AgentError::from( 117 - ClientError::invalid_request("AtUri missing rkey") 118 - .with_help("ensure the URI includes a record key after the collection"), 119 - ) 111 + let record = self.fetch_record_slingshot(uri).await?; 112 + let cid = record.cid.ok_or_else(|| { 113 + AgentError::from(ClientError::invalid_request("Record missing CID")) 120 114 })?; 121 - 122 - // Resolve authority (DID or handle) to get DID and PDS 123 - use jacquard::types::ident::AtIdentifier; 124 - let (repo_did, pds_url) = match uri.authority() { 125 - AtIdentifier::Did(did) => { 126 - let pds = 127 - self.pds_for_did(did).await.map_err(|e| { 128 - AgentError::from(ClientError::from(e).with_context( 129 - "DID document resolution failed during record retrieval", 130 - )) 131 - })?; 132 - (did.clone(), pds) 133 - } 134 - AtIdentifier::Handle(handle) => self.pds_for_handle(handle).await.map_err(|e| { 135 - AgentError::from( 136 - ClientError::from(e) 137 - .with_context("handle resolution failed during record retrieval"), 138 - ) 139 - })?, 140 - }; 141 - 142 - // Make stateless XRPC call to that PDS (no auth required for public records) 143 - use weaver_api::com_atproto::repo::get_record::GetRecord; 144 - let request = GetRecord::new() 145 - .repo(AtIdentifier::Did(repo_did)) 146 - .collection( 147 - uri.collection() 148 - .expect("collection should exist if rkey does") 149 - .clone(), 150 - ) 151 - .rkey(rkey.clone()) 152 - .build(); 153 - 154 - let response: Response<GetRecordResponse> = { 155 - let http_request = xrpc::build_http_request(&pds_url, &request, &self.opts().await) 156 - .map_err(|e| AgentError::from(ClientError::transport(e)))?; 157 - 158 - let http_response = self 159 - .send_http(http_request) 160 - .await 161 - .map_err(|e| AgentError::from(ClientError::transport(e)))?; 162 - 163 - xrpc::process_response(http_response) 164 - } 165 - .map_err(|e| AgentError::new(AgentErrorKind::Client, Some(e.into())))?; 166 - let record = response.parse().map_err(|e| AgentError::xrpc(e))?; 167 - let strong_ref = StrongRef::new() 168 - .uri(record.uri) 169 - .cid(record.cid.expect("when does this NOT have a CID?")) 170 - .build(); 171 - Ok(strong_ref.into_static()) 115 + Ok(StrongRef::new() 116 + .uri(record.uri.into_static()) 117 + .cid(cid.into_static()) 118 + .build()) 172 119 } 173 120 } 174 121 ··· 504 451 505 452 let entry_uri = Entry::uri(entry_ref.uri.clone()) 506 453 .map_err(|_| AgentError::from(ClientError::invalid_request("Invalid entry URI")))?; 507 - let entry = self.fetch_record(&entry_uri).await?; 508 454 509 - let title = entry.value.title.clone(); 510 - let path = entry.value.path.clone(); 511 - let tags = entry.value.tags.clone(); 455 + // Get the rkey for version lookup 456 + let rkey = entry_uri.rkey().ok_or_else(|| { 457 + AgentError::from(ClientError::invalid_request("Entry URI missing rkey")) 458 + })?; 512 459 513 460 // Fetch permissions for this entry (includes inherited notebook permissions) 514 461 let permissions = self.get_permissions_for_resource(&entry_uri).await?; 515 462 463 + // Get all collaborators (owner + invited) 464 + let owner_did = match entry_uri.authority() { 465 + jacquard::types::ident::AtIdentifier::Did(d) => d.clone().into_static(), 466 + jacquard::types::ident::AtIdentifier::Handle(h) => { 467 + let (did, _) = self.pds_for_handle(h).await.map_err(|e| { 468 + AgentError::from( 469 + ClientError::from(e).with_context("Failed to resolve handle"), 470 + ) 471 + })?; 472 + did.into_static() 473 + } 474 + }; 475 + let collaborators = self 476 + .find_collaborators_for_resource(&entry_uri) 477 + .await 478 + .unwrap_or_default(); 479 + let all_dids: Vec<Did<'static>> = std::iter::once(owner_did) 480 + .chain(collaborators.into_iter()) 481 + .collect(); 482 + 483 + // Find all versions across collaborators, get latest by updatedAt 484 + let versions = self 485 + .find_all_versions( 486 + <Entry as jacquard::types::collection::Collection>::NSID, 487 + rkey.0.as_str(), 488 + &all_dids, 489 + ) 490 + .await 491 + .unwrap_or_default(); 492 + 493 + // Use latest version if found, otherwise fall back to original entry_ref 494 + let (entry_data, final_uri, final_cid) = if let Some(latest) = versions.first() { 495 + // Deserialize from the latest version's value 496 + let entry: Entry = jacquard::from_data(&latest.value).map_err(|_| { 497 + AgentError::from(ClientError::invalid_request( 498 + "Failed to deserialize latest entry", 499 + )) 500 + })?; 501 + (entry.into_static(), latest.uri.clone(), latest.cid.clone()) 502 + } else { 503 + // No versions found via find_all_versions, fetch directly 504 + let entry = self.fetch_record(&entry_uri).await?; 505 + let cid = entry.cid.ok_or_else(|| { 506 + AgentError::from(ClientError::invalid_request("Entry missing CID")) 507 + })?; 508 + ( 509 + entry.value.into_static(), 510 + entry.uri.into_static(), 511 + cid.into_static(), 512 + ) 513 + }; 514 + 515 + let title = entry_data.title.clone(); 516 + let path = entry_data.path.clone(); 517 + let tags = entry_data.tags.clone(); 518 + 516 519 // Fetch contributors (evidence-based authors) for this entry 517 520 let contributor_dids = self.find_contributors_for_resource(&entry_uri).await?; 518 521 let mut authors = Vec::new(); ··· 528 531 } 529 532 530 533 Ok(EntryView::new() 531 - .cid(entry.cid.ok_or_else(|| { 532 - AgentError::from(ClientError::invalid_request("Entry missing CID")) 533 - })?) 534 - .uri(entry.uri) 534 + .cid(final_cid) 535 + .uri(final_uri) 535 536 .indexed_at(jacquard::types::string::Datetime::now()) 536 - .record(to_data(&entry.value).map_err(|_| { 537 + .record(to_data(&entry_data).map_err(|_| { 537 538 AgentError::from(ClientError::invalid_request("Failed to serialize entry")) 538 539 })?) 539 540 .maybe_tags(tags) ··· 975 976 use jacquard::to_data; 976 977 use weaver_api::sh_weaver::notebook::page::Page; 977 978 978 - let entry_uri = Page::uri(entry_ref.uri.clone()) 979 + let page_uri = Page::uri(entry_ref.uri.clone()) 979 980 .map_err(|_| AgentError::from(ClientError::invalid_request("Invalid page URI")))?; 980 - let entry = self.fetch_record(&entry_uri).await?; 981 981 982 - let title = entry.value.title.clone(); 983 - let tags = entry.value.tags.clone(); 982 + // Get the rkey for version lookup 983 + let rkey = page_uri.rkey().ok_or_else(|| { 984 + AgentError::from(ClientError::invalid_request("Page URI missing rkey")) 985 + })?; 984 986 985 987 // Fetch permissions for this page (includes inherited notebook permissions) 986 - let permissions = self.get_permissions_for_resource(&entry_uri).await?; 988 + let permissions = self.get_permissions_for_resource(&page_uri).await?; 989 + 990 + // Get all collaborators (owner + invited) 991 + let owner_did = match page_uri.authority() { 992 + jacquard::types::ident::AtIdentifier::Did(d) => d.clone().into_static(), 993 + jacquard::types::ident::AtIdentifier::Handle(h) => { 994 + let (did, _) = self.pds_for_handle(h).await.map_err(|e| { 995 + AgentError::from( 996 + ClientError::from(e).with_context("Failed to resolve handle"), 997 + ) 998 + })?; 999 + did.into_static() 1000 + } 1001 + }; 1002 + let collaborators = self 1003 + .find_collaborators_for_resource(&page_uri) 1004 + .await 1005 + .unwrap_or_default(); 1006 + let all_dids: Vec<Did<'static>> = std::iter::once(owner_did) 1007 + .chain(collaborators.into_iter()) 1008 + .collect(); 1009 + 1010 + // Find all versions across collaborators, get latest by updatedAt 1011 + let versions = self 1012 + .find_all_versions( 1013 + <Page as jacquard::types::collection::Collection>::NSID, 1014 + rkey.0.as_str(), 1015 + &all_dids, 1016 + ) 1017 + .await 1018 + .unwrap_or_default(); 1019 + 1020 + // Use latest version if found, otherwise fall back to direct fetch 1021 + let (page_data, final_uri, final_cid) = if let Some(latest) = versions.first() { 1022 + let page: Page = jacquard::from_data(&latest.value).map_err(|_| { 1023 + AgentError::from(ClientError::invalid_request( 1024 + "Failed to deserialize latest page", 1025 + )) 1026 + })?; 1027 + (page.into_static(), latest.uri.clone(), latest.cid.clone()) 1028 + } else { 1029 + // No versions found, fetch directly from PDS 1030 + let page = self.fetch_record(&page_uri).await?; 1031 + let cid = page.cid.ok_or_else(|| { 1032 + AgentError::from(ClientError::invalid_request("Page missing CID")) 1033 + })?; 1034 + ( 1035 + page.value.into_static(), 1036 + page.uri.into_static(), 1037 + cid.into_static(), 1038 + ) 1039 + }; 1040 + 1041 + let title = page_data.title.clone(); 1042 + let tags = page_data.tags.clone(); 987 1043 988 1044 // Fetch contributors (evidence-based authors) for this page 989 - let contributor_dids = self.find_contributors_for_resource(&entry_uri).await?; 1045 + let contributor_dids = self.find_contributors_for_resource(&page_uri).await?; 990 1046 let mut authors = Vec::new(); 991 1047 for (index, did) in contributor_dids.iter().enumerate() { 992 1048 let (profile_uri, profile_view) = self.hydrate_profile_view(did).await?; ··· 1000 1056 } 1001 1057 1002 1058 Ok(EntryView::new() 1003 - .cid(entry.cid.ok_or_else(|| { 1004 - AgentError::from(ClientError::invalid_request("Page missing CID")) 1005 - })?) 1006 - .uri(entry.uri) 1059 + .cid(final_cid) 1060 + .uri(final_uri) 1007 1061 .indexed_at(jacquard::types::string::Datetime::now()) 1008 - .record(to_data(&entry.value).map_err(|_| { 1062 + .record(to_data(&page_data).map_err(|_| { 1009 1063 AgentError::from(ClientError::invalid_request("Failed to serialize page")) 1010 1064 })?) 1011 1065 .maybe_tags(tags) ··· 1102 1156 async move { 1103 1157 use jacquard::to_data; 1104 1158 use jacquard::types::collection::Collection; 1105 - use weaver_api::com_atproto::repo::get_record::GetRecord; 1106 1159 1107 - // Resolve DID and PDS from ident 1108 - let (repo_did, pds_url) = match ident { 1109 - jacquard::types::ident::AtIdentifier::Did(did) => { 1110 - let pds = self.pds_for_did(did).await.map_err(|e| { 1111 - AgentError::from( 1112 - ClientError::from(e).with_context("Failed to resolve PDS for DID"), 1113 - ) 1114 - })?; 1115 - (did.clone(), pds) 1116 - } 1160 + // Resolve DID from ident 1161 + let repo_did = match ident { 1162 + jacquard::types::ident::AtIdentifier::Did(did) => did.clone(), 1117 1163 jacquard::types::ident::AtIdentifier::Handle(handle) => { 1118 - self.pds_for_handle(handle).await.map_err(|e| { 1164 + let (did, _pds) = self.pds_for_handle(handle).await.map_err(|e| { 1119 1165 AgentError::from( 1120 1166 ClientError::from(e).with_context("Failed to resolve handle"), 1121 1167 ) 1122 - })? 1168 + })?; 1169 + did 1123 1170 } 1124 1171 }; 1125 1172 1126 - // Fetch the entry record 1127 - let request = GetRecord::new() 1128 - .repo(jacquard::types::ident::AtIdentifier::Did(repo_did.clone())) 1129 - .collection(jacquard::types::nsid::Nsid::raw(entry::Entry::NSID)) 1130 - .rkey(RecordKey::any(rkey)?) 1131 - .build(); 1173 + // Build entry URI for contributor/permission queries 1174 + let entry_uri_str = format!("at://{}/{}/{}", repo_did, entry::Entry::NSID, rkey); 1175 + let entry_uri = AtUri::new(&entry_uri_str) 1176 + .map_err(|_| AgentError::from(ClientError::invalid_request("Invalid entry URI")))? 1177 + .into_static(); 1132 1178 1133 - let response: Response<GetRecordResponse> = { 1134 - let http_request = xrpc::build_http_request(&pds_url, &request, &self.opts().await) 1135 - .map_err(|e| AgentError::from(ClientError::transport(e)))?; 1179 + // Get collaborators for version lookup 1180 + let collaborators = self 1181 + .find_collaborators_for_resource(&entry_uri) 1182 + .await 1183 + .unwrap_or_default(); 1184 + let all_dids: Vec<Did<'static>> = std::iter::once(repo_did.clone().into_static()) 1185 + .chain(collaborators.into_iter()) 1186 + .collect(); 1136 1187 1137 - let http_response = self 1138 - .send_http(http_request) 1139 - .await 1140 - .map_err(|e| AgentError::from(ClientError::transport(e)))?; 1188 + // Find all versions across collaborators, get latest by updatedAt 1189 + let versions = self 1190 + .find_all_versions(entry::Entry::NSID, rkey, &all_dids) 1191 + .await 1192 + .unwrap_or_default(); 1141 1193 1142 - xrpc::process_response(http_response) 1143 - } 1144 - .map_err(|e| AgentError::new(AgentErrorKind::Client, Some(e.into())))?; 1194 + // Use latest version if found, otherwise fetch directly from original ident 1195 + let (entry_value, final_uri, final_cid) = if let Some(latest) = versions.first() { 1196 + let entry: entry::Entry = jacquard::from_data(&latest.value).map_err(|e| { 1197 + AgentError::from(ClientError::invalid_request(format!( 1198 + "Failed to deserialize latest entry: {}", 1199 + e 1200 + ))) 1201 + })?; 1202 + (entry.into_static(), latest.uri.clone(), latest.cid.clone()) 1203 + } else { 1204 + // Fallback: fetch directly via slingshot 1205 + let record = self.fetch_record_slingshot(&entry_uri).await?; 1145 1206 1146 - let record = response.into_output().map_err(|e| { 1147 - AgentError::from(ClientError::invalid_request(format!( 1148 - "Failed to parse entry record: {}", 1149 - e 1150 - ))) 1151 - })?; 1207 + let entry: entry::Entry = jacquard::from_data(&record.value).map_err(|e| { 1208 + AgentError::from(ClientError::invalid_request(format!( 1209 + "Failed to deserialize entry: {}", 1210 + e 1211 + ))) 1212 + })?; 1152 1213 1153 - // Parse the entry value 1154 - let entry_value: entry::Entry = jacquard::from_data(&record.value).map_err(|e| { 1155 - AgentError::from(ClientError::invalid_request(format!( 1156 - "Failed to deserialize entry: {}", 1157 - e 1158 - ))) 1159 - })?; 1214 + let cid = record.cid.ok_or_else(|| { 1215 + AgentError::from(ClientError::invalid_request("Entry missing CID")) 1216 + })?; 1160 1217 1161 - // Build entry URI for contributor/permission queries 1162 - let entry_uri = entry::Entry::uri(record.uri.clone()) 1163 - .map_err(|_| AgentError::from(ClientError::invalid_request("Invalid entry URI")))?; 1218 + ( 1219 + entry.into_static(), 1220 + record.uri.into_static(), 1221 + cid.into_static(), 1222 + ) 1223 + }; 1164 1224 1165 1225 // Fetch contributors (evidence-based authors) 1166 1226 let contributor_dids = self.find_contributors_for_resource(&entry_uri).await?; ··· 1180 1240 let permissions = self.get_permissions_for_resource(&entry_uri).await?; 1181 1241 1182 1242 let entry_view = EntryView::new() 1183 - .cid(record.cid.ok_or_else(|| { 1184 - AgentError::from(ClientError::invalid_request("Entry missing CID")) 1185 - })?) 1186 - .uri(record.uri) 1243 + .cid(final_cid) 1244 + .uri(final_uri) 1187 1245 .indexed_at(jacquard::types::string::Datetime::now()) 1188 1246 .record(to_data(&entry_value).map_err(|_| { 1189 1247 AgentError::from(ClientError::invalid_request("Failed to serialize entry")) ··· 1385 1443 { 1386 1444 async move { 1387 1445 use jacquard::Data; 1388 - use weaver_api::com_atproto::repo::get_record::GetRecord; 1389 1446 1390 1447 let mut versions = Vec::new(); 1391 1448 1392 1449 for collab_did in collaborators { 1393 - let Ok(pds_url) = self.pds_for_did(collab_did).await else { 1450 + // Build URI for this collaborator's version 1451 + let uri_str = format!("at://{}/{}/{}", collab_did, collection, rkey); 1452 + let Ok(uri) = AtUri::new(&uri_str) else { 1394 1453 continue; 1395 1454 }; 1396 1455 1397 - let Ok(record_key) = RecordKey::any(rkey) else { 1398 - continue; 1399 - }; 1400 - let request = GetRecord::new() 1401 - .repo(jacquard::types::ident::AtIdentifier::Did( 1402 - collab_did.clone(), 1403 - )) 1404 - .collection(jacquard::types::nsid::Nsid::raw(collection)) 1405 - .rkey(record_key) 1406 - .build(); 1407 - 1408 - let Ok(http_request) = 1409 - xrpc::build_http_request(&pds_url, &request, &self.opts().await) 1410 - else { 1411 - continue; 1412 - }; 1413 - 1414 - let Ok(http_response) = self.send_http(http_request).await else { 1415 - continue; 1416 - }; 1417 - 1418 - let response: Response<GetRecordResponse> = 1419 - match xrpc::process_response(http_response) { 1420 - Ok(r) => r, 1421 - Err(_) => continue, 1422 - }; 1423 - 1424 - let Ok(record) = response.into_output() else { 1456 + // Fetch via slingshot (handles cross-PDS routing) 1457 + let Ok(record) = self.fetch_record_slingshot(&uri).await else { 1425 1458 continue; 1426 1459 }; 1427 1460 ··· 1916 1949 1917 1950 if let (Some(rkey), Some(collection)) = (rkey, collection) { 1918 1951 for collab_did in collaborators { 1919 - // Try to fetch their version of the record 1952 + // Try to fetch their version of the record via slingshot 1920 1953 let collab_uri_str = format!( 1921 1954 "at://{}/{}/{}", 1922 1955 collab_did.as_ref(), ··· 1924 1957 rkey.as_ref() 1925 1958 ); 1926 1959 if let Ok(collab_uri) = AtUri::new(&collab_uri_str) { 1927 - // Check if record actually exists (200 = found, 400 = not found) 1928 - if let Ok(response) = self 1929 - .get_record::<weaver_api::sh_weaver::notebook::entry::Entry>( 1930 - &collab_uri, 1931 - ) 1932 - .await 1933 - { 1934 - if response.status().is_success() { 1935 - contributors.insert(collab_did); 1936 - } 1960 + // Check if record actually exists 1961 + if self.fetch_record_slingshot(&collab_uri).await.is_ok() { 1962 + contributors.insert(collab_did); 1937 1963 } 1938 1964 } 1939 1965 }
+2 -2
crates/weaver-common/src/lib.rs
··· 10 10 pub use agent::WeaverExt; 11 11 pub use error::WeaverError; 12 12 pub use resolve::{EntryIndex, ExtractedRef, RefCollector, ResolvedContent, ResolvedEntry}; 13 - #[cfg(any(test, feature = "standalone-collection"))] 14 - pub use resolve::collect_refs_from_markdown; 13 + 15 14 pub use jacquard; 16 15 use jacquard::CowStr; 17 16 use jacquard::client::{Agent, AgentSession}; ··· 19 18 use jacquard::types::ident::AtIdentifier; 20 19 use jacquard::types::string::{AtUri, Cid, Did, Handle}; 21 20 use jacquard::types::tid::Ticker; 21 + pub use resolve::collect_refs_from_markdown; 22 22 use std::sync::LazyLock; 23 23 use tokio::sync::Mutex; 24 24 use weaver_api::com_atproto::repo::strong_ref::StrongRef;
-1
crates/weaver-common/src/resolve.rs
··· 252 252 /// **Note:** This does a separate parsing pass. For production use, prefer 253 253 /// passing a `RefCollector` to the renderer to collect during the render pass. 254 254 /// This function is primarily useful for testing or quick analysis. 255 - #[cfg(any(test, feature = "standalone-collection"))] 256 255 pub fn collect_refs_from_markdown(markdown: &str) -> Vec<ExtractedRef> { 257 256 use markdown_weaver::{Event, LinkType, Options, Parser, Tag}; 258 257
+2 -2
lexicons/edit/defs.json
··· 35 35 36 36 "draftRef": { 37 37 "type": "object", 38 - "required": ["draft_key"], 38 + "required": ["draftKey"], 39 39 "properties": { 40 - "draft_key": { 40 + "draftKey": { 41 41 "type": "string", 42 42 "maxLength": 200 43 43 }