git-next/crates/actor-macros/src/message.rs

28 lines
853 B
Rust
Raw Normal View History

2024-06-29 10:49:12 +01:00
#[macro_export]
macro_rules! message {
($name:ident: $value:ty: $docs:literal) => {
git_next_config::newtype!($name: $value: $docs);
2024-06-29 10:49:12 +01:00
impl actix::prelude::Message for $name {
type Result = ();
}
};
($name:ident: $docs:literal) => {
git_next_config::newtype!($name: $docs);
2024-06-29 10:49:12 +01:00
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);
2024-06-29 10:49:12 +01:00
impl actix::prelude::Message for $name {
type Result = $result;
}
};
($name:ident => $result:ty: $docs:literal) => {
git_next_config::newtype!($name: $docs);
2024-06-29 10:49:12 +01:00
impl actix::prelude::Message for $name {
type Result = $result;
}
};
}