// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: pub.leaflet.pages.linearDocument // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Block<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub alignment: std::option::Option>, #[serde(borrow)] pub block: BlockBlock<'a>, } pub mod block_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 Block; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Block = Unset; } ///State transition - sets the `block` field to Set pub struct SetBlock(PhantomData S>); impl sealed::Sealed for SetBlock {} impl State for SetBlock { type Block = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `block` field pub struct block(()); } } /// Builder for constructing an instance of this type pub struct BlockBuilder<'a, S: block_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Block<'a> { /// Create a new builder for this type pub fn new() -> BlockBuilder<'a, block_state::Empty> { BlockBuilder::new() } } impl<'a> BlockBuilder<'a, block_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { BlockBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S: block_state::State> BlockBuilder<'a, S> { /// Set the `alignment` field (optional) pub fn alignment(mut self, value: impl Into>>) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `alignment` field to an Option value (optional) pub fn maybe_alignment(mut self, value: Option>) -> Self { self.__unsafe_private_named.0 = value; self } } impl<'a, S> BlockBuilder<'a, S> where S: block_state::State, S::Block: block_state::IsUnset, { /// Set the `block` field (required) pub fn block( mut self, value: impl Into>, ) -> BlockBuilder<'a, block_state::SetBlock> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); BlockBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> BlockBuilder<'a, S> where S: block_state::State, S::Block: block_state::IsSet, { /// Build the final struct pub fn build(self) -> Block<'a> { Block { alignment: self.__unsafe_private_named.0, block: 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>, >, ) -> Block<'a> { Block { alignment: self.__unsafe_private_named.0, block: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum BlockAlignment<'a> { TextAlignLeft, TextAlignCenter, TextAlignRight, TextAlignJustify, Other(jacquard_common::CowStr<'a>), } impl<'a> BlockAlignment<'a> { pub fn as_str(&self) -> &str { match self { Self::TextAlignLeft => "#textAlignLeft", Self::TextAlignCenter => "#textAlignCenter", Self::TextAlignRight => "#textAlignRight", Self::TextAlignJustify => "#textAlignJustify", Self::Other(s) => s.as_ref(), } } } impl<'a> From<&'a str> for BlockAlignment<'a> { fn from(s: &'a str) -> Self { match s { "#textAlignLeft" => Self::TextAlignLeft, "#textAlignCenter" => Self::TextAlignCenter, "#textAlignRight" => Self::TextAlignRight, "#textAlignJustify" => Self::TextAlignJustify, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> From for BlockAlignment<'a> { fn from(s: String) -> Self { match s.as_str() { "#textAlignLeft" => Self::TextAlignLeft, "#textAlignCenter" => Self::TextAlignCenter, "#textAlignRight" => Self::TextAlignRight, "#textAlignJustify" => Self::TextAlignJustify, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> core::fmt::Display for BlockAlignment<'a> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl<'a> AsRef for BlockAlignment<'a> { fn as_ref(&self) -> &str { self.as_str() } } impl<'a> serde::Serialize for BlockAlignment<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, 'a> serde::Deserialize<'de> for BlockAlignment<'a> where 'de: 'a, { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = <&'de str>::deserialize(deserializer)?; Ok(Self::from(s)) } } impl<'a> Default for BlockAlignment<'a> { fn default() -> Self { Self::Other(Default::default()) } } impl jacquard_common::IntoStatic for BlockAlignment<'_> { type Output = BlockAlignment<'static>; fn into_static(self) -> Self::Output { match self { BlockAlignment::TextAlignLeft => BlockAlignment::TextAlignLeft, BlockAlignment::TextAlignCenter => BlockAlignment::TextAlignCenter, BlockAlignment::TextAlignRight => BlockAlignment::TextAlignRight, BlockAlignment::TextAlignJustify => BlockAlignment::TextAlignJustify, BlockAlignment::Other(v) => BlockAlignment::Other(v.into_static()), } } } #[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 BlockBlock<'a> { #[serde(rename = "pub.leaflet.blocks.iframe")] Iframe(Box>), #[serde(rename = "pub.leaflet.blocks.text")] Text(Box>), #[serde(rename = "pub.leaflet.blocks.blockquote")] Blockquote(Box>), #[serde(rename = "pub.leaflet.blocks.header")] Header(Box>), #[serde(rename = "pub.leaflet.blocks.image")] Image(Box>), #[serde(rename = "pub.leaflet.blocks.unorderedList")] UnorderedList(Box>), #[serde(rename = "pub.leaflet.blocks.website")] Website(Box>), #[serde(rename = "pub.leaflet.blocks.math")] Math(Box>), #[serde(rename = "pub.leaflet.blocks.code")] Code(Box>), #[serde(rename = "pub.leaflet.blocks.horizontalRule")] HorizontalRule(Box>), #[serde(rename = "pub.leaflet.blocks.bskyPost")] BskyPost(Box>), #[serde(rename = "pub.leaflet.blocks.page")] Page(Box>), #[serde(rename = "pub.leaflet.blocks.poll")] Poll(Box>), #[serde(rename = "pub.leaflet.blocks.button")] Button(Box>), } fn lexicon_doc_pub_leaflet_pages_linearDocument() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("pub.leaflet.pages.linearDocument"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("block"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("block")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "alignment", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: 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("block"), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: None, refs: vec![ ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.iframe"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.text"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.blockquote"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.header"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.image"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.unorderedList"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.website"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.math"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.code"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.horizontalRule"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.bskyPost"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.page"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.poll"), ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.button") ], closed: None, }), ); map }, }), ); 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_common::smol_str::SmolStr::new_static("blocks")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("blocks"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#block"), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("id"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: 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 }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("position"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("block"), ::jacquard_common::smol_str::SmolStr::new_static("offset") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("block"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("offset"), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("quote"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("start"), ::jacquard_common::smol_str::SmolStr::new_static("end") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("end"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#position"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("start"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#position"), }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("textAlignCenter"), ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("textAlignJustify"), ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("textAlignLeft"), ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("textAlignRight"), ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { description: None, }), ); map }, } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Block<'a> { fn nsid() -> &'static str { "pub.leaflet.pages.linearDocument" } fn def_name() -> &'static str { "block" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_pub_leaflet_pages_linearDocument() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct LinearDocument<'a> { #[serde(borrow)] pub blocks: Vec>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub id: std::option::Option>, } pub mod linear_document_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 Blocks; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Blocks = Unset; } ///State transition - sets the `blocks` field to Set pub struct SetBlocks(PhantomData S>); impl sealed::Sealed for SetBlocks {} impl State for SetBlocks { type Blocks = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `blocks` field pub struct blocks(()); } } /// Builder for constructing an instance of this type pub struct LinearDocumentBuilder<'a, S: linear_document_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option< Vec>, >, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> LinearDocument<'a> { /// Create a new builder for this type pub fn new() -> LinearDocumentBuilder<'a, linear_document_state::Empty> { LinearDocumentBuilder::new() } } impl<'a> LinearDocumentBuilder<'a, linear_document_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { LinearDocumentBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LinearDocumentBuilder<'a, S> where S: linear_document_state::State, S::Blocks: linear_document_state::IsUnset, { /// Set the `blocks` field (required) pub fn blocks( mut self, value: impl Into>>, ) -> LinearDocumentBuilder<'a, linear_document_state::SetBlocks> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); LinearDocumentBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: linear_document_state::State> LinearDocumentBuilder<'a, S> { /// Set the `id` field (optional) pub fn id(mut self, value: impl Into>>) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `id` field to an Option value (optional) pub fn maybe_id(mut self, value: Option>) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S> LinearDocumentBuilder<'a, S> where S: linear_document_state::State, S::Blocks: linear_document_state::IsSet, { /// Build the final struct pub fn build(self) -> LinearDocument<'a> { LinearDocument { blocks: self.__unsafe_private_named.0.unwrap(), id: self.__unsafe_private_named.1, 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>, >, ) -> LinearDocument<'a> { LinearDocument { blocks: self.__unsafe_private_named.0.unwrap(), id: self.__unsafe_private_named.1, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LinearDocument<'a> { fn nsid() -> &'static str { "pub.leaflet.pages.linearDocument" } fn def_name() -> &'static str { "main" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_pub_leaflet_pages_linearDocument() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Position<'a> { pub block: Vec, pub offset: i64, } pub mod position_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 Offset; type Block; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Offset = Unset; type Block = Unset; } ///State transition - sets the `offset` field to Set pub struct SetOffset(PhantomData S>); impl sealed::Sealed for SetOffset {} impl State for SetOffset { type Offset = Set; type Block = S::Block; } ///State transition - sets the `block` field to Set pub struct SetBlock(PhantomData S>); impl sealed::Sealed for SetBlock {} impl State for SetBlock { type Offset = S::Offset; type Block = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `offset` field pub struct offset(()); ///Marker type for the `block` field pub struct block(()); } } /// Builder for constructing an instance of this type pub struct PositionBuilder<'a, S: position_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Position<'a> { /// Create a new builder for this type pub fn new() -> PositionBuilder<'a, position_state::Empty> { PositionBuilder::new() } } impl<'a> PositionBuilder<'a, position_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { PositionBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PositionBuilder<'a, S> where S: position_state::State, S::Block: position_state::IsUnset, { /// Set the `block` field (required) pub fn block( mut self, value: impl Into>, ) -> PositionBuilder<'a, position_state::SetBlock> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); PositionBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PositionBuilder<'a, S> where S: position_state::State, S::Offset: position_state::IsUnset, { /// Set the `offset` field (required) pub fn offset( mut self, value: impl Into, ) -> PositionBuilder<'a, position_state::SetOffset> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); PositionBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PositionBuilder<'a, S> where S: position_state::State, S::Offset: position_state::IsSet, S::Block: position_state::IsSet, { /// Build the final struct pub fn build(self) -> Position<'a> { Position { block: self.__unsafe_private_named.0.unwrap(), offset: 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>, >, ) -> Position<'a> { Position { block: self.__unsafe_private_named.0.unwrap(), offset: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Position<'a> { fn nsid() -> &'static str { "pub.leaflet.pages.linearDocument" } fn def_name() -> &'static str { "position" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_pub_leaflet_pages_linearDocument() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Quote<'a> { #[serde(borrow)] pub end: crate::pub_leaflet::pages::linear_document::Position<'a>, #[serde(borrow)] pub start: crate::pub_leaflet::pages::linear_document::Position<'a>, } pub mod quote_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 Start; type End; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Start = Unset; type End = Unset; } ///State transition - sets the `start` field to Set pub struct SetStart(PhantomData S>); impl sealed::Sealed for SetStart {} impl State for SetStart { type Start = Set; type End = S::End; } ///State transition - sets the `end` field to Set pub struct SetEnd(PhantomData S>); impl sealed::Sealed for SetEnd {} impl State for SetEnd { type Start = S::Start; type End = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `start` field pub struct start(()); ///Marker type for the `end` field pub struct end(()); } } /// Builder for constructing an instance of this type pub struct QuoteBuilder<'a, S: quote_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Quote<'a> { /// Create a new builder for this type pub fn new() -> QuoteBuilder<'a, quote_state::Empty> { QuoteBuilder::new() } } impl<'a> QuoteBuilder<'a, quote_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { QuoteBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> QuoteBuilder<'a, S> where S: quote_state::State, S::End: quote_state::IsUnset, { /// Set the `end` field (required) pub fn end( mut self, value: impl Into>, ) -> QuoteBuilder<'a, quote_state::SetEnd> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); QuoteBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> QuoteBuilder<'a, S> where S: quote_state::State, S::Start: quote_state::IsUnset, { /// Set the `start` field (required) pub fn start( mut self, value: impl Into>, ) -> QuoteBuilder<'a, quote_state::SetStart> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); QuoteBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> QuoteBuilder<'a, S> where S: quote_state::State, S::Start: quote_state::IsSet, S::End: quote_state::IsSet, { /// Build the final struct pub fn build(self) -> Quote<'a> { Quote { end: self.__unsafe_private_named.0.unwrap(), 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>, >, ) -> Quote<'a> { Quote { end: self.__unsafe_private_named.0.unwrap(), start: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Quote<'a> { fn nsid() -> &'static str { "pub.leaflet.pages.linearDocument" } fn def_name() -> &'static str { "quote" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_pub_leaflet_pages_linearDocument() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Hash, jacquard_derive::IntoStatic )] pub struct TextAlignCenter; impl std::fmt::Display for TextAlignCenter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "textAlignCenter") } } #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Hash, jacquard_derive::IntoStatic )] pub struct TextAlignJustify; impl std::fmt::Display for TextAlignJustify { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "textAlignJustify") } } #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Hash, jacquard_derive::IntoStatic )] pub struct TextAlignLeft; impl std::fmt::Display for TextAlignLeft { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "textAlignLeft") } } #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Hash, jacquard_derive::IntoStatic )] pub struct TextAlignRight; impl std::fmt::Display for TextAlignRight { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "textAlignRight") } }