1 #![recursion_limit = "256"]
3 #[cfg(feature = "full")]
6 #[cfg(feature = "full")]
8 extern crate diesel_derive_newtype;
10 #[cfg(feature = "full")]
12 extern crate diesel_derive_enum;
14 // this is used in tests
15 #[cfg(feature = "full")]
17 extern crate diesel_migrations;
19 #[cfg(feature = "full")]
21 extern crate async_trait;
24 #[cfg(feature = "full")]
27 #[cfg(feature = "full")]
31 #[cfg(feature = "full")]
33 #[cfg(feature = "full")]
36 use serde::{Deserialize, Serialize};
37 use strum_macros::{Display, EnumString};
38 #[cfg(feature = "full")]
41 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
42 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
45 ExistingTypePath = "crate::schema::sql_types::SortTypeEnum"
47 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
48 #[cfg_attr(feature = "full", ts(export))]
49 /// The post sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
67 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
68 #[cfg_attr(feature = "full", derive(TS))]
69 #[cfg_attr(feature = "full", ts(export))]
70 /// The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
71 pub enum CommentSortType {
78 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
79 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
82 ExistingTypePath = "crate::schema::sql_types::ListingTypeEnum"
84 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
85 #[cfg_attr(feature = "full", ts(export))]
86 /// A listing type for post and comment list fetches.
87 pub enum ListingType {
88 /// Content from your own site, as well as all connected / federated sites.
90 /// Content from your site only.
92 /// Content only from communities you've subscribed to.
96 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
97 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
100 ExistingTypePath = "crate::schema::sql_types::RegistrationModeEnum"
102 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
103 #[cfg_attr(feature = "full", ts(export))]
104 /// The registration mode for your site. Determines what happens after a user signs up.
105 pub enum RegistrationMode {
106 /// Closed to public.
108 /// Open, but pending approval of a registration application.
114 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
115 #[cfg_attr(feature = "full", derive(TS))]
116 #[cfg_attr(feature = "full", ts(export))]
117 /// The type of content returned from a search.
118 pub enum SearchType {
127 #[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
128 #[cfg_attr(feature = "full", derive(TS))]
129 #[cfg_attr(feature = "full", ts(export))]
130 /// A type / status for a community subscribe.
131 pub enum SubscribedType {
137 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
138 #[cfg_attr(feature = "full", derive(TS))]
139 #[cfg_attr(feature = "full", ts(export))]
140 /// A list of possible types for the various modlog actions.
141 pub enum ModlogActionType {
150 ModTransferCommunity,
161 EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq,
163 #[cfg_attr(feature = "full", derive(TS))]
164 #[cfg_attr(feature = "full", ts(export))]
165 /// The feature type for a post.
166 pub enum PostFeatureType {
168 /// Features to the top of your site.
170 /// Features to the top of the community.