1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-18 18:51:49 +01:00

doc tweaks

This commit is contained in:
Rob Ede 2021-11-01 02:19:20 +00:00
parent e49fedbfe7
commit 3c6f586b89
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
6 changed files with 21 additions and 24 deletions

View File

@ -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",
))
}
}

View File

@ -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 {

View File

@ -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>,

View File

@ -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.

View File

@ -103,7 +103,7 @@ where
}
}
/// `MapNewService` new service combinator
/// `MapServiceFactory` new service combinator.
pub struct MapServiceFactory<A, F, Req, Res> {
a: A,
f: F,

View File

@ -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,