fuel_derive/
lib.rs

1//! Derive macros for canonical type serialization and deserialization.
2
3#![cfg_attr(docsrs, feature(doc_auto_cfg))]
4#![deny(unused_must_use, unsafe_code, unused_crate_dependencies, missing_docs)]
5#![deny(
6    clippy::arithmetic_side_effects,
7    clippy::cast_sign_loss,
8    clippy::cast_possible_truncation,
9    clippy::cast_possible_wrap,
10    clippy::string_slice
11)]
12
13mod helpers;
14
15extern crate proc_macro;
16
17mod canonical {
18    mod attribute;
19    pub mod deserialize;
20    pub mod serialize;
21}
22
23synstructure::decl_derive!(
24    [Serialize, attributes(canonical)] =>
25    /// Derives `Serialize` trait for the given `struct` or `enum`.
26    canonical::serialize::derive
27);
28synstructure::decl_derive!(
29    [Deserialize, attributes(canonical)] =>
30    /// Derives `Deserialize` trait for the given `struct` or `enum`.
31    canonical::deserialize::derive
32);
33
34mod compression {
35    mod attribute;
36    pub mod compress;
37    pub mod decompress;
38}
39
40synstructure::decl_derive!(
41    [Compress, attributes(compress)] =>
42    /// Derives `Compressible` and `CompressibleBy` traits for the given `struct` or `enum`.
43    compression::compress::derive
44);
45synstructure::decl_derive!(
46    [Decompress, attributes(compress)] =>
47    /// Derives `DecompressibleBy` trait for the given `struct` or `enum`.
48    compression::decompress::derive
49);