#[macro_use]
mod macros;
mod impls;
mod map;
mod post_process;
mod specta_id;
pub use map::*;
pub use post_process::*;
pub use specta_id::*;
use crate::{
reference::{self, Reference},
DataType, NamedDataType,
};
#[derive(Debug, Clone, Copy)]
pub enum Generics<'a> {
Definition,
Provided(&'a [DataType]),
}
impl<'a> Generics<'a> {
#[doc(hidden)] pub const NONE: Self = Self::Provided(&[]);
}
pub trait Type {
fn inline(type_map: &mut TypeMap, generics: Generics) -> DataType;
fn reference(type_map: &mut TypeMap, generics: &[DataType]) -> Reference {
reference::inline::<Self>(type_map, generics)
}
}
pub trait NamedType: Type {
fn sid() -> SpectaID;
fn named_data_type(type_map: &mut TypeMap, generics: &[DataType]) -> NamedDataType;
fn definition_named_data_type(type_map: &mut TypeMap) -> NamedDataType;
}
pub trait Flatten: Type {}