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
64 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
65 #[cfg_attr(feature = "full", derive(TS))]
66 #[cfg_attr(feature = "full", ts(export))]
67 /// The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
68 pub enum CommentSortType {
75 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
76 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
79 ExistingTypePath = "crate::schema::sql_types::ListingTypeEnum"
81 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
82 #[cfg_attr(feature = "full", ts(export))]
83 /// A listing type for post and comment list fetches.
84 pub enum ListingType {
85 /// Content from your own site, as well as all connected / federated sites.
87 /// Content from your site only.
89 /// Content only from communities you've subscribed to.
93 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
94 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
97 ExistingTypePath = "crate::schema::sql_types::RegistrationModeEnum"
99 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
100 #[cfg_attr(feature = "full", ts(export))]
101 /// The registration mode for your site. Determines what happens after a user signs up.
102 pub enum RegistrationMode {
103 /// Closed to public.
105 /// Open, but pending approval of a registration application.
111 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
112 #[cfg_attr(feature = "full", derive(TS))]
113 #[cfg_attr(feature = "full", ts(export))]
114 /// The type of content returned from a search.
115 pub enum SearchType {
124 #[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
125 #[cfg_attr(feature = "full", derive(TS))]
126 #[cfg_attr(feature = "full", ts(export))]
127 /// A type / status for a community subscribe.
128 pub enum SubscribedType {
134 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
135 #[cfg_attr(feature = "full", derive(TS))]
136 #[cfg_attr(feature = "full", ts(export))]
137 /// A list of possible types for the various modlog actions.
138 pub enum ModlogActionType {
147 ModTransferCommunity,
158 EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq,
160 #[cfg_attr(feature = "full", derive(TS))]
161 #[cfg_attr(feature = "full", ts(export))]
162 /// The feature type for a post.
163 pub enum PostFeatureType {
165 /// Features to the top of your site.
167 /// Features to the top of the community.