// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.deckbelcher.richtext.facet // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. /** Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text.*/ #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ByteSlice<'a> { pub byte_end: i64, pub byte_start: i64, } pub mod byte_slice_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type ByteStart; type ByteEnd; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type ByteStart = Unset; type ByteEnd = Unset; } ///State transition - sets the `byte_start` field to Set pub struct SetByteStart(PhantomData S>); impl sealed::Sealed for SetByteStart {} impl State for SetByteStart { type ByteStart = Set; type ByteEnd = S::ByteEnd; } ///State transition - sets the `byte_end` field to Set pub struct SetByteEnd(PhantomData S>); impl sealed::Sealed for SetByteEnd {} impl State for SetByteEnd { type ByteStart = S::ByteStart; type ByteEnd = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `byte_start` field pub struct byte_start(()); ///Marker type for the `byte_end` field pub struct byte_end(()); } } /// Builder for constructing an instance of this type pub struct ByteSliceBuilder<'a, S: byte_slice_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: (::core::option::Option, ::core::option::Option), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ByteSlice<'a> { /// Create a new builder for this type pub fn new() -> ByteSliceBuilder<'a, byte_slice_state::Empty> { ByteSliceBuilder::new() } } impl<'a> ByteSliceBuilder<'a, byte_slice_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ByteSliceBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ByteSliceBuilder<'a, S> where S: byte_slice_state::State, S::ByteEnd: byte_slice_state::IsUnset, { /// Set the `byteEnd` field (required) pub fn byte_end( mut self, value: impl Into, ) -> ByteSliceBuilder<'a, byte_slice_state::SetByteEnd> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ByteSliceBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ByteSliceBuilder<'a, S> where S: byte_slice_state::State, S::ByteStart: byte_slice_state::IsUnset, { /// Set the `byteStart` field (required) pub fn byte_start( mut self, value: impl Into, ) -> ByteSliceBuilder<'a, byte_slice_state::SetByteStart> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ByteSliceBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ByteSliceBuilder<'a, S> where S: byte_slice_state::State, S::ByteStart: byte_slice_state::IsSet, S::ByteEnd: byte_slice_state::IsSet, { /// Build the final struct pub fn build(self) -> ByteSlice<'a> { ByteSlice { byte_end: self.__unsafe_private_named.0.unwrap(), byte_start: self.__unsafe_private_named.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> ByteSlice<'a> { ByteSlice { byte_end: self.__unsafe_private_named.0.unwrap(), byte_start: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } fn lexicon_doc_com_deckbelcher_richtext_facet() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("com.deckbelcher.richtext.facet"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("byteSlice"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Specifies the sub-string range a facet feature applies to.\nStart index is inclusive, end index is exclusive.\nIndices are zero-indexed, counting bytes of the UTF-8 encoded text.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("byteStart"), ::jacquard_common::smol_str::SmolStr::new_static("byteEnd") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("byteEnd"), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: Some(0i64), maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "byteStart", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: Some(0i64), maximum: None, r#enum: None, r#const: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("link"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Facet feature for a URL.\nThe text URL may have been simplified or truncated, but the facet reference should be a complete URL.", ), ), required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("uri")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); 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::Uri, ), 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.insert( ::jacquard_common::smol_str::SmolStr::new_static("main"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Annotation of a sub-string within rich text.\nExtends Bluesky's facet system to support DeckBelcher-specific features.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("index"), ::jacquard_common::smol_str::SmolStr::new_static("features") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("features"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: None, refs: vec![ ::jacquard_common::CowStr::new_static("#mention"), ::jacquard_common::CowStr::new_static("#link"), ::jacquard_common::CowStr::new_static("#tag") ], closed: None, }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("index"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#byteSlice"), }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("mention"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Facet feature for mention of another account.\nThe text is usually a handle, including an `@` prefix, but the facet reference is a DID.", ), ), required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("did")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("did"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Did, ), 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.insert( ::jacquard_common::smol_str::SmolStr::new_static("tag"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Facet feature for a hashtag.\nThe text usually includes a '#' prefix, but the facet reference should not.", ), ), required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("tag")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tag"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: Some(640usize), min_graphemes: None, max_graphemes: Some(64usize), r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map }, } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ByteSlice<'a> { fn nsid() -> &'static str { "com.deckbelcher.richtext.facet" } fn def_name() -> &'static str { "byteSlice" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_deckbelcher_richtext_facet() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { { let value = &self.byte_end; if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "byte_end", ), min: 0i64, actual: *value, }); } } { let value = &self.byte_start; if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "byte_start", ), min: 0i64, actual: *value, }); } } Ok(()) } } /** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.*/ #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Link<'a> { #[serde(borrow)] pub uri: jacquard_common::types::string::Uri<'a>, } pub mod link_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); } } /// Builder for constructing an instance of this type pub struct LinkBuilder<'a, S: link_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Link<'a> { /// Create a new builder for this type pub fn new() -> LinkBuilder<'a, link_state::Empty> { LinkBuilder::new() } } impl<'a> LinkBuilder<'a, link_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { LinkBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LinkBuilder<'a, S> where S: link_state::State, S::Uri: link_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> LinkBuilder<'a, link_state::SetUri> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); LinkBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LinkBuilder<'a, S> where S: link_state::State, S::Uri: link_state::IsSet, { /// Build the final struct pub fn build(self) -> Link<'a> { Link { uri: self.__unsafe_private_named.0.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> Link<'a> { Link { uri: self.__unsafe_private_named.0.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Link<'a> { fn nsid() -> &'static str { "com.deckbelcher.richtext.facet" } fn def_name() -> &'static str { "link" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_deckbelcher_richtext_facet() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /** Annotation of a sub-string within rich text. Extends Bluesky's facet system to support DeckBelcher-specific features.*/ #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Facet<'a> { #[serde(borrow)] pub features: Vec>, #[serde(borrow)] pub index: crate::com_deckbelcher::richtext::facet::ByteSlice<'a>, } pub mod facet_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Index; type Features; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Index = Unset; type Features = Unset; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { type Index = Set; type Features = S::Features; } ///State transition - sets the `features` field to Set pub struct SetFeatures(PhantomData S>); impl sealed::Sealed for SetFeatures {} impl State for SetFeatures { type Index = S::Index; type Features = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `index` field pub struct index(()); ///Marker type for the `features` field pub struct features(()); } } /// Builder for constructing an instance of this type pub struct FacetBuilder<'a, S: facet_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Facet<'a> { /// Create a new builder for this type pub fn new() -> FacetBuilder<'a, facet_state::Empty> { FacetBuilder::new() } } impl<'a> FacetBuilder<'a, facet_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { FacetBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FacetBuilder<'a, S> where S: facet_state::State, S::Features: facet_state::IsUnset, { /// Set the `features` field (required) pub fn features( mut self, value: impl Into>>, ) -> FacetBuilder<'a, facet_state::SetFeatures> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); FacetBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FacetBuilder<'a, S> where S: facet_state::State, S::Index: facet_state::IsUnset, { /// Set the `index` field (required) pub fn index( mut self, value: impl Into>, ) -> FacetBuilder<'a, facet_state::SetIndex> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); FacetBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FacetBuilder<'a, S> where S: facet_state::State, S::Index: facet_state::IsSet, S::Features: facet_state::IsSet, { /// Build the final struct pub fn build(self) -> Facet<'a> { Facet { features: self.__unsafe_private_named.0.unwrap(), index: self.__unsafe_private_named.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> Facet<'a> { Facet { features: self.__unsafe_private_named.0.unwrap(), index: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum FacetFeaturesItem<'a> { #[serde(rename = "com.deckbelcher.richtext.facet#mention")] Mention(Box>), #[serde(rename = "com.deckbelcher.richtext.facet#link")] Link(Box>), #[serde(rename = "com.deckbelcher.richtext.facet#tag")] Tag(Box>), } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Facet<'a> { fn nsid() -> &'static str { "com.deckbelcher.richtext.facet" } fn def_name() -> &'static str { "main" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_deckbelcher_richtext_facet() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /** Facet feature for mention of another account. The text is usually a handle, including an `@` prefix, but the facet reference is a DID.*/ #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Mention<'a> { #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, } pub mod mention_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); } } /// Builder for constructing an instance of this type pub struct MentionBuilder<'a, S: mention_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Mention<'a> { /// Create a new builder for this type pub fn new() -> MentionBuilder<'a, mention_state::Empty> { MentionBuilder::new() } } impl<'a> MentionBuilder<'a, mention_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { MentionBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> MentionBuilder<'a, S> where S: mention_state::State, S::Did: mention_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> MentionBuilder<'a, mention_state::SetDid> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); MentionBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> MentionBuilder<'a, S> where S: mention_state::State, S::Did: mention_state::IsSet, { /// Build the final struct pub fn build(self) -> Mention<'a> { Mention { did: self.__unsafe_private_named.0.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> Mention<'a> { Mention { did: self.__unsafe_private_named.0.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Mention<'a> { fn nsid() -> &'static str { "com.deckbelcher.richtext.facet" } fn def_name() -> &'static str { "mention" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_deckbelcher_richtext_facet() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not.*/ #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, Default )] #[serde(rename_all = "camelCase")] pub struct Tag<'a> { #[serde(borrow)] pub tag: jacquard_common::CowStr<'a>, } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Tag<'a> { fn nsid() -> &'static str { "com.deckbelcher.richtext.facet" } fn def_name() -> &'static str { "tag" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_deckbelcher_richtext_facet() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { { let value = &self.tag; #[allow(unused_comparisons)] if ::len(value.as_ref()) > 640usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "tag", ), max: 640usize, actual: ::len(value.as_ref()), }); } } { let value = &self.tag; { let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( value.as_ref(), true, ) .count(); if count > 64usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "tag", ), max: 64usize, actual: count, }); } } } Ok(()) } }