mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-28 10:02:38 +01:00
35 lines
928 B
Rust
35 lines
928 B
Rust
use actix_codec::Framed;
|
|
use actix_service::{Service, ServiceFactory};
|
|
use futures_core::future::LocalBoxFuture;
|
|
|
|
use crate::error::Error;
|
|
use crate::h1::Codec;
|
|
use crate::request::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!()
|
|
}
|
|
}
|