diff options
Diffstat (limited to 'src/entities')
-rw-r--r-- | src/entities/attachment.rs | 2 | ||||
-rw-r--r-- | src/entities/itemsiter.rs | 2 | ||||
-rw-r--r-- | src/entities/mod.rs | 2 | ||||
-rw-r--r-- | src/entities/search_result.rs | 13 | ||||
-rw-r--r-- | src/entities/status.rs | 15 |
5 files changed, 19 insertions, 15 deletions
diff --git a/src/entities/attachment.rs b/src/entities/attachment.rs index 3a93440..2115b9f 100644 --- a/src/entities/attachment.rs +++ b/src/entities/attachment.rs @@ -11,7 +11,7 @@ pub struct Attachment { #[serde(rename = "type")] pub media_type: MediaType, /// URL of the locally hosted version of the image. - pub url: String, + pub url: Option<String>, /// For remote images, the remote URL of the original image. pub remote_url: Option<String>, /// URL of the preview image. diff --git a/src/entities/itemsiter.rs b/src/entities/itemsiter.rs index ef97334..d8df189 100644 --- a/src/entities/itemsiter.rs +++ b/src/entities/itemsiter.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; /// Abstracts away the `next_page` logic into a single stream of items /// /// ```no_run,async -/// use elefren::prelude::*; +/// use mastodon_async::prelude::*; /// use futures::stream::StreamExt; /// use futures_util::pin_mut; /// diff --git a/src/entities/mod.rs b/src/entities/mod.rs index aef8121..f726abc 100644 --- a/src/entities/mod.rs +++ b/src/entities/mod.rs @@ -54,7 +54,7 @@ pub mod prelude { push::Subscription, relationship::Relationship, report::Report, - search_result::{SearchResult, SearchResultV2}, + search_result::SearchResult, status::{Application, Emoji, Status}, Empty, }; diff --git a/src/entities/search_result.rs b/src/entities/search_result.rs index 499af5f..e757f71 100644 --- a/src/entities/search_result.rs +++ b/src/entities/search_result.rs @@ -7,21 +7,10 @@ use super::{ status::Tag, }; -/// A struct containing results of a search. -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] -pub struct SearchResult { - /// An array of matched Accounts. - pub accounts: Vec<Account>, - /// An array of matched Statuses. - pub statuses: Vec<Status>, - /// An array of matched hashtags, as strings. - pub hashtags: Vec<String>, -} - /// A struct containing results of a search, with `Tag` objects in the /// `hashtags` field #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] -pub struct SearchResultV2 { +pub struct SearchResult { /// An array of matched Accounts. pub accounts: Vec<Account>, /// An array of matched Statuses. diff --git a/src/entities/status.rs b/src/entities/status.rs index 2de5d26..a094b0c 100644 --- a/src/entities/status.rs +++ b/src/entities/status.rs @@ -95,6 +95,10 @@ pub struct Tag { pub name: String, /// The URL of the hashtag. pub url: String, + /// Usage statistics for given days (typically the past week). + pub history: Vec<TagHistory>, + /// Whether the current token’s authorized user is following this tag. + pub following: Option<bool>, } /// Application details. @@ -105,3 +109,14 @@ pub struct Application { /// Homepage URL of the application. pub website: Option<String>, } + +/// Usage statistics for given days (typically the past week). +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct TagHistory { + /// UNIX timestamp on midnight of the given day. + pub day: String, + /// The counted usage of the tag within that day. + pub uses: String, + /// The total of accounts using the tag within that day. + pub accounts: String, +} |