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)]
31 #[cfg(feature = "full")]
33 use crate::schema::person;
34 diesel::alias!(person as person1: Person1, person as person2: Person2);
37 #[cfg(feature = "full")]
39 #[cfg(feature = "full")]
42 use serde::{Deserialize, Serialize};
43 use strum_macros::{Display, EnumString};
44 #[cfg(feature = "full")]
47 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
48 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
51 ExistingTypePath = "crate::schema::sql_types::SortTypeEnum"
53 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
54 #[cfg_attr(feature = "full", ts(export))]
55 /// The post sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
77 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
78 #[cfg_attr(feature = "full", derive(TS))]
79 #[cfg_attr(feature = "full", ts(export))]
80 /// The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
81 pub enum CommentSortType {
89 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
90 #[cfg_attr(feature = "full", derive(TS))]
91 #[cfg_attr(feature = "full", ts(export))]
92 /// The person sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
93 pub enum PersonSortType {
102 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
103 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
106 ExistingTypePath = "crate::schema::sql_types::ListingTypeEnum"
108 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
109 #[cfg_attr(feature = "full", ts(export))]
110 /// A listing type for post and comment list fetches.
111 pub enum ListingType {
112 /// Content from your own site, as well as all connected / federated sites.
114 /// Content from your site only.
116 /// Content only from communities you've subscribed to.
120 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
121 #[cfg_attr(feature = "full", derive(DbEnum, TS))]
124 ExistingTypePath = "crate::schema::sql_types::RegistrationModeEnum"
126 #[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
127 #[cfg_attr(feature = "full", ts(export))]
128 /// The registration mode for your site. Determines what happens after a user signs up.
129 pub enum RegistrationMode {
130 /// Closed to public.
132 /// Open, but pending approval of a registration application.
138 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
139 #[cfg_attr(feature = "full", derive(TS))]
140 #[cfg_attr(feature = "full", ts(export))]
141 /// The type of content returned from a search.
142 pub enum SearchType {
151 #[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
152 #[cfg_attr(feature = "full", derive(TS))]
153 #[cfg_attr(feature = "full", ts(export))]
154 /// A type / status for a community subscribe.
155 pub enum SubscribedType {
161 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
162 #[cfg_attr(feature = "full", derive(TS))]
163 #[cfg_attr(feature = "full", ts(export))]
164 /// A list of possible types for the various modlog actions.
165 pub enum ModlogActionType {
174 ModTransferCommunity,
185 EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq,
187 #[cfg_attr(feature = "full", derive(TS))]
188 #[cfg_attr(feature = "full", ts(export))]
189 /// The feature type for a post.
190 pub enum PostFeatureType {
192 /// Features to the top of your site.
194 /// Features to the top of the community.