bitcoin-derive

Crates.iobitcoin-derive
lib.rsbitcoin-derive
version0.1.18
created_at2023-01-17 21:06:09.468933+00
updated_at2025-07-09 00:39:17.025028+00
descriptionA procedural macro crate providing attributes for concurrency control, signal-slot mechanisms, and fuzz testing, designed for Bitcoin-related Rust projects.
homepage
repositoryhttps://github.com/klebs6/bitcoin-rs
max_upload_size
id761291
size176,096
(klebs6)

documentation

https://docs.rs/bitcoin-derive

README

bitcoin-derive

bitcoin-derive is a Rust procedural macro library designed to enhance concurrency and object interaction patterns for projects related to Bitcoin. Utilizing Rust's powerful procedural macros, this crate provides a series of attributes that facilitate compile-time guarantees and annotations for various concurrency and object modeling constructs.

Features

  • Concurrency Control: Decorate functions and methods with macros like LOCKABLE, EXCLUSIVE_LOCK_FUNCTION, SCOPED_LOCKABLE, and LOCKS_EXCLUDED to constraint and manage locking behavior.
  • Signal-Slot Mechanism: Implement Qt-inspired signal and slot patterns using Q_SIGNAL, Q_SIGALS, Q_SLOT, and Q_SLOTS attributes, enhancing modular event-driven designs.
  • Fuzz Testing: Annotate test functions with fuzz and fuzz_test for integration with fuzz testing tools.
  • Annotation Attributes: Utilize no_copy, no_move, and NO_THREAD_SAFETY_ANALYSIS to provide explicit specification of intended data handling and thread safety behaviors.

Getting Started

To integrate bitcoin-derive into your Rust project, include it as a dependency in your Cargo.toml:

[dependencies]
bitcoin-derive = "0.1.18"

Then, import the macros and use them to annotate your functions and structs:

use bitcoin_derive::{LOCKABLE, Q_SIGNAL};

#[LOCKABLE]
fn protected_function() {
    // Implementation 
}

#[Q_SIGNAL]
fn emit_signal() {
    // Emit signal logic
}

Documentation

For comprehensive usage and examples, please refer to the official repository where detailed documentation and example code snippets are available.

License

This project is licensed under the MIT License.


This README.md file is auto-generated by an AI model. Please verify contents for absolute accuracy.

Commit count: 0

cargo fmt