git-next/crates/actor-macros/src/message.rs
Paul Campbell 717cc8b0bc
Some checks failed
ci/woodpecker/push/tag-created Pipeline is pending
ci/woodpecker/push/cron-docker-builder Pipeline was successful
Rust / build (push) Has been cancelled
ci/woodpecker/push/push-next Pipeline was successful
refactor: update macro signatures and add documentation support
2024-06-29 18:26:19 +01:00

27 lines
853 B
Rust

#[macro_export]
macro_rules! message {
($name:ident: $value:ty: $docs:literal) => {
git_next_config::newtype!($name: $value: $docs);
impl actix::prelude::Message for $name {
type Result = ();
}
};
($name:ident: $docs:literal) => {
git_next_config::newtype!($name: $docs);
impl actix::prelude::Message for $name {
type Result = ();
}
};
($name:ident: $value:ty => $result:ty: $docs:literal) => {
git_next_config::newtype!($name is a $value: $docs);
impl actix::prelude::Message for $name {
type Result = $result;
}
};
($name:ident => $result:ty: $docs:literal) => {
git_next_config::newtype!($name: $docs);
impl actix::prelude::Message for $name {
type Result = $result;
}
};
}