use proc_macro2 as pm2;
pub trait ToMacroPattern {
fn to_macro_pattern(&self) -> Option<pm2::TokenStream>;
fn to_func_call_pattern(&self) -> pm2::TokenStream;
}
pub trait StripAttributes {
type Original;
fn strip_attributes(&self) -> Self::Original;
}
#[derive(Clone, Debug)]
pub struct DocInfo {
pub ident: String,
pub ty: String,
pub default_value: Option<String>,
}
impl std::fmt::Display for DocInfo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.default_value {
Some(val) => write!(f, "`{}`: `{}` = `{}` ", self.ident, self.ty, val),
None => write!(f, "`{}`: `{}` ", self.ident, self.ty),
}
}
}
pub trait ToDocInfo {
fn to_doc_info(&self) -> DocInfo;
}