jacquard_api/pub_leaflet/richtext/
facet.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: pub.leaflet.richtext.facet
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8///Facet feature for bold text
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)]
19#[serde(rename_all = "camelCase")]
20pub struct Bold<'a> {}
21///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. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.
22#[jacquard_derive::lexicon]
23#[derive(
24    serde::Serialize,
25    serde::Deserialize,
26    Debug,
27    Clone,
28    PartialEq,
29    Eq,
30    jacquard_derive::IntoStatic
31)]
32#[serde(rename_all = "camelCase")]
33pub struct ByteSlice<'a> {
34    pub byte_end: i64,
35    pub byte_start: i64,
36}
37
38///Facet feature for inline code.
39#[jacquard_derive::lexicon]
40#[derive(
41    serde::Serialize,
42    serde::Deserialize,
43    Debug,
44    Clone,
45    PartialEq,
46    Eq,
47    jacquard_derive::IntoStatic
48)]
49#[serde(rename_all = "camelCase")]
50pub struct Code<'a> {}
51///Facet feature for highlighted text.
52#[jacquard_derive::lexicon]
53#[derive(
54    serde::Serialize,
55    serde::Deserialize,
56    Debug,
57    Clone,
58    PartialEq,
59    Eq,
60    jacquard_derive::IntoStatic
61)]
62#[serde(rename_all = "camelCase")]
63pub struct Highlight<'a> {}
64///Facet feature for an identifier. Used for linking to a segment
65#[jacquard_derive::lexicon]
66#[derive(
67    serde::Serialize,
68    serde::Deserialize,
69    Debug,
70    Clone,
71    PartialEq,
72    Eq,
73    jacquard_derive::IntoStatic
74)]
75#[serde(rename_all = "camelCase")]
76pub struct Id<'a> {
77    #[serde(skip_serializing_if = "std::option::Option::is_none")]
78    #[serde(borrow)]
79    pub id: std::option::Option<jacquard_common::CowStr<'a>>,
80}
81
82///Facet feature for italic text
83#[jacquard_derive::lexicon]
84#[derive(
85    serde::Serialize,
86    serde::Deserialize,
87    Debug,
88    Clone,
89    PartialEq,
90    Eq,
91    jacquard_derive::IntoStatic
92)]
93#[serde(rename_all = "camelCase")]
94pub struct Italic<'a> {}
95///Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.
96#[jacquard_derive::lexicon]
97#[derive(
98    serde::Serialize,
99    serde::Deserialize,
100    Debug,
101    Clone,
102    PartialEq,
103    Eq,
104    jacquard_derive::IntoStatic
105)]
106#[serde(rename_all = "camelCase")]
107pub struct Link<'a> {
108    #[serde(borrow)]
109    pub uri: jacquard_common::types::string::Uri<'a>,
110}
111
112///Annotation of a sub-string within rich text.
113#[jacquard_derive::lexicon]
114#[derive(
115    serde::Serialize,
116    serde::Deserialize,
117    Debug,
118    Clone,
119    PartialEq,
120    Eq,
121    jacquard_derive::IntoStatic
122)]
123#[serde(rename_all = "camelCase")]
124pub struct Facet<'a> {
125    #[serde(borrow)]
126    pub features: Vec<FacetFeaturesItem<'a>>,
127    #[serde(borrow)]
128    pub index: crate::pub_leaflet::richtext::facet::ByteSlice<'a>,
129}
130
131#[jacquard_derive::open_union]
132#[derive(
133    serde::Serialize,
134    serde::Deserialize,
135    Debug,
136    Clone,
137    PartialEq,
138    Eq,
139    jacquard_derive::IntoStatic
140)]
141#[serde(tag = "$type")]
142#[serde(bound(deserialize = "'de: 'a"))]
143pub enum FacetFeaturesItem<'a> {
144    #[serde(rename = "pub.leaflet.richtext.facet#link")]
145    Link(Box<crate::pub_leaflet::richtext::facet::Link<'a>>),
146    #[serde(rename = "pub.leaflet.richtext.facet#code")]
147    Code(Box<crate::pub_leaflet::richtext::facet::Code<'a>>),
148    #[serde(rename = "pub.leaflet.richtext.facet#highlight")]
149    Highlight(Box<crate::pub_leaflet::richtext::facet::Highlight<'a>>),
150    #[serde(rename = "pub.leaflet.richtext.facet#underline")]
151    Underline(Box<crate::pub_leaflet::richtext::facet::Underline<'a>>),
152    #[serde(rename = "pub.leaflet.richtext.facet#strikethrough")]
153    Strikethrough(Box<crate::pub_leaflet::richtext::facet::Strikethrough<'a>>),
154    #[serde(rename = "pub.leaflet.richtext.facet#id")]
155    Id(Box<crate::pub_leaflet::richtext::facet::Id<'a>>),
156    #[serde(rename = "pub.leaflet.richtext.facet#bold")]
157    Bold(Box<crate::pub_leaflet::richtext::facet::Bold<'a>>),
158    #[serde(rename = "pub.leaflet.richtext.facet#italic")]
159    Italic(Box<crate::pub_leaflet::richtext::facet::Italic<'a>>),
160}
161
162///Facet feature for strikethrough markup
163#[jacquard_derive::lexicon]
164#[derive(
165    serde::Serialize,
166    serde::Deserialize,
167    Debug,
168    Clone,
169    PartialEq,
170    Eq,
171    jacquard_derive::IntoStatic
172)]
173#[serde(rename_all = "camelCase")]
174pub struct Strikethrough<'a> {}
175///Facet feature for underline markup
176#[jacquard_derive::lexicon]
177#[derive(
178    serde::Serialize,
179    serde::Deserialize,
180    Debug,
181    Clone,
182    PartialEq,
183    Eq,
184    jacquard_derive::IntoStatic
185)]
186#[serde(rename_all = "camelCase")]
187pub struct Underline<'a> {}