lemmy/crates/db_schema/src/lib.rs

59 lines
1 KiB
Rust
Raw Normal View History

#[cfg(feature = "full")]
#[macro_use]
extern crate diesel;
#[cfg(feature = "full")]
#[macro_use]
extern crate diesel_derive_newtype;
2021-10-16 13:33:38 +00:00
// this is used in tests
#[cfg(feature = "full")]
2021-10-16 13:33:38 +00:00
#[allow(unused_imports)]
#[macro_use]
extern crate diesel_migrations;
2021-10-16 13:33:38 +00:00
pub mod aggregates;
#[cfg(feature = "full")]
2021-10-16 13:33:38 +00:00
pub mod impls;
pub mod newtypes;
#[cfg(feature = "full")]
2021-10-16 13:33:38 +00:00
pub mod schema;
pub mod source;
#[cfg(feature = "full")]
2021-10-16 13:33:38 +00:00
pub mod traits;
#[cfg(feature = "full")]
pub mod utils;
use serde::{Deserialize, Serialize};
use strum_macros::{Display, EnumString};
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
pub enum SortType {
Active,
Hot,
New,
TopDay,
TopWeek,
TopMonth,
TopYear,
TopAll,
MostComments,
NewComments,
}
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq)]
pub enum ListingType {
All,
Local,
Subscribed,
Community,
}
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
pub enum SearchType {
All,
Comments,
Posts,
Communities,
Users,
Url,
}