From 382a118966308697bfa4ca72dedacadc83107554 Mon Sep 17 00:00:00 2001 From: Ari Seyhun Date: Thu, 30 May 2024 03:27:40 +1000 Subject: [PATCH] feat: add `Send + 'static` bounds to `Reply` trait --- crates/kameo/src/message.rs | 6 +++--- crates/kameo/src/reply.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/kameo/src/message.rs b/crates/kameo/src/message.rs index 6e065c3..9f28f3d 100644 --- a/crates/kameo/src/message.rs +++ b/crates/kameo/src/message.rs @@ -35,7 +35,7 @@ pub(crate) type BoxReply = Box; /// The reply type must implement [Reply]. pub trait Message: Send + 'static { /// The reply sent back to the message caller. - type Reply: Reply + Send + 'static; + type Reply: Reply; /// Handler for this message. fn handle( @@ -53,7 +53,7 @@ pub trait Message: Send + 'static { /// The reply type must implement [Reply]. pub trait BlockingMessage: Send + 'static { /// The reply sent back to the message caller. - type Reply: Reply + Send + 'static; + type Reply: Reply; /// Handler for this message. fn handle(&mut self, msg: T, ctx: Context<'_, Self, Self::Reply>) -> Self::Reply; @@ -68,7 +68,7 @@ pub trait BlockingMessage: Send + 'static { /// The reply type must implement [Reply]. pub trait Query: Send + 'static { /// The reply sent back to the query caller. - type Reply: Reply + Send + 'static; + type Reply: Reply; /// Handler for this query. fn handle( diff --git a/crates/kameo/src/reply.rs b/crates/kameo/src/reply.rs index e5ffa6b..c2e6ac7 100644 --- a/crates/kameo/src/reply.rs +++ b/crates/kameo/src/reply.rs @@ -66,7 +66,7 @@ pub type ForwardedReply = DelegatedReply /// #[derive(Reply)] /// pub struct Foo { } /// ``` -pub trait Reply { +pub trait Reply: Send + 'static { /// The success type in the reply. type Ok: Send + 'static; /// The error type in the reply. @@ -74,7 +74,7 @@ pub trait Reply { /// The type sent back to the receiver. /// /// In almost all cases this will be `Self`. The only exception is the `DeligatedReply` type. - type Value: Reply + Send + 'static; + type Value: Reply; /// Converts a reply to a `Result`. fn to_result(self) -> Result;