use serde::{Deserialize, Serialize};
use std::fmt::{Debug, Display};
use utoipa::ToSchema;
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, PartialOrd, ToSchema, Ord)]
pub enum OutputQuery {
#[serde(rename = "table")]
Table,
#[serde(rename = "neighborhood")]
Neighborhood,
#[serde(rename = "quantiles")]
Quantiles,
}
impl Default for OutputQuery {
fn default() -> Self {
Self::Table
}
}
impl Display for OutputQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
OutputQuery::Table => write!(f, "table"),
OutputQuery::Neighborhood => write!(f, "neighborhood"),
OutputQuery::Quantiles => write!(f, "quantiles"),
}
}
}
#[derive(Clone, Serialize, Deserialize, ToSchema)]
pub struct NeighborhoodQuery {
pub anchor: Option<utoipa::openapi::Object>,
pub before: u32,
pub after: u32,
}
impl Debug for NeighborhoodQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "NeighborhoodQuery")
}
}