diff options
| author | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2022-12-31 17:07:30 +0400 |
|---|---|---|
| committer | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2022-12-31 17:07:30 +0400 |
| commit | 65652932f77ce194a10cbc8dd42f3064e2c1a132 (patch) | |
| tree | 4ca18a9317c4e561e917e9dd0cf39b695b43bc34 /webhook/src/handler/make_service.rs | |
| parent | a16bafdf5b0ec52fa0d73458597eee7c34ea5e7b (diff) | |
updates and bazel removal
Diffstat (limited to 'webhook/src/handler/make_service.rs')
| -rw-r--r-- | webhook/src/handler/make_service.rs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/webhook/src/handler/make_service.rs b/webhook/src/handler/make_service.rs deleted file mode 100644 index 9e90436..0000000 --- a/webhook/src/handler/make_service.rs +++ /dev/null @@ -1,34 +0,0 @@ -use super::handler::HandlerService; -use crate::config::Config; -use hyper::service::Service; -use common::nats_crate::Connection; -use std::{ - future::{ready, Ready}, - sync::Arc, - task::{Context, Poll}, -}; -use ed25519_dalek::PublicKey; - -pub struct MakeSvc { - pub settings: Arc<Config>, - pub nats: Arc<Connection>, - pub public_key: Arc<PublicKey> -} - -impl<T> Service<T> for MakeSvc { - type Response = HandlerService; - type Error = std::io::Error; - type Future = Ready<Result<Self::Response, Self::Error>>; - - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { - Ok(()).into() - } - - fn call(&mut self, _: T) -> Self::Future { - ready(Ok(HandlerService { - config: self.settings.clone(), - nats: self.nats.clone(), - public_key: self.public_key.clone() - })) - } -} |
