File tree Expand file tree Collapse file tree 4 files changed +5
-7
lines changed Expand file tree Collapse file tree 4 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,8 @@ pub trait GenServer
105105where
106106 Self : Send + Sized ,
107107{
108- type CallMsg : Send + Sized + Sync ;
109- type CastMsg : Send + Sized + Sync ;
108+ type CallMsg : Clone + Send + Sized + Sync ;
109+ type CastMsg : Clone + Send + Sized + Sync ;
110110 type OutMsg : Send + Sized ;
111111 type State : Clone + Send ;
112112 type Error : Debug + Send ;
Original file line number Diff line number Diff line change 2727 Box :: pin ( cloned_token. cancelled ( ) ) ,
2828 Box :: pin ( async {
2929 rt:: sleep ( period) . await ;
30- let _ = handle. cast ( message) . await ;
30+ let _ = handle. cast ( message. clone ( ) ) . await ;
3131 } ) ,
3232 )
3333 . await ;
@@ -46,7 +46,6 @@ pub fn send_interval<T>(
4646) -> TimerHandle
4747where
4848 T : GenServer + ' static ,
49- T :: CastMsg : Clone ,
5049{
5150 let cancellation_token = CancellationToken :: new ( ) ;
5251 let cloned_token = cancellation_token. clone ( ) ;
Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ pub trait GenServer
8383where
8484 Self : Send + Sized ,
8585{
86- type CallMsg : Send + Sized ;
87- type CastMsg : Send + Sized ;
86+ type CallMsg : Clone + Send + Sized ;
87+ type CastMsg : Clone + Send + Sized ;
8888 type OutMsg : Send + Sized ;
8989 type State : Clone + Send ;
9090 type Error : Debug ;
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ pub fn send_interval<T>(
4141) -> TimerHandle
4242where
4343 T : GenServer + ' static ,
44- T :: CastMsg : Clone ,
4544{
4645 let cancellation_token = CancellationToken :: new ( ) ;
4746 let mut cloned_token = cancellation_token. clone ( ) ;
You can’t perform that action at this time.
0 commit comments