@@ -73,7 +73,7 @@ mod storage {
7373 } ;
7474 use irpc:: {
7575 channel:: { mpsc, oneshot} ,
76- Client , Service , WithChannels ,
76+ Client , Request , Service ,
7777 } ;
7878 // Import the macro
7979 use irpc_derive:: rpc_requests;
@@ -143,7 +143,7 @@ mod storage {
143143 let msg_with_channels = upcast_message ( msg, request, reply) ;
144144 match msg_with_channels {
145145 StorageMessage :: Auth ( msg) => {
146- let WithChannels { message, reply, .. } = msg;
146+ let Request { message, reply, .. } = msg;
147147 if authed {
148148 conn. close ( 1u32 . into ( ) , b"invalid message" ) ;
149149 break ;
@@ -177,11 +177,11 @@ mod storage {
177177 reply : SendStream ,
178178 ) -> StorageMessage {
179179 match msg {
180- StorageProtocol :: Auth ( msg) => WithChannels :: from ( ( msg, reply, request) ) . into ( ) ,
181- StorageProtocol :: Get ( msg) => WithChannels :: from ( ( msg, reply, request) ) . into ( ) ,
182- StorageProtocol :: Set ( msg) => WithChannels :: from ( ( msg, reply, request) ) . into ( ) ,
183- StorageProtocol :: SetMany ( msg) => WithChannels :: from ( ( msg, reply, request) ) . into ( ) ,
184- StorageProtocol :: List ( msg) => WithChannels :: from ( ( msg, reply, request) ) . into ( ) ,
180+ StorageProtocol :: Auth ( msg) => Request :: from ( ( msg, reply, request) ) . into ( ) ,
181+ StorageProtocol :: Get ( msg) => Request :: from ( ( msg, reply, request) ) . into ( ) ,
182+ StorageProtocol :: Set ( msg) => Request :: from ( ( msg, reply, request) ) . into ( ) ,
183+ StorageProtocol :: SetMany ( msg) => Request :: from ( ( msg, reply, request) ) . into ( ) ,
184+ StorageProtocol :: List ( msg) => Request :: from ( ( msg, reply, request) ) . into ( ) ,
185185 }
186186 }
187187
@@ -200,21 +200,21 @@ mod storage {
200200 StorageMessage :: Auth ( _) => unreachable ! ( "handled in ProtocolHandler::accept" ) ,
201201 StorageMessage :: Get ( get) => {
202202 info ! ( "get {:?}" , get) ;
203- let WithChannels { reply, message, .. } = get;
203+ let Request { reply, message, .. } = get;
204204 let res = self . state . lock ( ) . unwrap ( ) . get ( & message. key ) . cloned ( ) ;
205205 reply. send ( res) . await . ok ( ) ;
206206 }
207207 StorageMessage :: Set ( set) => {
208208 info ! ( "set {:?}" , set) ;
209- let WithChannels { reply, message, .. } = set;
209+ let Request { reply, message, .. } = set;
210210 self . state
211211 . lock ( )
212212 . unwrap ( )
213213 . insert ( message. key , message. value ) ;
214214 reply. send ( ( ) ) . await . ok ( ) ;
215215 }
216216 StorageMessage :: SetMany ( list) => {
217- let WithChannels {
217+ let Request {
218218 reply, mut updates, ..
219219 } = list;
220220 let mut i = 0 ;
@@ -227,7 +227,7 @@ mod storage {
227227 }
228228 StorageMessage :: List ( list) => {
229229 info ! ( "list {:?}" , list) ;
230- let WithChannels { reply, .. } = list;
230+ let Request { reply, .. } = list;
231231 let values = {
232232 let state = self . state . lock ( ) . unwrap ( ) ;
233233 // TODO: use async lock to not clone here.
0 commit comments