diff --git a/examples/oauth_timeline.rs b/examples/oauth_timeline.rs --- a/examples/oauth_timeline.rs +++ b/examples/oauth_timeline.rs @@ -72,7 +72,7 @@ // Wrap in Agent and fetch the timeline let agent: Agent<_> = Agent::from(session); - let output = agent.send(GetTimeline::builder().limit(5).build()).await?; + let output = agent.send(GetTimeline::new().limit(5).build()).await?; let timeline = output.into_output()?; for (i, post) in timeline.feed.iter().enumerate() { println!("\n{}. by {}", i + 1, post.post.author.handle); diff --git a/crates/jacquard/src/client.rs b/crates/jacquard/src/client.rs --- a/crates/jacquard/src/client.rs +++ b/crates/jacquard/src/client.rs @@ -829,7 +829,7 @@ "no rkey", ClientError::invalid_request("no rkey"), ))?; - let request = GetRecord::new() + let request = GetRecord::builder() .repo(uri.authority().clone()) .collection(collection.clone()) .rkey(RecordKey(rkey.clone())) diff --git a/crates/jacquard-lexicon/src/codegen/builder_gen/builder_struct.rs b/crates/jacquard-lexicon/src/codegen/builder_gen/builder_struct.rs --- a/crates/jacquard-lexicon/src/codegen/builder_gen/builder_struct.rs +++ b/crates/jacquard-lexicon/src/codegen/builder_gen/builder_struct.rs @@ -83,7 +83,7 @@ quote! {} }; quote! { - impl #type_ident { + impl #type_ident<#default_str_path> { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> #builder_name<#lifetime #state_mod_name::Empty, #default_str_path> { #builder_name::new() diff --git a/crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/label.rs b/crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/label.rs --- a/crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/label.rs +++ b/crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/label.rs @@ -798,66 +798,66 @@ /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Val; type Src; type Cts; + type Val; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; - type Val = Unset; type Src = Unset; type Cts = Unset; + type Val = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; + type Src = St::Src; + type Cts = St::Cts; type Val = St::Val; - type Src = St::Src; - type Cts = St::Cts; - } - ///State transition - sets the `val` field to Set - pub struct SetVal(PhantomData St>); - impl sealed::Sealed for SetVal {} - impl State for SetVal { - type Uri = St::Uri; - type Val = Set; - type Src = St::Src; - type Cts = St::Cts; } ///State transition - sets the `src` field to Set pub struct SetSrc(PhantomData St>); impl sealed::Sealed for SetSrc {} impl State for SetSrc { type Uri = St::Uri; - type Val = St::Val; type Src = Set; type Cts = St::Cts; + type Val = St::Val; } ///State transition - sets the `cts` field to Set pub struct SetCts(PhantomData St>); impl sealed::Sealed for SetCts {} impl State for SetCts { type Uri = St::Uri; - type Val = St::Val; type Src = St::Src; type Cts = Set; + type Val = St::Val; + } + ///State transition - sets the `val` field to Set + pub struct SetVal(PhantomData St>); + impl sealed::Sealed for SetVal {} + impl State for SetVal { + type Uri = St::Uri; + type Src = St::Src; + type Cts = St::Cts; + type Val = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `val` field - pub struct val(()); ///Marker type for the `src` field pub struct src(()); ///Marker type for the `cts` field pub struct cts(()); + ///Marker type for the `val` field + pub struct val(()); } } @@ -881,7 +881,7 @@ _type: ::core::marker::PhantomData S>, } -impl Label { +impl Label { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> LabelBuilder { LabelBuilder::new() @@ -1080,9 +1080,9 @@ where St: label_state::State, St::Uri: label_state::IsSet, - St::Val: label_state::IsSet, St::Src: label_state::IsSet, St::Cts: label_state::IsSet, + St::Val: label_state::IsSet, { /// Build the final struct. pub fn build(self) -> Label { @@ -1536,67 +1536,67 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Severity; type Locales; - type Blurs; + type Severity; type Identifier; + type Blurs; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Severity = Unset; type Locales = Unset; - type Blurs = Unset; + type Severity = Unset; type Identifier = Unset; - } - ///State transition - sets the `severity` field to Set - pub struct SetSeverity(PhantomData St>); - impl sealed::Sealed for SetSeverity {} - impl State for SetSeverity { - type Severity = Set; - type Locales = St::Locales; - type Blurs = St::Blurs; - type Identifier = St::Identifier; + type Blurs = Unset; } ///State transition - sets the `locales` field to Set pub struct SetLocales(PhantomData St>); impl sealed::Sealed for SetLocales {} impl State for SetLocales { - type Severity = St::Severity; type Locales = Set; - type Blurs = St::Blurs; - type Identifier = St::Identifier; - } - ///State transition - sets the `blurs` field to Set - pub struct SetBlurs(PhantomData St>); - impl sealed::Sealed for SetBlurs {} - impl State for SetBlurs { type Severity = St::Severity; - type Locales = St::Locales; - type Blurs = Set; type Identifier = St::Identifier; + type Blurs = St::Blurs; + } + ///State transition - sets the `severity` field to Set + pub struct SetSeverity(PhantomData St>); + impl sealed::Sealed for SetSeverity {} + impl State for SetSeverity { + type Locales = St::Locales; + type Severity = Set; + type Identifier = St::Identifier; + type Blurs = St::Blurs; } ///State transition - sets the `identifier` field to Set pub struct SetIdentifier(PhantomData St>); impl sealed::Sealed for SetIdentifier {} impl State for SetIdentifier { - type Severity = St::Severity; type Locales = St::Locales; - type Blurs = St::Blurs; + type Severity = St::Severity; type Identifier = Set; + type Blurs = St::Blurs; + } + ///State transition - sets the `blurs` field to Set + pub struct SetBlurs(PhantomData St>); + impl sealed::Sealed for SetBlurs {} + impl State for SetBlurs { + type Locales = St::Locales; + type Severity = St::Severity; + type Identifier = St::Identifier; + type Blurs = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `severity` field - pub struct severity(()); ///Marker type for the `locales` field pub struct locales(()); - ///Marker type for the `blurs` field - pub struct blurs(()); + ///Marker type for the `severity` field + pub struct severity(()); ///Marker type for the `identifier` field pub struct identifier(()); + ///Marker type for the `blurs` field + pub struct blurs(()); } } @@ -1619,7 +1619,7 @@ _type: ::core::marker::PhantomData S>, } -impl LabelValueDefinition { +impl LabelValueDefinition { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> LabelValueDefinitionBuilder< label_value_definition_state::Empty, @@ -1788,10 +1788,10 @@ impl LabelValueDefinitionBuilder where St: label_value_definition_state::State, - St::Severity: label_value_definition_state::IsSet, St::Locales: label_value_definition_state::IsSet, - St::Blurs: label_value_definition_state::IsSet, + St::Severity: label_value_definition_state::IsSet, St::Identifier: label_value_definition_state::IsSet, + St::Blurs: label_value_definition_state::IsSet, { /// Build the final struct. pub fn build(self) -> LabelValueDefinition { @@ -1835,51 +1835,51 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Description; type Lang; type Name; - type Description; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Description = Unset; type Lang = Unset; type Name = Unset; - type Description = Unset; - } - ///State transition - sets the `lang` field to Set - pub struct SetLang(PhantomData St>); - impl sealed::Sealed for SetLang {} - impl State for SetLang { - type Lang = Set; - type Name = St::Name; - type Description = St::Description; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData St>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Lang = St::Lang; - type Name = Set; - type Description = St::Description; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData St>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { + type Description = Set; type Lang = St::Lang; type Name = St::Name; - type Description = Set; + } + ///State transition - sets the `lang` field to Set + pub struct SetLang(PhantomData St>); + impl sealed::Sealed for SetLang {} + impl State for SetLang { + type Description = St::Description; + type Lang = Set; + type Name = St::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData St>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Description = St::Description; + type Lang = St::Lang; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `description` field + pub struct description(()); ///Marker type for the `lang` field pub struct lang(()); ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `description` field - pub struct description(()); } } @@ -1897,7 +1897,7 @@ _type: ::core::marker::PhantomData S>, } -impl LabelValueDefinitionStrings { +impl LabelValueDefinitionStrings { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> LabelValueDefinitionStringsBuilder< label_value_definition_strings_state::Empty, @@ -2013,9 +2013,9 @@ impl LabelValueDefinitionStringsBuilder where St: label_value_definition_strings_state::State, + St::Description: label_value_definition_strings_state::IsSet, St::Lang: label_value_definition_strings_state::IsSet, St::Name: label_value_definition_strings_state::IsSet, - St::Description: label_value_definition_strings_state::IsSet, { /// Build the final struct. pub fn build(self) -> LabelValueDefinitionStrings { @@ -2087,7 +2087,7 @@ _type: ::core::marker::PhantomData S>, } -impl SelfLabels { +impl SelfLabels { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> SelfLabelsBuilder< self_labels_state::Empty, diff --git a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/collection.rs b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/collection.rs --- a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/collection.rs +++ b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/collection.rs @@ -371,7 +371,7 @@ _type: ::core::marker::PhantomData S>, } -impl CollectionRecord { +impl CollectionRecord { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> CollectionRecordBuilder< collection_record_state::Empty, diff --git a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/did.rs b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/did.rs --- a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/did.rs +++ b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/did.rs @@ -264,37 +264,37 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Owner; type Identifier; + type Owner; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Owner = Unset; type Identifier = Unset; - } - ///State transition - sets the `owner` field to Set - pub struct SetOwner(PhantomData St>); - impl sealed::Sealed for SetOwner {} - impl State for SetOwner { - type Owner = Set; - type Identifier = St::Identifier; + type Owner = Unset; } ///State transition - sets the `identifier` field to Set pub struct SetIdentifier(PhantomData St>); impl sealed::Sealed for SetIdentifier {} impl State for SetIdentifier { - type Owner = St::Owner; type Identifier = Set; + type Owner = St::Owner; + } + ///State transition - sets the `owner` field to Set + pub struct SetOwner(PhantomData St>); + impl sealed::Sealed for SetOwner {} + impl State for SetOwner { + type Identifier = St::Identifier; + type Owner = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `owner` field - pub struct owner(()); ///Marker type for the `identifier` field pub struct identifier(()); + ///Marker type for the `owner` field + pub struct owner(()); } } @@ -312,7 +312,7 @@ _type: ::core::marker::PhantomData S>, } -impl DidRecord { +impl DidRecord { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> DidRecordBuilder< did_record_state::Empty, @@ -405,8 +405,8 @@ impl DidRecordBuilder where St: did_record_state::State, - St::Owner: did_record_state::IsSet, St::Identifier: did_record_state::IsSet, + St::Owner: did_record_state::IsSet, { /// Build the final struct. pub fn build(self) -> DidRecord { diff --git a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/option.rs b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/option.rs --- a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/option.rs +++ b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_collision/option.rs @@ -180,7 +180,7 @@ _type: ::core::marker::PhantomData S>, } -impl OptionRecord { +impl OptionRecord { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> OptionRecordBuilder< option_record_state::Empty, diff --git a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_ns2/consumer.rs b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_ns2/consumer.rs --- a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_ns2/consumer.rs +++ b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_ns2/consumer.rs @@ -110,7 +110,7 @@ _type: ::core::marker::PhantomData S>, } -impl Consumer { +impl Consumer { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ConsumerBuilder { ConsumerBuilder::new() diff --git a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_ns3/collision.rs b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_ns3/collision.rs --- a/crates/jacquard-codegen-tests/src/generated/macro_mode/test_ns3/collision.rs +++ b/crates/jacquard-codegen-tests/src/generated/macro_mode/test_ns3/collision.rs @@ -149,7 +149,7 @@ _type: ::core::marker::PhantomData S>, } -impl Foo { +impl Foo { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> FooBuilder { FooBuilder::new() @@ -404,7 +404,7 @@ _type: ::core::marker::PhantomData S>, } -impl Collision { +impl Collision { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> CollisionBuilder< collision_state::Empty, diff --git a/crates/jacquard-codegen-tests/src/generated/pretty/com_atproto/label.rs b/crates/jacquard-codegen-tests/src/generated/pretty/com_atproto/label.rs --- a/crates/jacquard-codegen-tests/src/generated/pretty/com_atproto/label.rs +++ b/crates/jacquard-codegen-tests/src/generated/pretty/com_atproto/label.rs @@ -679,67 +679,67 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Src; - type Uri; - type Val; type Cts; + type Src; + type Val; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Src = Unset; - type Uri = Unset; - type Val = Unset; type Cts = Unset; - } - ///State transition - sets the `src` field to Set - pub struct SetSrc(PhantomData St>); - impl sealed::Sealed for SetSrc {} - impl State for SetSrc { - type Src = Set; - type Uri = St::Uri; - type Val = St::Val; - type Cts = St::Cts; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Src = St::Src; - type Uri = Set; - type Val = St::Val; - type Cts = St::Cts; - } - ///State transition - sets the `val` field to Set - pub struct SetVal(PhantomData St>); - impl sealed::Sealed for SetVal {} - impl State for SetVal { - type Src = St::Src; - type Uri = St::Uri; - type Val = Set; - type Cts = St::Cts; + type Src = Unset; + type Val = Unset; + type Uri = Unset; } ///State transition - sets the `cts` field to Set pub struct SetCts(PhantomData St>); impl sealed::Sealed for SetCts {} impl State for SetCts { - type Src = St::Src; - type Uri = St::Uri; - type Val = St::Val; type Cts = Set; + type Src = St::Src; + type Val = St::Val; + type Uri = St::Uri; + } + ///State transition - sets the `src` field to Set + pub struct SetSrc(PhantomData St>); + impl sealed::Sealed for SetSrc {} + impl State for SetSrc { + type Cts = St::Cts; + type Src = Set; + type Val = St::Val; + type Uri = St::Uri; + } + ///State transition - sets the `val` field to Set + pub struct SetVal(PhantomData St>); + impl sealed::Sealed for SetVal {} + impl State for SetVal { + type Cts = St::Cts; + type Src = St::Src; + type Val = Set; + type Uri = St::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Cts = St::Cts; + type Src = St::Src; + type Val = St::Val; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `src` field - pub struct src(()); - ///Marker type for the `uri` field - pub struct uri(()); - ///Marker type for the `val` field - pub struct val(()); ///Marker type for the `cts` field pub struct cts(()); + ///Marker type for the `src` field + pub struct src(()); + ///Marker type for the `val` field + pub struct val(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -940,10 +940,10 @@ impl LabelBuilder where St: label_state::State, - St::Src: label_state::IsSet, - St::Uri: label_state::IsSet, - St::Val: label_state::IsSet, St::Cts: label_state::IsSet, + St::Src: label_state::IsSet, + St::Val: label_state::IsSet, + St::Uri: label_state::IsSet, { /// Build the final struct. pub fn build(self) -> Label { @@ -1315,67 +1315,67 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Locales; - type Severity; - type Blurs; type Identifier; + type Severity; + type Locales; + type Blurs; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Locales = Unset; - type Severity = Unset; - type Blurs = Unset; type Identifier = Unset; - } - ///State transition - sets the `locales` field to Set - pub struct SetLocales(PhantomData St>); - impl sealed::Sealed for SetLocales {} - impl State for SetLocales { - type Locales = Set; - type Severity = St::Severity; - type Blurs = St::Blurs; - type Identifier = St::Identifier; - } - ///State transition - sets the `severity` field to Set - pub struct SetSeverity(PhantomData St>); - impl sealed::Sealed for SetSeverity {} - impl State for SetSeverity { - type Locales = St::Locales; - type Severity = Set; - type Blurs = St::Blurs; - type Identifier = St::Identifier; - } - ///State transition - sets the `blurs` field to Set - pub struct SetBlurs(PhantomData St>); - impl sealed::Sealed for SetBlurs {} - impl State for SetBlurs { - type Locales = St::Locales; - type Severity = St::Severity; - type Blurs = Set; - type Identifier = St::Identifier; + type Severity = Unset; + type Locales = Unset; + type Blurs = Unset; } ///State transition - sets the `identifier` field to Set pub struct SetIdentifier(PhantomData St>); impl sealed::Sealed for SetIdentifier {} impl State for SetIdentifier { - type Locales = St::Locales; - type Severity = St::Severity; - type Blurs = St::Blurs; type Identifier = Set; + type Severity = St::Severity; + type Locales = St::Locales; + type Blurs = St::Blurs; + } + ///State transition - sets the `severity` field to Set + pub struct SetSeverity(PhantomData St>); + impl sealed::Sealed for SetSeverity {} + impl State for SetSeverity { + type Identifier = St::Identifier; + type Severity = Set; + type Locales = St::Locales; + type Blurs = St::Blurs; + } + ///State transition - sets the `locales` field to Set + pub struct SetLocales(PhantomData St>); + impl sealed::Sealed for SetLocales {} + impl State for SetLocales { + type Identifier = St::Identifier; + type Severity = St::Severity; + type Locales = Set; + type Blurs = St::Blurs; + } + ///State transition - sets the `blurs` field to Set + pub struct SetBlurs(PhantomData St>); + impl sealed::Sealed for SetBlurs {} + impl State for SetBlurs { + type Identifier = St::Identifier; + type Severity = St::Severity; + type Locales = St::Locales; + type Blurs = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `locales` field - pub struct locales(()); - ///Marker type for the `severity` field - pub struct severity(()); - ///Marker type for the `blurs` field - pub struct blurs(()); ///Marker type for the `identifier` field pub struct identifier(()); + ///Marker type for the `severity` field + pub struct severity(()); + ///Marker type for the `locales` field + pub struct locales(()); + ///Marker type for the `blurs` field + pub struct blurs(()); } } @@ -1558,10 +1558,10 @@ impl LabelValueDefinitionBuilder where St: label_value_definition_state::State, - St::Locales: label_value_definition_state::IsSet, - St::Severity: label_value_definition_state::IsSet, - St::Blurs: label_value_definition_state::IsSet, St::Identifier: label_value_definition_state::IsSet, + St::Severity: label_value_definition_state::IsSet, + St::Locales: label_value_definition_state::IsSet, + St::Blurs: label_value_definition_state::IsSet, { /// Build the final struct. pub fn build(self) -> LabelValueDefinition { @@ -1602,51 +1602,51 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Lang; type Description; type Name; + type Lang; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Lang = Unset; type Description = Unset; type Name = Unset; - } - ///State transition - sets the `lang` field to Set - pub struct SetLang(PhantomData St>); - impl sealed::Sealed for SetLang {} - impl State for SetLang { - type Lang = Set; - type Description = St::Description; - type Name = St::Name; + type Lang = Unset; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData St>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { - type Lang = St::Lang; type Description = Set; type Name = St::Name; + type Lang = St::Lang; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { - type Lang = St::Lang; type Description = St::Description; type Name = Set; + type Lang = St::Lang; + } + ///State transition - sets the `lang` field to Set + pub struct SetLang(PhantomData St>); + impl sealed::Sealed for SetLang {} + impl State for SetLang { + type Description = St::Description; + type Name = St::Name; + type Lang = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `lang` field - pub struct lang(()); ///Marker type for the `description` field pub struct description(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `lang` field + pub struct lang(()); } } @@ -1776,9 +1776,9 @@ impl LabelValueDefinitionStringsBuilder where St: label_value_definition_strings_state::State, - St::Lang: label_value_definition_strings_state::IsSet, St::Description: label_value_definition_strings_state::IsSet, St::Name: label_value_definition_strings_state::IsSet, + St::Lang: label_value_definition_strings_state::IsSet, { /// Build the final struct. pub fn build(self) -> LabelValueDefinitionStrings { diff --git a/crates/jacquard-codegen-tests/src/generated/pretty/test_ns3/collision.rs b/crates/jacquard-codegen-tests/src/generated/pretty/test_ns3/collision.rs --- a/crates/jacquard-codegen-tests/src/generated/pretty/test_ns3/collision.rs +++ b/crates/jacquard-codegen-tests/src/generated/pretty/test_ns3/collision.rs @@ -316,37 +316,37 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type LocalFoo; type ExternalFoo; + type LocalFoo; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type LocalFoo = Unset; type ExternalFoo = Unset; - } - ///State transition - sets the `local_foo` field to Set - pub struct SetLocalFoo(PhantomData St>); - impl sealed::Sealed for SetLocalFoo {} - impl State for SetLocalFoo { - type LocalFoo = Set; - type ExternalFoo = St::ExternalFoo; + type LocalFoo = Unset; } ///State transition - sets the `external_foo` field to Set pub struct SetExternalFoo(PhantomData St>); impl sealed::Sealed for SetExternalFoo {} impl State for SetExternalFoo { - type LocalFoo = St::LocalFoo; type ExternalFoo = Set; + type LocalFoo = St::LocalFoo; + } + ///State transition - sets the `local_foo` field to Set + pub struct SetLocalFoo(PhantomData St>); + impl sealed::Sealed for SetLocalFoo {} + impl State for SetLocalFoo { + type ExternalFoo = St::ExternalFoo; + type LocalFoo = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `local_foo` field - pub struct local_foo(()); ///Marker type for the `external_foo` field pub struct external_foo(()); + ///Marker type for the `local_foo` field + pub struct local_foo(()); } } @@ -447,8 +447,8 @@ impl CollisionBuilder where St: collision_state::State, - St::LocalFoo: collision_state::IsSet, St::ExternalFoo: collision_state::IsSet, + St::LocalFoo: collision_state::IsSet, { /// Build the final struct. pub fn build(self) -> Collision { diff --git a/crates/jacquard-codegen-tests/src/generated/macro_mode/app_bsky/embed/external.rs b/crates/jacquard-codegen-tests/src/generated/macro_mode/app_bsky/embed/external.rs --- a/crates/jacquard-codegen-tests/src/generated/macro_mode/app_bsky/embed/external.rs +++ b/crates/jacquard-codegen-tests/src/generated/macro_mode/app_bsky/embed/external.rs @@ -232,49 +232,49 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Description; + type Uri; type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Description = Unset; + type Uri = Unset; type Title = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Description = St::Description; - type Title = St::Title; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData St>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { - type Uri = St::Uri; type Description = Set; + type Uri = St::Uri; + type Title = St::Title; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Description = St::Description; + type Uri = Set; type Title = St::Title; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData St>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { - type Uri = St::Uri; type Description = St::Description; + type Uri = St::Uri; type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `description` field pub struct description(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `title` field pub struct title(()); } @@ -295,7 +295,7 @@ _type: ::core::marker::PhantomData S>, } -impl External { +impl External { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ExternalBuilder { ExternalBuilder::new() @@ -410,8 +410,8 @@ impl ExternalBuilder where St: external_state::State, - St::Uri: external_state::IsSet, St::Description: external_state::IsSet, + St::Uri: external_state::IsSet, St::Title: external_state::IsSet, { /// Build the final struct. @@ -666,7 +666,7 @@ _type: ::core::marker::PhantomData S>, } -impl ExternalRecord { +impl ExternalRecord { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ExternalRecordBuilder< external_record_state::Empty, @@ -797,7 +797,7 @@ _type: ::core::marker::PhantomData S>, } -impl View { +impl View { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ViewBuilder { ViewBuilder::new() @@ -952,7 +952,7 @@ _type: ::core::marker::PhantomData S>, } -impl ViewExternal { +impl ViewExternal { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ViewExternalBuilder< view_external_state::Empty, diff --git a/crates/jacquard-codegen-tests/src/generated/macro_mode/app_bsky/richtext/facet.rs b/crates/jacquard-codegen-tests/src/generated/macro_mode/app_bsky/richtext/facet.rs --- a/crates/jacquard-codegen-tests/src/generated/macro_mode/app_bsky/richtext/facet.rs +++ b/crates/jacquard-codegen-tests/src/generated/macro_mode/app_bsky/richtext/facet.rs @@ -310,37 +310,37 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ByteStart; type ByteEnd; + type ByteStart; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ByteStart = Unset; type ByteEnd = Unset; - } - ///State transition - sets the `byte_start` field to Set - pub struct SetByteStart(PhantomData St>); - impl sealed::Sealed for SetByteStart {} - impl State for SetByteStart { - type ByteStart = Set; - type ByteEnd = St::ByteEnd; + type ByteStart = Unset; } ///State transition - sets the `byte_end` field to Set pub struct SetByteEnd(PhantomData St>); impl sealed::Sealed for SetByteEnd {} impl State for SetByteEnd { - type ByteStart = St::ByteStart; type ByteEnd = Set; + type ByteStart = St::ByteStart; + } + ///State transition - sets the `byte_start` field to Set + pub struct SetByteStart(PhantomData St>); + impl sealed::Sealed for SetByteStart {} + impl State for SetByteStart { + type ByteEnd = St::ByteEnd; + type ByteStart = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `byte_start` field - pub struct byte_start(()); ///Marker type for the `byte_end` field pub struct byte_end(()); + ///Marker type for the `byte_start` field + pub struct byte_start(()); } } @@ -354,7 +354,7 @@ _type: ::core::marker::PhantomData S>, } -impl ByteSlice { +impl ByteSlice { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ByteSliceBuilder< byte_slice_state::Empty, @@ -434,8 +434,8 @@ impl ByteSliceBuilder where St: byte_slice_state::State, - St::ByteStart: byte_slice_state::IsSet, St::ByteEnd: byte_slice_state::IsSet, + St::ByteStart: byte_slice_state::IsSet, { /// Build the final struct. pub fn build(self) -> ByteSlice { @@ -699,7 +699,7 @@ _type: ::core::marker::PhantomData S>, } -impl Link { +impl Link { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> LinkBuilder { LinkBuilder::new() @@ -838,7 +838,7 @@ _type: ::core::marker::PhantomData S>, } -impl Facet { +impl Facet { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> FacetBuilder { FacetBuilder::new() @@ -984,7 +984,7 @@ _type: ::core::marker::PhantomData S>, } -impl Mention { +impl Mention { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> MentionBuilder { MentionBuilder::new() diff --git a/crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/repo/strong_ref.rs b/crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/repo/strong_ref.rs --- a/crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/repo/strong_ref.rs +++ b/crates/jacquard-codegen-tests/src/generated/macro_mode/com_atproto/repo/strong_ref.rs @@ -104,7 +104,7 @@ _type: ::core::marker::PhantomData S>, } -impl StrongRef { +impl StrongRef { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> StrongRefBuilder< strong_ref_state::Empty, diff --git a/crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/embed/external.rs b/crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/embed/external.rs --- a/crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/embed/external.rs +++ b/crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/embed/external.rs @@ -179,51 +179,51 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Description; type Title; type Uri; - type Description; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Description = Unset; type Title = Unset; type Uri = Unset; - type Description = Unset; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData St>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; - type Uri = St::Uri; - type Description = St::Description; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Title = St::Title; - type Uri = Set; - type Description = St::Description; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData St>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { + type Description = Set; type Title = St::Title; type Uri = St::Uri; - type Description = Set; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData St>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Description = St::Description; + type Title = Set; + type Uri = St::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Description = St::Description; + type Title = St::Title; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `description` field + pub struct description(()); ///Marker type for the `title` field pub struct title(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `description` field - pub struct description(()); } } @@ -343,9 +343,9 @@ impl ExternalBuilder where St: external_state::State, + St::Description: external_state::IsSet, St::Title: external_state::IsSet, St::Uri: external_state::IsSet, - St::Description: external_state::IsSet, { /// Build the final struct. pub fn build(self) -> External { @@ -749,51 +749,51 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; type Description; type Uri; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; type Description = Unset; type Uri = Unset; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData St>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; - type Description = St::Description; - type Uri = St::Uri; + type Title = Unset; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData St>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { - type Title = St::Title; type Description = Set; type Uri = St::Uri; + type Title = St::Title; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Title = St::Title; type Description = St::Description; type Uri = Set; + type Title = St::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData St>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Description = St::Description; + type Uri = St::Uri; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `description` field pub struct description(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -913,9 +913,9 @@ impl ViewExternalBuilder where St: view_external_state::State, - St::Title: view_external_state::IsSet, St::Description: view_external_state::IsSet, St::Uri: view_external_state::IsSet, + St::Title: view_external_state::IsSet, { /// Build the final struct. pub fn build(self) -> ViewExternal { diff --git a/crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/richtext/facet.rs b/crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/richtext/facet.rs --- a/crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/richtext/facet.rs +++ b/crates/jacquard-codegen-tests/src/generated/pretty/app_bsky/richtext/facet.rs @@ -219,37 +219,37 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ByteStart; type ByteEnd; + type ByteStart; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ByteStart = Unset; type ByteEnd = Unset; - } - ///State transition - sets the `byte_start` field to Set - pub struct SetByteStart(PhantomData St>); - impl sealed::Sealed for SetByteStart {} - impl State for SetByteStart { - type ByteStart = Set; - type ByteEnd = St::ByteEnd; + type ByteStart = Unset; } ///State transition - sets the `byte_end` field to Set pub struct SetByteEnd(PhantomData St>); impl sealed::Sealed for SetByteEnd {} impl State for SetByteEnd { - type ByteStart = St::ByteStart; type ByteEnd = Set; + type ByteStart = St::ByteStart; + } + ///State transition - sets the `byte_start` field to Set + pub struct SetByteStart(PhantomData St>); + impl sealed::Sealed for SetByteStart {} + impl State for SetByteStart { + type ByteEnd = St::ByteEnd; + type ByteStart = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `byte_start` field - pub struct byte_start(()); ///Marker type for the `byte_end` field pub struct byte_end(()); + ///Marker type for the `byte_start` field + pub struct byte_start(()); } } @@ -337,8 +337,8 @@ impl ByteSliceBuilder where St: byte_slice_state::State, - St::ByteStart: byte_slice_state::IsSet, St::ByteEnd: byte_slice_state::IsSet, + St::ByteStart: byte_slice_state::IsSet, { /// Build the final struct. pub fn build(self) -> ByteSlice { @@ -652,37 +652,37 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Index; type Features; + type Index; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Index = Unset; type Features = Unset; - } - ///State transition - sets the `index` field to Set - pub struct SetIndex(PhantomData St>); - impl sealed::Sealed for SetIndex {} - impl State for SetIndex { - type Index = Set; - type Features = St::Features; + type Index = Unset; } ///State transition - sets the `features` field to Set pub struct SetFeatures(PhantomData St>); impl sealed::Sealed for SetFeatures {} impl State for SetFeatures { - type Index = St::Index; type Features = Set; + type Index = St::Index; + } + ///State transition - sets the `index` field to Set + pub struct SetIndex(PhantomData St>); + impl sealed::Sealed for SetIndex {} + impl State for SetIndex { + type Features = St::Features; + type Index = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `index` field - pub struct index(()); ///Marker type for the `features` field pub struct features(()); + ///Marker type for the `index` field + pub struct index(()); } } @@ -770,8 +770,8 @@ impl FacetBuilder where St: facet_state::State, - St::Index: facet_state::IsSet, St::Features: facet_state::IsSet, + St::Index: facet_state::IsSet, { /// Build the final struct. pub fn build(self) -> Facet { diff --git a/crates/jacquard-codegen-tests/src/generated/pretty/com_atproto/repo/strong_ref.rs b/crates/jacquard-codegen-tests/src/generated/pretty/com_atproto/repo/strong_ref.rs --- a/crates/jacquard-codegen-tests/src/generated/pretty/com_atproto/repo/strong_ref.rs +++ b/crates/jacquard-codegen-tests/src/generated/pretty/com_atproto/repo/strong_ref.rs @@ -59,37 +59,37 @@ } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = St::Uri; + type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = St::Cid; type Uri = Set; + type Cid = St::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = St::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -177,8 +177,8 @@ impl StrongRefBuilder where St: strong_ref_state::State, - St::Cid: strong_ref_state::IsSet, St::Uri: strong_ref_state::IsSet, + St::Cid: strong_ref_state::IsSet, { /// Build the final struct. pub fn build(self) -> StrongRef {