mirror of
https://github.com/Syfaro/fuzzysearch.git
synced 2024-11-23 15:22:31 +00:00
Derive more for types.
This commit is contained in:
parent
08f1b6ad22
commit
e57d932042
@ -1,6 +1,6 @@
|
|||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
pub enum Rating {
|
pub enum Rating {
|
||||||
General,
|
General,
|
||||||
@ -24,7 +24,7 @@ impl std::str::FromStr for Rating {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A general type for every result in a search.
|
/// A general type for every result in a search.
|
||||||
#[derive(Debug, Default, Serialize)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
pub struct SearchResult {
|
pub struct SearchResult {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ pub struct SearchResult {
|
|||||||
pub searched_hash: Option<i64>,
|
pub searched_hash: Option<i64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
#[serde(tag = "site", content = "site_info")]
|
#[serde(tag = "site", content = "site_info")]
|
||||||
pub enum SiteInfo {
|
pub enum SiteInfo {
|
||||||
FurAffinity {
|
FurAffinity {
|
||||||
|
Loading…
Reference in New Issue
Block a user