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
71 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
72 #[cfg_attr(feature = "full", derive(TS))]
73 #[cfg_attr(feature = "full", ts(export))]
74 /// The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
75 pub enum CommentSortType {
82 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
83 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
86 ExistingTypePath = "crate::schema::sql_types::ListingTypeEnum"
88 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
89 #[cfg_attr(feature = "full", ts(export))]
90 /// A listing type for post and comment list fetches.
91 pub enum ListingType {
92 /// Content from your own site, as well as all connected / federated sites.
94 /// Content from your site only.
96 /// Content only from communities you've subscribed to.
100 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
101 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
104 ExistingTypePath = "crate::schema::sql_types::RegistrationModeEnum"
106 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
107 #[cfg_attr(feature = "full", ts(export))]
108 /// The registration mode for your site. Determines what happens after a user signs up.
109 pub enum RegistrationMode {
110 /// Closed to public.
112 /// Open, but pending approval of a registration application.
118 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
119 #[cfg_attr(feature = "full", derive(TS))]
120 #[cfg_attr(feature = "full", ts(export))]
121 /// The type of content returned from a search.
122 pub enum SearchType {
131 #[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
132 #[cfg_attr(feature = "full", derive(TS))]
133 #[cfg_attr(feature = "full", ts(export))]
134 /// A type / status for a community subscribe.
135 pub enum SubscribedType {
141 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
142 #[cfg_attr(feature = "full", derive(TS))]
143 #[cfg_attr(feature = "full", ts(export))]
144 /// A list of possible types for the various modlog actions.
145 pub enum ModlogActionType {
154 ModTransferCommunity,
165 EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq,
167 #[cfg_attr(feature = "full", derive(TS))]
168 #[cfg_attr(feature = "full", ts(export))]
169 /// The feature type for a post.
170 pub enum PostFeatureType {
172 /// Features to the top of your site.
174 /// Features to the top of the community.