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

28 lines
779 B
Rust
Raw Normal View History

2024-06-29 10:49:12 +01:00
#[macro_export]
macro_rules! message {
($name:ident wraps $value:ty) => {
git_next_config::newtype!($name is a $value);
impl actix::prelude::Message for $name {
type Result = ();
}
};
($name:ident) => {
git_next_config::newtype!($name);
impl actix::prelude::Message for $name {
type Result = ();
}
};
($name:ident wraps $value:ty => $result:ty) => {
git_next_config::newtype!($name is a $value);
impl actix::prelude::Message for $name {
type Result = $result;
}
};
($name:ident => $result:ty) => {
git_next_config::newtype!($name);
impl actix::prelude::Message for $name {
type Result = $result;
}
};
}