@@ -96,7 +96,7 @@ pub trait Handler<'a>: Sized {
9696 /// The type of Future this Handler will return
9797 type Fut : Future < Output = Result < Self :: Response , Self :: Error > > + ' a ;
9898 /// Function used to execute handler behavior
99- fn call ( & self , event : Request , context : Context ) -> Self :: Fut ;
99+ fn call ( & mut self , event : Request , context : Context ) -> Self :: Fut ;
100100}
101101
102102/// Adapts a [`Handler`](trait.Handler.html) to the `lambda_runtime::run` interface
@@ -117,7 +117,7 @@ where
117117 type Response = R ;
118118 type Error = Error ;
119119 type Fut = Fut ;
120- fn call ( & self , event : Request , context : Context ) -> Self :: Fut {
120+ fn call ( & mut self , event : Request , context : Context ) -> Self :: Fut {
121121 ( self ) ( event, context)
122122 }
123123}
@@ -159,7 +159,7 @@ impl<'a, H: Handler<'a>> Handler<'a> for Adapter<'a, H> {
159159 type Response = H :: Response ;
160160 type Error = H :: Error ;
161161 type Fut = H :: Fut ;
162- fn call ( & self , event : Request , context : Context ) -> Self :: Fut {
162+ fn call ( & mut self , event : Request , context : Context ) -> Self :: Fut {
163163 self . handler . call ( event, context)
164164 }
165165}
@@ -168,7 +168,7 @@ impl<'a, H: Handler<'a>> LambdaHandler<LambdaRequest<'a>, LambdaResponse> for Ad
168168 type Error = H :: Error ;
169169 type Fut = TransformResponse < ' a , H :: Response , Self :: Error > ;
170170
171- fn call ( & self , event : LambdaRequest < ' _ > , context : Context ) -> Self :: Fut {
171+ fn call ( & mut self , event : LambdaRequest < ' _ > , context : Context ) -> Self :: Fut {
172172 let request_origin = event. request_origin ( ) ;
173173 let fut = Box :: pin ( self . handler . call ( event. into ( ) , context) ) ;
174174 TransformResponse { request_origin, fut }
0 commit comments