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")]
29 #[allow(clippy::wildcard_imports)]
32 #[cfg(feature = "full")]
34 #[cfg(feature = "full")]
37 use serde::{Deserialize, Serialize};
38 use strum_macros::{Display, EnumString};
39 #[cfg(feature = "full")]
42 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
43 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
46 ExistingTypePath = "crate::schema::sql_types::SortTypeEnum"
48 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
49 #[cfg_attr(feature = "full", ts(export))]
50 /// The post sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
72 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
73 #[cfg_attr(feature = "full", derive(TS))]
74 #[cfg_attr(feature = "full", ts(export))]
75 /// The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
76 pub enum CommentSortType {
84 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
85 #[cfg_attr(feature = "full", derive(TS))]
86 #[cfg_attr(feature = "full", ts(export))]
87 /// The person sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
88 pub enum PersonSortType {
97 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
98 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
101 ExistingTypePath = "crate::schema::sql_types::ListingTypeEnum"
103 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
104 #[cfg_attr(feature = "full", ts(export))]
105 /// A listing type for post and comment list fetches.
106 pub enum ListingType {
107 /// Content from your own site, as well as all connected / federated sites.
109 /// Content from your site only.
111 /// Content only from communities you've subscribed to.
115 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
116 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
119 ExistingTypePath = "crate::schema::sql_types::RegistrationModeEnum"
121 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
122 #[cfg_attr(feature = "full", ts(export))]
123 /// The registration mode for your site. Determines what happens after a user signs up.
124 pub enum RegistrationMode {
125 /// Closed to public.
127 /// Open, but pending approval of a registration application.
133 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
134 #[cfg_attr(feature = "full", derive(TS))]
135 #[cfg_attr(feature = "full", ts(export))]
136 /// The type of content returned from a search.
137 pub enum SearchType {
146 #[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
147 #[cfg_attr(feature = "full", derive(TS))]
148 #[cfg_attr(feature = "full", ts(export))]
149 /// A type / status for a community subscribe.
150 pub enum SubscribedType {
156 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
157 #[cfg_attr(feature = "full", derive(TS))]
158 #[cfg_attr(feature = "full", ts(export))]
159 /// A list of possible types for the various modlog actions.
160 pub enum ModlogActionType {
169 ModTransferCommunity,
180 EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq,
182 #[cfg_attr(feature = "full", derive(TS))]
183 #[cfg_attr(feature = "full", ts(export))]
184 /// The feature type for a post.
185 pub enum PostFeatureType {
187 /// Features to the top of your site.
189 /// Features to the top of the community.