Implement export_* attributes for macros

This commit is contained in:
J Henry Waugh
2020-09-01 23:15:22 -05:00
parent 91b4f8a6bc
commit 3af49cec70
6 changed files with 274 additions and 41 deletions

View File

@@ -1,5 +1,18 @@
use syn::{parse::ParseStream, parse::Parser, spanned::Spanned};
#[derive(Debug)]
pub enum ExportScope {
PubOnly,
Prefix(String),
All,
}
impl Default for ExportScope {
fn default() -> ExportScope {
ExportScope::PubOnly
}
}
pub trait ExportedParams: Sized {
fn parse_stream(args: ParseStream) -> syn::Result<Self>;
fn no_attrs() -> Self;