mirror of
https://github.com/fafhrd91/actix-net
synced 2025-01-18 18:51:49 +01:00
doc tweaks
This commit is contained in:
parent
e49fedbfe7
commit
3c6f586b89
@ -503,15 +503,13 @@ pub(super) fn bind_addr<S: ToSocketAddrs>(
|
||||
|
||||
if success {
|
||||
Ok(sockets)
|
||||
} else if let Some(err) = err.take() {
|
||||
Err(err)
|
||||
} else {
|
||||
if let Some(err) = err.take() {
|
||||
Err(err)
|
||||
} else {
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Can not bind to socket address",
|
||||
))
|
||||
}
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Can not bind to socket address",
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ use super::{Service, ServiceFactory};
|
||||
/// Service for the `and_then` combinator, chaining a computation onto the end of another service
|
||||
/// which completes successfully.
|
||||
///
|
||||
/// This is created by the `Pipeline::and_then` method.
|
||||
/// Created by the `.and_then()` combinator.
|
||||
pub struct AndThenService<A, B, Req>(Rc<(A, B)>, PhantomData<Req>);
|
||||
|
||||
impl<A, B, Req> AndThenService<A, B, Req> {
|
||||
@ -116,7 +116,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// `.and_then()` service factory combinator
|
||||
/// Service factory created by the `.and_then()` combinator.
|
||||
pub struct AndThenServiceFactory<A, B, Req>
|
||||
where
|
||||
A: ServiceFactory<Req>,
|
||||
@ -326,16 +326,16 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<A: Clone, B: Clone, Req> Clone for AndThenSendServiceFactory<A, B, Req>
|
||||
impl<A, B, Req> Clone for AndThenSendServiceFactory<A, B, Req>
|
||||
where
|
||||
A: ServiceFactory<Req>,
|
||||
A: ServiceFactory<Req> + Clone,
|
||||
A::Config: Clone,
|
||||
B: ServiceFactory<
|
||||
A::Response,
|
||||
Config = A::Config,
|
||||
Error = A::Error,
|
||||
InitError = A::InitError,
|
||||
>,
|
||||
A::Response,
|
||||
Config = A::Config,
|
||||
Error = A::Error,
|
||||
InitError = A::InitError,
|
||||
> + Clone,
|
||||
{
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
|
@ -63,7 +63,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert `Fn(Config, &Server) -> Future<Service>` fn to NewService\
|
||||
/// Convert `Fn(Config, &Server) -> Future<Service>` fn to ServiceFactory.
|
||||
struct ApplyConfigService<S1, Req, F, Cfg, Fut, S2, Err>
|
||||
where
|
||||
S1: Service<Req>,
|
||||
|
@ -44,7 +44,7 @@ pub trait ServiceExt<Req>: Service<Req> {
|
||||
/// Call another service after call to this one has resolved successfully.
|
||||
///
|
||||
/// This function can be used to chain two services together and ensure that the second service
|
||||
/// isn't called until call to the fist service have finished. Result of the call to the first
|
||||
/// isn't called until call to the fist service has resolved. Result of the call to the first
|
||||
/// service is used as an input parameter for the second service's call.
|
||||
///
|
||||
/// Note that this function consumes the receiving service and returns a wrapped version of it.
|
||||
|
@ -103,7 +103,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// `MapNewService` new service combinator
|
||||
/// `MapServiceFactory` new service combinator.
|
||||
pub struct MapServiceFactory<A, F, Req, Res> {
|
||||
a: A,
|
||||
f: F,
|
||||
|
@ -238,8 +238,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Map this service's output to a different type, returning a new service
|
||||
/// of the resulting type.
|
||||
/// Map this service's output to a different type, returning a new service.
|
||||
pub fn map<F, R>(self, f: F) -> PipelineFactory<MapServiceFactory<SF, F, Req, R>, Req>
|
||||
where
|
||||
Self: Sized,
|
||||
@ -251,7 +250,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Map this service's error to a different error, returning a new service.
|
||||
/// Map this service's error to a different type, returning a new service.
|
||||
pub fn map_err<F, E>(
|
||||
self,
|
||||
f: F,
|
||||
@ -266,7 +265,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Map this factory's init error to a different error, returning a new service.
|
||||
/// Map this factory's init error to a different type, returning a new service.
|
||||
pub fn map_init_err<F, E>(self, f: F) -> PipelineFactory<MapInitErr<SF, F, Req, E>, Req>
|
||||
where
|
||||
Self: Sized,
|
||||
|
Loading…
x
Reference in New Issue
Block a user