phoxal-macros 0.15.0

Proc-macros for the phoxal framework: phoxal_api_tree!, #[derive(Runtime)], #[phoxal::runtime].
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Shared helpers for the phoxal proc-macros.

use proc_macro2::TokenStream;
use quote::quote;

/// The path generated code uses to reach the framework. The engine crate makes
/// this resolve to itself via `extern crate self as phoxal;`.
pub fn phoxal() -> TokenStream {
    quote!(::phoxal)
}

/// The standard derive set applied to every macro-emitted wire body / helper
/// type: cloneable, comparable, debuggable, and serde round-trippable.
pub fn body_derives() -> TokenStream {
    quote!(#[derive(Clone, Debug, PartialEq, ::serde::Serialize, ::serde::Deserialize)])
}