9 releases (1 stable)

1.0.0 Mar 31, 2020
1.0.0-rc.3 Mar 25, 2020
1.0.0-rc.1 Feb 7, 2020
0.13.0-rc.2 Dec 4, 2019
0.10.0 Dec 14, 2018

#23 in #exonum

Download history 133/week @ 2023-11-27 95/week @ 2023-12-04 92/week @ 2023-12-11 69/week @ 2023-12-18 71/week @ 2023-12-25 28/week @ 2024-01-01 48/week @ 2024-01-08 54/week @ 2024-01-15 31/week @ 2024-01-22 33/week @ 2024-01-29 74/week @ 2024-02-05 68/week @ 2024-02-12 51/week @ 2024-02-19 98/week @ 2024-02-26 56/week @ 2024-03-04 48/week @ 2024-03-11

265 downloads per month
Used in 17 crates (15 directly)

Apache-2.0

74KB
1.5K SLoC

Procedural macros for Exonum

Travis Build Status License: Apache-2.0 rust 1.42.0+ required

This crate provides several procedural macros for Exonum core and Exonum services.

Overview of presented macros:

  • BinaryValue: derive macro for BinaryValue trait of MerkleDB. Depending on codec, the implementation may use ProtobufConvert trait as base (default), or serde traits using bincode.
  • ObjectHash: derive macro for ObjectHash trait of MerkleDB. It can be used for any type that implements BinaryValue trait.
  • FromAccess: derive macro for FromAccess trait for schemas of MerkleDB indexes.
  • ServiceDispatcher: derive macro for generating dispatching mechanisms of Rust Exonum services.
  • ServiceFactory: derive macro for generating factory mechanisms of Rust Exonum services.
  • exonum_interface: attribute macro for transforming trait into interface of Rust Exonum service.
  • ExecutionFail: derive macro similar to failure::Fail, implementing ExecutionFail trait for an enum.
  • RequireArtifact: derive macro for RequireArtifact trait.

Consult the crate docs for more details.

Usage

Include exonum-derive as a dependency in your Cargo.toml:

[dependencies]
exonum-derive = "1.0.0"

License

exonum-derive is licensed under the Apache License (Version 2.0). See LICENSE for details.

Dependencies

~2MB
~45K SLoC