mirror of
https://github.com/actix/examples
synced 2024-11-23 14:31:07 +01:00
chore: update pin-project
This commit is contained in:
parent
ea07cc2370
commit
03879899a5
48
Cargo.lock
generated
48
Cargo.lock
generated
@ -4196,16 +4196,6 @@ dependencies = [
|
||||
"unicode-normalization",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
|
||||
dependencies = [
|
||||
"unicode-bidi",
|
||||
"unicode-normalization",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "0.5.0"
|
||||
@ -4216,12 +4206,6 @@ dependencies = [
|
||||
"unicode-normalization",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "if_chain"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed"
|
||||
|
||||
[[package]]
|
||||
name = "ignore"
|
||||
version = "0.4.20"
|
||||
@ -4975,7 +4959,7 @@ dependencies = [
|
||||
"env_logger",
|
||||
"futures-util",
|
||||
"log",
|
||||
"pin-project",
|
||||
"pin-project-lite 0.2.13",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -9121,12 +9105,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "validator"
|
||||
version = "0.16.1"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b92f40481c04ff1f4f61f304d61793c7b56ff76ac1469f1beb199b1445b253bd"
|
||||
checksum = "db79c75af171630a3148bd3e6d7c4f42b6a9a014c2945bc5ed0020cbb8d9478e"
|
||||
dependencies = [
|
||||
"idna 0.4.0",
|
||||
"lazy_static",
|
||||
"idna 0.5.0",
|
||||
"once_cell",
|
||||
"regex",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
@ -9137,28 +9121,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "validator_derive"
|
||||
version = "0.16.0"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc44ca3088bb3ba384d9aecf40c6a23a676ce23e09bdaca2073d99c207f864af"
|
||||
checksum = "55591299b7007f551ed1eb79a684af7672c19c3193fb9e0a31936987bb2438ec"
|
||||
dependencies = [
|
||||
"if_chain",
|
||||
"lazy_static",
|
||||
"darling 0.20.3",
|
||||
"once_cell",
|
||||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"syn 1.0.109",
|
||||
"validator_types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "validator_types"
|
||||
version = "0.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "111abfe30072511849c5910134e8baf8dc05de4c0e5903d681cbd5c9c4d611e3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"syn 1.0.109",
|
||||
"syn 2.0.48",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -104,6 +104,8 @@ color-eyre = "0.6"
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
|
||||
log = "0.4"
|
||||
openssl = { version = "0.10.60", features = ["v110"] }
|
||||
parking_lot = "0.12"
|
||||
pin-project-lite = "0.2"
|
||||
rand = "0.8"
|
||||
rustls = "0.23"
|
||||
rustls-pemfile = "2"
|
||||
|
@ -9,5 +9,5 @@ diesel = { version = "2", features = ["sqlite", "r2d2", "uuid"] }
|
||||
dotenvy.workspace = true
|
||||
env_logger.workspace = true
|
||||
log.workspace = true
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde.workspace = true
|
||||
uuid.workspace = true
|
||||
|
@ -9,7 +9,7 @@ config = "0.13"
|
||||
deadpool-postgres = { version = "0.12", features = ["serde"] }
|
||||
derive_more.workspace = true
|
||||
dotenvy.workspace = true
|
||||
serde = { version = "1.0.137", features = ["derive"] }
|
||||
serde.workspace = true
|
||||
tokio-pg-mapper = "0.2.0"
|
||||
tokio-pg-mapper-derive = "0.2.0"
|
||||
tokio-postgres = "0.7.6"
|
||||
|
@ -15,4 +15,4 @@ notify = "6"
|
||||
rustls.workspace = true
|
||||
rustls-pemfile.workspace = true
|
||||
tokio = { workspace = true, features = ["time", "rt", "macros"] }
|
||||
parking_lot = "0.12"
|
||||
parking_lot.workspace = true
|
||||
|
@ -8,5 +8,5 @@ actix-web.workspace = true
|
||||
|
||||
env_logger.workspace = true
|
||||
log.workspace = true
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
@ -12,4 +12,4 @@ futures-util.workspace = true
|
||||
log.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
validator = { version = "0.16", features = ["derive"] }
|
||||
validator = { version = "0.18", features = ["derive"] }
|
||||
|
@ -7,5 +7,5 @@ edition = "2021"
|
||||
actix-web.workspace = true
|
||||
env_logger.workspace = true
|
||||
log.workspace = true
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
@ -10,5 +10,5 @@ bytes = "1.1.0"
|
||||
env_logger.workspace = true
|
||||
futures-util.workspace = true
|
||||
log.workspace = true
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
@ -12,4 +12,4 @@ actix-web-lab.workspace = true
|
||||
env_logger.workspace = true
|
||||
futures-util.workspace = true
|
||||
log.workspace = true
|
||||
pin-project = "1"
|
||||
pin-project-lite.workspace = true
|
||||
|
@ -11,6 +11,7 @@ use actix_web::{
|
||||
web::{Bytes, BytesMut},
|
||||
Error,
|
||||
};
|
||||
use pin_project_lite::pin_project;
|
||||
|
||||
pub struct Logging;
|
||||
|
||||
@ -53,7 +54,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[pin_project::pin_project]
|
||||
pin_project! {
|
||||
pub struct WrapperStream<S, B>
|
||||
where
|
||||
B: MessageBody,
|
||||
@ -63,6 +64,7 @@ where
|
||||
fut: S::Future,
|
||||
_t: PhantomData<(B,)>,
|
||||
}
|
||||
}
|
||||
|
||||
impl<S, B> Future for WrapperStream<S, B>
|
||||
where
|
||||
@ -83,17 +85,17 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[pin_project::pin_project(PinnedDrop)]
|
||||
pin_project! {
|
||||
pub struct BodyLogger<B> {
|
||||
#[pin]
|
||||
body: B,
|
||||
body_accum: BytesMut,
|
||||
}
|
||||
|
||||
#[pin_project::pinned_drop]
|
||||
impl<B> PinnedDrop for BodyLogger<B> {
|
||||
fn drop(self: Pin<&mut Self>) {
|
||||
println!("response body: {:?}", self.body_accum);
|
||||
fn drop(this: Pin<&mut Self>) {
|
||||
println!("response body: {:?}", this.body_accum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,6 @@ actix-web-lab.workspace = true
|
||||
env_logger.workspace = true
|
||||
futures-util.workspace = true
|
||||
log.workspace = true
|
||||
parking_lot = "0.12"
|
||||
parking_lot.workspace = true
|
||||
tokio = { workspace = true, features = ["sync"] }
|
||||
tokio-stream.workspace = true
|
||||
|
@ -10,4 +10,4 @@ actix-web-lab.workspace = true
|
||||
|
||||
env_logger.workspace = true
|
||||
log.workspace = true
|
||||
parking_lot = "0.12"
|
||||
parking_lot.workspace = true
|
||||
|
Loading…
Reference in New Issue
Block a user