#async #message #derive #macro #reply

macro async-reply-derive

Derive macros for async-reply messages

2 releases

0.1.1 Jan 6, 2021
0.1.0 Dec 22, 2020

#160 in Procedural macros


Used in async-reply

MIT/Apache

8KB
107 lines

Documentation

async-reply-derive

Derive macros for async-reply message.

Usage

use async_reply::Message;

#[derive(Message)]
#[rtype(response = "Pong")]
struct Ping;

struct Pong;

fn main() {}

This code expands into following code:

use async_reply::Message;

struct Ping;

struct Pong;

impl Message for Ping {
    type Response = Pong;
}

fn main() {}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Derive macros for async-reply message.

Usage

use async_reply::Message;

#[derive(Message)]
#[rtype(response = "Pong")]
struct Ping;

struct Pong;

fn main() {}

This code expands into following code:

use async_reply::Message;

struct Ping;

struct Pong;

impl Message for Ping {
    type Response = Pong;
}

fn main() {}

Dependencies

~0.4–0.8MB
~20K SLoC