diff options
author | D. Scott Boggs <scott@tams.tech> | 2023-02-13 09:47:26 -0500 |
---|---|---|
committer | D. Scott Boggs <scott@tams.tech> | 2023-09-01 07:50:39 -0400 |
commit | 1a979b5bd450f8702f23721f483521cdf11ec0a6 (patch) | |
tree | 609c9928450586565d52ca7fb1313c53a5a1d785 | |
parent | 68a928b275cee1c68829529d7e11faba62bcabcd (diff) |
Update entities prelude
-rw-r--r-- | entities/src/admin/mod.rs | 11 | ||||
-rw-r--r-- | entities/src/announcement.rs | 2 | ||||
-rw-r--r-- | entities/src/auth/mod.rs | 4 | ||||
-rw-r--r-- | entities/src/card.rs | 4 | ||||
-rw-r--r-- | entities/src/lib.rs | 48 | ||||
-rw-r--r-- | entities/src/notification.rs | 4 | ||||
-rw-r--r-- | entities/src/status/mod.rs | 13 |
7 files changed, 56 insertions, 30 deletions
diff --git a/entities/src/admin/mod.rs b/entities/src/admin/mod.rs index 71a1d23..ecf3883 100644 --- a/entities/src/admin/mod.rs +++ b/entities/src/admin/mod.rs @@ -9,7 +9,7 @@ pub mod measure; pub mod report; pub mod tag; -pub use account::*; +pub use account::Account; pub use canonical_email_block::*; pub use cohort::{Cohort, CohortFrequency}; pub use dimension::Dimension; @@ -17,3 +17,12 @@ pub use email_domain_block::EmailDomainBlock; pub use ip_block::IpBlock; pub use measure::Measure; pub use report::Report; +pub use tag::Tag; + +pub mod prelude { + pub use super::{ + account, dimension, domain, email_domain_block, ip_block, measure, Account, + CanonicalEmailBlock, Cohort, CohortFrequency, Dimension, EmailDomainBlock, IpBlock, + Measure, Report, Tag + }; +} diff --git a/entities/src/announcement.rs b/entities/src/announcement.rs index d72501b..3a2d418 100644 --- a/entities/src/announcement.rs +++ b/entities/src/announcement.rs @@ -8,7 +8,7 @@ use crate::{custom_emoji::CustomEmoji, status, AccountId, AnnouncementId, Status /// /// See also [the API documentation](https://docs.joinmastodon.org/entities/Announcement/) #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -struct Announcement { +pub struct Announcement { /// The ID of the announcement in the database. pub id: AnnouncementId, /// The text of the announcement, as HTML. diff --git a/entities/src/auth/mod.rs b/entities/src/auth/mod.rs index 5e82abd..7a125a2 100644 --- a/entities/src/auth/mod.rs +++ b/entities/src/auth/mod.rs @@ -4,3 +4,7 @@ pub mod token; pub use scopes::{Scope, Scopes}; pub use token::Token; + +pub mod prelude { + pub use super::{scopes, Scope, Scopes, Token}; +} diff --git a/entities/src/card.rs b/entities/src/card.rs index 8dbeb3e..639f37c 100644 --- a/entities/src/card.rs +++ b/entities/src/card.rs @@ -18,7 +18,7 @@ pub struct Card { pub description: String, /// The type of the preview card. #[serde(rename = "type")] - pub card_type: CardType, + pub card_type: Type, /// Preview thumbnail. pub image: Option<String>, /// The author of the original resource. @@ -49,7 +49,7 @@ pub struct Card { /// The type of the preview card. #[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, is_enum_variant)] #[serde(rename_all = "lowercase")] -pub enum CardType { +pub enum Type { /// Link OEmbed Link, /// Photo OEmbed diff --git a/entities/src/lib.rs b/entities/src/lib.rs index 5ea5f69..8ede3c2 100644 --- a/entities/src/lib.rs +++ b/entities/src/lib.rs @@ -71,24 +71,50 @@ pub struct Empty {} /// modules: pub mod prelude { pub use super::{ - account::{Account, Source}, - attachment::{Attachment, MediaType}, - auth, - card::Card, + account::{ + self, /* for + SuggestionSource, Suggestion, FamiliarFollowers, Color, Credentials, + CredentialsBuilder */ + Account, CredentialAccount, Role, RolePermissions, Source, + }, + admin::prelude::*, + announcement::{self /* for Status, Account, Reaction */, Announcement}, + application::Application, + attachment::{ + self, /* for FocalPoint, SizeSpecificDetails, Meta */ + Attachment, MediaType, ProcessedAttachment, + }, + auth::prelude::*, + card::{self /* for Type */, Card, TrendsLink}, context::Context, + conversation::Conversation, custom_emoji::CustomEmoji, event::Event, - filter::{Filter, FilterContext}, + filter::{self /* for Action, Keyword, Status, v1, Result */, Filter, FilterContext}, ids::*, - instance::*, - list::List, + instance::{ + self, /* for + Usage, Users, Thumbnail, ThumbnailVersions, Contact, Registrations, + Rule, Activity, Configuration, ExtendedDescription */ + DomainBlock, Instance, + }, + list::{self /* for RepliesPolicy */, List}, + marker::Marker, mention::Mention, - notification::Notification, - push::Subscription, + notification::{self /* for Type */, Notification}, + preferences::Preferences, + push::{ + self, /* for Alerts, AdminAlerts, add_subscription, update_data */ + Subscription, + }, relationship::Relationship, - report::Report, + report::{self /* for Category */, Report}, search_result::SearchResult, - status::{self, Application, Status}, + status::{ + self, /* for Scheduled, Source, Tag, Application, FeaturedTag, Mention*/ + NewStatus, NewStatusBuilder, Poll, PollBuilder, Status, + }, + tag::{self /* for History */, Tag}, visibility::Visibility, Empty, }; diff --git a/entities/src/notification.rs b/entities/src/notification.rs index 9b972a2..a7d4176 100644 --- a/entities/src/notification.rs +++ b/entities/src/notification.rs @@ -17,7 +17,7 @@ pub struct Notification { pub id: NotificationId, /// The type of event that resulted in the notification.. #[serde(rename = "type")] - pub notification_type: NotificationType, + pub notification_type: Type, /// The timestamp of the notification. #[serde(with = "iso8601")] pub created_at: OffsetDateTime, @@ -35,7 +35,7 @@ pub struct Notification { /// The type of notification. #[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, is_enum_variant)] #[serde(rename_all = "snake_case")] -pub enum NotificationType { +pub enum Type { /// Someone mentioned you in their status Mention, /// Someone you enabled notifications for has posted a status diff --git a/entities/src/status/mod.rs b/entities/src/status/mod.rs index 6ca9fdd..502ee67 100644 --- a/entities/src/status/mod.rs +++ b/entities/src/status/mod.rs @@ -106,19 +106,6 @@ pub struct Status { pub filtered: Vec<filter::Result>, } -/// A mention of another user. -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] -pub struct Mention { - /// URL of user's profile (can be remote). - pub url: String, - /// The username of the account. - pub username: String, - /// Equals `username` for local users, includes `@domain` for remote ones. - pub acct: String, - /// Account ID. - pub id: String, -} - /// Represents a hashtag used within the content of a status. /// /// See also [the API documentation](https://docs.joinmastodon.org/entities/Status/#Tag) |