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
68 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
69 #[cfg_attr(feature = "full", derive(TS))]
70 #[cfg_attr(feature = "full", ts(export))]
71 /// The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
72 pub enum CommentSortType {
79 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
80 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
83 ExistingTypePath = "crate::schema::sql_types::ListingTypeEnum"
85 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
86 #[cfg_attr(feature = "full", ts(export))]
87 /// A listing type for post and comment list fetches.
88 pub enum ListingType {
89 /// Content from your own site, as well as all connected / federated sites.
91 /// Content from your site only.
93 /// Content only from communities you've subscribed to.
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::RegistrationModeEnum"
103 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
104 #[cfg_attr(feature = "full", ts(export))]
105 /// The registration mode for your site. Determines what happens after a user signs up.
106 pub enum RegistrationMode {
107 /// Closed to public.
109 /// Open, but pending approval of a registration application.
115 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
116 #[cfg_attr(feature = "full", derive(TS))]
117 #[cfg_attr(feature = "full", ts(export))]
118 /// The type of content returned from a search.
119 pub enum SearchType {
128 #[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
129 #[cfg_attr(feature = "full", derive(TS))]
130 #[cfg_attr(feature = "full", ts(export))]
131 /// A type / status for a community subscribe.
132 pub enum SubscribedType {
138 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
139 #[cfg_attr(feature = "full", derive(TS))]
140 #[cfg_attr(feature = "full", ts(export))]
141 /// A list of possible types for the various modlog actions.
142 pub enum ModlogActionType {
151 ModTransferCommunity,
162 EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq,
164 #[cfg_attr(feature = "full", derive(TS))]
165 #[cfg_attr(feature = "full", ts(export))]
166 /// The feature type for a post.
167 pub enum PostFeatureType {
169 /// Features to the top of your site.
171 /// Features to the top of the community.