Skip to content

Commit aaef318

Browse files
mendeltyoshuawuyts
authored andcommitted
implement Endpoint trait for Box<dyn Endpoint>
1 parent 5478535 commit aaef318

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/endpoint.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,10 @@ where
118118
Ok(next.run(req).await)
119119
}
120120
}
121+
122+
#[async_trait]
123+
impl<State: Clone + Send + Sync + 'static> Endpoint<State> for Box<dyn Endpoint<State>> {
124+
async fn call(&self, request: Request<State>) -> crate::Result {
125+
self.call(request).await
126+
}
127+
}

0 commit comments

Comments
 (0)