diff options
| author | Fuwn <[email protected]> | 2023-04-06 07:25:24 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-04-06 07:25:24 +0000 |
| commit | 4444f64ee98f314938a383b4dfdf3cd74fd7e717 (patch) | |
| tree | 3c4f36a742112e0a0cde337aaa0ffe3fd7096a99 /src/context/hook.rs | |
| parent | feat(cargo): bump 0.3.0 -> 0.3.1 (diff) | |
| download | windmark-4444f64ee98f314938a383b4dfdf3cd74fd7e717.tar.xz windmark-4444f64ee98f314938a383b4dfdf3cd74fd7e717.zip | |
fix(context): fix async sharing
Diffstat (limited to 'src/context/hook.rs')
| -rw-r--r-- | src/context/hook.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/context/hook.rs b/src/context/hook.rs index 44804fa..736696f 100644 --- a/src/context/hook.rs +++ b/src/context/hook.rs @@ -18,26 +18,23 @@ use matchit::Params; use openssl::x509::X509; -use tokio::net::TcpStream; use url::Url; #[allow(clippy::module_name_repetitions)] pub struct HookContext<'a> { - pub tcp: &'a TcpStream, - pub url: &'a Url, - pub params: Option<&'a Params<'a, 'a>>, - pub certificate: &'a Option<X509>, + pub url: Url, + pub params: Option<Params<'a, 'a>>, + pub certificate: Option<X509>, } impl<'a> HookContext<'a> { + #[must_use] pub const fn new( - tcp: &'a TcpStream, - url: &'a Url, - params: Option<&'a Params<'a, 'a>>, - certificate: &'a Option<X509>, + url: Url, + params: Option<Params<'a, 'a>>, + certificate: Option<X509>, ) -> Self { Self { - tcp, url, params, certificate, |