mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-26 22:07:42 +02:00
fix uds server support
This commit is contained in:
@ -4,6 +4,8 @@ use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
use std::task::{self, Context, Poll};
|
||||
|
||||
use futures::future::{ready, Ready};
|
||||
|
||||
mod and_then;
|
||||
mod apply;
|
||||
mod apply_cfg;
|
||||
|
@ -6,6 +6,18 @@ use std::task::{Context, Poll};
|
||||
|
||||
use crate::{IntoServiceFactory, Service, ServiceFactory};
|
||||
|
||||
/// Apply transform to a service. Function returns
|
||||
/// services factory that in initialization creates
|
||||
/// service and applies transform to this service.
|
||||
pub fn apply<T, S, U>(t: T, service: U) -> ApplyTransform<T, S>
|
||||
where
|
||||
S: ServiceFactory,
|
||||
T: Transform<S::Service, InitError = S::InitError>,
|
||||
U: IntoServiceFactory<S>,
|
||||
{
|
||||
ApplyTransform::new(t, service.into_factory())
|
||||
}
|
||||
|
||||
/// The `Transform` trait defines the interface of a Service factory. `Transform`
|
||||
/// is often implemented for middleware, defining how to construct a
|
||||
/// middleware Service. A Service that is constructed by the factory takes
|
||||
@ -70,18 +82,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Apply transform to a service. Function returns
|
||||
/// services factory that in initialization creates
|
||||
/// service and applies transform to this service.
|
||||
pub fn apply<T, S, U>(t: T, service: U) -> ApplyTransform<T, S>
|
||||
where
|
||||
S: ServiceFactory,
|
||||
T: Transform<S::Service, InitError = S::InitError>,
|
||||
U: IntoServiceFactory<S>,
|
||||
{
|
||||
ApplyTransform::new(t, service.into_factory())
|
||||
}
|
||||
|
||||
/// `Apply` transform to new service
|
||||
pub struct ApplyTransform<T, S> {
|
||||
s: Rc<S>,
|
||||
|
Reference in New Issue
Block a user