use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SearchType {
#[serde(rename = "fulltext")]
Fulltext,
#[serde(rename = "prefix")]
Prefix,
}
impl std::fmt::Display for SearchType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Fulltext => write!(f, "fulltext"),
Self::Prefix => write!(f, "prefix"),
}
}
}
impl Default for SearchType {
fn default() -> SearchType {
Self::Fulltext
}
}