@@ -87,7 +87,7 @@ impl<T, R> Chain<T, R> {
87
87
pub ( crate ) async fn traverse ( & self , mut input : T ) -> ChainResult < T , R > {
88
88
use ChainResult :: { Done , Next } ;
89
89
for e in self . 0 . lock ( ) . await . iter_mut ( ) {
90
- match e. chain ( input) . await {
90
+ match e. handle ( input) . await {
91
91
Next ( r) => input = r,
92
92
Done ( r) => {
93
93
return Done ( r) ;
@@ -131,7 +131,7 @@ pub trait Handler<T, R>: Debug {
131
131
///
132
132
/// #[async_trait]
133
133
/// impl Handler<Request, Status> for AddHeader {
134
- /// async fn chain (&mut self, mut request: Request) -> ChainResult<Request, Status> {
134
+ /// async fn handle (&mut self, mut request: Request) -> ChainResult<Request, Status> {
135
135
/// // You can modify the request however you like here
136
136
/// request.headers_mut().append("X-Header", "value".parse().unwrap());
137
137
///
@@ -140,7 +140,7 @@ pub trait Handler<T, R>: Debug {
140
140
/// }
141
141
/// }
142
142
/// ```
143
- async fn chain ( & mut self , input : T ) -> ChainResult < T , R > ;
143
+ async fn handle ( & mut self , input : T ) -> ChainResult < T , R > ;
144
144
}
145
145
146
146
/// Client request chains
@@ -195,7 +195,7 @@ mod test {
195
195
196
196
#[ async_trait]
197
197
impl Handler < Result , Result > for Add {
198
- async fn chain ( & mut self , req : Result ) -> ChainResult < Result , Result > {
198
+ async fn handle ( & mut self , req : Result ) -> ChainResult < Result , Result > {
199
199
let added = req. 0 + self . 0 ;
200
200
if added > 100 {
201
201
Done ( Result ( req. 0 ) )
0 commit comments