Renamed MappedMessage

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2025-11-04 10:25:19 +01:00
parent 66971a4f26
commit 36966ff86d

View file

@ -10,7 +10,7 @@ use tytix_core::MessageBundle;
use tytix_core::anyhow; use tytix_core::anyhow;
pub trait AddressExt<MB> { pub trait AddressExt<MB> {
fn map_message<F, M, R, U>(self, f: F) -> MappedBeforeAddress<Self, F, M, R> fn map_message<F, M, R, U>(self, f: F) -> MappedMessage<Self, F, M, R>
where where
F: Fn(M) -> U + 'static, F: Fn(M) -> U + 'static,
U: Future<Output = R>, U: Future<Output = R>,
@ -26,7 +26,7 @@ pub trait AddressExt<MB> {
} }
impl<MB: MessageBundle, A: Address<MB>> AddressExt<MB> for A { impl<MB: MessageBundle, A: Address<MB>> AddressExt<MB> for A {
fn map_message<F, M, R, U>(self, f: F) -> MappedBeforeAddress<Self, F, M, R> fn map_message<F, M, R, U>(self, f: F) -> MappedMessage<Self, F, M, R>
where where
MB: MessageBundle, MB: MessageBundle,
F: Fn(M) -> U + 'static, F: Fn(M) -> U + 'static,
@ -41,7 +41,7 @@ impl<MB: MessageBundle, A: Address<MB>> AddressExt<MB> for A {
}; };
} }
MappedBeforeAddress { MappedMessage {
address: self, address: self,
func: f, func: f,
_pd: PhantomData, _pd: PhantomData,
@ -91,7 +91,7 @@ where
} }
} }
pub struct MappedBeforeAddress<A, F, M, R> { pub struct MappedMessage<A, F, M, R> {
address: A, address: A,
func: F, func: F,
_pd: PhantomData<fn(M) -> R>, _pd: PhantomData<fn(M) -> R>,
@ -110,7 +110,7 @@ where
const IDS: tytix_core::BundleChain = MB::IDS.without::<R>().with::<M>(); const IDS: tytix_core::BundleChain = MB::IDS.without::<R>().with::<M>();
} }
impl<A, F, M, R, U> InternalMessageHandler for MappedBeforeAddress<A, F, M, R> impl<A, F, M, R, U> InternalMessageHandler for MappedMessage<A, F, M, R>
where where
A: InternalMessageHandler, A: InternalMessageHandler,
M: Message, M: Message,