File tree 1 file changed +10
-9
lines changed
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -114,18 +114,19 @@ pub mod prelude {
114
114
}
115
115
}
116
116
117
- pub trait CosmosRequest < T > {
118
- fn with_height ( & mut self , height : MetadataValue < Ascii > ) -> & mut Self ;
119
- }
120
-
121
- impl < T > CosmosRequest < T > for tonic:: Request < T > {
122
- fn with_height ( & mut self , height : MetadataValue < Ascii > ) -> & mut Self {
123
- self . metadata_mut ( ) . insert ( HEIGHT_METADATA_KEY , height) ;
124
-
125
- self
117
+ pub trait CosmosMessage {
118
+ fn with_height ( self , height : MetadataValue < Ascii > ) -> tonic:: Request < Self >
119
+ where
120
+ Self : Sized ,
121
+ {
122
+ let mut req = tonic:: Request :: new ( self ) ;
123
+ req. metadata_mut ( ) . insert ( HEIGHT_METADATA_KEY , height) ;
124
+ req
126
125
}
127
126
}
128
127
128
+ impl < T > CosmosMessage for T { }
129
+
129
130
pub trait CosmosResponse < T > {
130
131
fn get_height ( & self ) -> Option < & MetadataValue < Ascii > > ;
131
132
}
You can’t perform that action at this time.
0 commit comments