channel_protocol/
lib.rs

1//! # Channel Protocol
2//! A procedural macro to generate channel protocol clients.
3//! You can use function oriented communication between threads instead of communicating by sending messages through channels.
4//! This is an abstraction over channels that makes inter-thread communication easier to use and read.
5//!
6//! ## Example
7//! ```
8#![doc = include_str!("../examples/sync.rs")]
9//! ```
10mod channel_protocol;
11mod client;
12mod enum_message;
13
14use proc_macro::TokenStream;
15/// Expect a trait definition as input and generate a channel protocol based on it.
16#[proc_macro_attribute]
17pub fn channel_protocol(_attr_content: TokenStream, item: TokenStream) -> TokenStream {
18    channel_protocol::build(item.into()).into()
19}