actix_http/h1/
upgrade.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use actix_codec::Framed;
use actix_service::{Service, ServiceFactory};
use futures_core::future::LocalBoxFuture;

use crate::{h1::Codec, Error, Request};

pub struct UpgradeHandler;

impl<T> ServiceFactory<(Request, Framed<T, Codec>)> for UpgradeHandler {
    type Response = ();
    type Error = Error;
    type Config = ();
    type Service = UpgradeHandler;
    type InitError = Error;
    type Future = LocalBoxFuture<'static, Result<Self::Service, Self::InitError>>;

    fn new_service(&self, _: ()) -> Self::Future {
        unimplemented!()
    }
}

impl<T> Service<(Request, Framed<T, Codec>)> for UpgradeHandler {
    type Response = ();
    type Error = Error;
    type Future = LocalBoxFuture<'static, Result<Self::Response, Self::Error>>;

    actix_service::always_ready!();

    fn call(&self, _: (Request, Framed<T, Codec>)) -> Self::Future {
        unimplemented!()
    }
}