include!(concat!(env!("OUT_DIR"), "/generated.rs"));
pub mod operations {
pub trait Operation {
const ID: &'static str;
const METHOD: reqwest::Method;
}
pub trait Fields: Operation {}
pub trait AdditionalFields: Operation {}
pub trait Include: Operation {}
pub trait Filter: Operation {}
pub trait Sort: Operation {}
pub trait PageSize: Operation {}
pub trait Paginated: Operation {
const CURSOR_PARAM: &'static str;
}
#[derive(Debug)]
pub struct Path<'p, O> {
segments: Vec<&'p str>,
operation: std::marker::PhantomData<fn() -> O>,
}
impl<'p, O> Path<'p, O> {
fn new(segments: Vec<&'p str>) -> Self {
Self {
segments,
operation: std::marker::PhantomData,
}
}
pub fn segments(&self) -> &[&'p str] {
&self.segments
}
}
include!(concat!(env!("OUT_DIR"), "/operations.rs"));
}