1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.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///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.
9#[jacquard_derive::lexicon]
10#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
11#[serde(rename_all = "camelCase")]
12pub struct ByteSlice<'a> {
13 pub byte_end: i64,
14 pub byte_start: i64,
15}
16
17impl jacquard_common::IntoStatic for ByteSlice<'_> {
18 type Output = ByteSlice<'static>;
19 fn into_static(self) -> Self::Output {
20 ByteSlice {
21 byte_end: self.byte_end.into_static(),
22 byte_start: self.byte_start.into_static(),
23 extra_data: self.extra_data.into_static(),
24 }
25 }
26}
27
28///Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.
29#[jacquard_derive::lexicon]
30#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
31#[serde(rename_all = "camelCase")]
32pub struct Link<'a> {
33 #[serde(borrow)]
34 pub uri: jacquard_common::types::string::Uri<'a>,
35}
36
37impl jacquard_common::IntoStatic for Link<'_> {
38 type Output = Link<'static>;
39 fn into_static(self) -> Self::Output {
40 Link {
41 uri: self.uri.into_static(),
42 extra_data: self.extra_data.into_static(),
43 }
44 }
45}
46
47///Annotation of a sub-string within rich text.
48#[jacquard_derive::lexicon]
49#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
50#[serde(rename_all = "camelCase")]
51pub struct Facet<'a> {
52 #[serde(borrow)]
53 pub features: Vec<jacquard_common::types::value::Data<'a>>,
54 #[serde(borrow)]
55 pub index: crate::app_bsky::richtext::facet::ByteSlice<'a>,
56}
57
58impl jacquard_common::IntoStatic for Facet<'_> {
59 type Output = Facet<'static>;
60 fn into_static(self) -> Self::Output {
61 Facet {
62 features: self.features.into_static(),
63 index: self.index.into_static(),
64 extra_data: self.extra_data.into_static(),
65 }
66 }
67}
68
69///Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.
70#[jacquard_derive::lexicon]
71#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
72#[serde(rename_all = "camelCase")]
73pub struct Mention<'a> {
74 #[serde(borrow)]
75 pub did: jacquard_common::types::string::Did<'a>,
76}
77
78impl jacquard_common::IntoStatic for Mention<'_> {
79 type Output = Mention<'static>;
80 fn into_static(self) -> Self::Output {
81 Mention {
82 did: self.did.into_static(),
83 extra_data: self.extra_data.into_static(),
84 }
85 }
86}
87
88///Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').
89#[jacquard_derive::lexicon]
90#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
91#[serde(rename_all = "camelCase")]
92pub struct Tag<'a> {
93 #[serde(borrow)]
94 pub tag: jacquard_common::CowStr<'a>,
95}
96
97impl jacquard_common::IntoStatic for Tag<'_> {
98 type Output = Tag<'static>;
99 fn into_static(self) -> Self::Output {
100 Tag {
101 tag: self.tag.into_static(),
102 extra_data: self.extra_data.into_static(),
103 }
104 }
105}