mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
Implement Clone for CookieJar, PrivateCookieJar and SignedCookieJar (#1808)
This commit is contained in:
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning].
|
|||||||
except that it enforces field exclusivity at runtime instead of compile time,
|
except that it enforces field exclusivity at runtime instead of compile time,
|
||||||
as this improves usability.
|
as this improves usability.
|
||||||
|
|
||||||
|
- **added:** Implement `Clone` for `CookieJar`, `PrivateCookieJar` and `SignedCookieJar` ([#1808])
|
||||||
|
|
||||||
|
[#1808]: https://github.com/tokio-rs/axum/pull/1808
|
||||||
|
|
||||||
# 0.6.0 (24. February, 2022)
|
# 0.6.0 (24. February, 2022)
|
||||||
|
|
||||||
- **breaking:** Change casing of `ProtoBuf` to `Protobuf` ([#1595])
|
- **breaking:** Change casing of `ProtoBuf` to `Protobuf` ([#1595])
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ pub use cookie::Key;
|
|||||||
/// .route("/me", get(me));
|
/// .route("/me", get(me));
|
||||||
/// # let app: Router = app;
|
/// # let app: Router = app;
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default, Clone)]
|
||||||
pub struct CookieJar {
|
pub struct CookieJar {
|
||||||
jar: cookie::CookieJar,
|
jar: cookie::CookieJar,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,3 +301,13 @@ impl<'a, K> Iterator for PrivateCookieJarIter<'a, K> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<K> Clone for PrivateCookieJar<K> {
|
||||||
|
fn clone(&self) -> Self {
|
||||||
|
Self {
|
||||||
|
jar: self.jar.clone(),
|
||||||
|
key: self.key.clone(),
|
||||||
|
_marker: self._marker,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -319,3 +319,13 @@ impl<'a, K> Iterator for SignedCookieJarIter<'a, K> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<K> Clone for SignedCookieJar<K> {
|
||||||
|
fn clone(&self) -> Self {
|
||||||
|
Self {
|
||||||
|
jar: self.jar.clone(),
|
||||||
|
key: self.key.clone(),
|
||||||
|
_marker: self._marker,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user