// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: sh.weaver.notebook.theme // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. /// Custom syntax highlighting theme file (sublime text/textmate theme format) #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct CodeThemeFile<'a> { #[serde(borrow)] pub content: jacquard_common::types::blob::BlobRef<'a>, #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, #[serde(borrow)] pub name: jacquard_common::CowStr<'a>, } pub mod code_theme_file_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; type Name; type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; type Name = Unset; type Content = 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; type Name = S::Name; type Content = S::Content; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { type Did = S::Did; type Name = Set; type Content = S::Content; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { type Did = S::Did; type Name = S::Name; type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `content` field pub struct content(()); } } /// Builder for constructing an instance of this type pub struct CodeThemeFileBuilder<'a, S: code_theme_file_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> CodeThemeFile<'a> { /// Create a new builder for this type pub fn new() -> CodeThemeFileBuilder<'a, code_theme_file_state::Empty> { CodeThemeFileBuilder::new() } } impl<'a> CodeThemeFileBuilder<'a, code_theme_file_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { CodeThemeFileBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CodeThemeFileBuilder<'a, S> where S: code_theme_file_state::State, S::Content: code_theme_file_state::IsUnset, { /// Set the `content` field (required) pub fn content( mut self, value: impl Into>, ) -> CodeThemeFileBuilder<'a, code_theme_file_state::SetContent> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); CodeThemeFileBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CodeThemeFileBuilder<'a, S> where S: code_theme_file_state::State, S::Did: code_theme_file_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> CodeThemeFileBuilder<'a, code_theme_file_state::SetDid> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); CodeThemeFileBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CodeThemeFileBuilder<'a, S> where S: code_theme_file_state::State, S::Name: code_theme_file_state::IsUnset, { /// Set the `name` field (required) pub fn name( mut self, value: impl Into>, ) -> CodeThemeFileBuilder<'a, code_theme_file_state::SetName> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); CodeThemeFileBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CodeThemeFileBuilder<'a, S> where S: code_theme_file_state::State, S::Did: code_theme_file_state::IsSet, S::Name: code_theme_file_state::IsSet, S::Content: code_theme_file_state::IsSet, { /// Build the final struct pub fn build(self) -> CodeThemeFile<'a> { CodeThemeFile { content: self.__unsafe_private_named.0.unwrap(), did: self.__unsafe_private_named.1.unwrap(), name: self.__unsafe_private_named.2.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>, >, ) -> CodeThemeFile<'a> { CodeThemeFile { content: self.__unsafe_private_named.0.unwrap(), did: self.__unsafe_private_named.1.unwrap(), name: self.__unsafe_private_named.2.unwrap(), extra_data: Some(extra_data), } } } fn lexicon_doc_sh_weaver_notebook_theme() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.theme"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("codeThemeFile"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Custom syntax highlighting theme file (sublime text/textmate theme format)", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("name"), ::jacquard_common::smol_str::SmolStr::new_static("did"), ::jacquard_common::smol_str::SmolStr::new_static("content") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("content"), ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { description: None, accept: None, max_size: None, }), ); 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.insert( ::jacquard_common::smol_str::SmolStr::new_static("name"), ::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("codeThemeName"), ::jacquard_lexicon::lexicon::LexUserType::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("font"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("value")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("value"), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: Some( ::jacquard_common::CowStr::new_static("Font for a notebook"), ), refs: vec![ ::jacquard_common::CowStr::new_static("#fontName"), ::jacquard_common::CowStr::new_static("#fontFile") ], closed: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("fontFile"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Custom woff(2) or ttf font file", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("name"), ::jacquard_common::smol_str::SmolStr::new_static("did"), ::jacquard_common::smol_str::SmolStr::new_static("content") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("content"), ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { description: None, accept: None, max_size: None, }), ); 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.insert( ::jacquard_common::smol_str::SmolStr::new_static("name"), ::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("fontName"), ::jacquard_lexicon::lexicon::LexUserType::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("main"), ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { description: Some( ::jacquard_common::CowStr::new_static("Theme for a notebook"), ), key: Some(::jacquard_common::CowStr::new_static("tid")), record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("darkScheme"), ::jacquard_common::smol_str::SmolStr::new_static("lightScheme"), ::jacquard_common::smol_str::SmolStr::new_static("fonts"), ::jacquard_common::smol_str::SmolStr::new_static("spacing"), ::jacquard_common::smol_str::SmolStr::new_static("darkCodeTheme"), ::jacquard_common::smol_str::SmolStr::new_static("lightCodeTheme") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "darkCodeTheme", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: Some( ::jacquard_common::CowStr::new_static( "Syntax highlighting theme for dark mode", ), ), refs: vec![ ::jacquard_common::CowStr::new_static("#codeThemeName"), ::jacquard_common::CowStr::new_static("#codeThemeFile") ], closed: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "darkScheme", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.repo.strongRef", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "defaultTheme", ), ::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("fonts"), ::jacquard_lexicon::lexicon::LexObjectProperty::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Fonts to be used in the notebook. Can specify a name or list of names (will load if available) or a file or list of files for each. Empty lists will use site defaults.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("body"), ::jacquard_common::smol_str::SmolStr::new_static("heading"), ::jacquard_common::smol_str::SmolStr::new_static("monospace") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("body"), ::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("#font"), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("heading"), ::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("#font"), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "monospace", ), ::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("#font"), }), min_length: None, max_length: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "lightCodeTheme", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: Some( ::jacquard_common::CowStr::new_static( "Syntax highlighting theme for light mode", ), ), refs: vec![ ::jacquard_common::CowStr::new_static("#codeThemeName"), ::jacquard_common::CowStr::new_static("#codeThemeFile") ], closed: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "lightScheme", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.repo.strongRef", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("spacing"), ::jacquard_lexicon::lexicon::LexObjectProperty::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("baseSize"), ::jacquard_common::smol_str::SmolStr::new_static("lineHeight"), ::jacquard_common::smol_str::SmolStr::new_static("scale") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "baseSize", ), ::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( "lineHeight", ), ::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("scale"), ::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 }, }), }), ); map }, } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CodeThemeFile<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.theme" } fn def_name() -> &'static str { "codeThemeFile" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_theme() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } pub type CodeThemeName<'a> = jacquard_common::CowStr<'a>; #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Font<'a> { /// Font for a notebook #[serde(borrow)] pub value: FontValue<'a>, } pub mod font_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 Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Value = Unset; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `value` field pub struct value(()); } } /// Builder for constructing an instance of this type pub struct FontBuilder<'a, S: font_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: (::core::option::Option>,), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Font<'a> { /// Create a new builder for this type pub fn new() -> FontBuilder<'a, font_state::Empty> { FontBuilder::new() } } impl<'a> FontBuilder<'a, font_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { FontBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FontBuilder<'a, S> where S: font_state::State, S::Value: font_state::IsUnset, { /// Set the `value` field (required) pub fn value( mut self, value: impl Into>, ) -> FontBuilder<'a, font_state::SetValue> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); FontBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FontBuilder<'a, S> where S: font_state::State, S::Value: font_state::IsSet, { /// Build the final struct pub fn build(self) -> Font<'a> { Font { value: 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>, >, ) -> Font<'a> { Font { value: self.__unsafe_private_named.0.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 FontValue<'a> { #[serde(rename = "sh.weaver.notebook.theme#fontName")] FontName(Box>), #[serde(rename = "sh.weaver.notebook.theme#fontFile")] FontFile(Box>), } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Font<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.theme" } fn def_name() -> &'static str { "font" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_theme() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// Custom woff(2) or ttf font file #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct FontFile<'a> { #[serde(borrow)] pub content: jacquard_common::types::blob::BlobRef<'a>, #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, #[serde(borrow)] pub name: jacquard_common::CowStr<'a>, } pub mod font_file_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 Name; type Did; type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Name = Unset; type Did = Unset; type Content = 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 Did = S::Did; type Content = S::Content; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Name = S::Name; type Did = Set; type Content = S::Content; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { type Name = S::Name; type Did = S::Did; type Content = 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 `did` field pub struct did(()); ///Marker type for the `content` field pub struct content(()); } } /// Builder for constructing an instance of this type pub struct FontFileBuilder<'a, S: font_file_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> FontFile<'a> { /// Create a new builder for this type pub fn new() -> FontFileBuilder<'a, font_file_state::Empty> { FontFileBuilder::new() } } impl<'a> FontFileBuilder<'a, font_file_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { FontFileBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FontFileBuilder<'a, S> where S: font_file_state::State, S::Content: font_file_state::IsUnset, { /// Set the `content` field (required) pub fn content( mut self, value: impl Into>, ) -> FontFileBuilder<'a, font_file_state::SetContent> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); FontFileBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FontFileBuilder<'a, S> where S: font_file_state::State, S::Did: font_file_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> FontFileBuilder<'a, font_file_state::SetDid> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); FontFileBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FontFileBuilder<'a, S> where S: font_file_state::State, S::Name: font_file_state::IsUnset, { /// Set the `name` field (required) pub fn name( mut self, value: impl Into>, ) -> FontFileBuilder<'a, font_file_state::SetName> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); FontFileBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FontFileBuilder<'a, S> where S: font_file_state::State, S::Name: font_file_state::IsSet, S::Did: font_file_state::IsSet, S::Content: font_file_state::IsSet, { /// Build the final struct pub fn build(self) -> FontFile<'a> { FontFile { content: self.__unsafe_private_named.0.unwrap(), did: self.__unsafe_private_named.1.unwrap(), name: self.__unsafe_private_named.2.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>, >, ) -> FontFile<'a> { FontFile { content: self.__unsafe_private_named.0.unwrap(), did: self.__unsafe_private_named.1.unwrap(), name: self.__unsafe_private_named.2.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FontFile<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.theme" } fn def_name() -> &'static str { "fontFile" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_theme() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } pub type FontName<'a> = jacquard_common::CowStr<'a>; /// Theme for a notebook #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Theme<'a> { /// Syntax highlighting theme for dark mode #[serde(borrow)] pub dark_code_theme: ThemeDarkCodeTheme<'a>, /// Reference to a dark colour scheme #[serde(borrow)] pub dark_scheme: crate::com_atproto::repo::strong_ref::StrongRef<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub default_theme: std::option::Option>, /// Fonts to be used in the notebook. Can specify a name or list of names (will load if available) or a file or list of files for each. Empty lists will use site defaults. #[serde(borrow)] pub fonts: ThemeFonts<'a>, /// Syntax highlighting theme for light mode #[serde(borrow)] pub light_code_theme: ThemeLightCodeTheme<'a>, /// Reference to a light colour scheme #[serde(borrow)] pub light_scheme: crate::com_atproto::repo::strong_ref::StrongRef<'a>, #[serde(borrow)] pub spacing: ThemeSpacing<'a>, } pub mod theme_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 DarkCodeTheme; type Fonts; type DarkScheme; type Spacing; type LightCodeTheme; type LightScheme; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type DarkCodeTheme = Unset; type Fonts = Unset; type DarkScheme = Unset; type Spacing = Unset; type LightCodeTheme = Unset; type LightScheme = Unset; } ///State transition - sets the `dark_code_theme` field to Set pub struct SetDarkCodeTheme(PhantomData S>); impl sealed::Sealed for SetDarkCodeTheme {} impl State for SetDarkCodeTheme { type DarkCodeTheme = Set; type Fonts = S::Fonts; type DarkScheme = S::DarkScheme; type Spacing = S::Spacing; type LightCodeTheme = S::LightCodeTheme; type LightScheme = S::LightScheme; } ///State transition - sets the `fonts` field to Set pub struct SetFonts(PhantomData S>); impl sealed::Sealed for SetFonts {} impl State for SetFonts { type DarkCodeTheme = S::DarkCodeTheme; type Fonts = Set; type DarkScheme = S::DarkScheme; type Spacing = S::Spacing; type LightCodeTheme = S::LightCodeTheme; type LightScheme = S::LightScheme; } ///State transition - sets the `dark_scheme` field to Set pub struct SetDarkScheme(PhantomData S>); impl sealed::Sealed for SetDarkScheme {} impl State for SetDarkScheme { type DarkCodeTheme = S::DarkCodeTheme; type Fonts = S::Fonts; type DarkScheme = Set; type Spacing = S::Spacing; type LightCodeTheme = S::LightCodeTheme; type LightScheme = S::LightScheme; } ///State transition - sets the `spacing` field to Set pub struct SetSpacing(PhantomData S>); impl sealed::Sealed for SetSpacing {} impl State for SetSpacing { type DarkCodeTheme = S::DarkCodeTheme; type Fonts = S::Fonts; type DarkScheme = S::DarkScheme; type Spacing = Set; type LightCodeTheme = S::LightCodeTheme; type LightScheme = S::LightScheme; } ///State transition - sets the `light_code_theme` field to Set pub struct SetLightCodeTheme(PhantomData S>); impl sealed::Sealed for SetLightCodeTheme {} impl State for SetLightCodeTheme { type DarkCodeTheme = S::DarkCodeTheme; type Fonts = S::Fonts; type DarkScheme = S::DarkScheme; type Spacing = S::Spacing; type LightCodeTheme = Set; type LightScheme = S::LightScheme; } ///State transition - sets the `light_scheme` field to Set pub struct SetLightScheme(PhantomData S>); impl sealed::Sealed for SetLightScheme {} impl State for SetLightScheme { type DarkCodeTheme = S::DarkCodeTheme; type Fonts = S::Fonts; type DarkScheme = S::DarkScheme; type Spacing = S::Spacing; type LightCodeTheme = S::LightCodeTheme; type LightScheme = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `dark_code_theme` field pub struct dark_code_theme(()); ///Marker type for the `fonts` field pub struct fonts(()); ///Marker type for the `dark_scheme` field pub struct dark_scheme(()); ///Marker type for the `spacing` field pub struct spacing(()); ///Marker type for the `light_code_theme` field pub struct light_code_theme(()); ///Marker type for the `light_scheme` field pub struct light_scheme(()); } } /// Builder for constructing an instance of this type pub struct ThemeBuilder<'a, S: theme_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Theme<'a> { /// Create a new builder for this type pub fn new() -> ThemeBuilder<'a, theme_state::Empty> { ThemeBuilder::new() } } impl<'a> ThemeBuilder<'a, theme_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ThemeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, S::DarkCodeTheme: theme_state::IsUnset, { /// Set the `darkCodeTheme` field (required) pub fn dark_code_theme( mut self, value: impl Into>, ) -> ThemeBuilder<'a, theme_state::SetDarkCodeTheme> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ThemeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, S::DarkScheme: theme_state::IsUnset, { /// Set the `darkScheme` field (required) pub fn dark_scheme( mut self, value: impl Into>, ) -> ThemeBuilder<'a, theme_state::SetDarkScheme> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ThemeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: theme_state::State> ThemeBuilder<'a, S> { /// Set the `defaultTheme` field (optional) pub fn default_theme( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `defaultTheme` field to an Option value (optional) pub fn maybe_default_theme( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.2 = value; self } } impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, S::Fonts: theme_state::IsUnset, { /// Set the `fonts` field (required) pub fn fonts( mut self, value: impl Into>, ) -> ThemeBuilder<'a, theme_state::SetFonts> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); ThemeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, S::LightCodeTheme: theme_state::IsUnset, { /// Set the `lightCodeTheme` field (required) pub fn light_code_theme( mut self, value: impl Into>, ) -> ThemeBuilder<'a, theme_state::SetLightCodeTheme> { self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); ThemeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, S::LightScheme: theme_state::IsUnset, { /// Set the `lightScheme` field (required) pub fn light_scheme( mut self, value: impl Into>, ) -> ThemeBuilder<'a, theme_state::SetLightScheme> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); ThemeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, S::Spacing: theme_state::IsUnset, { /// Set the `spacing` field (required) pub fn spacing( mut self, value: impl Into>, ) -> ThemeBuilder<'a, theme_state::SetSpacing> { self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); ThemeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, S::DarkCodeTheme: theme_state::IsSet, S::Fonts: theme_state::IsSet, S::DarkScheme: theme_state::IsSet, S::Spacing: theme_state::IsSet, S::LightCodeTheme: theme_state::IsSet, S::LightScheme: theme_state::IsSet, { /// Build the final struct pub fn build(self) -> Theme<'a> { Theme { dark_code_theme: self.__unsafe_private_named.0.unwrap(), dark_scheme: self.__unsafe_private_named.1.unwrap(), default_theme: self.__unsafe_private_named.2, fonts: self.__unsafe_private_named.3.unwrap(), light_code_theme: self.__unsafe_private_named.4.unwrap(), light_scheme: self.__unsafe_private_named.5.unwrap(), spacing: self.__unsafe_private_named.6.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>, >, ) -> Theme<'a> { Theme { dark_code_theme: self.__unsafe_private_named.0.unwrap(), dark_scheme: self.__unsafe_private_named.1.unwrap(), default_theme: self.__unsafe_private_named.2, fonts: self.__unsafe_private_named.3.unwrap(), light_code_theme: self.__unsafe_private_named.4.unwrap(), light_scheme: self.__unsafe_private_named.5.unwrap(), spacing: self.__unsafe_private_named.6.unwrap(), extra_data: Some(extra_data), } } } impl<'a> Theme<'a> { pub fn uri( uri: impl Into>, ) -> Result< jacquard_common::types::uri::RecordUri<'a, ThemeRecord>, jacquard_common::types::uri::UriError, > { jacquard_common::types::uri::RecordUri::try_from_uri( jacquard_common::types::string::AtUri::new_cow(uri.into())?, ) } } #[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 ThemeDarkCodeTheme<'a> { #[serde(rename = "sh.weaver.notebook.theme#codeThemeName")] CodeThemeName(Box>), #[serde(rename = "sh.weaver.notebook.theme#codeThemeFile")] CodeThemeFile(Box>), } /// Fonts to be used in the notebook. Can specify a name or list of names (will load if available) or a file or list of files for each. Empty lists will use site defaults. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ThemeFonts<'a> { #[serde(borrow)] pub body: Vec>, #[serde(borrow)] pub heading: Vec>, #[serde(borrow)] pub monospace: Vec>, } pub mod theme_fonts_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 Body; type Heading; type Monospace; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Body = Unset; type Heading = Unset; type Monospace = Unset; } ///State transition - sets the `body` field to Set pub struct SetBody(PhantomData S>); impl sealed::Sealed for SetBody {} impl State for SetBody { type Body = Set; type Heading = S::Heading; type Monospace = S::Monospace; } ///State transition - sets the `heading` field to Set pub struct SetHeading(PhantomData S>); impl sealed::Sealed for SetHeading {} impl State for SetHeading { type Body = S::Body; type Heading = Set; type Monospace = S::Monospace; } ///State transition - sets the `monospace` field to Set pub struct SetMonospace(PhantomData S>); impl sealed::Sealed for SetMonospace {} impl State for SetMonospace { type Body = S::Body; type Heading = S::Heading; type Monospace = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `body` field pub struct body(()); ///Marker type for the `heading` field pub struct heading(()); ///Marker type for the `monospace` field pub struct monospace(()); } } /// Builder for constructing an instance of this type pub struct ThemeFontsBuilder<'a, S: theme_fonts_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option>>, ::core::option::Option>>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ThemeFonts<'a> { /// Create a new builder for this type pub fn new() -> ThemeFontsBuilder<'a, theme_fonts_state::Empty> { ThemeFontsBuilder::new() } } impl<'a> ThemeFontsBuilder<'a, theme_fonts_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ThemeFontsBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeFontsBuilder<'a, S> where S: theme_fonts_state::State, S::Body: theme_fonts_state::IsUnset, { /// Set the `body` field (required) pub fn body( mut self, value: impl Into>>, ) -> ThemeFontsBuilder<'a, theme_fonts_state::SetBody> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ThemeFontsBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeFontsBuilder<'a, S> where S: theme_fonts_state::State, S::Heading: theme_fonts_state::IsUnset, { /// Set the `heading` field (required) pub fn heading( mut self, value: impl Into>>, ) -> ThemeFontsBuilder<'a, theme_fonts_state::SetHeading> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ThemeFontsBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeFontsBuilder<'a, S> where S: theme_fonts_state::State, S::Monospace: theme_fonts_state::IsUnset, { /// Set the `monospace` field (required) pub fn monospace( mut self, value: impl Into>>, ) -> ThemeFontsBuilder<'a, theme_fonts_state::SetMonospace> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); ThemeFontsBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ThemeFontsBuilder<'a, S> where S: theme_fonts_state::State, S::Body: theme_fonts_state::IsSet, S::Heading: theme_fonts_state::IsSet, S::Monospace: theme_fonts_state::IsSet, { /// Build the final struct pub fn build(self) -> ThemeFonts<'a> { ThemeFonts { body: self.__unsafe_private_named.0.unwrap(), heading: self.__unsafe_private_named.1.unwrap(), monospace: self.__unsafe_private_named.2.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>, >, ) -> ThemeFonts<'a> { ThemeFonts { body: self.__unsafe_private_named.0.unwrap(), heading: self.__unsafe_private_named.1.unwrap(), monospace: self.__unsafe_private_named.2.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThemeFonts<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.theme" } fn def_name() -> &'static str { "ThemeFonts" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_theme() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[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 ThemeLightCodeTheme<'a> { #[serde(rename = "sh.weaver.notebook.theme#codeThemeName")] CodeThemeName(Box>), #[serde(rename = "sh.weaver.notebook.theme#codeThemeFile")] CodeThemeFile(Box>), } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, Default )] #[serde(rename_all = "camelCase")] pub struct ThemeSpacing<'a> { #[serde(borrow)] pub base_size: jacquard_common::CowStr<'a>, #[serde(borrow)] pub line_height: jacquard_common::CowStr<'a>, #[serde(borrow)] pub scale: jacquard_common::CowStr<'a>, } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThemeSpacing<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.theme" } fn def_name() -> &'static str { "ThemeSpacing" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_theme() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// Typed wrapper for GetRecord response with this collection's record type. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ThemeGetRecordOutput<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub cid: std::option::Option>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(borrow)] pub value: Theme<'a>, } impl From> for Theme<'_> { fn from(output: ThemeGetRecordOutput<'_>) -> Self { use jacquard_common::IntoStatic; output.value.into_static() } } impl jacquard_common::types::collection::Collection for Theme<'_> { const NSID: &'static str = "sh.weaver.notebook.theme"; type Record = ThemeRecord; } /// Marker type for deserializing records from this collection. #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct ThemeRecord; impl jacquard_common::xrpc::XrpcResp for ThemeRecord { const NSID: &'static str = "sh.weaver.notebook.theme"; const ENCODING: &'static str = "application/json"; type Output<'de> = ThemeGetRecordOutput<'de>; type Err<'de> = jacquard_common::types::collection::RecordError<'de>; } impl jacquard_common::types::collection::Collection for ThemeRecord { const NSID: &'static str = "sh.weaver.notebook.theme"; type Record = ThemeRecord; } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Theme<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.theme" } fn def_name() -> &'static str { "main" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_theme() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }