mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-29 15:49:16 +01:00
Implement Clone
for RouterIntoService
(#2456)
This commit is contained in:
parent
560213a7b7
commit
b494d455cc
2 changed files with 14 additions and 0 deletions
|
@ -12,12 +12,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- **change:** Update tokio-tungstenite to 0.21 ([#2435])
|
- **change:** Update tokio-tungstenite to 0.21 ([#2435])
|
||||||
- **added:** Enable `tracing` feature by default ([#2460])
|
- **added:** Enable `tracing` feature by default ([#2460])
|
||||||
- **added:** Support graceful shutdown on `serve` ([#2398])
|
- **added:** Support graceful shutdown on `serve` ([#2398])
|
||||||
|
- **added:** `RouterIntoService` implements `Clone` ([#2456])
|
||||||
|
|
||||||
[#2411]: https://github.com/tokio-rs/axum/pull/2411
|
[#2411]: https://github.com/tokio-rs/axum/pull/2411
|
||||||
[#2433]: https://github.com/tokio-rs/axum/pull/2433
|
[#2433]: https://github.com/tokio-rs/axum/pull/2433
|
||||||
[#2435]: https://github.com/tokio-rs/axum/pull/2435
|
[#2435]: https://github.com/tokio-rs/axum/pull/2435
|
||||||
[#2460]: https://github.com/tokio-rs/axum/pull/2460
|
[#2460]: https://github.com/tokio-rs/axum/pull/2460
|
||||||
[#2398]: https://github.com/tokio-rs/axum/pull/2398
|
[#2398]: https://github.com/tokio-rs/axum/pull/2398
|
||||||
|
[#2456]: https://github.com/tokio-rs/axum/pull/2456
|
||||||
|
|
||||||
# 0.7.2 (03. December, 2023)
|
# 0.7.2 (03. December, 2023)
|
||||||
|
|
||||||
|
|
|
@ -515,6 +515,18 @@ pub struct RouterIntoService<B, S = ()> {
|
||||||
_marker: PhantomData<B>,
|
_marker: PhantomData<B>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<B, S> Clone for RouterIntoService<B, S>
|
||||||
|
where
|
||||||
|
Router<S>: Clone,
|
||||||
|
{
|
||||||
|
fn clone(&self) -> Self {
|
||||||
|
Self {
|
||||||
|
router: self.router.clone(),
|
||||||
|
_marker: PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<B> Service<Request<B>> for RouterIntoService<B, ()>
|
impl<B> Service<Request<B>> for RouterIntoService<B, ()>
|
||||||
where
|
where
|
||||||
B: HttpBody<Data = bytes::Bytes> + Send + 'static,
|
B: HttpBody<Data = bytes::Bytes> + Send + 'static,
|
||||||
|
|
Loading…
Reference in a new issue