mastodon_async_entities/
instance.rs

1//! Module containing everything related to an instance.
2use serde::{Deserialize, Serialize};
3
4use super::account::Account;
5
6/// A struct containing info of an instance.
7#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
8pub struct Instance {
9    /// URI of the current instance
10    pub uri: String,
11    /// The instance's title.
12    pub title: String,
13    /// A description for the instance.
14    pub description: String,
15    /// An email address which can be used to contact the
16    /// instance administrator.
17    pub email: String,
18    /// The Mastodon version used by instance.
19    pub version: String,
20    /// Urls to the streaming api.
21    pub urls: Option<StreamingApi>,
22    /// Stats about the instance.
23    pub stats: Option<Stats>,
24    /// Thumbnail of the server image.
25    pub thumbnail: Option<String>,
26    /// List of languages used on the server.
27    pub languages: Option<Vec<String>>,
28    /// Contact account for the server.
29    pub contact_account: Option<Account>,
30    /// The maximum number of characters allowed in a status
31    pub max_toot_chars: Option<u32>,
32}
33
34/// Object containing url for streaming api.
35#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
36pub struct StreamingApi {
37    /// Url for streaming API, typically a `wss://` url.
38    pub streaming_api: String,
39}
40
41/// Statistics about the Mastodon instance.
42#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq)]
43pub struct Stats {
44    user_count: u64,
45    status_count: u64,
46    domain_count: u64,
47}