binary-util-derive 0.1.1

Proc Macros for binary-util
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use syn::DataUnion;

use super::AstContext;

pub(crate) fn derive_union(ast_ctx: AstContext, _: DataUnion, _: &mut TokenStream2) -> TokenStream {
    syn::Error::new_spanned(
        ast_ctx.0,
        "Unions are not supported by binary_util, there is currently no way to implement the BinaryReader and BinaryWriter traits for unions."
    ).to_compile_error().into()
}