| Crates.io | quote-data |
| lib.rs | quote-data |
| version | 1.0.0 |
| created_at | 2024-08-18 16:34:12.229728+00 |
| updated_at | 2024-08-18 16:34:12.229728+00 |
| description | A tokenization Library for Rust |
| homepage | |
| repository | https://github.com/dark-flames/Iroha |
| max_upload_size | |
| id | 1342777 |
| size | 19,456 |
A tokenization Library for Rust.
quote-data provide derive macro quote_data::QuoteIt,
which implements quote::ToTokens for struct or enum.
use quote_data::QuoteIt;
use proc_macro2::TokenStream;
use quote::quote;
#[derive(QuoteIt)]
struct Foo {
a: i32,
b: i64
}
#[derive(QuoteIt)]
#[mod_path="path::to::mod"]
enum Bar {
A(u8, String),
B
}
fn some_fn() -> TokenStream {
let foo = Foo {a: 1, b: 2};
let bar = Bar::A(1, "test".to_string);
quote! {
|| (#foo, #bar)
}
}
quote::ToTokensStringVec, HashMap, HashSetResult, OptionTuplestd::marker::PhantomData