mirror of https://github.com/fafhrd91/actix-net
update changelogs
This commit is contained in:
parent
a868ce9be5
commit
7669ba118d
|
@ -11,7 +11,7 @@ use quote::quote;
|
||||||
///
|
///
|
||||||
/// ## Usage
|
/// ## Usage
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```
|
||||||
/// #[actix_rt::main]
|
/// #[actix_rt::main]
|
||||||
/// async fn main() {
|
/// async fn main() {
|
||||||
/// println!("Hello world");
|
/// println!("Hello world");
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2021-xx-xx
|
## Unreleased - 2021-xx-xx
|
||||||
|
* Use `bytestring` version range compatible with Bytes v1.0. [#246]
|
||||||
|
|
||||||
|
[#246]: https://github.com/actix/actix-net/pull/246
|
||||||
|
|
||||||
|
|
||||||
## 0.2.5 - 2020-09-20
|
## 0.2.5 - 2020-09-20
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl Runtime {
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust,ignore
|
/// ```ignore
|
||||||
/// # use futures::{future, Future, Stream};
|
/// # use futures::{future, Future, Stream};
|
||||||
/// use actix_rt::Runtime;
|
/// use actix_rt::Runtime;
|
||||||
///
|
///
|
||||||
|
|
|
@ -70,7 +70,7 @@ impl System {
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust,ignore
|
/// ```ignore
|
||||||
/// use tokio::{runtime::Runtime, task::LocalSet};
|
/// use tokio::{runtime::Runtime, task::LocalSet};
|
||||||
/// use actix_rt::System;
|
/// use actix_rt::System;
|
||||||
/// use futures_util::future::try_join_all;
|
/// use futures_util::future::try_join_all;
|
||||||
|
@ -139,7 +139,7 @@ impl System {
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust,ignore
|
/// ```ignore
|
||||||
/// use tokio::runtime::Runtime;
|
/// use tokio::runtime::Runtime;
|
||||||
/// use actix_rt::System;
|
/// use actix_rt::System;
|
||||||
/// use futures_util::future::try_join_all;
|
/// use futures_util::future::try_join_all;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2021-xx-xx
|
## Unreleased - 2021-xx-xx
|
||||||
|
* Hidden `ServerBuilder::start` method has been removed. Use `ServerBuilder::run`. [#246]
|
||||||
|
|
||||||
|
[#246]: https://github.com/actix/actix-net/pull/246
|
||||||
|
|
||||||
|
|
||||||
## 2.0.0-beta.2 - 2021-01-03
|
## 2.0.0-beta.2 - 2021-01-03
|
||||||
|
|
|
@ -12,7 +12,7 @@ use crate::{Server, ServerBuilder, ServiceFactory};
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```
|
||||||
/// use actix_service::fn_service;
|
/// use actix_service::fn_service;
|
||||||
/// use actix_server::TestServer;
|
/// use actix_server::TestServer;
|
||||||
///
|
///
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2021-xx-xx
|
## Unreleased - 2021-xx-xx
|
||||||
|
* The `forward_ready!` macro converts errors. [#246]
|
||||||
|
|
||||||
|
[#246]: https://github.com/actix/actix-net/pull/246
|
||||||
|
|
||||||
|
|
||||||
## 2.0.0-beta.2 - 2021-01-03
|
## 2.0.0-beta.2 - 2021-01-03
|
||||||
|
|
|
@ -17,7 +17,7 @@ where
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```
|
||||||
/// use std::io;
|
/// use std::io;
|
||||||
/// use actix_service::{fn_factory, fn_service, Service, ServiceFactory};
|
/// use actix_service::{fn_factory, fn_service, Service, ServiceFactory};
|
||||||
/// use futures_util::future::ok;
|
/// use futures_util::future::ok;
|
||||||
|
@ -67,7 +67,7 @@ where
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```
|
||||||
/// use std::io;
|
/// use std::io;
|
||||||
/// use actix_service::{fn_factory_with_config, fn_service, Service, ServiceFactory};
|
/// use actix_service::{fn_factory_with_config, fn_service, Service, ServiceFactory};
|
||||||
/// use futures_util::future::ok;
|
/// use futures_util::future::ok;
|
||||||
|
|
|
@ -48,7 +48,7 @@ use self::ready::{err, ok, ready, Ready};
|
||||||
/// replies. You can think about a service as a function with one argument that returns some result
|
/// replies. You can think about a service as a function with one argument that returns some result
|
||||||
/// asynchronously. Conceptually, the operation looks like this:
|
/// asynchronously. Conceptually, the operation looks like this:
|
||||||
///
|
///
|
||||||
/// ```rust,ignore
|
/// ```ignore
|
||||||
/// async fn(Request) -> Result<Response, Err>
|
/// async fn(Request) -> Result<Response, Err>
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
@ -60,7 +60,7 @@ use self::ready::{err, ok, ready, Ready};
|
||||||
/// simple API surfaces. This leads to simpler design of each service, improves test-ability and
|
/// simple API surfaces. This leads to simpler design of each service, improves test-ability and
|
||||||
/// makes composition easier.
|
/// makes composition easier.
|
||||||
///
|
///
|
||||||
/// ```rust,ignore
|
/// ```ignore
|
||||||
/// struct MyService;
|
/// struct MyService;
|
||||||
///
|
///
|
||||||
/// impl Service for MyService {
|
/// impl Service for MyService {
|
||||||
|
@ -78,7 +78,7 @@ use self::ready::{err, ok, ready, Ready};
|
||||||
/// Sometimes it is not necessary to implement the Service trait. For example, the above service
|
/// Sometimes it is not necessary to implement the Service trait. For example, the above service
|
||||||
/// could be rewritten as a simple function and passed to [fn_service](fn_service()).
|
/// could be rewritten as a simple function and passed to [fn_service](fn_service()).
|
||||||
///
|
///
|
||||||
/// ```rust,ignore
|
/// ```ignore
|
||||||
/// async fn my_service(req: u8) -> Result<u64, MyError>;
|
/// async fn my_service(req: u8) -> Result<u64, MyError>;
|
||||||
/// ```
|
/// ```
|
||||||
pub trait Service<Req> {
|
pub trait Service<Req> {
|
||||||
|
|
|
@ -30,7 +30,7 @@ where
|
||||||
///
|
///
|
||||||
/// For example, timeout transform:
|
/// For example, timeout transform:
|
||||||
///
|
///
|
||||||
/// ```rust,ignore
|
/// ```ignore
|
||||||
/// pub struct Timeout<S> {
|
/// pub struct Timeout<S> {
|
||||||
/// service: S,
|
/// service: S,
|
||||||
/// timeout: Duration,
|
/// timeout: Duration,
|
||||||
|
@ -45,9 +45,7 @@ where
|
||||||
/// type Error = TimeoutError<S::Error>;
|
/// type Error = TimeoutError<S::Error>;
|
||||||
/// type Future = TimeoutServiceResponse<S>;
|
/// type Future = TimeoutServiceResponse<S>;
|
||||||
///
|
///
|
||||||
/// fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
/// actix_service::forward_ready!(service);
|
||||||
/// ready!(self.service.poll_ready(cx)).map_err(TimeoutError::Service)
|
|
||||||
/// }
|
|
||||||
///
|
///
|
||||||
/// fn call(&mut self, req: S::Request) -> Self::Future {
|
/// fn call(&mut self, req: S::Request) -> Self::Future {
|
||||||
/// TimeoutServiceResponse {
|
/// TimeoutServiceResponse {
|
||||||
|
@ -69,7 +67,7 @@ where
|
||||||
///
|
///
|
||||||
/// Factory for `Timeout` middleware from the above example could look like this:
|
/// Factory for `Timeout` middleware from the above example could look like this:
|
||||||
///
|
///
|
||||||
/// ```rust,,ignore
|
/// ```ignore
|
||||||
/// pub struct TimeoutTransform {
|
/// pub struct TimeoutTransform {
|
||||||
/// timeout: Duration,
|
/// timeout: Duration,
|
||||||
/// }
|
/// }
|
||||||
|
|
|
@ -94,7 +94,7 @@ where
|
||||||
/// is passed in a reference to the request being handled by the service.
|
/// is passed in a reference to the request being handled by the service.
|
||||||
///
|
///
|
||||||
/// For example:
|
/// For example:
|
||||||
/// ```rust,ignore
|
/// ```ignore
|
||||||
/// let traced_service = trace(
|
/// let traced_service = trace(
|
||||||
/// web_service,
|
/// web_service,
|
||||||
/// |req: &Request| Some(span!(Level::INFO, "request", req.id))
|
/// |req: &Request| Some(span!(Level::INFO, "request", req.id))
|
||||||
|
|
|
@ -149,9 +149,7 @@ where
|
||||||
type Error = TimeoutError<S::Error>;
|
type Error = TimeoutError<S::Error>;
|
||||||
type Future = TimeoutServiceResponse<S, Req>;
|
type Future = TimeoutServiceResponse<S, Req>;
|
||||||
|
|
||||||
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
actix_service::forward_ready!(service);
|
||||||
self.service.poll_ready(cx).map_err(TimeoutError::Service)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn call(&mut self, request: Req) -> Self::Future {
|
fn call(&mut self, request: Req) -> Self::Future {
|
||||||
TimeoutServiceResponse {
|
TimeoutServiceResponse {
|
||||||
|
|
Loading…
Reference in New Issue