mirror of
https://github.com/actix/actix-extras.git
synced 2025-03-20 20:05:18 +01:00
Implement Clone
for CookieSession
. (#201)
This commit is contained in:
parent
a08b96529f
commit
d0f2075ce9
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
## Unreleased - 2020-xx-xx
|
## Unreleased - 2020-xx-xx
|
||||||
* Minimum supported Rust version (MSRV) is now 1.51.
|
* Minimum supported Rust version (MSRV) is now 1.51.
|
||||||
|
* Impl `Clone` for `CookieSession`. [#201]
|
||||||
|
|
||||||
|
[#201]: https://github.com/actix/actix-extras/pull/201
|
||||||
|
|
||||||
|
|
||||||
## 0.5.0-beta.2 - 2020-06-27
|
## 0.5.0-beta.2 - 2020-06-27
|
||||||
|
@ -30,11 +30,13 @@ pub enum CookieSessionError {
|
|||||||
|
|
||||||
impl ResponseError for CookieSessionError {}
|
impl ResponseError for CookieSessionError {}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone)]
|
||||||
enum CookieSecurity {
|
enum CookieSecurity {
|
||||||
Signed,
|
Signed,
|
||||||
Private,
|
Private,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
struct CookieSessionInner {
|
struct CookieSessionInner {
|
||||||
key: Key,
|
key: Key,
|
||||||
security: CookieSecurity,
|
security: CookieSecurity,
|
||||||
@ -197,6 +199,7 @@ impl CookieSessionInner {
|
|||||||
/// .secure(true))
|
/// .secure(true))
|
||||||
/// .service(web::resource("/").to(|| HttpResponse::Ok()));
|
/// .service(web::resource("/").to(|| HttpResponse::Ok()));
|
||||||
/// ```
|
/// ```
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct CookieSession(Rc<CookieSessionInner>);
|
pub struct CookieSession(Rc<CookieSessionInner>);
|
||||||
|
|
||||||
impl CookieSession {
|
impl CookieSession {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user