A better Rust ATProto crate
at main 3.0 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: blog.pckt.theme 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8/// Theme configuration for a blog publication 9#[jacquard_derive::lexicon] 10#[derive( 11 serde::Serialize, 12 serde::Deserialize, 13 Debug, 14 Clone, 15 PartialEq, 16 Eq, 17 jacquard_derive::IntoStatic, 18 bon::Builder 19)] 20#[serde(rename_all = "camelCase")] 21pub struct Theme<'a> { 22 /// Dark mode color palette 23 #[serde(borrow)] 24 pub dark: crate::blog_pckt::theme::Palette<'a>, 25 /// Font family name (optional) 26 #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 #[builder(into)] 28 #[serde(borrow)] 29 pub font: Option<jacquard_common::CowStr<'a>>, 30 /// Light mode color palette 31 #[serde(borrow)] 32 pub light: crate::blog_pckt::theme::Palette<'a>, 33} 34 35/// Typed wrapper for GetRecord response with this collection's record type. 36#[derive( 37 serde::Serialize, 38 serde::Deserialize, 39 Debug, 40 Clone, 41 PartialEq, 42 Eq, 43 jacquard_derive::IntoStatic 44)] 45#[serde(rename_all = "camelCase")] 46pub struct ThemeGetRecordOutput<'a> { 47 #[serde(skip_serializing_if = "std::option::Option::is_none")] 48 #[serde(borrow)] 49 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 50 #[serde(borrow)] 51 pub uri: jacquard_common::types::string::AtUri<'a>, 52 #[serde(borrow)] 53 pub value: Theme<'a>, 54} 55 56/// Marker type for deserializing records from this collection. 57pub struct ThemeRecord; 58impl jacquard_common::xrpc::XrpcResp for ThemeRecord { 59 const NSID: &'static str = "blog.pckt.theme"; 60 const ENCODING: &'static str = "application/json"; 61 type Output<'de> = ThemeGetRecordOutput<'de>; 62 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 63} 64 65impl jacquard_common::types::collection::Collection for Theme<'_> { 66 const NSID: &'static str = "blog.pckt.theme"; 67 type Record = ThemeRecord; 68} 69 70impl From<ThemeGetRecordOutput<'_>> for Theme<'_> { 71 fn from(output: ThemeGetRecordOutput<'_>) -> Self { 72 use jacquard_common::IntoStatic; 73 output.value.into_static() 74 } 75} 76 77/// Color palette with CSS hex values 78#[jacquard_derive::lexicon] 79#[derive( 80 serde::Serialize, 81 serde::Deserialize, 82 Debug, 83 Clone, 84 PartialEq, 85 Eq, 86 jacquard_derive::IntoStatic, 87 Default 88)] 89#[serde(rename_all = "camelCase")] 90pub struct Palette<'a> { 91 /// Accent color (hex value) 92 #[serde(borrow)] 93 pub accent: jacquard_common::CowStr<'a>, 94 /// Background color (hex value) 95 #[serde(borrow)] 96 pub background: jacquard_common::CowStr<'a>, 97 /// Link color (hex value) 98 #[serde(borrow)] 99 pub link: jacquard_common::CowStr<'a>, 100 /// Surface hover color (hex value) 101 #[serde(borrow)] 102 pub surface_hover: jacquard_common::CowStr<'a>, 103 /// Primary text color (hex value) 104 #[serde(borrow)] 105 pub text: jacquard_common::CowStr<'a>, 106}