From 383336a320d7c5aa27675ae69e793be73e19f37c Mon Sep 17 00:00:00 2001 From: Thomas Karpiniec Date: Sun, 8 Mar 2026 19:11:28 +1100 Subject: [PATCH] Update lexicons --- .../lexicons/site.standard.document.json | 105 ++--- .../lexicons/site.standard.publication.json | 66 ++-- lexicons-example/src/builder_types.rs | 2 +- lexicons-example/src/com_atproto.rs | 2 +- lexicons-example/src/com_atproto/repo.rs | 2 +- .../src/com_atproto/repo/strong_ref.rs | 134 +++---- lexicons-example/src/lib.rs | 2 +- lexicons-example/src/site_standard.rs | 2 +- .../src/site_standard/document.rs | 256 +++++++++---- lexicons-example/src/site_standard/graph.rs | 2 +- .../src/site_standard/graph/subscription.rs | 29 +- .../src/site_standard/publication.rs | 224 +++++++---- lexicons-example/src/site_standard/theme.rs | 2 +- .../src/site_standard/theme/basic.rs | 50 ++- .../src/site_standard/theme/color.rs | 362 ++++++++++-------- 15 files changed, 734 insertions(+), 506 deletions(-) diff --git a/lexicons-example/lexicons/site.standard.document.json b/lexicons-example/lexicons/site.standard.document.json index 4c808c3..d0064b1 100644 --- a/lexicons-example/lexicons/site.standard.document.json +++ b/lexicons-example/lexicons/site.standard.document.json @@ -1,74 +1,85 @@ { + "id": "site.standard.document", "defs": { "main": { "key": "tid", + "type": "record", "record": { + "type": "object", + "required": [ + "site", + "title", + "publishedAt" + ], "properties": { - "bskyPostRef": { - "ref": "com.atproto.repo.strongRef", - "type": "ref" + "path": { + "type": "string", + "description": "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash." + }, + "site": { + "type": "string", + "format": "uri", + "description": "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes." + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "maxLength": 1280, + "maxGraphemes": 128 + }, + "description": "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags." + }, + "title": { + "type": "string", + "maxLength": 5000, + "description": "Title of the document.", + "maxGraphemes": 500 }, "content": { - "closed": false, "refs": [], - "type": "union" + "type": "union", + "closed": false, + "description": "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." + }, + "updatedAt": { + "type": "string", + "format": "datetime", + "description": "Timestamp of the documents last edit." }, "coverImage": { + "type": "blob", "accept": [ "image/*" ], "maxSize": 1000000, - "type": "blob" + "description": "Image to used for thumbnail or cover image. Less than 1MB is size." }, - "description": { - "maxGraphemes": 300, - "maxLength": 3000, - "type": "string" + "bskyPostRef": { + "ref": "com.atproto.repo.strongRef", + "type": "ref", + "description": "Strong reference to a Bluesky post. Useful to keep track of comments off-platform." }, - "path": { - "description": "combine with the publication url or the document site to construct a full url to the document", - "type": "string" + "description": { + "type": "string", + "maxLength": 30000, + "description": "A brief description or excerpt from the document.", + "maxGraphemes": 3000 }, "publishedAt": { + "type": "string", "format": "datetime", - "type": "string" - }, - "site": { - "description": "URI to the site or publication this document belongs to (https or at-uri)", - "format": "uri", - "type": "string" - }, - "tags": { - "items": { - "maxGraphemes": 50, - "maxLength": 100, - "type": "string" - }, - "type": "array" + "description": "Timestamp of the documents publish time." }, "textContent": { - "type": "string" - }, - "title": { - "maxGraphemes": 128, - "maxLength": 1280, - "type": "string" - }, - "updatedAt": { - "format": "datetime", - "type": "string" + "type": "string", + "description": "Plaintext representation of the documents contents. Should not contain markdown or other formatting." } - }, - "required": [ - "site", - "title", - "publishedAt" - ], - "type": "object" + } }, - "type": "record" + "description": "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently." } }, - "id": "site.standard.document", + "$type": "com.atproto.lexicon.schema", "lexicon": 1 -} +} \ No newline at end of file diff --git a/lexicons-example/lexicons/site.standard.publication.json b/lexicons-example/lexicons/site.standard.publication.json index fc6e3fb..93a3a34 100644 --- a/lexicons-example/lexicons/site.standard.publication.json +++ b/lexicons-example/lexicons/site.standard.publication.json @@ -1,57 +1,67 @@ { + "id": "site.standard.publication", "defs": { "main": { "key": "tid", + "type": "record", "record": { + "type": "object", + "required": [ + "url", + "name" + ], "properties": { - "basicTheme": { - "ref": "site.standard.theme.basic", - "type": "ref" - }, - "description": { - "maxGraphemes": 300, - "maxLength": 3000, - "type": "string" + "url": { + "type": "string", + "format": "uri", + "description": "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path." }, "icon": { + "type": "blob", "accept": [ "image/*" ], "maxSize": 1000000, - "type": "blob" + "description": "Square image to identify the publication. Should be at least 256x256." }, "name": { - "maxGraphemes": 128, - "maxLength": 1280, - "type": "string" + "type": "string", + "maxLength": 5000, + "description": "Name of the publication.", + "maxGraphemes": 500 + }, + "basicTheme": { + "ref": "site.standard.theme.basic", + "type": "ref", + "description": "Simplified publication theme for tools and apps to utilize when displaying content." + }, + "description": { + "type": "string", + "maxLength": 30000, + "description": "Brief description of the publication.", + "maxGraphemes": 3000 }, "preferences": { "ref": "#preferences", - "type": "ref" - }, - "url": { - "format": "uri", - "type": "string" + "type": "ref", + "description": "Object containing platform specific preferences (with a few shared properties)." } - }, - "required": [ - "url", - "name" - ], - "type": "object" + } }, - "type": "record" + "description": "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings." }, "preferences": { + "type": "object", "properties": { "showInDiscover": { + "type": "boolean", "default": true, - "type": "boolean" + "description": "Boolean which decides whether the publication should appear in discovery feeds." } }, - "type": "object" + "description": "Platform-specific preferences for the publication, including discovery and visibility settings." } }, - "id": "site.standard.publication", + "$type": "com.atproto.lexicon.schema", "lexicon": 1 -} +} \ No newline at end of file diff --git a/lexicons-example/src/builder_types.rs b/lexicons-example/src/builder_types.rs index d4b0bc4..5deeb86 100644 --- a/lexicons-example/src/builder_types.rs +++ b/lexicons-example/src/builder_types.rs @@ -40,4 +40,4 @@ mod private { pub trait Sealed {} impl Sealed for super::Set {} impl Sealed for super::Unset {} -} +} \ No newline at end of file diff --git a/lexicons-example/src/com_atproto.rs b/lexicons-example/src/com_atproto.rs index 80674cd..501e17d 100644 --- a/lexicons-example/src/com_atproto.rs +++ b/lexicons-example/src/com_atproto.rs @@ -3,4 +3,4 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. -pub mod repo; +pub mod repo; \ No newline at end of file diff --git a/lexicons-example/src/com_atproto/repo.rs b/lexicons-example/src/com_atproto/repo.rs index 1d58de6..3c65f8f 100644 --- a/lexicons-example/src/com_atproto/repo.rs +++ b/lexicons-example/src/com_atproto/repo.rs @@ -3,4 +3,4 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. -pub mod strong_ref; +pub mod strong_ref; \ No newline at end of file diff --git a/lexicons-example/src/com_atproto/repo/strong_ref.rs b/lexicons-example/src/com_atproto/repo/strong_ref.rs index bf2a4c4..9a034c1 100644 --- a/lexicons-example/src/com_atproto/repo/strong_ref.rs +++ b/lexicons-example/src/com_atproto/repo/strong_ref.rs @@ -7,7 +7,13 @@ #[jacquard_derive::lexicon] #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct StrongRef<'a> { @@ -19,7 +25,7 @@ pub struct StrongRef<'a> { pub mod strong_ref_state { - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -27,37 +33,37 @@ pub mod strong_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Cid; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Cid = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Cid = S::Cid; + type Uri = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; type Cid = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Cid = S::Cid; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -130,8 +136,8 @@ where impl<'a, S> StrongRefBuilder<'a, S> where S: strong_ref_state::State, - S::Uri: strong_ref_state::IsSet, S::Cid: strong_ref_state::IsSet, + S::Uri: strong_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> StrongRef<'a> { @@ -157,7 +163,9 @@ where } } -fn lexicon_doc_com_atproto_repo_strongRef() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { +fn lexicon_doc_com_atproto_repo_strongRef() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("com.atproto.repo.strongRef"), @@ -167,59 +175,55 @@ fn lexicon_doc_com_atproto_repo_strongRef() -> ::jacquard_lexicon::lexicon::Lexi let mut map = ::std::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("main"), - ::jacquard_lexicon::lexicon::LexUserType::Object( - ::jacquard_lexicon::lexicon::LexObject { - description: None, - required: Some(vec![ + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("cid") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( ::jacquard_common::smol_str::SmolStr::new_static("cid"), - ]), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::std::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("cid"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String( - ::jacquard_lexicon::lexicon::LexString { - description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::Cid, - ), - default: None, - min_length: None, - max_length: None, - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }, + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, ), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("uri"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String( - ::jacquard_lexicon::lexicon::LexString { - description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, - ), - default: None, - min_length: None, - max_length: None, - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), - ); - map - }, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map }, - ), + }), ); map }, @@ -241,4 +245,4 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StrongRef<'a> { ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } -} +} \ No newline at end of file diff --git a/lexicons-example/src/lib.rs b/lexicons-example/src/lib.rs index 7b63d74..bac2281 100644 --- a/lexicons-example/src/lib.rs +++ b/lexicons-example/src/lib.rs @@ -9,4 +9,4 @@ pub mod builder_types; pub mod com_atproto; #[cfg(feature = "site_standard")] -pub mod site_standard; +pub mod site_standard; \ No newline at end of file diff --git a/lexicons-example/src/site_standard.rs b/lexicons-example/src/site_standard.rs index ddb6898..8b95214 100644 --- a/lexicons-example/src/site_standard.rs +++ b/lexicons-example/src/site_standard.rs @@ -6,4 +6,4 @@ pub mod document; pub mod graph; pub mod publication; -pub mod theme; +pub mod theme; \ No newline at end of file diff --git a/lexicons-example/src/site_standard/document.rs b/lexicons-example/src/site_standard/document.rs index 6948ead..1bee878 100644 --- a/lexicons-example/src/site_standard/document.rs +++ b/lexicons-example/src/site_standard/document.rs @@ -5,47 +5,65 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. +/// A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently. #[jacquard_derive::lexicon] #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Document<'a> { + /// Strong reference to a Bluesky post. Useful to keep track of comments off-platform. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] - pub bsky_post_ref: std::option::Option>, + pub bsky_post_ref: std::option::Option< + crate::com_atproto::repo::strong_ref::StrongRef<'a>, + >, + /// 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. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub content: std::option::Option>, + /// Image to used for thumbnail or cover image. Less than 1MB is size. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub cover_image: std::option::Option>, + /// A brief description or excerpt from the document. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub description: std::option::Option>, - /// combine with the publication url or the document site to construct a full url to the document + /// Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub path: std::option::Option>, + /// Timestamp of the documents publish time. pub published_at: jacquard_common::types::string::Datetime, - /// URI to the site or publication this document belongs to (https or at-uri) + /// Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes. #[serde(borrow)] pub site: jacquard_common::types::string::Uri<'a>, + /// Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub tags: std::option::Option>>, + /// Plaintext representation of the documents contents. Should not contain markdown or other formatting. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub text_content: std::option::Option>, + /// Title of the document. #[serde(borrow)] pub title: jacquard_common::CowStr<'a>, + /// Timestamp of the documents last edit. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub updated_at: std::option::Option, } pub mod document_state { - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -53,51 +71,51 @@ pub mod document_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type PublishedAt; type Title; type Site; - type PublishedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type PublishedAt = Unset; type Title = Unset; type Site = Unset; - type PublishedAt = Unset; + } + ///State transition - sets the `published_at` field to Set + pub struct SetPublishedAt(PhantomData S>); + impl sealed::Sealed for SetPublishedAt {} + impl State for SetPublishedAt { + type PublishedAt = Set; + type Title = S::Title; + type Site = S::Site; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { + type PublishedAt = S::PublishedAt; type Title = Set; type Site = S::Site; - type PublishedAt = S::PublishedAt; } ///State transition - sets the `site` field to Set pub struct SetSite(PhantomData S>); impl sealed::Sealed for SetSite {} impl State for SetSite { - type Title = S::Title; - type Site = Set; type PublishedAt = S::PublishedAt; - } - ///State transition - sets the `published_at` field to Set - pub struct SetPublishedAt(PhantomData S>); - impl sealed::Sealed for SetPublishedAt {} - impl State for SetPublishedAt { type Title = S::Title; - type Site = S::Site; - type PublishedAt = Set; + type Site = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `published_at` field + pub struct published_at(()); ///Marker type for the `title` field pub struct title(()); ///Marker type for the `site` field pub struct site(()); - ///Marker type for the `published_at` field - pub struct published_at(()); } } @@ -133,7 +151,17 @@ impl<'a> DocumentBuilder<'a, document_state::Empty> { DocumentBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: ( - None, None, None, None, None, None, None, None, None, None, None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, ), _phantom: ::core::marker::PhantomData, } @@ -169,7 +197,10 @@ impl<'a, S: document_state::State> DocumentBuilder<'a, S> { self } /// Set the `content` field to an Option value (optional) - pub fn maybe_content(mut self, value: Option>) -> Self { + pub fn maybe_content( + mut self, + value: Option>, + ) -> Self { self.__unsafe_private_named.1 = value; self } @@ -196,12 +227,18 @@ impl<'a, S: document_state::State> DocumentBuilder<'a, S> { impl<'a, S: document_state::State> DocumentBuilder<'a, S> { /// Set the `description` field (optional) - pub fn description(mut self, value: impl Into>>) -> Self { + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { self.__unsafe_private_named.3 = value.into(); self } /// Set the `description` field to an Option value (optional) - pub fn maybe_description(mut self, value: Option>) -> Self { + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { self.__unsafe_private_named.3 = value; self } @@ -209,7 +246,10 @@ impl<'a, S: document_state::State> DocumentBuilder<'a, S> { impl<'a, S: document_state::State> DocumentBuilder<'a, S> { /// Set the `path` field (optional) - pub fn path(mut self, value: impl Into>>) -> Self { + pub fn path( + mut self, + value: impl Into>>, + ) -> Self { self.__unsafe_private_named.4 = value.into(); self } @@ -260,12 +300,18 @@ where impl<'a, S: document_state::State> DocumentBuilder<'a, S> { /// Set the `tags` field (optional) - pub fn tags(mut self, value: impl Into>>>) -> Self { + pub fn tags( + mut self, + value: impl Into>>>, + ) -> Self { self.__unsafe_private_named.7 = value.into(); self } /// Set the `tags` field to an Option value (optional) - pub fn maybe_tags(mut self, value: Option>>) -> Self { + pub fn maybe_tags( + mut self, + value: Option>>, + ) -> Self { self.__unsafe_private_named.7 = value; self } @@ -273,12 +319,18 @@ impl<'a, S: document_state::State> DocumentBuilder<'a, S> { impl<'a, S: document_state::State> DocumentBuilder<'a, S> { /// Set the `textContent` field (optional) - pub fn text_content(mut self, value: impl Into>>) -> Self { + pub fn text_content( + mut self, + value: impl Into>>, + ) -> Self { self.__unsafe_private_named.8 = value.into(); self } /// Set the `textContent` field to an Option value (optional) - pub fn maybe_text_content(mut self, value: Option>) -> Self { + pub fn maybe_text_content( + mut self, + value: Option>, + ) -> Self { self.__unsafe_private_named.8 = value; self } @@ -325,9 +377,9 @@ impl<'a, S: document_state::State> DocumentBuilder<'a, S> { impl<'a, S> DocumentBuilder<'a, S> where S: document_state::State, + S::PublishedAt: document_state::IsSet, S::Title: document_state::IsSet, S::Site: document_state::IsSet, - S::PublishedAt: document_state::IsSet, { /// Build the final struct pub fn build(self) -> Document<'a> { @@ -386,7 +438,13 @@ impl<'a> Document<'a> { /// Typed wrapper for GetRecord response with this collection's record type. #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct DocumentGetRecordOutput<'a> { @@ -441,39 +499,43 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Document<'a> { ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { if let Some(ref value) = self.description { #[allow(unused_comparisons)] - if ::len(value.as_ref()) > 3000usize { + if ::len(value.as_ref()) > 30000usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("description"), - max: 3000usize, + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 30000usize, actual: ::len(value.as_ref()), }); } } if let Some(ref value) = self.description { { - let count = - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) - .count(); - if count > 300usize { - return Err( - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { - path: ::jacquard_lexicon::validation::ValidationPath::from_field( - "description", - ), - max: 300usize, - actual: count, - }, - ); + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 3000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 3000usize, + actual: count, + }); } } } { let value = &self.title; #[allow(unused_comparisons)] - if ::len(value.as_ref()) > 1280usize { + if ::len(value.as_ref()) > 5000usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("title"), - max: 1280usize, + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "title", + ), + max: 5000usize, actual: ::len(value.as_ref()), }); } @@ -481,19 +543,19 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Document<'a> { { let value = &self.title; { - let count = - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) - .count(); - if count > 128usize { - return Err( - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { - path: ::jacquard_lexicon::validation::ValidationPath::from_field( - "title", - ), - max: 128usize, - actual: count, - }, - ); + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 500usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "title", + ), + max: 500usize, + actual: count, + }); } } } @@ -501,7 +563,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Document<'a> { } } -fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { +fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("site.standard.document"), @@ -512,7 +576,11 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD map.insert( ::jacquard_common::smol_str::SmolStr::new_static("main"), ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently.", + ), + ), key: Some(::jacquard_common::CowStr::new_static("tid")), record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { description: None, @@ -541,7 +609,11 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD map.insert( ::jacquard_common::smol_str::SmolStr::new_static("content"), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "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.", + ), + ), refs: vec![], closed: Some(false), }), @@ -561,13 +633,17 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD "description", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "A brief description or excerpt from the document.", + ), + ), format: None, default: None, min_length: None, - max_length: Some(3000usize), + max_length: Some(30000usize), min_graphemes: None, - max_graphemes: Some(300usize), + max_graphemes: Some(3000usize), r#enum: None, r#const: None, known_values: None, @@ -578,7 +654,7 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( - "combine with the publication url or the document site to construct a full url to the document", + "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash.", ), ), format: None, @@ -597,7 +673,11 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD "publishedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp of the documents publish time.", + ), + ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), @@ -616,7 +696,7 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( - "URI to the site or publication this document belongs to (https or at-uri)", + "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes.", ), ), format: Some( @@ -635,15 +715,19 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags.", + ), + ), items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, - max_length: Some(100usize), + max_length: Some(1280usize), min_graphemes: None, - max_graphemes: Some(50usize), + max_graphemes: Some(128usize), r#enum: None, r#const: None, known_values: None, @@ -657,7 +741,11 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD "textContent", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Plaintext representation of the documents contents. Should not contain markdown or other formatting.", + ), + ), format: None, default: None, min_length: None, @@ -672,13 +760,17 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD map.insert( ::jacquard_common::smol_str::SmolStr::new_static("title"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Title of the document.", + ), + ), format: None, default: None, min_length: None, - max_length: Some(1280usize), + max_length: Some(5000usize), min_graphemes: None, - max_graphemes: Some(128usize), + max_graphemes: Some(500usize), r#enum: None, r#const: None, known_values: None, @@ -689,7 +781,11 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD "updatedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp of the documents last edit.", + ), + ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), @@ -711,4 +807,4 @@ fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconD map }, } -} +} \ No newline at end of file diff --git a/lexicons-example/src/site_standard/graph.rs b/lexicons-example/src/site_standard/graph.rs index f6dd500..061b7c3 100644 --- a/lexicons-example/src/site_standard/graph.rs +++ b/lexicons-example/src/site_standard/graph.rs @@ -3,4 +3,4 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. -pub mod subscription; +pub mod subscription; \ No newline at end of file diff --git a/lexicons-example/src/site_standard/graph/subscription.rs b/lexicons-example/src/site_standard/graph/subscription.rs index caf87ef..e40bdd0 100644 --- a/lexicons-example/src/site_standard/graph/subscription.rs +++ b/lexicons-example/src/site_standard/graph/subscription.rs @@ -8,7 +8,13 @@ /// Record declaring a subscription to a publication #[jacquard_derive::lexicon] #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Subscription<'a> { @@ -19,7 +25,7 @@ pub struct Subscription<'a> { pub mod subscription_state { - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -52,7 +58,9 @@ pub mod subscription_state { /// Builder for constructing an instance of this type pub struct SubscriptionBuilder<'a, S: subscription_state::State> { _phantom_state: ::core::marker::PhantomData S>, - __unsafe_private_named: (::core::option::Option>,), + __unsafe_private_named: ( + ::core::option::Option>, + ), _phantom: ::core::marker::PhantomData<&'a ()>, } @@ -135,7 +143,13 @@ impl<'a> Subscription<'a> { /// Typed wrapper for GetRecord response with this collection's record type. #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct SubscriptionGetRecordOutput<'a> { @@ -192,8 +206,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Subscription<'a> { } } -fn lexicon_doc_site_standard_graph_subscription() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> -{ +fn lexicon_doc_site_standard_graph_subscription() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("site.standard.graph.subscription"), @@ -252,4 +267,4 @@ fn lexicon_doc_site_standard_graph_subscription() -> ::jacquard_lexicon::lexicon map }, } -} +} \ No newline at end of file diff --git a/lexicons-example/src/site_standard/publication.rs b/lexicons-example/src/site_standard/publication.rs index ced9e99..bf1bd13 100644 --- a/lexicons-example/src/site_standard/publication.rs +++ b/lexicons-example/src/site_standard/publication.rs @@ -5,33 +5,48 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. +/// A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings. #[jacquard_derive::lexicon] #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Publication<'a> { + /// Simplified publication theme for tools and apps to utilize when displaying content. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub basic_theme: std::option::Option>, + /// Brief description of the publication. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub description: std::option::Option>, + /// Square image to identify the publication. Should be at least 256x256. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub icon: std::option::Option>, + /// Name of the publication. #[serde(borrow)] pub name: jacquard_common::CowStr<'a>, + /// Object containing platform specific preferences (with a few shared properties). #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] - pub preferences: std::option::Option>, + pub preferences: std::option::Option< + crate::site_standard::publication::Preferences<'a>, + >, + /// Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path. #[serde(borrow)] pub url: jacquard_common::types::string::Uri<'a>, } pub mod publication_state { - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -39,37 +54,37 @@ pub mod publication_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; type Url; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Name = Unset; type Url = Unset; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Name = Set; - type Url = S::Url; + type Name = Unset; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { - type Name = S::Name; type Url = Set; + type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Url = S::Url; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `url` field pub struct url(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -126,12 +141,18 @@ impl<'a, S: publication_state::State> PublicationBuilder<'a, S> { impl<'a, S: publication_state::State> PublicationBuilder<'a, S> { /// Set the `description` field (optional) - pub fn description(mut self, value: impl Into>>) -> Self { + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `description` field to an Option value (optional) - pub fn maybe_description(mut self, value: Option>) -> Self { + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { self.__unsafe_private_named.1 = value; self } @@ -147,7 +168,10 @@ impl<'a, S: publication_state::State> PublicationBuilder<'a, S> { self } /// Set the `icon` field to an Option value (optional) - pub fn maybe_icon(mut self, value: Option>) -> Self { + pub fn maybe_icon( + mut self, + value: Option>, + ) -> Self { self.__unsafe_private_named.2 = value; self } @@ -213,8 +237,8 @@ where impl<'a, S> PublicationBuilder<'a, S> where S: publication_state::State, - S::Name: publication_state::IsSet, S::Url: publication_state::IsSet, + S::Name: publication_state::IsSet, { /// Build the final struct pub fn build(self) -> Publication<'a> { @@ -263,7 +287,13 @@ impl<'a> Publication<'a> { /// Typed wrapper for GetRecord response with this collection's record type. #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct PublicationGetRecordOutput<'a> { @@ -318,39 +348,43 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Publication<'a> { ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { if let Some(ref value) = self.description { #[allow(unused_comparisons)] - if ::len(value.as_ref()) > 3000usize { + if ::len(value.as_ref()) > 30000usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("description"), - max: 3000usize, + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 30000usize, actual: ::len(value.as_ref()), }); } } if let Some(ref value) = self.description { { - let count = - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) - .count(); - if count > 300usize { - return Err( - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { - path: ::jacquard_lexicon::validation::ValidationPath::from_field( - "description", - ), - max: 300usize, - actual: count, - }, - ); + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 3000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 3000usize, + actual: count, + }); } } } { let value = &self.name; #[allow(unused_comparisons)] - if ::len(value.as_ref()) > 1280usize { + if ::len(value.as_ref()) > 5000usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("name"), - max: 1280usize, + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 5000usize, actual: ::len(value.as_ref()), }); } @@ -358,19 +392,19 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Publication<'a> { { let value = &self.name; { - let count = - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) - .count(); - if count > 128usize { - return Err( - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { - path: ::jacquard_lexicon::validation::ValidationPath::from_field( - "name", - ), - max: 128usize, - actual: count, - }, - ); + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 500usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 500usize, + actual: count, + }); } } } @@ -378,7 +412,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Publication<'a> { } } -fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { +fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("site.standard.publication"), @@ -389,7 +425,11 @@ fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::Lexic map.insert( ::jacquard_common::smol_str::SmolStr::new_static("main"), ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings.", + ), + ), key: Some(::jacquard_common::CowStr::new_static("tid")), record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { description: None, @@ -419,13 +459,17 @@ fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::Lexic "description", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Brief description of the publication.", + ), + ), format: None, default: None, min_length: None, - max_length: Some(3000usize), + max_length: Some(30000usize), min_graphemes: None, - max_graphemes: Some(300usize), + max_graphemes: Some(3000usize), r#enum: None, r#const: None, known_values: None, @@ -442,13 +486,17 @@ fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::Lexic map.insert( ::jacquard_common::smol_str::SmolStr::new_static("name"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Name of the publication.", + ), + ), format: None, default: None, min_length: None, - max_length: Some(1280usize), + max_length: Some(5000usize), min_graphemes: None, - max_graphemes: Some(128usize), + max_graphemes: Some(500usize), r#enum: None, r#const: None, known_values: None, @@ -466,7 +514,11 @@ fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::Lexic map.insert( ::jacquard_common::smol_str::SmolStr::new_static("url"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path.", + ), + ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Uri, ), @@ -487,34 +539,37 @@ fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::Lexic ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("preferences"), - ::jacquard_lexicon::lexicon::LexUserType::Object( - ::jacquard_lexicon::lexicon::LexObject { - description: None, - required: None, - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::std::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("showInDiscover"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean( - ::jacquard_lexicon::lexicon::LexBoolean { - description: None, - default: None, - r#const: None, - }, - ), - ); - map - }, + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Platform-specific preferences for the publication, including discovery and visibility settings.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "showInDiscover", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map }, - ), + }), ); map }, } } +/// Platform-specific preferences for the publication, including discovery and visibility settings. #[jacquard_derive::lexicon] #[derive( serde::Serialize, @@ -524,10 +579,11 @@ fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::Lexic PartialEq, Eq, jacquard_derive::IntoStatic, - Default, + Default )] #[serde(rename_all = "camelCase")] pub struct Preferences<'a> { + /// Boolean which decides whether the publication should appear in discovery feeds. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub show_in_discover: std::option::Option, } @@ -547,4 +603,4 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Preferences<'a> { ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } -} +} \ No newline at end of file diff --git a/lexicons-example/src/site_standard/theme.rs b/lexicons-example/src/site_standard/theme.rs index bee0804..a7391de 100644 --- a/lexicons-example/src/site_standard/theme.rs +++ b/lexicons-example/src/site_standard/theme.rs @@ -4,4 +4,4 @@ // Any manual changes will be overwritten on the next regeneration. pub mod basic; -pub mod color; +pub mod color; \ No newline at end of file diff --git a/lexicons-example/src/site_standard/theme/basic.rs b/lexicons-example/src/site_standard/theme/basic.rs index 83551a9..96543e6 100644 --- a/lexicons-example/src/site_standard/theme/basic.rs +++ b/lexicons-example/src/site_standard/theme/basic.rs @@ -8,7 +8,13 @@ /// A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications. #[jacquard_derive::lexicon] #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Basic<'a> { @@ -28,7 +34,7 @@ pub struct Basic<'a> { pub mod basic_state { - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -36,65 +42,65 @@ pub mod basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Background; type AccentForeground; type Accent; + type Background; type Foreground; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Background = Unset; type AccentForeground = Unset; type Accent = Unset; + type Background = Unset; type Foreground = Unset; } - ///State transition - sets the `background` field to Set - pub struct SetBackground(PhantomData S>); - impl sealed::Sealed for SetBackground {} - impl State for SetBackground { - type Background = Set; - type AccentForeground = S::AccentForeground; - type Accent = S::Accent; - type Foreground = S::Foreground; - } ///State transition - sets the `accent_foreground` field to Set pub struct SetAccentForeground(PhantomData S>); impl sealed::Sealed for SetAccentForeground {} impl State for SetAccentForeground { - type Background = S::Background; type AccentForeground = Set; type Accent = S::Accent; + type Background = S::Background; type Foreground = S::Foreground; } ///State transition - sets the `accent` field to Set pub struct SetAccent(PhantomData S>); impl sealed::Sealed for SetAccent {} impl State for SetAccent { - type Background = S::Background; type AccentForeground = S::AccentForeground; type Accent = Set; + type Background = S::Background; + type Foreground = S::Foreground; + } + ///State transition - sets the `background` field to Set + pub struct SetBackground(PhantomData S>); + impl sealed::Sealed for SetBackground {} + impl State for SetBackground { + type AccentForeground = S::AccentForeground; + type Accent = S::Accent; + type Background = Set; type Foreground = S::Foreground; } ///State transition - sets the `foreground` field to Set pub struct SetForeground(PhantomData S>); impl sealed::Sealed for SetForeground {} impl State for SetForeground { - type Background = S::Background; type AccentForeground = S::AccentForeground; type Accent = S::Accent; + type Background = S::Background; type Foreground = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `background` field - pub struct background(()); ///Marker type for the `accent_foreground` field pub struct accent_foreground(()); ///Marker type for the `accent` field pub struct accent(()); + ///Marker type for the `background` field + pub struct background(()); ///Marker type for the `foreground` field pub struct foreground(()); } @@ -209,9 +215,9 @@ where impl<'a, S> BasicBuilder<'a, S> where S: basic_state::State, - S::Background: basic_state::IsSet, S::AccentForeground: basic_state::IsSet, S::Accent: basic_state::IsSet, + S::Background: basic_state::IsSet, S::Foreground: basic_state::IsSet, { /// Build the final struct @@ -242,7 +248,9 @@ where } } -fn lexicon_doc_site_standard_theme_basic() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { +fn lexicon_doc_site_standard_theme_basic() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("site.standard.theme.basic"), @@ -356,4 +364,4 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Basic<'a> { ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } -} +} \ No newline at end of file diff --git a/lexicons-example/src/site_standard/theme/color.rs b/lexicons-example/src/site_standard/theme/color.rs index 4a8b068..a612a3e 100644 --- a/lexicons-example/src/site_standard/theme/color.rs +++ b/lexicons-example/src/site_standard/theme/color.rs @@ -7,7 +7,13 @@ #[jacquard_derive::lexicon] #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Rgb<'a> { @@ -18,7 +24,7 @@ pub struct Rgb<'a> { pub mod rgb_state { - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -26,51 +32,51 @@ pub mod rgb_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type G; type B; type R; - type G; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type G = Unset; type B = Unset; type R = Unset; - type G = Unset; + } + ///State transition - sets the `g` field to Set + pub struct SetG(PhantomData S>); + impl sealed::Sealed for SetG {} + impl State for SetG { + type G = Set; + type B = S::B; + type R = S::R; } ///State transition - sets the `b` field to Set pub struct SetB(PhantomData S>); impl sealed::Sealed for SetB {} impl State for SetB { + type G = S::G; type B = Set; type R = S::R; - type G = S::G; } ///State transition - sets the `r` field to Set pub struct SetR(PhantomData S>); impl sealed::Sealed for SetR {} impl State for SetR { - type B = S::B; - type R = Set; type G = S::G; - } - ///State transition - sets the `g` field to Set - pub struct SetG(PhantomData S>); - impl sealed::Sealed for SetG {} - impl State for SetG { type B = S::B; - type R = S::R; - type G = Set; + type R = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `g` field + pub struct g(()); ///Marker type for the `b` field pub struct b(()); ///Marker type for the `r` field pub struct r(()); - ///Marker type for the `g` field - pub struct g(()); } } @@ -154,9 +160,9 @@ where impl<'a, S> RgbBuilder<'a, S> where S: rgb_state::State, + S::G: rgb_state::IsSet, S::B: rgb_state::IsSet, S::R: rgb_state::IsSet, - S::G: rgb_state::IsSet, { /// Build the final struct pub fn build(self) -> Rgb<'a> { @@ -184,7 +190,9 @@ where } } -fn lexicon_doc_site_standard_theme_color() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { +fn lexicon_doc_site_standard_theme_color() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("site.standard.theme.color"), @@ -194,133 +202,119 @@ fn lexicon_doc_site_standard_theme_color() -> ::jacquard_lexicon::lexicon::Lexic let mut map = ::std::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("rgb"), - ::jacquard_lexicon::lexicon::LexUserType::Object( - ::jacquard_lexicon::lexicon::LexObject { - description: None, - required: Some(vec![ + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ ::jacquard_common::smol_str::SmolStr::new_static("r"), ::jacquard_common::smol_str::SmolStr::new_static("g"), + ::jacquard_common::smol_str::SmolStr::new_static("b") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( ::jacquard_common::smol_str::SmolStr::new_static("b"), - ]), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::std::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("b"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( - ::jacquard_lexicon::lexicon::LexInteger { - description: None, - default: None, - minimum: Some(0i64), - maximum: Some(255i64), - r#enum: None, - r#const: None, - }, - ), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("g"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( - ::jacquard_lexicon::lexicon::LexInteger { - description: None, - default: None, - minimum: Some(0i64), - maximum: Some(255i64), - r#enum: None, - r#const: None, - }, - ), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("r"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( - ::jacquard_lexicon::lexicon::LexInteger { - description: None, - default: None, - minimum: Some(0i64), - maximum: Some(255i64), - r#enum: None, - r#const: None, - }, - ), - ); - map - }, + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: Some(255i64), + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("g"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: Some(255i64), + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("r"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: Some(255i64), + r#enum: None, + r#const: None, + }), + ); + map }, - ), + }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("rgba"), - ::jacquard_lexicon::lexicon::LexUserType::Object( - ::jacquard_lexicon::lexicon::LexObject { - description: None, - required: Some(vec![ + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ ::jacquard_common::smol_str::SmolStr::new_static("r"), ::jacquard_common::smol_str::SmolStr::new_static("g"), ::jacquard_common::smol_str::SmolStr::new_static("b"), + ::jacquard_common::smol_str::SmolStr::new_static("a") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( ::jacquard_common::smol_str::SmolStr::new_static("a"), - ]), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::std::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("a"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( - ::jacquard_lexicon::lexicon::LexInteger { - description: None, - default: None, - minimum: Some(0i64), - maximum: Some(100i64), - r#enum: None, - r#const: None, - }, - ), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("b"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( - ::jacquard_lexicon::lexicon::LexInteger { - description: None, - default: None, - minimum: Some(0i64), - maximum: Some(255i64), - r#enum: None, - r#const: None, - }, - ), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("g"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( - ::jacquard_lexicon::lexicon::LexInteger { - description: None, - default: None, - minimum: Some(0i64), - maximum: Some(255i64), - r#enum: None, - r#const: None, - }, - ), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("r"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( - ::jacquard_lexicon::lexicon::LexInteger { - description: None, - default: None, - minimum: Some(0i64), - maximum: Some(255i64), - r#enum: None, - r#const: None, - }, - ), - ); - map - }, + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: Some(100i64), + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("b"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: Some(255i64), + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("g"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: Some(255i64), + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("r"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: Some(255i64), + r#enum: None, + r#const: None, + }), + ); + map }, - ), + }), ); map }, @@ -344,7 +338,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgb<'a> { let value = &self.b; if *value > 255i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("b"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "b", + ), max: 255i64, actual: *value, }); @@ -354,7 +350,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgb<'a> { let value = &self.b; if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("b"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "b", + ), min: 0i64, actual: *value, }); @@ -364,7 +362,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgb<'a> { let value = &self.g; if *value > 255i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("g"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "g", + ), max: 255i64, actual: *value, }); @@ -374,7 +374,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgb<'a> { let value = &self.g; if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("g"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "g", + ), min: 0i64, actual: *value, }); @@ -384,7 +386,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgb<'a> { let value = &self.r; if *value > 255i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("r"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "r", + ), max: 255i64, actual: *value, }); @@ -394,7 +398,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgb<'a> { let value = &self.r; if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("r"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "r", + ), min: 0i64, actual: *value, }); @@ -406,7 +412,13 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgb<'a> { #[jacquard_derive::lexicon] #[derive( - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Rgba<'a> { @@ -418,7 +430,7 @@ pub struct Rgba<'a> { pub mod rgba_state { - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -427,66 +439,66 @@ pub mod rgba_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type A; + type G; type R; type B; - type G; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type A = Unset; + type G = Unset; type R = Unset; type B = Unset; - type G = Unset; } ///State transition - sets the `a` field to Set pub struct SetA(PhantomData S>); impl sealed::Sealed for SetA {} impl State for SetA { type A = Set; + type G = S::G; + type R = S::R; + type B = S::B; + } + ///State transition - sets the `g` field to Set + pub struct SetG(PhantomData S>); + impl sealed::Sealed for SetG {} + impl State for SetG { + type A = S::A; + type G = Set; type R = S::R; type B = S::B; - type G = S::G; } ///State transition - sets the `r` field to Set pub struct SetR(PhantomData S>); impl sealed::Sealed for SetR {} impl State for SetR { type A = S::A; + type G = S::G; type R = Set; type B = S::B; - type G = S::G; } ///State transition - sets the `b` field to Set pub struct SetB(PhantomData S>); impl sealed::Sealed for SetB {} impl State for SetB { type A = S::A; - type R = S::R; - type B = Set; type G = S::G; - } - ///State transition - sets the `g` field to Set - pub struct SetG(PhantomData S>); - impl sealed::Sealed for SetG {} - impl State for SetG { - type A = S::A; type R = S::R; - type B = S::B; - type G = Set; + type B = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `a` field pub struct a(()); + ///Marker type for the `g` field + pub struct g(()); ///Marker type for the `r` field pub struct r(()); ///Marker type for the `b` field pub struct b(()); - ///Marker type for the `g` field - pub struct g(()); } } @@ -588,9 +600,9 @@ impl<'a, S> RgbaBuilder<'a, S> where S: rgba_state::State, S::A: rgba_state::IsSet, + S::G: rgba_state::IsSet, S::R: rgba_state::IsSet, S::B: rgba_state::IsSet, - S::G: rgba_state::IsSet, { /// Build the final struct pub fn build(self) -> Rgba<'a> { @@ -637,7 +649,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgba<'a> { let value = &self.a; if *value > 100i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("a"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "a", + ), max: 100i64, actual: *value, }); @@ -647,7 +661,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgba<'a> { let value = &self.a; if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("a"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "a", + ), min: 0i64, actual: *value, }); @@ -657,7 +673,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgba<'a> { let value = &self.b; if *value > 255i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("b"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "b", + ), max: 255i64, actual: *value, }); @@ -667,7 +685,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgba<'a> { let value = &self.b; if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("b"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "b", + ), min: 0i64, actual: *value, }); @@ -677,7 +697,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgba<'a> { let value = &self.g; if *value > 255i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("g"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "g", + ), max: 255i64, actual: *value, }); @@ -687,7 +709,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgba<'a> { let value = &self.g; if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("g"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "g", + ), min: 0i64, actual: *value, }); @@ -697,7 +721,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgba<'a> { let value = &self.r; if *value > 255i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("r"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "r", + ), max: 255i64, actual: *value, }); @@ -707,7 +733,9 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgba<'a> { let value = &self.r; if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { - path: ::jacquard_lexicon::validation::ValidationPath::from_field("r"), + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "r", + ), min: 0i64, actual: *value, }); @@ -715,4 +743,4 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Rgba<'a> { } Ok(()) } -} +} \ No newline at end of file -- 2.51.2