1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.richtext.facet` namespace.
///Annotation of a sub-string within rich text.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Main {
    pub features: Vec<MainFeaturesItem>,
    pub index: ByteSlice,
}
///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.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ByteSlice {
    pub byte_end: usize,
    pub byte_start: usize,
}
///Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Link {
    pub uri: String,
}
///Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Mention {
    pub did: crate::types::string::Did,
}
///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').
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Tag {
    pub tag: String,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum MainFeaturesItem {
    #[serde(rename = "app.bsky.richtext.facet#mention")]
    Mention(Box<Mention>),
    #[serde(rename = "app.bsky.richtext.facet#link")]
    Link(Box<Link>),
    #[serde(rename = "app.bsky.richtext.facet#tag")]
    Tag(Box<Tag>),
}