···11{
22+ "id": "site.standard.publication",
23 "defs": {
34 "main": {
45 "key": "tid",
66+ "type": "record",
57 "record": {
88+ "type": "object",
99+ "required": [
1010+ "url",
1111+ "name"
1212+ ],
613 "properties": {
77- "basicTheme": {
88- "ref": "site.standard.theme.basic",
99- "type": "ref"
1010- },
1111- "description": {
1212- "maxGraphemes": 300,
1313- "maxLength": 3000,
1414- "type": "string"
1414+ "url": {
1515+ "type": "string",
1616+ "format": "uri",
1717+ "description": "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path."
1518 },
1619 "icon": {
2020+ "type": "blob",
1721 "accept": [
1822 "image/*"
1923 ],
2024 "maxSize": 1000000,
2121- "type": "blob"
2525+ "description": "Square image to identify the publication. Should be at least 256x256."
2226 },
2327 "name": {
2424- "maxGraphemes": 128,
2525- "maxLength": 1280,
2626- "type": "string"
2828+ "type": "string",
2929+ "maxLength": 5000,
3030+ "description": "Name of the publication.",
3131+ "maxGraphemes": 500
3232+ },
3333+ "basicTheme": {
3434+ "ref": "site.standard.theme.basic",
3535+ "type": "ref",
3636+ "description": "Simplified publication theme for tools and apps to utilize when displaying content."
3737+ },
3838+ "description": {
3939+ "type": "string",
4040+ "maxLength": 30000,
4141+ "description": "Brief description of the publication.",
4242+ "maxGraphemes": 3000
2743 },
2844 "preferences": {
2945 "ref": "#preferences",
3030- "type": "ref"
3131- },
3232- "url": {
3333- "format": "uri",
3434- "type": "string"
4646+ "type": "ref",
4747+ "description": "Object containing platform specific preferences (with a few shared properties)."
3548 }
3636- },
3737- "required": [
3838- "url",
3939- "name"
4040- ],
4141- "type": "object"
4949+ }
4250 },
4343- "type": "record"
5151+ "description": "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings."
4452 },
4553 "preferences": {
5454+ "type": "object",
4655 "properties": {
4756 "showInDiscover": {
5757+ "type": "boolean",
4858 "default": true,
4949- "type": "boolean"
5959+ "description": "Boolean which decides whether the publication should appear in discovery feeds."
5060 }
5161 },
5252- "type": "object"
6262+ "description": "Platform-specific preferences for the publication, including discovery and visibility settings."
5363 }
5464 },
5555- "id": "site.standard.publication",
6565+ "$type": "com.atproto.lexicon.schema",
5666 "lexicon": 1
5757-}
6767+}
+1-1
lexicons-example/src/builder_types.rs
···4040 pub trait Sealed {}
4141 impl<T> Sealed for super::Set<T> {}
4242 impl Sealed for super::Unset {}
4343-}
4343+}
+1-1
lexicons-example/src/com_atproto.rs
···33// This file was automatically generated from Lexicon schemas.
44// Any manual changes will be overwritten on the next regeneration.
5566-pub mod repo;
66+pub mod repo;
+1-1
lexicons-example/src/com_atproto/repo.rs
···33// This file was automatically generated from Lexicon schemas.
44// Any manual changes will be overwritten on the next regeneration.
5566-pub mod strong_ref;
66+pub mod strong_ref;
···7788#[jacquard_derive::lexicon]
99#[derive(
1010- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
1010+ serde::Serialize,
1111+ serde::Deserialize,
1212+ Debug,
1313+ Clone,
1414+ PartialEq,
1515+ Eq,
1616+ jacquard_derive::IntoStatic
1117)]
1218#[serde(rename_all = "camelCase")]
1319pub struct StrongRef<'a> {
···19252026pub mod strong_ref_state {
21272222- pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
2828+ pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2329 #[allow(unused)]
2430 use ::core::marker::PhantomData;
2531 mod sealed {
···2733 }
2834 /// State trait tracking which required fields have been set
2935 pub trait State: sealed::Sealed {
3030- type Uri;
3136 type Cid;
3737+ type Uri;
3238 }
3339 /// Empty state - all required fields are unset
3440 pub struct Empty(());
3541 impl sealed::Sealed for Empty {}
3642 impl State for Empty {
3737- type Uri = Unset;
3843 type Cid = Unset;
3939- }
4040- ///State transition - sets the `uri` field to Set
4141- pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
4242- impl<S: State> sealed::Sealed for SetUri<S> {}
4343- impl<S: State> State for SetUri<S> {
4444- type Uri = Set<members::uri>;
4545- type Cid = S::Cid;
4444+ type Uri = Unset;
4645 }
4746 ///State transition - sets the `cid` field to Set
4847 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
4948 impl<S: State> sealed::Sealed for SetCid<S> {}
5049 impl<S: State> State for SetCid<S> {
5050+ type Cid = Set<members::cid>;
5151 type Uri = S::Uri;
5252- type Cid = Set<members::cid>;
5252+ }
5353+ ///State transition - sets the `uri` field to Set
5454+ pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
5555+ impl<S: State> sealed::Sealed for SetUri<S> {}
5656+ impl<S: State> State for SetUri<S> {
5757+ type Cid = S::Cid;
5858+ type Uri = Set<members::uri>;
5359 }
5460 /// Marker types for field names
5561 #[allow(non_camel_case_types)]
5662 pub mod members {
6363+ ///Marker type for the `cid` field
6464+ pub struct cid(());
5765 ///Marker type for the `uri` field
5866 pub struct uri(());
5959- ///Marker type for the `cid` field
6060- pub struct cid(());
6167 }
6268}
6369···130136impl<'a, S> StrongRefBuilder<'a, S>
131137where
132138 S: strong_ref_state::State,
133133- S::Uri: strong_ref_state::IsSet,
134139 S::Cid: strong_ref_state::IsSet,
140140+ S::Uri: strong_ref_state::IsSet,
135141{
136142 /// Build the final struct
137143 pub fn build(self) -> StrongRef<'a> {
···157163 }
158164}
159165160160-fn lexicon_doc_com_atproto_repo_strongRef() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
166166+fn lexicon_doc_com_atproto_repo_strongRef() -> ::jacquard_lexicon::lexicon::LexiconDoc<
167167+ 'static,
168168+> {
161169 ::jacquard_lexicon::lexicon::LexiconDoc {
162170 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
163171 id: ::jacquard_common::CowStr::new_static("com.atproto.repo.strongRef"),
···167175 let mut map = ::std::collections::BTreeMap::new();
168176 map.insert(
169177 ::jacquard_common::smol_str::SmolStr::new_static("main"),
170170- ::jacquard_lexicon::lexicon::LexUserType::Object(
171171- ::jacquard_lexicon::lexicon::LexObject {
172172- description: None,
173173- required: Some(vec![
178178+ ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
179179+ description: None,
180180+ required: Some(
181181+ vec![
174182 ::jacquard_common::smol_str::SmolStr::new_static("uri"),
183183+ ::jacquard_common::smol_str::SmolStr::new_static("cid")
184184+ ],
185185+ ),
186186+ nullable: None,
187187+ properties: {
188188+ #[allow(unused_mut)]
189189+ let mut map = ::std::collections::BTreeMap::new();
190190+ map.insert(
175191 ::jacquard_common::smol_str::SmolStr::new_static("cid"),
176176- ]),
177177- nullable: None,
178178- properties: {
179179- #[allow(unused_mut)]
180180- let mut map = ::std::collections::BTreeMap::new();
181181- map.insert(
182182- ::jacquard_common::smol_str::SmolStr::new_static("cid"),
183183- ::jacquard_lexicon::lexicon::LexObjectProperty::String(
184184- ::jacquard_lexicon::lexicon::LexString {
185185- description: None,
186186- format: Some(
187187- ::jacquard_lexicon::lexicon::LexStringFormat::Cid,
188188- ),
189189- default: None,
190190- min_length: None,
191191- max_length: None,
192192- min_graphemes: None,
193193- max_graphemes: None,
194194- r#enum: None,
195195- r#const: None,
196196- known_values: None,
197197- },
192192+ ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
193193+ description: None,
194194+ format: Some(
195195+ ::jacquard_lexicon::lexicon::LexStringFormat::Cid,
198196 ),
199199- );
200200- map.insert(
201201- ::jacquard_common::smol_str::SmolStr::new_static("uri"),
202202- ::jacquard_lexicon::lexicon::LexObjectProperty::String(
203203- ::jacquard_lexicon::lexicon::LexString {
204204- description: None,
205205- format: Some(
206206- ::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
207207- ),
208208- default: None,
209209- min_length: None,
210210- max_length: None,
211211- min_graphemes: None,
212212- max_graphemes: None,
213213- r#enum: None,
214214- r#const: None,
215215- known_values: None,
216216- },
197197+ default: None,
198198+ min_length: None,
199199+ max_length: None,
200200+ min_graphemes: None,
201201+ max_graphemes: None,
202202+ r#enum: None,
203203+ r#const: None,
204204+ known_values: None,
205205+ }),
206206+ );
207207+ map.insert(
208208+ ::jacquard_common::smol_str::SmolStr::new_static("uri"),
209209+ ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
210210+ description: None,
211211+ format: Some(
212212+ ::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
217213 ),
218218- );
219219- map
220220- },
214214+ default: None,
215215+ min_length: None,
216216+ max_length: None,
217217+ min_graphemes: None,
218218+ max_graphemes: None,
219219+ r#enum: None,
220220+ r#const: None,
221221+ known_values: None,
222222+ }),
223223+ );
224224+ map
221225 },
222222- ),
226226+ }),
223227 );
224228 map
225229 },
···241245 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
242246 Ok(())
243247 }
244244-}
248248+}
+1-1
lexicons-example/src/lib.rs
···99pub mod com_atproto;
10101111#[cfg(feature = "site_standard")]
1212-pub mod site_standard;
1212+pub mod site_standard;
+1-1
lexicons-example/src/site_standard.rs
···66pub mod document;
77pub mod graph;
88pub mod publication;
99-pub mod theme;
99+pub mod theme;
+176-80
lexicons-example/src/site_standard/document.rs
···55// This file was automatically generated from Lexicon schemas.
66// Any manual changes will be overwritten on the next regeneration.
7788+/// A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently.
89#[jacquard_derive::lexicon]
910#[derive(
1010- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
1111+ serde::Serialize,
1212+ serde::Deserialize,
1313+ Debug,
1414+ Clone,
1515+ PartialEq,
1616+ Eq,
1717+ jacquard_derive::IntoStatic
1118)]
1219#[serde(rename_all = "camelCase")]
1320pub struct Document<'a> {
2121+ /// Strong reference to a Bluesky post. Useful to keep track of comments off-platform.
1422 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1523 #[serde(borrow)]
1616- pub bsky_post_ref: std::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
2424+ pub bsky_post_ref: std::option::Option<
2525+ crate::com_atproto::repo::strong_ref::StrongRef<'a>,
2626+ >,
2727+ /// Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats.
1728 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1829 #[serde(borrow)]
1930 pub content: std::option::Option<jacquard_common::types::value::Data<'a>>,
3131+ /// Image to used for thumbnail or cover image. Less than 1MB is size.
2032 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2133 #[serde(borrow)]
2234 pub cover_image: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
3535+ /// A brief description or excerpt from the document.
2336 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2437 #[serde(borrow)]
2538 pub description: std::option::Option<jacquard_common::CowStr<'a>>,
2626- /// combine with the publication url or the document site to construct a full url to the document
3939+ /// Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash.
2740 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2841 #[serde(borrow)]
2942 pub path: std::option::Option<jacquard_common::CowStr<'a>>,
4343+ /// Timestamp of the documents publish time.
3044 pub published_at: jacquard_common::types::string::Datetime,
3131- /// URI to the site or publication this document belongs to (https or at-uri)
4545+ /// Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes.
3246 #[serde(borrow)]
3347 pub site: jacquard_common::types::string::Uri<'a>,
4848+ /// Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags.
3449 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3550 #[serde(borrow)]
3651 pub tags: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
5252+ /// Plaintext representation of the documents contents. Should not contain markdown or other formatting.
3753 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3854 #[serde(borrow)]
3955 pub text_content: std::option::Option<jacquard_common::CowStr<'a>>,
5656+ /// Title of the document.
4057 #[serde(borrow)]
4158 pub title: jacquard_common::CowStr<'a>,
5959+ /// Timestamp of the documents last edit.
4260 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4361 pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>,
4462}
45634664pub mod document_state {
47654848- pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
6666+ pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
4967 #[allow(unused)]
5068 use ::core::marker::PhantomData;
5169 mod sealed {
···5371 }
5472 /// State trait tracking which required fields have been set
5573 pub trait State: sealed::Sealed {
7474+ type PublishedAt;
5675 type Title;
5776 type Site;
5858- type PublishedAt;
5977 }
6078 /// Empty state - all required fields are unset
6179 pub struct Empty(());
6280 impl sealed::Sealed for Empty {}
6381 impl State for Empty {
8282+ type PublishedAt = Unset;
6483 type Title = Unset;
6584 type Site = Unset;
6666- type PublishedAt = Unset;
8585+ }
8686+ ///State transition - sets the `published_at` field to Set
8787+ pub struct SetPublishedAt<S: State = Empty>(PhantomData<fn() -> S>);
8888+ impl<S: State> sealed::Sealed for SetPublishedAt<S> {}
8989+ impl<S: State> State for SetPublishedAt<S> {
9090+ type PublishedAt = Set<members::published_at>;
9191+ type Title = S::Title;
9292+ type Site = S::Site;
6793 }
6894 ///State transition - sets the `title` field to Set
6995 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>);
7096 impl<S: State> sealed::Sealed for SetTitle<S> {}
7197 impl<S: State> State for SetTitle<S> {
9898+ type PublishedAt = S::PublishedAt;
7299 type Title = Set<members::title>;
73100 type Site = S::Site;
7474- type PublishedAt = S::PublishedAt;
75101 }
76102 ///State transition - sets the `site` field to Set
77103 pub struct SetSite<S: State = Empty>(PhantomData<fn() -> S>);
78104 impl<S: State> sealed::Sealed for SetSite<S> {}
79105 impl<S: State> State for SetSite<S> {
8080- type Title = S::Title;
8181- type Site = Set<members::site>;
82106 type PublishedAt = S::PublishedAt;
8383- }
8484- ///State transition - sets the `published_at` field to Set
8585- pub struct SetPublishedAt<S: State = Empty>(PhantomData<fn() -> S>);
8686- impl<S: State> sealed::Sealed for SetPublishedAt<S> {}
8787- impl<S: State> State for SetPublishedAt<S> {
88107 type Title = S::Title;
8989- type Site = S::Site;
9090- type PublishedAt = Set<members::published_at>;
108108+ type Site = Set<members::site>;
91109 }
92110 /// Marker types for field names
93111 #[allow(non_camel_case_types)]
94112 pub mod members {
113113+ ///Marker type for the `published_at` field
114114+ pub struct published_at(());
95115 ///Marker type for the `title` field
96116 pub struct title(());
97117 ///Marker type for the `site` field
98118 pub struct site(());
9999- ///Marker type for the `published_at` field
100100- pub struct published_at(());
101119 }
102120}
103121···133151 DocumentBuilder {
134152 _phantom_state: ::core::marker::PhantomData,
135153 __unsafe_private_named: (
136136- None, None, None, None, None, None, None, None, None, None, None,
154154+ None,
155155+ None,
156156+ None,
157157+ None,
158158+ None,
159159+ None,
160160+ None,
161161+ None,
162162+ None,
163163+ None,
164164+ None,
137165 ),
138166 _phantom: ::core::marker::PhantomData,
139167 }
···169197 self
170198 }
171199 /// Set the `content` field to an Option value (optional)
172172- pub fn maybe_content(mut self, value: Option<jacquard_common::types::value::Data<'a>>) -> Self {
200200+ pub fn maybe_content(
201201+ mut self,
202202+ value: Option<jacquard_common::types::value::Data<'a>>,
203203+ ) -> Self {
173204 self.__unsafe_private_named.1 = value;
174205 self
175206 }
···196227197228impl<'a, S: document_state::State> DocumentBuilder<'a, S> {
198229 /// Set the `description` field (optional)
199199- pub fn description(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self {
230230+ pub fn description(
231231+ mut self,
232232+ value: impl Into<Option<jacquard_common::CowStr<'a>>>,
233233+ ) -> Self {
200234 self.__unsafe_private_named.3 = value.into();
201235 self
202236 }
203237 /// Set the `description` field to an Option value (optional)
204204- pub fn maybe_description(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
238238+ pub fn maybe_description(
239239+ mut self,
240240+ value: Option<jacquard_common::CowStr<'a>>,
241241+ ) -> Self {
205242 self.__unsafe_private_named.3 = value;
206243 self
207244 }
···209246210247impl<'a, S: document_state::State> DocumentBuilder<'a, S> {
211248 /// Set the `path` field (optional)
212212- pub fn path(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self {
249249+ pub fn path(
250250+ mut self,
251251+ value: impl Into<Option<jacquard_common::CowStr<'a>>>,
252252+ ) -> Self {
213253 self.__unsafe_private_named.4 = value.into();
214254 self
215255 }
···260300261301impl<'a, S: document_state::State> DocumentBuilder<'a, S> {
262302 /// Set the `tags` field (optional)
263263- pub fn tags(mut self, value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>) -> Self {
303303+ pub fn tags(
304304+ mut self,
305305+ value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>,
306306+ ) -> Self {
264307 self.__unsafe_private_named.7 = value.into();
265308 self
266309 }
267310 /// Set the `tags` field to an Option value (optional)
268268- pub fn maybe_tags(mut self, value: Option<Vec<jacquard_common::CowStr<'a>>>) -> Self {
311311+ pub fn maybe_tags(
312312+ mut self,
313313+ value: Option<Vec<jacquard_common::CowStr<'a>>>,
314314+ ) -> Self {
269315 self.__unsafe_private_named.7 = value;
270316 self
271317 }
···273319274320impl<'a, S: document_state::State> DocumentBuilder<'a, S> {
275321 /// Set the `textContent` field (optional)
276276- pub fn text_content(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self {
322322+ pub fn text_content(
323323+ mut self,
324324+ value: impl Into<Option<jacquard_common::CowStr<'a>>>,
325325+ ) -> Self {
277326 self.__unsafe_private_named.8 = value.into();
278327 self
279328 }
280329 /// Set the `textContent` field to an Option value (optional)
281281- pub fn maybe_text_content(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
330330+ pub fn maybe_text_content(
331331+ mut self,
332332+ value: Option<jacquard_common::CowStr<'a>>,
333333+ ) -> Self {
282334 self.__unsafe_private_named.8 = value;
283335 self
284336 }
···325377impl<'a, S> DocumentBuilder<'a, S>
326378where
327379 S: document_state::State,
380380+ S::PublishedAt: document_state::IsSet,
328381 S::Title: document_state::IsSet,
329382 S::Site: document_state::IsSet,
330330- S::PublishedAt: document_state::IsSet,
331383{
332384 /// Build the final struct
333385 pub fn build(self) -> Document<'a> {
···386438387439/// Typed wrapper for GetRecord response with this collection's record type.
388440#[derive(
389389- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
441441+ serde::Serialize,
442442+ serde::Deserialize,
443443+ Debug,
444444+ Clone,
445445+ PartialEq,
446446+ Eq,
447447+ jacquard_derive::IntoStatic
390448)]
391449#[serde(rename_all = "camelCase")]
392450pub struct DocumentGetRecordOutput<'a> {
···441499 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
442500 if let Some(ref value) = self.description {
443501 #[allow(unused_comparisons)]
444444- if <str>::len(value.as_ref()) > 3000usize {
502502+ if <str>::len(value.as_ref()) > 30000usize {
445503 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
446446- path: ::jacquard_lexicon::validation::ValidationPath::from_field("description"),
447447- max: 3000usize,
504504+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
505505+ "description",
506506+ ),
507507+ max: 30000usize,
448508 actual: <str>::len(value.as_ref()),
449509 });
450510 }
451511 }
452512 if let Some(ref value) = self.description {
453513 {
454454- let count =
455455- ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true)
456456- .count();
457457- if count > 300usize {
458458- return Err(
459459- ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
460460- path: ::jacquard_lexicon::validation::ValidationPath::from_field(
461461- "description",
462462- ),
463463- max: 300usize,
464464- actual: count,
465465- },
466466- );
514514+ let count = ::unicode_segmentation::UnicodeSegmentation::graphemes(
515515+ value.as_ref(),
516516+ true,
517517+ )
518518+ .count();
519519+ if count > 3000usize {
520520+ return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
521521+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
522522+ "description",
523523+ ),
524524+ max: 3000usize,
525525+ actual: count,
526526+ });
467527 }
468528 }
469529 }
470530 {
471531 let value = &self.title;
472532 #[allow(unused_comparisons)]
473473- if <str>::len(value.as_ref()) > 1280usize {
533533+ if <str>::len(value.as_ref()) > 5000usize {
474534 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
475475- path: ::jacquard_lexicon::validation::ValidationPath::from_field("title"),
476476- max: 1280usize,
535535+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
536536+ "title",
537537+ ),
538538+ max: 5000usize,
477539 actual: <str>::len(value.as_ref()),
478540 });
479541 }
···481543 {
482544 let value = &self.title;
483545 {
484484- let count =
485485- ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true)
486486- .count();
487487- if count > 128usize {
488488- return Err(
489489- ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
490490- path: ::jacquard_lexicon::validation::ValidationPath::from_field(
491491- "title",
492492- ),
493493- max: 128usize,
494494- actual: count,
495495- },
496496- );
546546+ let count = ::unicode_segmentation::UnicodeSegmentation::graphemes(
547547+ value.as_ref(),
548548+ true,
549549+ )
550550+ .count();
551551+ if count > 500usize {
552552+ return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
553553+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
554554+ "title",
555555+ ),
556556+ max: 500usize,
557557+ actual: count,
558558+ });
497559 }
498560 }
499561 }
···501563 }
502564}
503565504504-fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
566566+fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconDoc<
567567+ 'static,
568568+> {
505569 ::jacquard_lexicon::lexicon::LexiconDoc {
506570 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
507571 id: ::jacquard_common::CowStr::new_static("site.standard.document"),
···512576 map.insert(
513577 ::jacquard_common::smol_str::SmolStr::new_static("main"),
514578 ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
515515- description: None,
579579+ description: Some(
580580+ ::jacquard_common::CowStr::new_static(
581581+ "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently.",
582582+ ),
583583+ ),
516584 key: Some(::jacquard_common::CowStr::new_static("tid")),
517585 record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
518586 description: None,
···541609 map.insert(
542610 ::jacquard_common::smol_str::SmolStr::new_static("content"),
543611 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
544544- description: None,
612612+ description: Some(
613613+ ::jacquard_common::CowStr::new_static(
614614+ "Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats.",
615615+ ),
616616+ ),
545617 refs: vec![],
546618 closed: Some(false),
547619 }),
···561633 "description",
562634 ),
563635 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
564564- description: None,
636636+ description: Some(
637637+ ::jacquard_common::CowStr::new_static(
638638+ "A brief description or excerpt from the document.",
639639+ ),
640640+ ),
565641 format: None,
566642 default: None,
567643 min_length: None,
568568- max_length: Some(3000usize),
644644+ max_length: Some(30000usize),
569645 min_graphemes: None,
570570- max_graphemes: Some(300usize),
646646+ max_graphemes: Some(3000usize),
571647 r#enum: None,
572648 r#const: None,
573649 known_values: None,
···578654 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
579655 description: Some(
580656 ::jacquard_common::CowStr::new_static(
581581- "combine with the publication url or the document site to construct a full url to the document",
657657+ "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash.",
582658 ),
583659 ),
584660 format: None,
···597673 "publishedAt",
598674 ),
599675 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
600600- description: None,
676676+ description: Some(
677677+ ::jacquard_common::CowStr::new_static(
678678+ "Timestamp of the documents publish time.",
679679+ ),
680680+ ),
601681 format: Some(
602682 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
603683 ),
···616696 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
617697 description: Some(
618698 ::jacquard_common::CowStr::new_static(
619619- "URI to the site or publication this document belongs to (https or at-uri)",
699699+ "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes.",
620700 ),
621701 ),
622702 format: Some(
···635715 map.insert(
636716 ::jacquard_common::smol_str::SmolStr::new_static("tags"),
637717 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
638638- description: None,
718718+ description: Some(
719719+ ::jacquard_common::CowStr::new_static(
720720+ "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags.",
721721+ ),
722722+ ),
639723 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
640724 description: None,
641725 format: None,
642726 default: None,
643727 min_length: None,
644644- max_length: Some(100usize),
728728+ max_length: Some(1280usize),
645729 min_graphemes: None,
646646- max_graphemes: Some(50usize),
730730+ max_graphemes: Some(128usize),
647731 r#enum: None,
648732 r#const: None,
649733 known_values: None,
···657741 "textContent",
658742 ),
659743 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
660660- description: None,
744744+ description: Some(
745745+ ::jacquard_common::CowStr::new_static(
746746+ "Plaintext representation of the documents contents. Should not contain markdown or other formatting.",
747747+ ),
748748+ ),
661749 format: None,
662750 default: None,
663751 min_length: None,
···672760 map.insert(
673761 ::jacquard_common::smol_str::SmolStr::new_static("title"),
674762 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
675675- description: None,
763763+ description: Some(
764764+ ::jacquard_common::CowStr::new_static(
765765+ "Title of the document.",
766766+ ),
767767+ ),
676768 format: None,
677769 default: None,
678770 min_length: None,
679679- max_length: Some(1280usize),
771771+ max_length: Some(5000usize),
680772 min_graphemes: None,
681681- max_graphemes: Some(128usize),
773773+ max_graphemes: Some(500usize),
682774 r#enum: None,
683775 r#const: None,
684776 known_values: None,
···689781 "updatedAt",
690782 ),
691783 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
692692- description: None,
784784+ description: Some(
785785+ ::jacquard_common::CowStr::new_static(
786786+ "Timestamp of the documents last edit.",
787787+ ),
788788+ ),
693789 format: Some(
694790 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
695791 ),
···711807 map
712808 },
713809 }
714714-}
810810+}
+1-1
lexicons-example/src/site_standard/graph.rs
···33// This file was automatically generated from Lexicon schemas.
44// Any manual changes will be overwritten on the next regeneration.
5566-pub mod subscription;
66+pub mod subscription;
···88/// Record declaring a subscription to a publication
99#[jacquard_derive::lexicon]
1010#[derive(
1111- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
1111+ serde::Serialize,
1212+ serde::Deserialize,
1313+ Debug,
1414+ Clone,
1515+ PartialEq,
1616+ Eq,
1717+ jacquard_derive::IntoStatic
1218)]
1319#[serde(rename_all = "camelCase")]
1420pub struct Subscription<'a> {
···19252026pub mod subscription_state {
21272222- pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
2828+ pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2329 #[allow(unused)]
2430 use ::core::marker::PhantomData;
2531 mod sealed {
···5258/// Builder for constructing an instance of this type
5359pub struct SubscriptionBuilder<'a, S: subscription_state::State> {
5460 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
5555- __unsafe_private_named: (::core::option::Option<jacquard_common::types::string::AtUri<'a>>,),
6161+ __unsafe_private_named: (
6262+ ::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
6363+ ),
5664 _phantom: ::core::marker::PhantomData<&'a ()>,
5765}
5866···135143136144/// Typed wrapper for GetRecord response with this collection's record type.
137145#[derive(
138138- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
146146+ serde::Serialize,
147147+ serde::Deserialize,
148148+ Debug,
149149+ Clone,
150150+ PartialEq,
151151+ Eq,
152152+ jacquard_derive::IntoStatic
139153)]
140154#[serde(rename_all = "camelCase")]
141155pub struct SubscriptionGetRecordOutput<'a> {
···192206 }
193207}
194208195195-fn lexicon_doc_site_standard_graph_subscription() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static>
196196-{
209209+fn lexicon_doc_site_standard_graph_subscription() -> ::jacquard_lexicon::lexicon::LexiconDoc<
210210+ 'static,
211211+> {
197212 ::jacquard_lexicon::lexicon::LexiconDoc {
198213 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
199214 id: ::jacquard_common::CowStr::new_static("site.standard.graph.subscription"),
···252267 map
253268 },
254269 }
255255-}
270270+}
+140-84
lexicons-example/src/site_standard/publication.rs
···55// This file was automatically generated from Lexicon schemas.
66// Any manual changes will be overwritten on the next regeneration.
7788+/// A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings.
89#[jacquard_derive::lexicon]
910#[derive(
1010- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
1111+ serde::Serialize,
1212+ serde::Deserialize,
1313+ Debug,
1414+ Clone,
1515+ PartialEq,
1616+ Eq,
1717+ jacquard_derive::IntoStatic
1118)]
1219#[serde(rename_all = "camelCase")]
1320pub struct Publication<'a> {
2121+ /// Simplified publication theme for tools and apps to utilize when displaying content.
1422 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1523 #[serde(borrow)]
1624 pub basic_theme: std::option::Option<crate::site_standard::theme::basic::Basic<'a>>,
2525+ /// Brief description of the publication.
1726 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1827 #[serde(borrow)]
1928 pub description: std::option::Option<jacquard_common::CowStr<'a>>,
2929+ /// Square image to identify the publication. Should be at least 256x256.
2030 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2131 #[serde(borrow)]
2232 pub icon: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
3333+ /// Name of the publication.
2334 #[serde(borrow)]
2435 pub name: jacquard_common::CowStr<'a>,
3636+ /// Object containing platform specific preferences (with a few shared properties).
2537 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2638 #[serde(borrow)]
2727- pub preferences: std::option::Option<crate::site_standard::publication::Preferences<'a>>,
3939+ pub preferences: std::option::Option<
4040+ crate::site_standard::publication::Preferences<'a>,
4141+ >,
4242+ /// Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path.
2843 #[serde(borrow)]
2944 pub url: jacquard_common::types::string::Uri<'a>,
3045}
31463247pub mod publication_state {
33483434- pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
4949+ pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
3550 #[allow(unused)]
3651 use ::core::marker::PhantomData;
3752 mod sealed {
···3954 }
4055 /// State trait tracking which required fields have been set
4156 pub trait State: sealed::Sealed {
4242- type Name;
4357 type Url;
5858+ type Name;
4459 }
4560 /// Empty state - all required fields are unset
4661 pub struct Empty(());
4762 impl sealed::Sealed for Empty {}
4863 impl State for Empty {
4949- type Name = Unset;
5064 type Url = Unset;
5151- }
5252- ///State transition - sets the `name` field to Set
5353- pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
5454- impl<S: State> sealed::Sealed for SetName<S> {}
5555- impl<S: State> State for SetName<S> {
5656- type Name = Set<members::name>;
5757- type Url = S::Url;
6565+ type Name = Unset;
5866 }
5967 ///State transition - sets the `url` field to Set
6068 pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>);
6169 impl<S: State> sealed::Sealed for SetUrl<S> {}
6270 impl<S: State> State for SetUrl<S> {
7171+ type Url = Set<members::url>;
6372 type Name = S::Name;
6464- type Url = Set<members::url>;
7373+ }
7474+ ///State transition - sets the `name` field to Set
7575+ pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
7676+ impl<S: State> sealed::Sealed for SetName<S> {}
7777+ impl<S: State> State for SetName<S> {
7878+ type Url = S::Url;
7979+ type Name = Set<members::name>;
6580 }
6681 /// Marker types for field names
6782 #[allow(non_camel_case_types)]
6883 pub mod members {
8484+ ///Marker type for the `url` field
8585+ pub struct url(());
6986 ///Marker type for the `name` field
7087 pub struct name(());
7171- ///Marker type for the `url` field
7272- pub struct url(());
7388 }
7489}
7590···126141127142impl<'a, S: publication_state::State> PublicationBuilder<'a, S> {
128143 /// Set the `description` field (optional)
129129- pub fn description(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self {
144144+ pub fn description(
145145+ mut self,
146146+ value: impl Into<Option<jacquard_common::CowStr<'a>>>,
147147+ ) -> Self {
130148 self.__unsafe_private_named.1 = value.into();
131149 self
132150 }
133151 /// Set the `description` field to an Option value (optional)
134134- pub fn maybe_description(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
152152+ pub fn maybe_description(
153153+ mut self,
154154+ value: Option<jacquard_common::CowStr<'a>>,
155155+ ) -> Self {
135156 self.__unsafe_private_named.1 = value;
136157 self
137158 }
···147168 self
148169 }
149170 /// Set the `icon` field to an Option value (optional)
150150- pub fn maybe_icon(mut self, value: Option<jacquard_common::types::blob::BlobRef<'a>>) -> Self {
171171+ pub fn maybe_icon(
172172+ mut self,
173173+ value: Option<jacquard_common::types::blob::BlobRef<'a>>,
174174+ ) -> Self {
151175 self.__unsafe_private_named.2 = value;
152176 self
153177 }
···213237impl<'a, S> PublicationBuilder<'a, S>
214238where
215239 S: publication_state::State,
216216- S::Name: publication_state::IsSet,
217240 S::Url: publication_state::IsSet,
241241+ S::Name: publication_state::IsSet,
218242{
219243 /// Build the final struct
220244 pub fn build(self) -> Publication<'a> {
···263287264288/// Typed wrapper for GetRecord response with this collection's record type.
265289#[derive(
266266- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
290290+ serde::Serialize,
291291+ serde::Deserialize,
292292+ Debug,
293293+ Clone,
294294+ PartialEq,
295295+ Eq,
296296+ jacquard_derive::IntoStatic
267297)]
268298#[serde(rename_all = "camelCase")]
269299pub struct PublicationGetRecordOutput<'a> {
···318348 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
319349 if let Some(ref value) = self.description {
320350 #[allow(unused_comparisons)]
321321- if <str>::len(value.as_ref()) > 3000usize {
351351+ if <str>::len(value.as_ref()) > 30000usize {
322352 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
323323- path: ::jacquard_lexicon::validation::ValidationPath::from_field("description"),
324324- max: 3000usize,
353353+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
354354+ "description",
355355+ ),
356356+ max: 30000usize,
325357 actual: <str>::len(value.as_ref()),
326358 });
327359 }
328360 }
329361 if let Some(ref value) = self.description {
330362 {
331331- let count =
332332- ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true)
333333- .count();
334334- if count > 300usize {
335335- return Err(
336336- ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
337337- path: ::jacquard_lexicon::validation::ValidationPath::from_field(
338338- "description",
339339- ),
340340- max: 300usize,
341341- actual: count,
342342- },
343343- );
363363+ let count = ::unicode_segmentation::UnicodeSegmentation::graphemes(
364364+ value.as_ref(),
365365+ true,
366366+ )
367367+ .count();
368368+ if count > 3000usize {
369369+ return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
370370+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
371371+ "description",
372372+ ),
373373+ max: 3000usize,
374374+ actual: count,
375375+ });
344376 }
345377 }
346378 }
347379 {
348380 let value = &self.name;
349381 #[allow(unused_comparisons)]
350350- if <str>::len(value.as_ref()) > 1280usize {
382382+ if <str>::len(value.as_ref()) > 5000usize {
351383 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
352352- path: ::jacquard_lexicon::validation::ValidationPath::from_field("name"),
353353- max: 1280usize,
384384+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
385385+ "name",
386386+ ),
387387+ max: 5000usize,
354388 actual: <str>::len(value.as_ref()),
355389 });
356390 }
···358392 {
359393 let value = &self.name;
360394 {
361361- let count =
362362- ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true)
363363- .count();
364364- if count > 128usize {
365365- return Err(
366366- ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
367367- path: ::jacquard_lexicon::validation::ValidationPath::from_field(
368368- "name",
369369- ),
370370- max: 128usize,
371371- actual: count,
372372- },
373373- );
395395+ let count = ::unicode_segmentation::UnicodeSegmentation::graphemes(
396396+ value.as_ref(),
397397+ true,
398398+ )
399399+ .count();
400400+ if count > 500usize {
401401+ return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
402402+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
403403+ "name",
404404+ ),
405405+ max: 500usize,
406406+ actual: count,
407407+ });
374408 }
375409 }
376410 }
···378412 }
379413}
380414381381-fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
415415+fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::LexiconDoc<
416416+ 'static,
417417+> {
382418 ::jacquard_lexicon::lexicon::LexiconDoc {
383419 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
384420 id: ::jacquard_common::CowStr::new_static("site.standard.publication"),
···389425 map.insert(
390426 ::jacquard_common::smol_str::SmolStr::new_static("main"),
391427 ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
392392- description: None,
428428+ description: Some(
429429+ ::jacquard_common::CowStr::new_static(
430430+ "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings.",
431431+ ),
432432+ ),
393433 key: Some(::jacquard_common::CowStr::new_static("tid")),
394434 record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
395435 description: None,
···419459 "description",
420460 ),
421461 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
422422- description: None,
462462+ description: Some(
463463+ ::jacquard_common::CowStr::new_static(
464464+ "Brief description of the publication.",
465465+ ),
466466+ ),
423467 format: None,
424468 default: None,
425469 min_length: None,
426426- max_length: Some(3000usize),
470470+ max_length: Some(30000usize),
427471 min_graphemes: None,
428428- max_graphemes: Some(300usize),
472472+ max_graphemes: Some(3000usize),
429473 r#enum: None,
430474 r#const: None,
431475 known_values: None,
···442486 map.insert(
443487 ::jacquard_common::smol_str::SmolStr::new_static("name"),
444488 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
445445- description: None,
489489+ description: Some(
490490+ ::jacquard_common::CowStr::new_static(
491491+ "Name of the publication.",
492492+ ),
493493+ ),
446494 format: None,
447495 default: None,
448496 min_length: None,
449449- max_length: Some(1280usize),
497497+ max_length: Some(5000usize),
450498 min_graphemes: None,
451451- max_graphemes: Some(128usize),
499499+ max_graphemes: Some(500usize),
452500 r#enum: None,
453501 r#const: None,
454502 known_values: None,
···466514 map.insert(
467515 ::jacquard_common::smol_str::SmolStr::new_static("url"),
468516 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
469469- description: None,
517517+ description: Some(
518518+ ::jacquard_common::CowStr::new_static(
519519+ "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path.",
520520+ ),
521521+ ),
470522 format: Some(
471523 ::jacquard_lexicon::lexicon::LexStringFormat::Uri,
472524 ),
···487539 );
488540 map.insert(
489541 ::jacquard_common::smol_str::SmolStr::new_static("preferences"),
490490- ::jacquard_lexicon::lexicon::LexUserType::Object(
491491- ::jacquard_lexicon::lexicon::LexObject {
492492- description: None,
493493- required: None,
494494- nullable: None,
495495- properties: {
496496- #[allow(unused_mut)]
497497- let mut map = ::std::collections::BTreeMap::new();
498498- map.insert(
499499- ::jacquard_common::smol_str::SmolStr::new_static("showInDiscover"),
500500- ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(
501501- ::jacquard_lexicon::lexicon::LexBoolean {
502502- description: None,
503503- default: None,
504504- r#const: None,
505505- },
506506- ),
507507- );
508508- map
509509- },
542542+ ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
543543+ description: Some(
544544+ ::jacquard_common::CowStr::new_static(
545545+ "Platform-specific preferences for the publication, including discovery and visibility settings.",
546546+ ),
547547+ ),
548548+ required: None,
549549+ nullable: None,
550550+ properties: {
551551+ #[allow(unused_mut)]
552552+ let mut map = ::std::collections::BTreeMap::new();
553553+ map.insert(
554554+ ::jacquard_common::smol_str::SmolStr::new_static(
555555+ "showInDiscover",
556556+ ),
557557+ ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
558558+ description: None,
559559+ default: None,
560560+ r#const: None,
561561+ }),
562562+ );
563563+ map
510564 },
511511- ),
565565+ }),
512566 );
513567 map
514568 },
515569 }
516570}
517571572572+/// Platform-specific preferences for the publication, including discovery and visibility settings.
518573#[jacquard_derive::lexicon]
519574#[derive(
520575 serde::Serialize,
···524579 PartialEq,
525580 Eq,
526581 jacquard_derive::IntoStatic,
527527- Default,
582582+ Default
528583)]
529584#[serde(rename_all = "camelCase")]
530585pub struct Preferences<'a> {
586586+ /// Boolean which decides whether the publication should appear in discovery feeds.
531587 #[serde(skip_serializing_if = "std::option::Option::is_none")]
532588 pub show_in_discover: std::option::Option<bool>,
533589}
···547603 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
548604 Ok(())
549605 }
550550-}
606606+}
+1-1
lexicons-example/src/site_standard/theme.rs
···44// Any manual changes will be overwritten on the next regeneration.
5566pub mod basic;
77-pub mod color;
77+pub mod color;
+29-21
lexicons-example/src/site_standard/theme/basic.rs
···88/// A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications.
99#[jacquard_derive::lexicon]
1010#[derive(
1111- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
1111+ serde::Serialize,
1212+ serde::Deserialize,
1313+ Debug,
1414+ Clone,
1515+ PartialEq,
1616+ Eq,
1717+ jacquard_derive::IntoStatic
1218)]
1319#[serde(rename_all = "camelCase")]
1420pub struct Basic<'a> {
···28342935pub mod basic_state {
30363131- pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
3737+ pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
3238 #[allow(unused)]
3339 use ::core::marker::PhantomData;
3440 mod sealed {
···3642 }
3743 /// State trait tracking which required fields have been set
3844 pub trait State: sealed::Sealed {
3939- type Background;
4045 type AccentForeground;
4146 type Accent;
4747+ type Background;
4248 type Foreground;
4349 }
4450 /// Empty state - all required fields are unset
4551 pub struct Empty(());
4652 impl sealed::Sealed for Empty {}
4753 impl State for Empty {
4848- type Background = Unset;
4954 type AccentForeground = Unset;
5055 type Accent = Unset;
5656+ type Background = Unset;
5157 type Foreground = Unset;
5258 }
5353- ///State transition - sets the `background` field to Set
5454- pub struct SetBackground<S: State = Empty>(PhantomData<fn() -> S>);
5555- impl<S: State> sealed::Sealed for SetBackground<S> {}
5656- impl<S: State> State for SetBackground<S> {
5757- type Background = Set<members::background>;
5858- type AccentForeground = S::AccentForeground;
5959- type Accent = S::Accent;
6060- type Foreground = S::Foreground;
6161- }
6259 ///State transition - sets the `accent_foreground` field to Set
6360 pub struct SetAccentForeground<S: State = Empty>(PhantomData<fn() -> S>);
6461 impl<S: State> sealed::Sealed for SetAccentForeground<S> {}
6562 impl<S: State> State for SetAccentForeground<S> {
6666- type Background = S::Background;
6763 type AccentForeground = Set<members::accent_foreground>;
6864 type Accent = S::Accent;
6565+ type Background = S::Background;
6966 type Foreground = S::Foreground;
7067 }
7168 ///State transition - sets the `accent` field to Set
7269 pub struct SetAccent<S: State = Empty>(PhantomData<fn() -> S>);
7370 impl<S: State> sealed::Sealed for SetAccent<S> {}
7471 impl<S: State> State for SetAccent<S> {
7272+ type AccentForeground = S::AccentForeground;
7373+ type Accent = Set<members::accent>;
7574 type Background = S::Background;
7575+ type Foreground = S::Foreground;
7676+ }
7777+ ///State transition - sets the `background` field to Set
7878+ pub struct SetBackground<S: State = Empty>(PhantomData<fn() -> S>);
7979+ impl<S: State> sealed::Sealed for SetBackground<S> {}
8080+ impl<S: State> State for SetBackground<S> {
7681 type AccentForeground = S::AccentForeground;
7777- type Accent = Set<members::accent>;
8282+ type Accent = S::Accent;
8383+ type Background = Set<members::background>;
7884 type Foreground = S::Foreground;
7985 }
8086 ///State transition - sets the `foreground` field to Set
8187 pub struct SetForeground<S: State = Empty>(PhantomData<fn() -> S>);
8288 impl<S: State> sealed::Sealed for SetForeground<S> {}
8389 impl<S: State> State for SetForeground<S> {
8484- type Background = S::Background;
8590 type AccentForeground = S::AccentForeground;
8691 type Accent = S::Accent;
9292+ type Background = S::Background;
8793 type Foreground = Set<members::foreground>;
8894 }
8995 /// Marker types for field names
9096 #[allow(non_camel_case_types)]
9197 pub mod members {
9292- ///Marker type for the `background` field
9393- pub struct background(());
9498 ///Marker type for the `accent_foreground` field
9599 pub struct accent_foreground(());
96100 ///Marker type for the `accent` field
97101 pub struct accent(());
102102+ ///Marker type for the `background` field
103103+ pub struct background(());
98104 ///Marker type for the `foreground` field
99105 pub struct foreground(());
100106 }
···209215impl<'a, S> BasicBuilder<'a, S>
210216where
211217 S: basic_state::State,
212212- S::Background: basic_state::IsSet,
213218 S::AccentForeground: basic_state::IsSet,
214219 S::Accent: basic_state::IsSet,
220220+ S::Background: basic_state::IsSet,
215221 S::Foreground: basic_state::IsSet,
216222{
217223 /// Build the final struct
···242248 }
243249}
244250245245-fn lexicon_doc_site_standard_theme_basic() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
251251+fn lexicon_doc_site_standard_theme_basic() -> ::jacquard_lexicon::lexicon::LexiconDoc<
252252+ 'static,
253253+> {
246254 ::jacquard_lexicon::lexicon::LexiconDoc {
247255 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
248256 id: ::jacquard_common::CowStr::new_static("site.standard.theme.basic"),
···356364 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
357365 Ok(())
358366 }
359359-}
367367+}
+195-167
lexicons-example/src/site_standard/theme/color.rs
···7788#[jacquard_derive::lexicon]
99#[derive(
1010- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
1010+ serde::Serialize,
1111+ serde::Deserialize,
1212+ Debug,
1313+ Clone,
1414+ PartialEq,
1515+ Eq,
1616+ jacquard_derive::IntoStatic
1117)]
1218#[serde(rename_all = "camelCase")]
1319pub struct Rgb<'a> {
···18241925pub mod rgb_state {
20262121- pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
2727+ pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2228 #[allow(unused)]
2329 use ::core::marker::PhantomData;
2430 mod sealed {
···2632 }
2733 /// State trait tracking which required fields have been set
2834 pub trait State: sealed::Sealed {
3535+ type G;
2936 type B;
3037 type R;
3131- type G;
3238 }
3339 /// Empty state - all required fields are unset
3440 pub struct Empty(());
3541 impl sealed::Sealed for Empty {}
3642 impl State for Empty {
4343+ type G = Unset;
3744 type B = Unset;
3845 type R = Unset;
3939- type G = Unset;
4646+ }
4747+ ///State transition - sets the `g` field to Set
4848+ pub struct SetG<S: State = Empty>(PhantomData<fn() -> S>);
4949+ impl<S: State> sealed::Sealed for SetG<S> {}
5050+ impl<S: State> State for SetG<S> {
5151+ type G = Set<members::g>;
5252+ type B = S::B;
5353+ type R = S::R;
4054 }
4155 ///State transition - sets the `b` field to Set
4256 pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>);
4357 impl<S: State> sealed::Sealed for SetB<S> {}
4458 impl<S: State> State for SetB<S> {
5959+ type G = S::G;
4560 type B = Set<members::b>;
4661 type R = S::R;
4747- type G = S::G;
4862 }
4963 ///State transition - sets the `r` field to Set
5064 pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>);
5165 impl<S: State> sealed::Sealed for SetR<S> {}
5266 impl<S: State> State for SetR<S> {
6767+ type G = S::G;
5368 type B = S::B;
5469 type R = Set<members::r>;
5555- type G = S::G;
5656- }
5757- ///State transition - sets the `g` field to Set
5858- pub struct SetG<S: State = Empty>(PhantomData<fn() -> S>);
5959- impl<S: State> sealed::Sealed for SetG<S> {}
6060- impl<S: State> State for SetG<S> {
6161- type B = S::B;
6262- type R = S::R;
6363- type G = Set<members::g>;
6470 }
6571 /// Marker types for field names
6672 #[allow(non_camel_case_types)]
6773 pub mod members {
7474+ ///Marker type for the `g` field
7575+ pub struct g(());
6876 ///Marker type for the `b` field
6977 pub struct b(());
7078 ///Marker type for the `r` field
7179 pub struct r(());
7272- ///Marker type for the `g` field
7373- pub struct g(());
7480 }
7581}
7682···154160impl<'a, S> RgbBuilder<'a, S>
155161where
156162 S: rgb_state::State,
163163+ S::G: rgb_state::IsSet,
157164 S::B: rgb_state::IsSet,
158165 S::R: rgb_state::IsSet,
159159- S::G: rgb_state::IsSet,
160166{
161167 /// Build the final struct
162168 pub fn build(self) -> Rgb<'a> {
···184190 }
185191}
186192187187-fn lexicon_doc_site_standard_theme_color() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
193193+fn lexicon_doc_site_standard_theme_color() -> ::jacquard_lexicon::lexicon::LexiconDoc<
194194+ 'static,
195195+> {
188196 ::jacquard_lexicon::lexicon::LexiconDoc {
189197 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
190198 id: ::jacquard_common::CowStr::new_static("site.standard.theme.color"),
···194202 let mut map = ::std::collections::BTreeMap::new();
195203 map.insert(
196204 ::jacquard_common::smol_str::SmolStr::new_static("rgb"),
197197- ::jacquard_lexicon::lexicon::LexUserType::Object(
198198- ::jacquard_lexicon::lexicon::LexObject {
199199- description: None,
200200- required: Some(vec![
205205+ ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
206206+ description: None,
207207+ required: Some(
208208+ vec![
201209 ::jacquard_common::smol_str::SmolStr::new_static("r"),
202210 ::jacquard_common::smol_str::SmolStr::new_static("g"),
211211+ ::jacquard_common::smol_str::SmolStr::new_static("b")
212212+ ],
213213+ ),
214214+ nullable: None,
215215+ properties: {
216216+ #[allow(unused_mut)]
217217+ let mut map = ::std::collections::BTreeMap::new();
218218+ map.insert(
203219 ::jacquard_common::smol_str::SmolStr::new_static("b"),
204204- ]),
205205- nullable: None,
206206- properties: {
207207- #[allow(unused_mut)]
208208- let mut map = ::std::collections::BTreeMap::new();
209209- map.insert(
210210- ::jacquard_common::smol_str::SmolStr::new_static("b"),
211211- ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(
212212- ::jacquard_lexicon::lexicon::LexInteger {
213213- description: None,
214214- default: None,
215215- minimum: Some(0i64),
216216- maximum: Some(255i64),
217217- r#enum: None,
218218- r#const: None,
219219- },
220220- ),
221221- );
222222- map.insert(
223223- ::jacquard_common::smol_str::SmolStr::new_static("g"),
224224- ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(
225225- ::jacquard_lexicon::lexicon::LexInteger {
226226- description: None,
227227- default: None,
228228- minimum: Some(0i64),
229229- maximum: Some(255i64),
230230- r#enum: None,
231231- r#const: None,
232232- },
233233- ),
234234- );
235235- map.insert(
236236- ::jacquard_common::smol_str::SmolStr::new_static("r"),
237237- ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(
238238- ::jacquard_lexicon::lexicon::LexInteger {
239239- description: None,
240240- default: None,
241241- minimum: Some(0i64),
242242- maximum: Some(255i64),
243243- r#enum: None,
244244- r#const: None,
245245- },
246246- ),
247247- );
248248- map
249249- },
220220+ ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
221221+ description: None,
222222+ default: None,
223223+ minimum: Some(0i64),
224224+ maximum: Some(255i64),
225225+ r#enum: None,
226226+ r#const: None,
227227+ }),
228228+ );
229229+ map.insert(
230230+ ::jacquard_common::smol_str::SmolStr::new_static("g"),
231231+ ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
232232+ description: None,
233233+ default: None,
234234+ minimum: Some(0i64),
235235+ maximum: Some(255i64),
236236+ r#enum: None,
237237+ r#const: None,
238238+ }),
239239+ );
240240+ map.insert(
241241+ ::jacquard_common::smol_str::SmolStr::new_static("r"),
242242+ ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
243243+ description: None,
244244+ default: None,
245245+ minimum: Some(0i64),
246246+ maximum: Some(255i64),
247247+ r#enum: None,
248248+ r#const: None,
249249+ }),
250250+ );
251251+ map
250252 },
251251- ),
253253+ }),
252254 );
253255 map.insert(
254256 ::jacquard_common::smol_str::SmolStr::new_static("rgba"),
255255- ::jacquard_lexicon::lexicon::LexUserType::Object(
256256- ::jacquard_lexicon::lexicon::LexObject {
257257- description: None,
258258- required: Some(vec![
257257+ ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
258258+ description: None,
259259+ required: Some(
260260+ vec![
259261 ::jacquard_common::smol_str::SmolStr::new_static("r"),
260262 ::jacquard_common::smol_str::SmolStr::new_static("g"),
261263 ::jacquard_common::smol_str::SmolStr::new_static("b"),
264264+ ::jacquard_common::smol_str::SmolStr::new_static("a")
265265+ ],
266266+ ),
267267+ nullable: None,
268268+ properties: {
269269+ #[allow(unused_mut)]
270270+ let mut map = ::std::collections::BTreeMap::new();
271271+ map.insert(
262272 ::jacquard_common::smol_str::SmolStr::new_static("a"),
263263- ]),
264264- nullable: None,
265265- properties: {
266266- #[allow(unused_mut)]
267267- let mut map = ::std::collections::BTreeMap::new();
268268- map.insert(
269269- ::jacquard_common::smol_str::SmolStr::new_static("a"),
270270- ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(
271271- ::jacquard_lexicon::lexicon::LexInteger {
272272- description: None,
273273- default: None,
274274- minimum: Some(0i64),
275275- maximum: Some(100i64),
276276- r#enum: None,
277277- r#const: None,
278278- },
279279- ),
280280- );
281281- map.insert(
282282- ::jacquard_common::smol_str::SmolStr::new_static("b"),
283283- ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(
284284- ::jacquard_lexicon::lexicon::LexInteger {
285285- description: None,
286286- default: None,
287287- minimum: Some(0i64),
288288- maximum: Some(255i64),
289289- r#enum: None,
290290- r#const: None,
291291- },
292292- ),
293293- );
294294- map.insert(
295295- ::jacquard_common::smol_str::SmolStr::new_static("g"),
296296- ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(
297297- ::jacquard_lexicon::lexicon::LexInteger {
298298- description: None,
299299- default: None,
300300- minimum: Some(0i64),
301301- maximum: Some(255i64),
302302- r#enum: None,
303303- r#const: None,
304304- },
305305- ),
306306- );
307307- map.insert(
308308- ::jacquard_common::smol_str::SmolStr::new_static("r"),
309309- ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(
310310- ::jacquard_lexicon::lexicon::LexInteger {
311311- description: None,
312312- default: None,
313313- minimum: Some(0i64),
314314- maximum: Some(255i64),
315315- r#enum: None,
316316- r#const: None,
317317- },
318318- ),
319319- );
320320- map
321321- },
273273+ ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
274274+ description: None,
275275+ default: None,
276276+ minimum: Some(0i64),
277277+ maximum: Some(100i64),
278278+ r#enum: None,
279279+ r#const: None,
280280+ }),
281281+ );
282282+ map.insert(
283283+ ::jacquard_common::smol_str::SmolStr::new_static("b"),
284284+ ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
285285+ description: None,
286286+ default: None,
287287+ minimum: Some(0i64),
288288+ maximum: Some(255i64),
289289+ r#enum: None,
290290+ r#const: None,
291291+ }),
292292+ );
293293+ map.insert(
294294+ ::jacquard_common::smol_str::SmolStr::new_static("g"),
295295+ ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
296296+ description: None,
297297+ default: None,
298298+ minimum: Some(0i64),
299299+ maximum: Some(255i64),
300300+ r#enum: None,
301301+ r#const: None,
302302+ }),
303303+ );
304304+ map.insert(
305305+ ::jacquard_common::smol_str::SmolStr::new_static("r"),
306306+ ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
307307+ description: None,
308308+ default: None,
309309+ minimum: Some(0i64),
310310+ maximum: Some(255i64),
311311+ r#enum: None,
312312+ r#const: None,
313313+ }),
314314+ );
315315+ map
322316 },
323323- ),
317317+ }),
324318 );
325319 map
326320 },
···344338 let value = &self.b;
345339 if *value > 255i64 {
346340 return Err(::jacquard_lexicon::validation::ConstraintError::Maximum {
347347- path: ::jacquard_lexicon::validation::ValidationPath::from_field("b"),
341341+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
342342+ "b",
343343+ ),
348344 max: 255i64,
349345 actual: *value,
350346 });
···354350 let value = &self.b;
355351 if *value < 0i64 {
356352 return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
357357- path: ::jacquard_lexicon::validation::ValidationPath::from_field("b"),
353353+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
354354+ "b",
355355+ ),
358356 min: 0i64,
359357 actual: *value,
360358 });
···364362 let value = &self.g;
365363 if *value > 255i64 {
366364 return Err(::jacquard_lexicon::validation::ConstraintError::Maximum {
367367- path: ::jacquard_lexicon::validation::ValidationPath::from_field("g"),
365365+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
366366+ "g",
367367+ ),
368368 max: 255i64,
369369 actual: *value,
370370 });
···374374 let value = &self.g;
375375 if *value < 0i64 {
376376 return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
377377- path: ::jacquard_lexicon::validation::ValidationPath::from_field("g"),
377377+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
378378+ "g",
379379+ ),
378380 min: 0i64,
379381 actual: *value,
380382 });
···384386 let value = &self.r;
385387 if *value > 255i64 {
386388 return Err(::jacquard_lexicon::validation::ConstraintError::Maximum {
387387- path: ::jacquard_lexicon::validation::ValidationPath::from_field("r"),
389389+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
390390+ "r",
391391+ ),
388392 max: 255i64,
389393 actual: *value,
390394 });
···394398 let value = &self.r;
395399 if *value < 0i64 {
396400 return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
397397- path: ::jacquard_lexicon::validation::ValidationPath::from_field("r"),
401401+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
402402+ "r",
403403+ ),
398404 min: 0i64,
399405 actual: *value,
400406 });
···406412407413#[jacquard_derive::lexicon]
408414#[derive(
409409- serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic,
415415+ serde::Serialize,
416416+ serde::Deserialize,
417417+ Debug,
418418+ Clone,
419419+ PartialEq,
420420+ Eq,
421421+ jacquard_derive::IntoStatic
410422)]
411423#[serde(rename_all = "camelCase")]
412424pub struct Rgba<'a> {
···418430419431pub mod rgba_state {
420432421421- pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
433433+ pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
422434 #[allow(unused)]
423435 use ::core::marker::PhantomData;
424436 mod sealed {
···427439 /// State trait tracking which required fields have been set
428440 pub trait State: sealed::Sealed {
429441 type A;
442442+ type G;
430443 type R;
431444 type B;
432432- type G;
433445 }
434446 /// Empty state - all required fields are unset
435447 pub struct Empty(());
436448 impl sealed::Sealed for Empty {}
437449 impl State for Empty {
438450 type A = Unset;
451451+ type G = Unset;
439452 type R = Unset;
440453 type B = Unset;
441441- type G = Unset;
442454 }
443455 ///State transition - sets the `a` field to Set
444456 pub struct SetA<S: State = Empty>(PhantomData<fn() -> S>);
445457 impl<S: State> sealed::Sealed for SetA<S> {}
446458 impl<S: State> State for SetA<S> {
447459 type A = Set<members::a>;
460460+ type G = S::G;
448461 type R = S::R;
449462 type B = S::B;
450450- type G = S::G;
463463+ }
464464+ ///State transition - sets the `g` field to Set
465465+ pub struct SetG<S: State = Empty>(PhantomData<fn() -> S>);
466466+ impl<S: State> sealed::Sealed for SetG<S> {}
467467+ impl<S: State> State for SetG<S> {
468468+ type A = S::A;
469469+ type G = Set<members::g>;
470470+ type R = S::R;
471471+ type B = S::B;
451472 }
452473 ///State transition - sets the `r` field to Set
453474 pub struct SetR<S: State = Empty>(PhantomData<fn() -> S>);
454475 impl<S: State> sealed::Sealed for SetR<S> {}
455476 impl<S: State> State for SetR<S> {
456477 type A = S::A;
478478+ type G = S::G;
457479 type R = Set<members::r>;
458480 type B = S::B;
459459- type G = S::G;
460481 }
461482 ///State transition - sets the `b` field to Set
462483 pub struct SetB<S: State = Empty>(PhantomData<fn() -> S>);
463484 impl<S: State> sealed::Sealed for SetB<S> {}
464485 impl<S: State> State for SetB<S> {
465486 type A = S::A;
466466- type R = S::R;
467467- type B = Set<members::b>;
468487 type G = S::G;
469469- }
470470- ///State transition - sets the `g` field to Set
471471- pub struct SetG<S: State = Empty>(PhantomData<fn() -> S>);
472472- impl<S: State> sealed::Sealed for SetG<S> {}
473473- impl<S: State> State for SetG<S> {
474474- type A = S::A;
475488 type R = S::R;
476476- type B = S::B;
477477- type G = Set<members::g>;
489489+ type B = Set<members::b>;
478490 }
479491 /// Marker types for field names
480492 #[allow(non_camel_case_types)]
481493 pub mod members {
482494 ///Marker type for the `a` field
483495 pub struct a(());
496496+ ///Marker type for the `g` field
497497+ pub struct g(());
484498 ///Marker type for the `r` field
485499 pub struct r(());
486500 ///Marker type for the `b` field
487501 pub struct b(());
488488- ///Marker type for the `g` field
489489- pub struct g(());
490502 }
491503}
492504···588600where
589601 S: rgba_state::State,
590602 S::A: rgba_state::IsSet,
603603+ S::G: rgba_state::IsSet,
591604 S::R: rgba_state::IsSet,
592605 S::B: rgba_state::IsSet,
593593- S::G: rgba_state::IsSet,
594606{
595607 /// Build the final struct
596608 pub fn build(self) -> Rgba<'a> {
···637649 let value = &self.a;
638650 if *value > 100i64 {
639651 return Err(::jacquard_lexicon::validation::ConstraintError::Maximum {
640640- path: ::jacquard_lexicon::validation::ValidationPath::from_field("a"),
652652+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
653653+ "a",
654654+ ),
641655 max: 100i64,
642656 actual: *value,
643657 });
···647661 let value = &self.a;
648662 if *value < 0i64 {
649663 return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
650650- path: ::jacquard_lexicon::validation::ValidationPath::from_field("a"),
664664+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
665665+ "a",
666666+ ),
651667 min: 0i64,
652668 actual: *value,
653669 });
···657673 let value = &self.b;
658674 if *value > 255i64 {
659675 return Err(::jacquard_lexicon::validation::ConstraintError::Maximum {
660660- path: ::jacquard_lexicon::validation::ValidationPath::from_field("b"),
676676+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
677677+ "b",
678678+ ),
661679 max: 255i64,
662680 actual: *value,
663681 });
···667685 let value = &self.b;
668686 if *value < 0i64 {
669687 return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
670670- path: ::jacquard_lexicon::validation::ValidationPath::from_field("b"),
688688+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
689689+ "b",
690690+ ),
671691 min: 0i64,
672692 actual: *value,
673693 });
···677697 let value = &self.g;
678698 if *value > 255i64 {
679699 return Err(::jacquard_lexicon::validation::ConstraintError::Maximum {
680680- path: ::jacquard_lexicon::validation::ValidationPath::from_field("g"),
700700+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
701701+ "g",
702702+ ),
681703 max: 255i64,
682704 actual: *value,
683705 });
···687709 let value = &self.g;
688710 if *value < 0i64 {
689711 return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
690690- path: ::jacquard_lexicon::validation::ValidationPath::from_field("g"),
712712+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
713713+ "g",
714714+ ),
691715 min: 0i64,
692716 actual: *value,
693717 });
···697721 let value = &self.r;
698722 if *value > 255i64 {
699723 return Err(::jacquard_lexicon::validation::ConstraintError::Maximum {
700700- path: ::jacquard_lexicon::validation::ValidationPath::from_field("r"),
724724+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
725725+ "r",
726726+ ),
701727 max: 255i64,
702728 actual: *value,
703729 });
···707733 let value = &self.r;
708734 if *value < 0i64 {
709735 return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
710710- path: ::jacquard_lexicon::validation::ValidationPath::from_field("r"),
736736+ path: ::jacquard_lexicon::validation::ValidationPath::from_field(
737737+ "r",
738738+ ),
711739 min: 0i64,
712740 actual: *value,
713741 });
···715743 }
716744 Ok(())
717745 }
718718-}
746746+}